Jump to content
  • Advertisement
Sign in to follow this  
Apsi

Draw Primitive Issue

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

Hey guys!
Shouldn't I be able to see a triangle on the screen?

This piece of code is a test project, so I have no framework.
(classes/ custom library )

It compiles fine, but I don't see a triangle on the screen.

I posted it @ Codepad:
http://codepad.org/fqmvIP6S

Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Getting the first triangle on the screen is often the hardest part :P

It could be back face culling... although i don't see where you set up your projection matrix?

What i would seriously recomend is grabbing some code such as the code at this place:

http://www.drunkenhyena.com/cgi-bin/dx9.pl

that has a working example of rendering a tutorial to the screen in directx, then i would start working from there.

Seriously getting the first triangle on screen can really be a pain :P

Share this post


Link to post
Share on other sites
Another likely culprit is that you haven't disabled lighting:
Device->SetRenderState(D3DRS_LIGHTING,false);


By default lighting is on so without a light source defined, everything appears black.

Share this post


Link to post
Share on other sites
Hey everyone! Thank you very much for the replies.
Curiously, all of you were right! lol
It was the backface culling, the lightning and the projection matrix
Also, I made a very stupid mistake, that was really compromising the whole exercise.
I was calling EndScene(); AFTER Present( NULL, NULL, NULL, NULL);
I suddenly noticed that the DX was not clearing the screen (tried changing the color) and I was really confused, as I thought it was something with the init stuff.
Now I see the triangle!
Thank you all again!!!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!