Archived

This topic is now archived and is closed to further replies.

DirectX Game Programming...

This topic is 5536 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, I''m having a hard time understanding this. I''ve got the book "Beginning Direct3D Game Programming" and I''ve found a tutorial on it but it seems overwhelming. Is there anything you can suggest? I learned C++ from www.cprogramming.com ''s tutorials. If anyone can suggest some good, easy to understand websites or give me tips on how to understand these books, i''d be grateful

Share this post


Link to post
Share on other sites
I have that book, I think. It''s at home right now but I could probably help you figure out stuff in it.

Anything specific in it that you are having trouble with?

Are you having trouble with the example not working correctly or with understanding C++ code or what?



By the way, at least the first couple of programs in Chapter 5(?) are slightly broken. The author has a website at http://www.shaderx.com/direct3d.net/index.html and he has a download for Chapter 5 on the right under the link to Basic Examples(Source).

I think the change is this piece in the ::RestoreDeviceObjects() function
D3DVIEWPORT8 vp;
// m_pd3dDevice->GetViewport(&vp);

// Initialize to render a quad
CUSTOMVERTEX cvVertices[] =
{
{ 0.0f, 0.0f, 0.5f, 1.0f, 0xffff0000, }, // x, y, z, rhw, color
{ (float)m_d3dsdBackBuffer.Width, 0.0f, 0.5f, 1.0f, 0xffff0000, },
{ (float)m_d3dsdBackBuffer.Width, (float)m_d3dsdBackBuffer.Height, 0.5f, 1.0f, 0xff00ff00, },
{ 0.0f, (float)m_d3dsdBackBuffer.Height, 0.5f, 1.0f, 0xff00ffff, },
};
He commented out the GetViewport(..) function call and used the backbuffer width and height for his quad.

If that change wasn''t made, it resulted in garbage being displayed in the view rather than the gradient quad on video cards with GPU''s.

Share this post


Link to post
Share on other sites