Only the first pixel in the image loads.
I load an image onto a texture with D3DXCreateTextureFromFileEx, specify D3DX_DEFAULT for the hieght and width, but when I draw it too the screen it only shows the color of the first pixel of the image for the whole texture. I assume that it only loaded one pixel and is scaling it and is now filling the whole textue with the first pixel. Do you guys have some possible reasons.
1. Make sure your texture coordinates are correct. Check that they arn''t all zero. Also make sure they arn''t negative and you''re clamping the texture, because that would also create texture coordinates that are 0.
2. Are you using a texture matrix by any chance?
---
Brent Gunning | My Site
2. Are you using a texture matrix by any chance?
---
Brent Gunning | My Site
Sounds to me like a texture coord problem for certain. If you haven''t already fixed it (which it sounds like you have) just set your texture coords correctly. For instance, for a square they would be:
Vertex #1: (0.0f, 0.0f)
Vertex #2: (1.0f, 0.0f)
Vertex #3: (0.0f, 1.0f)
Vertex #4: (1.0f, 1.0f)
Good Luck
Vertex #1: (0.0f, 0.0f)
Vertex #2: (1.0f, 0.0f)
Vertex #3: (0.0f, 1.0f)
Vertex #4: (1.0f, 1.0f)
Good Luck
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement