Results 1 to 3 of 3

Thread: SDL_image don't load different images of .bmp

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    France
    Posts
    286

    SDL_image don't load different images of .bmp

    Hi,
    My program run well if i load .bmp textures, but if put a different type of file, windows says to me "the program have to close..." and my opengl windows don't appear.
    What have i done of wrong ?

    i do this :

    SDL_Surface *texture=IMG_Load("eyeball.tif") ;

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    France
    Posts
    286

    Re: SDL_image don't load different images of .bmp

    img_load returns and its value is 0x00000,
    do you know what it means ?
    i have also seen that in fact the program crashes here :
    glTexImage2D(GL_TEXTURE_2D, 0, 3, texture->w,
    texture->h,0,GL_RGB,GL_UNSIGNED_BYTE, texture->pixels);

  3. #3
    Member Contributor
    Join Date
    Feb 2004
    Location
    Dallas/ Nottingham
    Posts
    96

    Re: SDL_image don't load different images of .bmp

    Firstly Your In the Wrong forum this is for OpenGL not SDL

    The reason your program is crashing is that you are trying to use a NULL pointer SDL_Surface *texture is set to NULL when you use IMG_Load with an invalid image type

    Check the documentation for SDL and your IMG_Load function to see what image formats are supported.

Similar Threads

  1. Load images
    By ALASgc in forum OpenCL
    Replies: 2
    Last Post: 10-31-2014, 02:19 PM
  2. what is the easiest way to load images?
    By jenny88 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 05-24-2011, 02:22 PM
  3. how to load images
    By Inugami in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-17-2008, 03:48 AM
  4. load images
    By ceca in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-09-2003, 02:52 PM
  5. load images from file
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-22-2002, 05:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean