wxGLCanvas using problem

General questions regarding the usage of CodeLite
Sergey
CodeLite Enthusiast
Posts: 15
Joined: Tue Dec 16, 2008 11:37 pm
Location: Ukraine
Contact:

wxGLCanvas using problem

Post 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.
Смотри в корень!
Лучше скажи мало, но хорошо.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxGLCanvas using problem

Post 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
Make sure you have read the HOW TO POST thread
Sergey
CodeLite Enthusiast
Posts: 15
Joined: Tue Dec 16, 2008 11:37 pm
Location: Ukraine
Contact:

Re: wxGLCanvas using problem

Post 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?
Смотри в корень!
Лучше скажи мало, но хорошо.
Sergey
CodeLite Enthusiast
Posts: 15
Joined: Tue Dec 16, 2008 11:37 pm
Location: Ukraine
Contact:

Re: wxGLCanvas using problem

Post 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
Смотри в корень!
Лучше скажи мало, но хорошо.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxGLCanvas using problem

Post by eranif »

Sergey wrote:Should I distribute mingwm10.dll for my project distribution?
Yes, if u use threads

Eran
Make sure you have read the HOW TO POST thread
Post Reply