Glew init error with GTK3 wx 3.1.5
Glew init error with GTK3 wx 3.1.5
glewInit() gives "Unknown error" with WX 3.1.5 when wx is compiled with '--with-gtk=3'. It works with GTK2 and on all the other platforms. Opengl samples do work. I call glewInit() in OnPaint() for wxGLCanvas. It also used to work with older wx versions. This is Debian bullseye.
Re: Glew init error with GTK3 wx 3.1.5
Hi,
Why can't you modify your code to match the sample?
Thank you.
Why can't you modify your code to match the sample?
Thank you.
Re: Glew init error with GTK3 wx 3.1.5
Because the samples do not use external libraries to enable opengl extensions.
Re: Glew init error with GTK3 wx 3.1.5
Hi,
Can you at least explain why you are initializing it the paint event?
Thank you.
Can you at least explain why you are initializing it the paint event?
Thank you.
Re: Glew init error with GTK3 wx 3.1.5
No particular reason, just the way its currently done. I guess calling glewInit() could be moved to the constructor.
I really only needed GTK3 version for some testing so this is not a huge deal for me.
I really only needed GTK3 version for some testing so this is not a huge deal for me.
Re: Glew init error with GTK3 wx 3.1.5
Hi,
It is possible that calling it inside the OnPaint() is already too late.
So I would try to move it in the init routine of you frame and try again. There uis a reason for it to be called "init"
Thank you.
It is possible that calling it inside the OnPaint() is already too late.
So I would try to move it in the init routine of you frame and try again. There uis a reason for it to be called "init"
Thank you.
Re: Glew init error with GTK3 wx 3.1.5
Calling glewinit() from a paint-event doesn't seem a good idea. I find two reasons:
a) Unless you set some flag, you're calling glewinit() time and time and time...
b) In GTK the paint event may be handled before the window is realized. This means you can not set the gl-context as current, which is required before any glew call.
If you take a look at the pyramid sample you'll find that any gl initialization is done at OnSize event handler. And with some checks, just because the "window not realized yet" issu in GTK.
This wx sample handles OGL in a very similar way glew does.
a) Unless you set some flag, you're calling glewinit() time and time and time...
b) In GTK the paint event may be handled before the window is realized. This means you can not set the gl-context as current, which is required before any glew call.
If you take a look at the pyramid sample you'll find that any gl initialization is done at OnSize event handler. And with some checks, just because the "window not realized yet" issu in GTK.
This wx sample handles OGL in a very similar way glew does.
Re: Glew init error with GTK3 wx 3.1.5
I tried moving glewinit() to OnSize() with " if ( !IsShownOnScreen() ) return; " test, and getting gl context in constructor like with pyramid sample but it didn't change anything.
I am doing a very similar check in OnPaint() anyway.
Since this code was working earlier with GTK3 I presume it is some change in either recent wx or Debian's gtk 3 dev package that breaks glewinit().
I tried adding glewinit() into the penguin sample at OnSize() and it failed there too.
I am doing a very similar check in OnPaint() anyway.
Since this code was working earlier with GTK3 I presume it is some change in either recent wx or Debian's gtk 3 dev package that breaks glewinit().
I tried adding glewinit() into the penguin sample at OnSize() and it failed there too.
Re: Glew init error with GTK3 wx 3.1.5
This problem is reproducibly fixed with patching glew to
include egl for wxWidgets =< 3.1.5 including 3.2.0
See https://bbs.archlinux.org/viewtopic.php?id=278127
and the the AUR page for the patched version on Arch and its derivatives.
include egl for wxWidgets =< 3.1.5 including 3.2.0
See https://bbs.archlinux.org/viewtopic.php?id=278127
and the the AUR page for the patched version on Arch and its derivatives.
Re: Glew init error with GTK3 wx 3.1.5
Hi,
Please open an issue at github.com/wxwidgets with the reference to the patch.
This is user forum and this will not be visible to the core developers.
Thank you.
Please open an issue at github.com/wxwidgets with the reference to the patch.
This is user forum and this will not be visible to the core developers.
Thank you.