Only the first pixel in the image loads.

Started by
2 comments, last by PlayGGY 20 years, 6 months ago
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.
And the rockets' red glare, the bombs bursting in air,gave proof through the fight that our flag was still there.Oh say, does that star-spangled banner yet waveover the land of the free and the home of the brave?
Advertisement
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
You got it. Man, you are great.
And the rockets' red glare, the bombs bursting in air,gave proof through the fight that our flag was still there.Oh say, does that star-spangled banner yet waveover the land of the free and the home of the brave?
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

This topic is closed to new replies.

Advertisement