Archived

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

goldsword

Direct Graphics - Surface Question

Recommended Posts

Does a DGFX surface contain the exact same thing as a DDRAW surface? Thus being able to acquire a pointer to the memory by locking it? Or is there a better (FASTER!) way of retrieving a pointer to the surface memory? ----------------------------------------------------------------- Some other qustions... (Q2) The DrawPrimitive() function takes a pointer to a vertexbuffer, an index and the type of primitive right... Why does it need an index? Since it could be coded like this instead... DrawPrimitive(&VertexBuffer[index],Type) Please, I''m a little confused here...

Share this post


Link to post
Share on other sites
The vertex buffer is not an array of vertices, anymore than a DirectDraw surface is an array of RGB triplets. Just as you need to lock a DirectDraw surface to get or set the actual image data, so do you need to lock the vertex buffer to get or set the actual vertex data. So saying &VertexBuffer[index] would generate an error.

~CGameProgrammer( );



Edited by - CGameProgrammer on January 29, 2002 4:13:18 PM

Share this post


Link to post
Share on other sites