Skip to main content
gamedev.net
🔒 Locked

Bitmap as a resource

Started by OB1st Jun 1, 2002 at 11:18 PM 1 replies 200+ views
Original Post
OB1st
OB1st
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
I would love going home to M7, but I can't detect black holes.
Beer Hunter
Beer Hunter
I''m thinking this would work:

D3DXCreateTextureFromResource(g_pd3dDevice, hInstance, MAKEINTRESOURCE(IDB_BITMAP1), &g_pTexture)
OB1st
OB1st
Yes it does

Thanks

If love is illusion and hate is real, I would rather be crazy
I would love going home to M7, but I can't detect black holes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.