Jump to content
  • Advertisement

Archived

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

OB1st

Bitmap as a resource

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

Hi I want to hide the bitmap that is used as a texture from the user. Here what I did I created a resource file in my project, then I inserted a bitmap. MSVC++ installed a blank bitmap with the name IDB_BITMAP1, I copied and pasted to that blank bitmap the bitmap I wanted.(I inserted resource.h to the project) This bitmap is supposed to be a texture as follows. D3DXCreateTextureFromFile( g_pd3dDevice,"banana.bmp",&g_pTexture ) Now how do I modify the code to get the texture from IDB_BITMAP1 instead of getting the texture from banana.bmp Best regards If love is illusion and hate is real, I would rather be crazy

Share this post


Link to post
Share on other sites
Advertisement
I''m thinking this would work:

D3DXCreateTextureFromResource(g_pd3dDevice, hInstance, MAKEINTRESOURCE(IDB_BITMAP1), &g_pTexture)

Share this post


Link to post
Share on other sites
Yes it does

Thanks

If love is illusion and hate is real, I would rather be crazy

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!