Jump to content
  • Advertisement
Sign in to follow this  
White Scorpion

Simple D3D questions ( mostly vertex buffering )

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

Hi everyone ! I've continued reading the MSDN's tutorial on D3D and here are some questions I have so far: What is the adapter ? ( i.e. GetAdapterDisplayMode( ) ... ) What is the difference between hardware acceleration and software acceleration ? What is a vertex buffer ? What is it used for ? Could someone explain me that code that I took from MSDN's tutorial on vertex buffers please ?
VOID* pVertices;
if( FAILED( g_pVB->Lock( 0, sizeof(g_Vertices), (BYTE**)&pVertices, 0 ) ) )
    return E_FAIL;
memcpy( pVertices, g_Vertices, sizeof(g_Vertices) );
g_pVB->Unlock();

And finally ( for now ) what is the rhw parameter ?

Share this post


Link to post
Share on other sites
Advertisement
Newbie, so answers might be off, or wrong.

Adapter- Isn't that just whatever video card is being used?

Hardware vs software- Hardware acceleration is done on the video card, software is done by the general CPU [think an emulator]

Vertex Buffer- A vertex buffer is a buffer that holds vertex information. Verteces are just points of a polygon. Thus a vertex buffer is a bunch of polygon points which describe a shape [or multiple shapes].

Code-

First, Lock the vertex buffer memory so nothing else in the system will fubar the process. If it fails, return. Then, copy the bunch of vertex information into the buffer. Then unlock the buffer since we're done.

RHW- rhw probably stands for something, but it's basically something to say that the vertex information is not 3d [an object in space] but 2d, with z representing windowing order [an object on the screen]. The actual rhw variable in the vertex information I've always set to 1. I don't know what it does.

Share this post


Link to post
Share on other sites
Thank you.
Is it me or this line:
memcpy( pVertices, g_Vertices, sizeof(g_Vertices) );

is just plain stupid... you copy things from the empty vertices to the one that contains stuff... I never used that function but IntelliSense says that the 2nd parameter is const so it will not have its values copied so obviously it's the "copier" and the 1st is the one to receive copies but anyway... I think I'll have to read a lot more before I get those lines

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!