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

Author Topic: SFML 2 and Qt5 on Windows  (Read 5873 times)

0 Members and 1 Guest are viewing this topic.

Canadadry

  • Hero Member
  • *****
  • Posts: 1081
    • View Profile
SFML 2 and Qt5 on Windows
« on: December 30, 2012, 12:38:45 pm »
Hi,

I was playing a little with Qt5 since the release ( 2 weeks ago ). And when I start playing with OpenGL in Qt5 I found something quite disturbing. It was impossible to use OpenGL without using QOpengl classes.

After some research I found that : How Qt5 handle OpenGL.

To summary, They don't want to fight with windows's implementation of OpenGL, drivers, version  and stuff (since they want at least OpenGL 2 or OpenGL ES 2).  They wanted to avoid those issues and look WebGL and how Browser implemented it without requiring decent drivers. Here what they found : The ANGLE project. This is an OpenGL ES 2 implementation on top of DirectX 9.0c.

So my question is : what can we do to make smlf 2 work with Qt 5 on windows?

I came with 2 answers :
  • Port SMFL 2 to ANGLE, this just required to port SFML 2 to OpenGL 2, ES 2.
  • We can let people rebuild Qt5 to use standard Opengl.


What do you think about that ? Did you have other ideas?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2 and Qt5 on Windows
« Reply #1 on: December 30, 2012, 01:08:09 pm »
ANGLE is just another implementation of OpenGL, it doesn't change anything to the code that uses it. And it doesn't change anything to how SFML works -- even if you put it inside a QWidget, it's still SFML inside.

So what is the problem exactly?
« Last Edit: December 30, 2012, 01:11:05 pm by Laurent »
Laurent Gomila - SFML developer

cire

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: SFML 2 and Qt5 on Windows
« Reply #2 on: December 30, 2012, 01:13:04 pm »
And, from the link you posted...

Quote
On the other hand if your application requires full desktop OpenGL, then it’s simply a matter of configuring Qt with “-opengl desktop” and you get the same behavior as before.

Canadadry

  • Hero Member
  • *****
  • Posts: 1081
    • View Profile
Re: SFML 2 and Qt5 on Windows
« Reply #3 on: December 30, 2012, 03:43:26 pm »
Using ANGLE means using DirectX not OpenGL. You're not link to opengl32.dll anymore. We can't use Qt to create a OpenGL context and use old OpenGL.


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2 and Qt5 on Windows
« Reply #4 on: December 30, 2012, 03:56:46 pm »
The only important thing is that ANGLE only supports OpenGL (ES) 2, and that SFML still uses old OpenGL 1.x functions.

So yes, actually you'll need one of the solutions that you proposed in your first post: either reconfigure Qt to use regular OpenGL, or wait until SFML is ported to GL ES 2.
« Last Edit: December 30, 2012, 04:32:18 pm by Laurent »
Laurent Gomila - SFML developer

Ancurio

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: SFML 2 and Qt5 on Windows
« Reply #5 on: December 31, 2012, 03:41:22 pm »
The only important thing is that ANGLE only supports OpenGL (ES) 2, and that SFML still uses old OpenGL 1.x functions.

Just out of curiosity (and because I'm a openGL noob), where are those 1.x functions used? In many places? And how hard would it be to replace them with 2.x equivalents?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2 and Qt5 on Windows
« Reply #6 on: December 31, 2012, 04:52:37 pm »
I have no idea, but don't worry I'll work on it soon.
Laurent Gomila - SFML developer

Canadadry

  • Hero Member
  • *****
  • Posts: 1081
    • View Profile
Re: SFML 2 and Qt5 on Windows
« Reply #7 on: January 07, 2013, 09:40:51 am »
Here a list of all OpenGL ES function : http://pastebin.com/bZK6Bnj6

For SFML2, that imply do not use anymore Matrix functions and use allways shader. Re-write context creation code. I guess this is all it has to be done.

 

anything