Skip to main content
gamedev.net
🔒 Locked

Texture Problem

Started by Cloral Jan 22, 2003 at 2:18 PM 0 replies 250+ views
Original Post
Cloral
Cloral
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.

Topic Locked

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

Sign in to reply to this topic.