Page 1 of 1

Linking OpenGL and wxWidgets

Posted: Wed Oct 10, 2018 4:12 am
by hurricane_rush
I want to create a program that converts 2d models to 3d mesh data using wxWidgets and OpenGL.

In this process I want to use only wxWidgets, wxcore, wxbase, wxGL.

Is it possible to use only the desired library when using wxWidgets?

If it's possible what is the method?

What should I do?

Thank you

Re: Linking OpenGL and wxWidgets

Posted: Wed Oct 10, 2018 12:59 pm
by Manolo
It's not clear what you have in mind. For example, are you planning to do the 2d->3d conversion in the CPU or in the GPU (by some sophisticated shader)?
Some thoughts:

a) wxWidgets relation with OpenGL is just create a window and the gl-context. See wxGLCanvas and wxGLContext docs.

b) In order to use OpenGL on wxWidgets you need to add USE_OPENGL=1 parameter (Windows) or --with-opengl (linux/OSX) when compiling wxWidgets.
Then add opengl32 lib (Wiindows), GL lib (Linux) or Framework.Opengl (OSX) to your project settings.

c) If you have the idea of using OpenGL version < 3.2 (aka "fixed pipeline"), please forget it. Use a modern Core Profile context.

d) wxWidgets provides some simple examples of OpenGL. "pyramid" uses OGL 3.2

Re: Linking OpenGL and wxWidgets

Posted: Thu Oct 11, 2018 4:43 am
by hurricane_rush
I want to convert 2D images to 3D MESH using software called 'SAGA GIS'.

Then except for the other unnecessary libraries here, I want to write only what is needed for the task.

Why use opengl linking wxwidgets?

Re: Linking OpenGL and wxWidgets

Posted: Thu Oct 11, 2018 8:30 am
by doublemax
Your post is a little confusing. 'SAGA GIS' is a software that uses wxWidgets. Do you just want to build it? Or do you want to use parts of it in your own project? Or anything else?

Re: Linking OpenGL and wxWidgets

Posted: Fri Oct 12, 2018 12:15 am
by hurricane_rush
I want to make software that converts 2d to 3d mesh.
Like 'saga gis'
Then i know that software called 'SAGA GIS' uses OpenGL and wxWidgets together.
As a result I want to move the 3d view implementation of 'saga gis' into my project.
In the process, I only want to use wxCore, wxBase, wxglContext and wxglCanvas of wxWidgets.
What should I do?
Thank you

Re: Linking OpenGL and wxWidgets

Posted: Fri Oct 12, 2018 5:19 am
by PB
hurricane_rush wrote:In the process, I only want to use wxCore, wxBase, wxglContext and wxglCanvas of wxWidgets.
What should I do?
I think not using any wxWidgets class not provided in any of the listed libraries. That should be it.

If you mean how you actually setup the build chain, that depends on your platform, compiler, and IDE and is described in the wxWidgets documentation.

Additionally, you can disable certain features so the third party libraries wxWidgets depend on are not used (such as the various image format support, zip, xml, regex). But this depends on what SAGA GIS itself uses in the part of the code you want to take.

But the question is: Why? Are there such serious disk space constraints on your target machines? I would start with the default configuration, particularly if you are a wxWidgets beginner...