Another SDL + OpenGL quandary...
How do I load texture data with SDL?
I''m reading OpenGL Game Programming, and it''s pretty Win32 specific. How to I get bitmap data from an SDL_Surface onto a texture?
This is my code to load the pixels onto a surface:
SDL_LockSurface(lpSurface);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, lpSurface->w, lpSurface->h, 0, GL_RGB, GL_UNSIGNED_BYTE, lpSurface->pixels);
SDL_UnlockSurface(lpSurface);
It crashes whenever it gets to this point.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement