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

Author Topic: Custom Qt-widget + SFML -- how to?  (Read 1783 times)

0 Members and 1 Guest are viewing this topic.

codewizard

  • Newbie
  • *
  • Posts: 9
    • View Profile
Custom Qt-widget + SFML -- how to?
« on: September 22, 2013, 03:29:35 pm »
I want to integrate my SFML application within a qt window, so I followed this tutorial (http://www.sfml-dev.org/tutorials/1.6/graphics-qt.php). The first part with the base class is no problem, but I don't actually understand how to use a derived class of it:

Is it meant to replace my game class where the whole SFML part runs (like this: http://www.sfml-dev.org/tutorials/2.1/start-linux.php), so i.e. OnUpdate would replace update? Am I even able to use RenderWindow when using SFML with Qt?

Or is this class meant to be used completely different?

codewizard

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Custom Qt-widget + SFML -- how to?
« Reply #1 on: September 23, 2013, 11:25:03 pm »
I'm sorry, but - bump.

Estivo

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • Email
Re: Custom Qt-widget + SFML -- how to?
« Reply #2 on: September 28, 2013, 01:28:18 am »
you have to make a deriverd class of QSFMLCanvas. In that class you render and do what you want , and overloading some functions. To render you have to make widget/frame in your window/dialog and do something like this.
QSFML* qsfml 〓 new QSFML(ui->frame)
Thats all.