Jump to content
  • Advertisement
Sign in to follow this  
obiwan74

OpenGL TextOut on buffer OpenGL

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

hello world! I am newbie. How to use the TextOut(*) function directly on the buffer OpenGL. I want to write accurate 2D text. thanks. (*) TextOut(Hdc, x, y, string, lenstr)

Share this post


Link to post
Share on other sites
Advertisement
FTGL or another libs should be used instead.
TextOut is a GDI operation and should not be mixed with OpenGL.

Share this post


Link to post
Share on other sites
thanks for your answer.
but I do not want to use external libraries because I get 2D texts large and small low quality.
I want to use the TextOut function on the form after swapbuffers(hdc).
The text is written but disappears immediately with the refresh.
help me.
thanks.

Share this post


Link to post
Share on other sites
That's normal. Like I said, TextOut is a GDI operation.
If you absolutly want it, you would have to make a single buffer GL context and also there is a certain flag that you need to set for PIXELFORMATDESCRIPTOR
You need the PFD_SUPPORT_GDI flag.

Share this post


Link to post
Share on other sites
Ok, but if i set the PFD_SUPPORT_GDI flag, i can't use the DoubleBuffers and lose the power of OpenGL.
how can I do?
can use the glDrawPixels to transfer the text (created by the function TextOut) to the buffer in some way??
Thanks.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!