Use OpenGL like wxDC? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Pille456
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Sep 03, 2008 5:29 pm

Post by Pille456 »

I know what you mean and I already checked this.
In addition to this I also compiled and ran the example you posted and both worked without any problems. So the OpenGL files cant be the problem,
Pille456
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Sep 03, 2008 5:29 pm

Post by Pille456 »

I'm sorry for this double post, but I noticed something strange:
I installed VisualC++ Express just to test if it runs with this program and its compiler and it does. I had to reinstall the wxPack but now everything runs fine with VC++.

Unfortunately I dont like VC++, therefore I use Code::Blocks with MinGW. And now I'm questioning myself why it works with VC++ but not with Code::Blocks / MinGW!
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

Maybe the MingW pack you got from wxPack doesn't have OpenGl enabled. Maybe try building wx yourself?
Pille456
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Sep 03, 2008 5:29 pm

Post by Pille456 »

I thought about that, but the forum says it would be in: http://sourceforge.net/forum/forum.php? ... _id=595652 (okay they are talking about 2.7, but I think this hadn't change between 2.7 and 2.8 )

I also tried to build them on my own and the build process was successful (which makes me happy on my windows :D) but I couldn't compile anything. Think I missed something there..

Maybe someone here could post some of her/his working libraries so that I can check if this is the problem? If it is so, then I can start to fully rebuild all the things I need (but momently I would just like to run this program)
Pille456
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Sep 03, 2008 5:29 pm

Post by Pille456 »

Again I have to make a double post, but still there is no answer in view.
In addition to my post above, I tested the samples with wxDevCpp, which worked out of the box -.-
Looks like CB makes something really strange here.

What I noticed:
In the CB wxWidget Project Wizard is a term called "use wxWidget DLL" , which sounds a bit odd to me, because I always had to link the libraries manually.
But unchecking this leads me into a linker error, even if all libraries are linked
Maybe you know what to do with this:

Code: Select all

C:\Programmieren\C++\Compiler\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud.a(monolib_gdicmn.o)||In function `~wxResourceCache':../../src/common/gdicmn.cpp:871: undefined reference to `_Unwind_Resume'|
:..\..\src\common\gdicmn.cpp|871|undefined reference to `_Unwind_Resume'|
:..\..\src\common\gdicmn.cpp|871|undefined reference to `_Unwind_Resume'|
C:\Programmieren\C++\Compiler\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud.a(monolib_gdicmn.o)||In function `~wxGDIObjListBase':../../src/common/gdicmn.cpp:714: undefined reference to `_Unwind_Resume'|
:..\..\src\common\gdicmn.cpp|714|undefined reference to `_Unwind_Resume'|
//etc..
Pille456
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Sep 03, 2008 5:29 pm

Post by Pille456 »

After a week of searching and finally speaking to the CB guys I have the solution.
Just, as always, a little easy thing: I have to use the multiLib build instead of the monolith one...

Thanks for helping me!
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re:

Post by gtafan »

Disch wrote: Sun Oct 19, 2008 4:45 pm
You could do that. Rather than derive classes like I indicated in my post, you could do something like:

Code: Select all

wxGLCanvas* myCanvas = new wxGLCanvas( ... );
wxGLContext* myContext = new wxGLContext( ... );

// then in OnPaint of some dialog/window/whatever

myContext->SetCanvas(myCanvas);
  // do GL drawing stuff here
There's no rule that says the GL drawing code HAS to be in a wxGLCanvas derived class. OpenGL is all a series of global functions, so it's all available anywhere -- and as long as you tie the context to the desired canvas -- all GL drawing functions will draw to that canvas, no matter where the code is in your program.
Is it really necesary to do this code for every OnPaint event?

Code: Select all

myContext->SetCanvas(myCanvas);
Can´t I do this in the constuctor of the Frame for example?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Use OpenGL like wxDC?

Post by ONEEYEMAN »

Hi,
This thread is 10-years old.
Please create a new thread with the specific question.

Also, lok at the OpenGL samples and try to follow their code.

Thank you.
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: Use OpenGL like wxDC?

Post by gtafan »

ONEEYEMAN wrote: Mon Oct 21, 2019 2:51 pm Hi,
This thread is 10-years old.
Please create a new thread with the specific question.

Also, lok at the OpenGL samples and try to follow their code.

Thank you.
The example here is at least 1000 times beter than OpenGL samples, which in my opinion complete useles for learning something. My question was about this exsample, so starting new thread seems to make no much sence for me, even I know this thread is really old.
Post Reply