• Advertisement

Archived

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

D3D Font class

This topic is 6448 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 all. I''m trying to port a font class from OpenGL to D3D, but I''m having some problems. The text strings must be projected with an orthogonal projection matrix...How can I create one with D3D?. OpenGL makes one with glOrtho function but D3D... Thank you.

Share this post


Link to post
Share on other sites
Advertisement
I don´t know but one thing you can try is to set both dvMinZ and dvMaxZ (D3DVIEWPORT7 structure members) to 0 to force the system to render objects to the foreground.

Gandalf the White

Share this post


Link to post
Share on other sites
If you don''t need to draw the text in world space, couldn''t you just use screen space coordinates? This would bypass any projection at all and allow you to specify the coordinates of the text directly on the screen (check out D3DTLVERTEX structure).

Otherwise, you''ll need to set the projection matrix in Direct3D''s transformation pipeline. D3DX can be used to make setting up the matrix a whole lot simpler...

D3DXMATRIX matrix;
D3DXMatrixOrtho( &matrix, view_width, view_height, 1.0f, 100.0f );
device->SetTransform( D3DTRANSFORMSTATE_PROJECTION, matrix );

Look the functions up in the DirectX help file if you need more information.

Share this post


Link to post
Share on other sites

  • Advertisement