Jump to content
  • Advertisement
Sign in to follow this  
chennaiaras

D3DXTexture

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

Hi,

I want to load an globe into my game. So, I created a sphere and loaded into the window,no problem up to here. I downloaded a world.jpg (map image) and try to apply the texture on to the sphere.

No result there in the window.

// texture variable
LPDIRECT3DTEXTURE9 d3dTexture = NULL;

and in the winMain function before the message loop,

D3DXCreateTextureFromFile( d3ddev, "world.jpg", &d3dTexture );

do i need to do anything more than this..where is the flaw?

regards,
aras

Share this post


Link to post
Share on other sites
Advertisement
Work through the examples in the SDK. Take note that DirectX functions give some sort of indication of success or failure. Check those error indications.

Avoid sites like www.directxtutorial.com that don't check error codes in their examples!

Share this post


Link to post
Share on other sites
Check HRESULT values returned by every DirectX Function in your application, if any of them fails. Also you can check using some debugging tool (like Pix for Windows) values of Pre & Post VS vertices and see whether they include adequate texture corrdinates.
Also you didn't mention how you loaded the sphere , i mean importing from a X File or used D3DXCREATESPHERE function ?
D3DXCreateSphere doesn't create mesh with texture coordinates.

Again i am gonna agree with above replies go through DirectX SDK.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!