Problem with the ID3DXSprite....
Hey people.
My ID3DXSprite object is drawing everything fine and all but there is a little problem.
I''m trying to draw my 3D mesh INFRONT of the sprite and that doesn''t seem to work.(The sprite gets drawn but the mesh doesn''t)
However,if I draw the mesh first then the sprite,it works fine but the mesh is obviously partly covered by the sprite which is not what I want to do.What is the problem?
I believe so. I mean,my 3D mesh renders properly. And the sprite and mesh are drawn properly if you draw the mesh then the sprite but not the other way around.Doesn''t the D3D sprite restore everything after you call it''s End() function? Or is there a bug somewhere here?
Draw your sprites and call lpd3dd->Present(). Then draw your mesh and call lpd3dd->Present(). Don''t clear the screen between the two operations. I didn''t tried this, but just give it a try.
Yikes! That wasn''t a good effect There was alot of flickering and even then,the mesh didn''t get drawn.
NM.I finally got it working.Apparently, when you Begin() to draw your sprite,D3D DOES NOT disable ZBuffering for you.You''ll have to do it manually.So I disabled my ZBuffer,drew my sprites,re enabled my ZBuffer and drew my mesh.Everything is fine now. Thanx for all who helped
Are you calling ID3DXSprite::Begin and ID3DXSprite::End?
Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement