Sign in to follow this  
RealityMeltdown

Utter lack of failure

Recommended Posts

I'm currently building a 2-dGame using DirectX. It was originally formed from some gamedev and gamasatura articles/tutorials. I currently have a black screen, and nothing is reporting an error. Am I missing a step? None of these report an error. Create a Device. Create a Sprite. Create a Texture (a pink, easy to spot, square). then, in rendering: Clear my Device. Begin the Device's Scene. Begin the Sprite. Draw the Sprite(s) (current trying for a copy from the file to the middle of the screen). End the Sprite. End the Device's Scene. Present the Device. All fo these steps happen, but nothing appears. All report D3D_OK, and I'm perplexed, this was taken from some old code, which was working fine.

Share this post


Link to post
Share on other sites
"Utter lack of failure"??
Grammatical error: double negative [lol]

Well, if your screen is black, it means that you've initialised the d3ddevice properly.

The fact that nothing's there could be a couple of reasons:
  • You're not calling your render() funtion
  • You haven't made anything to render yet (what kind of sprite are you using? pointsprites?)
  • Your texture = null
  • You're not rendering to the correct target
  • and if you were in 3d, and you're not, incorrectly set matrices. You should have no matrices set up because you're in 2d mode...

That's all I can think up off the top of my head.


Mushu - trying to help those he doesn't know, with things he doesn't know.
Why won't he just go away? An question the universe may never have an answer to...

Share this post


Link to post
Share on other sites
Have you tried the debugger yet? When I installed DirectX it added DX debug to my visual studio, and that's usually the best way to tell if something isn't working (your code could be forgetting to error check something). If you do that and still don't get any errors, you'll probably have to show some code or more information about how you're trying to render sprites before anyone can help you out.

Share this post


Link to post
Share on other sites
Heh, this happened to me the first time I was dealing with directX and once later.

The first time, I was not using RHW properly. Essentially the sprite was being rendered, but the camera wasn't looking at it.

The second time, I enabled lighting, but didn't set ambient light. An unlit sprite is not seen.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this