Image file types
Anything you can find/make a loader for. OpenGL itself doesnt have any image loaders (glaux might?), you have to write them yourself(or download them like, SDL_image)
Hope that helps!
Hope that helps!
Its entirely dependent on the format...if you know the language your using well enough it shouldnt be a problem. You may have to do some research on the file format your wanting to use also.
If you dont know how to do that...then your best off using sdl_image or going to learn that language your using better.
If you dont know how to do that...then your best off using sdl_image or going to learn that language your using better.
i just got the SDL_image thing (since i use SDL anyway so it's all good), but i can't download the docs for it for some reason... is there another link for it?
Say i load an image:
SDL_Surface *image;
image = IMG_Load("image.png");
what do i do to that surface to bind it to a texture in opengl?
edit: by the way, this is using SDL_Image lib
SDL_Surface *image;
image = IMG_Load("image.png");
what do i do to that surface to bind it to a texture in opengl?
edit: by the way, this is using SDL_Image lib
ok, i found a site that had this:
i just have one question about glGenTextures()...
what's the first parameter for? at first i thought it was to specific the texture number; like if i put 1, then make another texture with 1, it would over write that... what's it for?
GLuint texture;//Load BitmapSDL_Surface* bmpFile = SDL_LoadBMP("data/test.bmp"); /* Standard OpenGL texture creation code */glPixelStorei(GL_UNPACK_ALIGNMENT,4); glGenTextures(1,&texture);glBindTexture(GL_TEXTURE_2D,texture); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,minFilter);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,magFilter); gluBuild2DMipmaps(GL_TEXTURE_2D,3,bmpFile->w, bmpFile->h,GL_BGR_EXT, GL_UNSIGNED_BYTE,bmpFile->pixels); //Free surface after using itSDL_FreeSurface(bmpFile);
i just have one question about glGenTextures()...
what's the first parameter for? at first i thought it was to specific the texture number; like if i put 1, then make another texture with 1, it would over write that... what's it for?
sweet!! i'm looking at that and it looks like i can do that thing i'm always wanted to do but couldn't, where i have a mapped texture, then when i load each tile i can write it to a separte texture, then when rendering i can just render that big texture instead of drawing every tile. will i be able to do that with OpenIL?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement