Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BradDaBug

OpenGL Another SDL + OpenGL quandary...

This topic is 5937 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
OK, I got it to load a texture. I accidently put the texture loading code before the surface was actually loaded.

Anyways, I can draw a nice textured polygon, but the colors are all wrong. What''s up with that?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!