Sprite not rendering

I am trying to render a sprite onto the screen.

I call sprite->Begin();

sprite->Draw();

Sprite->End();

nothing renders.

Should this be called before or after BeginScene()?

Do I need to set the renderstate?

[227 byte] By [4B7] at [2007-12-22]
# 1
Look at the sample "Simple2D" in the DX Sample Browser. That will give you guidance on how to draw sprites effectively.
DavidWeller at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2
I have been thru all of the dx samples and tons of google searches and have not been able to find a solution to my problem.

Do you have any suggestions on another place I may find an answer.

4B7 at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 3

ok, I'm not asking if you've been through all of them :-)

What I'm asking is: When you looked at the code in Simple2D, and compared it to your code, what did you do that was fundamentally different? Did you start your code from the "Empty Project" sample that we recommend? Quite often we find that something is missing in the fundamentals of the infrastructure.

DavidWeller at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 4
The major fundamental difference in my code and the Simple2D sample is

that I used C++ and the sample was done using C#. Any C++ suggestions?

4B7 at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 5
I don't really have suggestions. You can do a search for ID3DXSPRITE and see what comes up. However, the DirectX API calls in C# are essentially the same. You might want to look at the code anyway.
DavidWeller at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 6
One last question, as I am developing in a 3D environment would I be

better off to just texture a quad, as opposed to using ID3DXSPRITE.

4B7 at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 7
A sprite actually is a textured quad. Check d3dx9core.h for the details (or the documentation ). If that library doesn't suit your needs, then you will need to create your own sprite library.
DavidWeller at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...