Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texture not showing

Started by Elektron Apr 14, 2006 at 11:19 AM 3 replies 600+ views
Original Post
Elektron
Elektron
I loaded the texture but i can´t show it. My code for render is this: void render( void ) { g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_COLORVALUE(0.0f,0.0f,1.0f,1.0f), 1.0f, 0 ); g_pd3dDevice->BeginScene(); // Render geometry here... g_pd3dDevice->SetTexture(0,ppTexture); g_pd3dDevice->EndScene(); g_pd3dDevice->Present( NULL, NULL, NULL, NULL ); }
check my blog: http://indiegamedeveloper71.wordpress.com/
Evil Steve
Evil Steve
Does your vertex format have texture coordinates in it? Are you using the debug runtime? Are there any errors or warnings in the debug output? Is ppTexture definitely not NULL? ppTexture isn't a LPDIRECT3DTEXTURE9* is it? It should be a LPDIRECT3DTEXTURE9
BornToCode
BornToCode
based on your render code, all you are doing is setting the texture but you are not applying it to any geometry. In order to see the texture you will need to build at least three vertices with texture coordinate and use any of the drawing routines to display the object with the texture on it.
ET3D
ET3D
Quote:
Original post by Anonymous Poster
Dont you have to call SetTexture() before you render your geometry?


Technically, yes. But since there's just one texture, after the first frame it will be set, so the next frames should use it.

Given that the rendering code wasn't posted, it's really hard to say what the problem may be. Neither does "I can't show it" fully describe the problem.

Topic Locked

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

Sign in to reply to this topic.