|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Updating GLEW to version 2.2.0 for 2020.2 Release (March 2020)
Updating GLEW to version 2.2.0 for 2020.2 Release [message #54664] |
Sat, 29 August 2020 18:41 |
|
Klugier
Messages: 1087 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
It seems that there is new glew version (2.2.0 - March 2020). We should updated it before releasing new Upp version. Also, I had discussion today with Xemuth and our current version forces him to use GLAD.
In attachment I attached plugin/glew updated to version 2.2.0. If you want to dowload it by yourself you could do this on Sourceforge.
If you are interested in this plugin. Please test it Especially I would be grateful if Xemuth test this plugin by himself.
Sincerely,
Klugier
-
Attachment: glew.zip
(Size: 375.17KB, Downloaded 170 times)
U++ - one framework to rule them all.
[Updated on: Sat, 29 August 2020 18:57] Report message to a moderator
|
|
|
|
Re: Updating GLEW to version 2.2.0 for 2020.2 Release [message #54666 is a reply to message #54664] |
Sat, 29 August 2020 20:00 |
|
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
First I have changed the "uppsrc/plugin/glew" by the glew you provided, then I have launch the example : Reference->OpenGL
Compilation error: C:\Upp\upp\uppsrc\plugin\glew\glew.c (34): fatal error: 'GL/glew.h' file not found
Comparing the glew you provided with the one Upp had, it should be #include "glew.h"
Same for line 53 in glew.c it should be #include "wglew.h" instead of #include <GL/wglew.h>
Same for....
You will find the patch file bellow.
Also, GLCtrl have a strange behavior concerning context (A behavior I changed in my own GLCtrl) :
When ExecuteGL is call, in original version it do this :
void GLCtrl::GLPane::ExecuteGL(HDC hDC, Event<> paint, bool swap_buffers){
/**** CODE ****/
wglMakeCurrent(hDC, s_openGLContext); //Hooking the OpenGL Context
/***** Code / Swap buffer etc .... *****/
wglMakeCurrent(NULL, NULL); //Releasing the current OpenGL Context
}
This aquisition then releasing is problematique since it prevent you to execute some OpenGL code outside of GLPaint function.
It mean I can't do OpenGL when button is pressed or fenetre resized or even when my application is starting etc... To fix this issue, in my own Ctrl I just changed the fonction like this :
void GLCtrl::GLPane::ExecuteGL(HDC hDC, Event<> paint, bool swap_buffers)
{
ONCELOCK{
wglMakeCurrent(hDC, s_openGLContext); //Creating the context one time
}
/**** CODE .... ****/
//wglMakeCurrent(NULL, NULL); //no release
}
Since I encoutered no problem with my version and I don't see (maybe I'm wrong) any problem with it, I would be happy it become so official behavior of GLCtrl. So I could migrate my surfaceCtrl package to this GLCtrl.
With all this, my application and OpenGL Example (in reference) work perfectly.
|
|
|
|
|
|
Re: Updating GLEW to version 2.2.0 for 2020.2 Release [message #54670 is a reply to message #54669] |
Sun, 30 August 2020 22:04 |
|
Klugier
Messages: 1087 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Mirek,
It seems that we have all information to update glew. Howeverm what about this change proposed by Xemuth:
if (glewIsSupported("GL_VERSION_4_3")) enhanced_mode=true;
instead of
if (glewIsSupported("GL_VERSION_2_1")) enhanced_mode=true;
Do we need it? BTW, This string should be defined in one place to change it more easily. Right now to change it we need to modify two source files (Win & X11). Mire, can we improve this? I do not have access to GLCtrl.
Klugier
U++ - one framework to rule them all.
[Updated on: Sun, 30 August 2020 22:05] Report message to a moderator
|
|
|
Re: Updating GLEW to version 2.2.0 for 2020.2 Release [message #54673 is a reply to message #54670] |
Mon, 31 August 2020 00:01 |
|
mirek
Messages: 14164 Registered: November 2005
|
Ultimate Member |
|
|
Klugier wrote on Sun, 30 August 2020 22:04Hello Mirek,
It seems that we have all information to update glew.
Updated.
Quote:
if (glewIsSupported("GL_VERSION_4_3")) enhanced_mode=true;
instead of
if (glewIsSupported("GL_VERSION_2_1")) enhanced_mode=true;
Do we need it?
No. Check the code for the real purpose. Above change would be grave mistake.
Quote:
BTW, This string should be defined in one place to change it more easily. Right now to change it we need to modify two source files (Win & X11).
I do not see it in X11. This is win32 specific issue if I remember well...
Mirek
[Updated on: Mon, 31 August 2020 00:01] Report message to a moderator
|
|
|
Re: Updating GLEW to version 2.2.0 for 2020.2 Release [message #54674 is a reply to message #54673] |
Mon, 31 August 2020 00:23 |
|
Klugier
Messages: 1087 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Mirek,
Thanks for updating this plugin is such short amount of time!
You are right about GL version string it is only used in Windows implementation. About the if you are right too, we will do not execute some enhanced OpenGL initialization when version will be less than 4.3. If this initialization works correctly on 2.1 there is no need to change them.
Klugier
U++ - one framework to rule them all.
[Updated on: Mon, 31 August 2020 00:26] Report message to a moderator
|
|
|
Re: Updating GLEW to version 2.2.0 for 2020.2 Release [message #54675 is a reply to message #54669] |
Mon, 31 August 2020 00:35 |
|
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
mirek wrote on Sun, 30 August 2020 19:42Xemuth wrote on Sat, 29 August 2020 20:00
Also, GLCtrl have a strange behavior concerning context (A behavior I changed in my own GLCtrl) :
When ExecuteGL is call, in original version it do this :
void GLCtrl::GLPane::ExecuteGL(HDC hDC, Event<> paint, bool swap_buffers){
/**** CODE ****/
wglMakeCurrent(hDC, s_openGLContext); //Hooking the OpenGL Context
/***** Code / Swap buffer etc .... *****/
wglMakeCurrent(NULL, NULL); //Releasing the current OpenGL Context
}
This aquisition then releasing is problematique since it prevent you to execute some OpenGL code outside of GLPaint function.
This is needed so that you can have multiple GLCtrls in multiple windows. If you need to execute OpenGL code outside of GLPaint function, just use ExecuteGL (it is in fact inteded for that use).
Mirek
Indeed it work, thanks for the tips
|
|
|
|
Re: Updating GLEW to version 2.2.0 for 2020.2 Release [message #54677 is a reply to message #54664] |
Mon, 31 August 2020 02:28 |
|
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
The linking error is fix by adding this define at the top of GLCtrl.h
Just before the glew include.
However I don't understand why it work since it is still defined as compilation option in package configuration of plugin/glew....
Update: After trying to set -D GLEW_STATIC as compiler option in GLCtrl package configuration it worked. Maybe this compiler option should be move from plugin/glew to GLCtrl
[Updated on: Mon, 31 August 2020 02:33] Report message to a moderator
|
|
|
|
|
Re: Updating GLEW to version 2.2.0 for 2020.2 Release [message #54698 is a reply to message #54684] |
Wed, 02 September 2020 01:03 |
Novo
Messages: 1378 Registered: December 2006
|
Ultimate Contributor |
|
|
Compilation of reference/GLDrawDemo is broken on Linux.
In file included from /home/ssg/.local/soft/bb-worker/worker/l-upp/build/uppsrc/plugin/glew/glew.c:55:
/home/ssg/.local/soft/bb-worker/worker/l-upp/build/uppsrc/plugin/glew/glxew.h:103:12: fatal error: 'GL/glew.h' file not found
# include <GL/glew.h>
^~~~~~~~~~~
It was broken in
plugin/glew: updated to 2.2.0 - March 2020
git-svn-id: svn://ultimatepp.org/upp/trunk@14939 f0d560ea-af0d-0410-9eb7-867de7ffcac7
Before that everything was fine.
Regards,
Novo
|
|
|
Re: Updating GLEW to version 2.2.0 for 2020.2 Release [message #54699 is a reply to message #54698] |
Wed, 02 September 2020 01:14 |
|
Klugier
Messages: 1087 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Novo,
Thanks for reporting. I checked this example before creating this message, however I need to have glew library installed on my system. In this case all we need to do is replace in the plugin/glew source code:
with
Let's do the same for eglew.h (line 110). Mirek please apply I do not have write permission for plugins...
In case of glew static I just wonder what is the difference between passing argument like "-D GLEW_STATIC" to "-DGLEW_STATIC". I see that plugin/png uses the second notation.
Klugier
U++ - one framework to rule them all.
[Updated on: Wed, 02 September 2020 01:21] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Dec 14 15:28:26 CET 2024
Total time taken to generate the page: 0.02299 seconds
|
|
|