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

Author Topic: Text Output in OpenGL ?  (Read 2874 times)

0 Members and 1 Guest are viewing this topic.

alienGhost

  • Newbie
  • *
  • Posts: 7
    • View Profile
Text Output in OpenGL ?
« on: November 20, 2011, 07:30:34 am »
Hi,

I'm using SFML as a GLUT replacement for OpenGL/GLSL.

I have an sf::Window for my output and would like to use SFML to output text. It doesn't seem possible, or am I missing something?

I notice in the sf::Text object has a virtual method called Render. I've not looked very deep, but would it be possible to derive a class from sf::Text and implement drawing to an sf::Window?

SFML really needs to support sf::Window output if possible. It's a killer-app for people wanting to ditch stuff like GLUT and freeGLUT.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Text Output in OpenGL ?
« Reply #1 on: November 20, 2011, 11:24:38 am »
You have to use sf::RenderWindow to draw SFML graphics. sf::Window is only for event handling and direct OpenGL rendering.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

alienGhost

  • Newbie
  • *
  • Posts: 7
    • View Profile
Text Output in OpenGL ?
« Reply #2 on: November 20, 2011, 11:29:33 pm »
hey, that's the problem. i am using OpenGL directly for drawing and shaders (not SFML). but I would still like to use sfml's font facilities, somehow.

i thought maybe overloading sf::Text's Render method. not sure.

EDIT: oh, im using SFML 2 - just incase

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Text Output in OpenGL ?
« Reply #3 on: November 21, 2011, 07:54:32 am »
What's the problem with sf::RenderWindow? You can still use OpenGL to draw, but as a bonus you'll be able to draw sf::Text as well.
Laurent Gomila - SFML developer

alienGhost

  • Newbie
  • *
  • Posts: 7
    • View Profile
Text Output in OpenGL ?
« Reply #4 on: November 21, 2011, 05:57:16 pm »
thanks Laurent. for some reason I believed that you could only use a RenderWindow with SFML draw commands. I will try switching my display setup to use it.