Discussion:
OpenGL 4 on MacOS X 10.9
Christer Wickman
2014-07-30 12:20:49 UTC
Permalink
Anybody manage to compile wxWidgets with OpenGL 4.x support on MacOS X 10.9?

I can compile modern OpenGL (4.x) program with GLEW+GLFW, but with
wxWidgets I am stuck with the old.
The reason seems to be that wxWidgets use GLUT, that is stuck on old-school
OpenGL.

So I would like to replace GLUT with GLFW, but not sure how or if there is
a more simple way?
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-07-30 12:30:40 UTC
Permalink
On Wed, 30 Jul 2014 05:20:49 -0700 (PDT) Christer Wickman wrote:

CW> Anybody manage to compile wxWidgets with OpenGL 4.x support on MacOS X 10.9?
CW>
CW> I can compile modern OpenGL (4.x) program with GLEW+GLFW, but with
CW> wxWidgets I am stuck with the old.
CW> The reason seems to be that wxWidgets use GLUT, that is stuck on old-school
CW> OpenGL.

I didn't try building wx with OpenGL 4 under OS X, but I'm pretty sure it
doesn't use GLUT anywhere, so there must be some mistake here. What
problems exactly do you have?

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Christer Wickman
2014-07-30 12:48:49 UTC
Permalink
When I run configure it report GLUT after checking for OpenGL utility
library (GLU).
What does configure report on your machine?
Post by Vadim Zeitlin
CW> Anybody manage to compile wxWidgets with OpenGL 4.x support on MacOS X 10.9?
CW>
CW> I can compile modern OpenGL (4.x) program with GLEW+GLFW, but with
CW> wxWidgets I am stuck with the old.
CW> The reason seems to be that wxWidgets use GLUT, that is stuck on old-school
CW> OpenGL.
I didn't try building wx with OpenGL 4 under OS X, but I'm pretty sure it
doesn't use GLUT anywhere, so there must be some mistake here. What
problems exactly do you have?
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-07-30 13:17:37 UTC
Permalink
On Wed, 30 Jul 2014 05:48:49 -0700 (PDT) Christer Wickman wrote:

CW> When I run configure it report GLUT after checking for OpenGL utility
CW> library (GLU).
CW> What does configure report on your machine?

This is libtiff configure and it is irrelevant for us, don't pay attention
to it.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Christer Wickman
2014-07-30 13:30:52 UTC
Permalink
lib tiff configure, good. Do you by any chance have a minimal example using
OpenGL 4 (I only find old school examples)? And especially what compile
parameters do you use?
I only manage to get OpenGL 2.1 code to work with wxWidgets.
Without wxWidgets I can compile with GLFW and GLEW, but I guess GLFW
collide with something else in wxWidgets that I am not familiar with. And
can I still use GLEW on top on that?
Post by Vadim Zeitlin
CW> When I run configure it report GLUT after checking for OpenGL utility
CW> library (GLU).
CW> What does configure report on your machine?
This is libtiff configure and it is irrelevant for us, don't pay attention
to it.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Christer Wickman
2014-07-30 15:39:57 UTC
Permalink
If I use the example: wiki.wxwidgets.org/WxGLCanvas#Example
as starting code I get OpenGL 2.1 when I add "glGetString(GL_VERSION)".
I don't know how to change version in wxGLCanvas. With GLFW I can add
initialise-functions to activate OpenGL 4.1 but can't find any
corresponding functions with wxGLCanvas. So how can I get access to OpenGL
4 with wxWidgets?
Post by Christer Wickman
lib tiff configure, good. Do you by any chance have a minimal example
using OpenGL 4 (I only find old school examples)? And especially what
compile parameters do you use?
I only manage to get OpenGL 2.1 code to work with wxWidgets.
Without wxWidgets I can compile with GLFW and GLEW, but I guess GLFW
collide with something else in wxWidgets that I am not familiar with. And
can I still use GLEW on top on that?
Post by Vadim Zeitlin
CW> When I run configure it report GLUT after checking for OpenGL utility
CW> library (GLU).
CW> What does configure report on your machine?
This is libtiff configure and it is irrelevant for us, don't pay attention
to it.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Eric Jensen
2014-07-30 16:28:10 UTC
Permalink
Hello Christer,

Wednesday, July 30, 2014, 5:39:57 PM, you wrote:

CW> If I use the example: wiki.wxwidgets.org/WxGLCanvas#Example
CW> as starting code I get OpenGL 2.1 when I add "glGetString(GL_VERSION)".
CW> I don't know how to change version in wxGLCanvas. With GLFW I can add
CW> initialise-functions to activate OpenGL 4.1 but can't find any
CW> corresponding functions with wxGLCanvas. So how can I get access to OpenGL
CW> 4 with wxWidgets?

