Advertisement Jump to content

Archived

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

Cloral

Texture Problem

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

Could someone please explain to me what I am doing wrong here? The texture returned from this method is blank: Public Function getTextureFromFile(fileName As String) As Direct3DTexture8 ''Load a texture from file Dim img As ftImage, temp As Direct3DTexture8 Dim lr As D3DLOCKED_RECT img = getImageFromFile(fileName) ''Init the texture Set temp = man.forXFiles.CreateTexture(man.dxDevice, img.info.bmiHeader.biWidth, img.info.bmiHeader.biHeight, 1, DIB_RGB_COLORS, D3DFMT_R8G8B8, D3DPOOL_MANAGED) temp.LockRect 0, lr, ByVal 0, 0 DXCopyMemory ByVal lr.pBits, img.data(0), (img.info.bmiHeader.biSizeImage + 1) * 3 temp.UnlockRect 0 Set getTextureFromFile = temp End Function PS: The reason I am doing it this way is I need to be able to load textures from binary data I have stored in my custom resource file. This method is so that I can figure out how to do it.

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!