SFML community forums
General => General discussions => Topic started by: Canadadry 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 (http://blog.qt.digia.com/blog/2012/10/24/graphics-on-windows-from-a-different-angle/).
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 (http://code.google.com/p/angleproject/). 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?
-
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?
-
And, from the link you posted...
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.
-
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.
-
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.
-
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?
-
I have no idea, but don't worry I'll work on it soon.
-
Here a list of all OpenGL ES function : http://pastebin.com/bZK6Bnj6 (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.