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

Author Topic: [C++] Drawing SFML Text in Leadwerks Engine Window  (Read 1478 times)

0 Members and 1 Guest are viewing this topic.

Gandi

  • Newbie
  • *
  • Posts: 4
    • View Profile
[C++] Drawing SFML Text in Leadwerks Engine Window
« on: February 02, 2010, 03:38:44 pm »
Hey,

i'm using the Leadwerks Engine 2.3 for my game. Although it is a good engine, the font support is pretty weak, so i'd like to use sf::String in combination with the normal drawing commands of the engine to draw on the SAME render target.

So what i basically want to do with SMFL is:
-do no OGL initialization at all
-do not create any Window or RenderTarget, since they already exist
-render the string on the current render target, with the current render states
-do not flip buffers, since LE does this

The problems seems to be that LE also uses OpenGL and somehow the render states or OGL initialization or whatever seem to interfere as soon as I create a sf::RenderWindow from the existing HWND.

I also tried to derive a class from sf::RenderTarget which basically does nothing ( since the render target already exists and is correctly set up ) and draw the String with that target, but i'm also just getting memory acess violations.

Unfortunately, LE is closed source, so I cannot tell exactly what it does.

Any help would be appreciated.

Greetings from Bavaria
Gandi[/url]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[C++] Drawing SFML Text in Leadwerks Engine Window
« Reply #1 on: February 02, 2010, 06:33:59 pm »
Hi

SFML is not made for this kind of usage, I'm afraid you won't be able to use sf::String alone.

But what you can do is to use sf::Font and sf::Glyph, retrieve the texture that contains the generated glyphs and use it to draw your text with LE or OpenGL commands.
Laurent Gomila - SFML developer

 

anything