Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: get a window device context  (Read 2521 times)

0 Members and 1 Guest are viewing this topic.

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
get a window device context
« on: May 17, 2011, 03:03:30 pm »
I am writing some code to do text in opengl. I am using wglUseFontOutlines based on some tutorials i have read.

The problem is i need a HDC for this to work. I can not see anyway to do that looking at your api.

Could you provide some information about this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
get a window device context
« Reply #1 on: May 17, 2011, 03:18:58 pm »
There's no way to get the HDC in SFML 1 (but you can do it in SFML 2).

Note that you can use sf::String to display text in your window, and you can mix it with your OpenGL stuff.
Laurent Gomila - SFML developer

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
get a window device context
« Reply #2 on: May 17, 2011, 06:39:10 pm »
I recently asked if i could use that to draw into 3d space. basically being able to use the z axis(though still flat text of course). I was told this is not possible.

If there is a way that would be great.

It would be so much better than making up images of the alphabet and using a textured quad, or storing a mesh of fonts.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
get a window device context
« Reply #3 on: May 17, 2011, 06:52:24 pm »
Well, with SFML 2 you could draw 3D text by using sf::Font and reimplementing your own sf::Text.
Laurent Gomila - SFML developer

 

anything