Jump to content
  • Advertisement
Sign in to follow this  
rpsathe

OpenGL OpenGL --- DirectX

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

I am a newbie in DirectX and have a few programs that I want to port that I had written with OpenGL. Is there any place where I can see what a particular API in OpenGL maps to in DirectX ? Specifically I am interested in glBegin and glEnd for GL_QUAD primitive. Thanks

Share this post


Link to post
Share on other sites
Advertisement
I don't know of anywhere, but there's no such thing as quads in D3D, you need to use two triangles. I suspect that OpenGL converts it to two triangles internally also.

Share this post


Link to post
Share on other sites
this is probly as close to OpenGL because it doesnt use vertex buffers


struct CustomVertex
{
D3DXVECTOR3 Position;
D3DCOLOR Diffuse;
D3DXVECTOR2 Tex1;
};
#define D3DFVF_CUSTOM (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)

CustomVertex vertices[4]; // Quad
// Fill in vertices to make up the quad
// Must be setup like a tri-strip in proper order

// Render the vertices
pDevice->SetFVF(D3DFVF_CUSTOM);
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, &vertices, sizeof(CustomVertex));

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!