I don't know much about OpenGL, but at least under Windows, you need a
different kind of context creation for OpenGL 3.2 or higher.

http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt

I assume it's the same under OSX.

Regards,
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Christer Wickman
2014-07-30 16:54:53 UTC
Permalink
Yes this is what I initialise when I use GLFW:
I call functions like "glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 4);" and
so on.

the prefix "ARB" should be gone, and be a core specification.
The question is how I do this context creation in wxWidgets?
Post by Eric Jensen
Hello Christer,
CW> If I use the example: wiki.wxwidgets.org/WxGLCanvas#Example
CW> as starting code I get OpenGL 2.1 when I add
"glGetString(GL_VERSION)".
CW> I don't know how to change version in wxGLCanvas. With GLFW I can add
CW> initialise-functions to activate OpenGL 4.1 but can't find any
CW> corresponding functions with wxGLCanvas. So how can I get access to OpenGL
CW> 4 with wxWidgets?
I don't know much about OpenGL, but at least under Windows, you need a
different kind of context creation for OpenGL 3.2 or higher.
http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt
I assume it's the same under OSX.
Regards,
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Eric Jensen
2014-07-30 17:07:37 UTC
Permalink
Hello Christer,

Wednesday, July 30, 2014, 6:54:53 PM, you wrote:

CW> Yes this is what I initialise when I use GLFW:
CW> I call functions like "glfwWindowHint
CW> (GLFW_CONTEXT_VERSION_MAJOR, 4);" and
CW> so on.

CW> the prefix "ARB" should be gone, and be a core specification.
CW> The question is how I do this context creation in wxWidgets?

I'd say currently not possible. (At least) the wxGLContext
implementation has to be changed for that.

Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Christer Wickman
2014-07-30 17:31:58 UTC
Permalink
And I am not so found of QT, but it seems I'm running out of options.
Post by Eric Jensen
Hello Christer,
CW> I call functions like "glfwWindowHint
CW> (GLFW_CONTEXT_VERSION_MAJOR, 4);" and
CW> so on.
CW> the prefix "ARB" should be gone, and be a core specification.
CW> The question is how I do this context creation in wxWidgets?
I'd say currently not possible. (At least) the wxGLContext
implementation has to be changed for that.
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-07-30 19:34:06 UTC
Permalink
On Wed, 30 Jul 2014 09:54:53 -0700 (PDT) Christer Wickman wrote:

CW> Yes this is what I initialise when I use GLFW:
CW> I call functions like "glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 4);" and
CW> so on.
CW>
CW> the prefix "ARB" should be gone, and be a core specification.
CW> The question is how I do this context creation in wxWidgets?

There is no built-in support for dynamic loading of OpenGL 3+ functions in
wx and while I think it might be nice to have it there, you can use any of
the usual libraries instead. E.g. I do

#include <glload/gll.hpp>
#include <glload/gl_3_2_comp.h>

#ifdef _MSC_VER
#ifdef NDEBUG
#pragma comment(lib, "glload")
#else
#pragma comment(lib, "glloadd")
#endif
#endif

and then just

if ( glload::LoadFunctions() == glload::LS_LOAD_FAILED )
{
wxLogFatalError("OpenGL functions couldn't be loaded.");
}

wxLogDebug("Using OpenGL %d.%d\n",
glload::GetMajorVersion(),
glload::GetMinorVersion());


I've only used this under Windows however...

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Christer Wickman
2014-07-30 19:57:50 UTC
Permalink
If I get you correct: I can use GLEW+GLFW solution to handle the OpenGL
things and somehow use a more general wxWidgets window class as general
holder to somehow display it or?
I'm curious to see how you combine it.
Post by Vadim Zeitlin
CW> I call functions like "glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 4);" and
CW> so on.
CW>
CW> the prefix "ARB" should be gone, and be a core specification.
CW> The question is how I do this context creation in wxWidgets?
There is no built-in support for dynamic loading of OpenGL 3+ functions in
wx and while I think it might be nice to have it there, you can use any of
the usual libraries instead. E.g. I do
#include <glload/gll.hpp>
#include <glload/gl_3_2_comp.h>
#ifdef _MSC_VER
#ifdef NDEBUG
#pragma comment(lib, "glload")
#else
#pragma comment(lib, "glloadd")
#endif
#endif
and then just
if ( glload::LoadFunctions() == glload::LS_LOAD_FAILED )
{
wxLogFatalError("OpenGL functions couldn't be loaded.");
}
wxLogDebug("Using OpenGL %d.%d\n",
glload::GetMajorVersion(),
glload::GetMinorVersion());
I've only used this under Windows however...
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...