Jump to content
  • Advertisement

Archived

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

soreno

load raw texture from ressource

This topic is 6034 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

the following code attempt to load a RAW bitmap (RGB: 600x450@8)file from a ressource: HRSRC hResInfo = NULL; HGLOBAL hResData = NULL; VOID* pvRes = NULL; GLubyte* pbRes = NULL; hResInfo = FindResource(NULL, "IDR_RAW", TEXT("RAW")); hResData = LoadResource(NULL, hResInfo); pvRes = LockResource(hResData); pbRes = (GLubyte*)pvRes; glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glBindTexture(GL_TEXTURE_2D, m_backgroundTex); gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, 600, 450, GL_RGB, GL_UNSIGNED_BYTE, &pbRes); but the last line produces a "The memory could not be read", what could be wrong?

Share this post


Link to post
Share on other sites
Advertisement
The code you posted (the windows part anyway) only finds the location of the resource in your excutable, loads and gets the address in memory to it. You still have to read the file data from that given address yourself. Cant expect opengl to do all the work.

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!