Page 1 of 1

wxGLCanvas using problem

Posted: Fri Dec 19, 2008 12:12 am
by Sergey
Hello.
I try use wxGLCanvas in my project. The part of the code below.

Code: Select all

#include <GL/glu.h>
#include "wx/glcanvas.h"// inheriting class's header file
#include "wx/image.h"
#include "wx/dcclient.h"
#include "wx/timer.h"

class MeshPicture2D : public wxGLCanvas
{
	DECLARE_EVENT_TABLE()
    public:
		// class constructor
		MeshPicture2D(wxWindow* parent, wxWindowID id = wxID_ANY,
            const wxPoint & pos = wxDefaultPosition,
            const wxSize & size = wxDefaultSize, long style = 0);
		// class destructor
		~MeshPicture2D();
		// Обработка события перепрорисовки канвы элемента
		void OnPaint(wxPaintEvent & event);
...
But when I try compile project I take message:
`wxGLCanvas' has not been declared
Where my error?
P.S. Sorry if topic is not for this section.

Re: wxGLCanvas using problem

Posted: Fri Dec 19, 2008 12:18 am
by eranif
The WX library that comes with codelite does NOT has OpenGL enabled, you will need to compile WX by yourself for this.

If you need more assistant with OpenGL and WX you can ask here:
wxforum.shadonet.com

I myself, dont have any experience in OpenGL and WX.
Eran

Re: wxGLCanvas using problem

Posted: Fri Dec 19, 2008 11:09 am
by Sergey
I downloaded wxWidgets 2.8.9 and built it:

Code: Select all

mingw32-make -f makefile.gcc UNICODE=1 SHARED=1 MONOLITHIC=1 BUILD=debug USE_OPENGL=1
and

Code: Select all

mingw32-make -f makefile.gcc UNICODE=1 SHARED=1 MONOLITHIC=1 BUILD=release USE_OPENGL=1
Next I changed WXWIN value to C:\wxWidgets-2.8.9
Now when I press Ctrl+left mouse click on any include file name (like

Code: Select all

#include "wx/wx.h"
) it is don't open.
Problem with compilation of wxGLCanvas still exist. Maybe anybody have experience in this question?

Re: wxGLCanvas using problem

Posted: Fri Dec 19, 2008 6:02 pm
by Sergey
Hello. I found the solution of the problem. For using wxGLCanvas I have done several steps.
    1. Download and extract wxWidgets 2.8.9
    • Edit WXDIR/include/wx/msw/ setup.h, set wxUSE_GLCANVAS to 1, and compile with USE_OPENGL=1 on the command line
    • Add to linker options -lwxmsw28ud_gl;-lopengl32;-lglu32; - for debug and -lwxmsw28u_gl;-lopengl32;-lglu32; - for release
As I undarstant now for distribution I need distribute additional two files: wxmsw28u_gcc_custom.dll and wxmsw28u_gl_gcc_custom.dll.
Should I distribute mingwm10.dll for my project distribution?

Sergey

Re: wxGLCanvas using problem

Posted: Fri Dec 19, 2008 6:28 pm
by eranif
Sergey wrote:Should I distribute mingwm10.dll for my project distribution?
Yes, if u use threads

Eran