Page 1 of 1

irrLicht + wxWidgets + Linux

Posted: Mon Jan 18, 2010 3:12 am
by cleversight
Hello

I'm getting into madness since i got most part of my personal project done until i begin to deal with the integration of irrLicht into a wxWidgets window under Linux (which means, X system).
I read that a wxFrame has a method useful to retrieve its handle, which i later i can use as a "windowId" parameter with irrLicht's createDeviceEx.
So, this is part of my code:

Code: Select all

MainWindow* window = new MainWindow(NULL,-1,L"test");
	window->Center();
	window->Show(true);
	//SetTopWindow(window);
	GtkWidget* hwnd = window->GetHandle();
	SIrrlichtCreationParameters params;
	params.DeviceType = EIDT_BEST;
	params.DriverType = this->driverType;
	params.WindowSize = core::dimension2d<u32>(640,480);
	params.Bits = 24;
	params.EventReceiver = &receiver;
	params.WindowId = hwnd;
	this->device = createDeviceEx(params);
Instead of GtkWidget* hwnd i also tried just a (void*) pointer. In every case i just get:

X Error: BadDrawable (invalid Pixmap or Window parameter)
From call : X_CreateGC
X Error: BadDrawable (invalid Pixmap or Window parameter)
From call : X_PolyFillRectangle
X Error: BadDrawable (invalid Pixmap or Window parameter)
From call : X_PolyFillRectangle
X Error: BadPixmap (invalid Pixmap parameter)
From call : X_CreateCursor
X Error: BadGC (invalid GC parameter)
From call : X_FreeGC
X Error: BadPixmap (invalid Pixmap parameter)
From call : X_FreePixmap
X Error: BadPixmap (invalid Pixmap parameter)
From call : X_FreePixmap
X Error: BadWindow (invalid Window parameter)
From call : X_ChangeProperty
X Error: BadWindow (invalid Window parameter)
From call : X_ChangeProperty
X Error: BadWindow (invalid Window parameter)
From call : X_ChangeWindowAttributes

Please, help will be appreciated.

Regards,
Nico

Posted: Mon Jan 18, 2010 4:15 am
by netpipe
keep reading then cause no one knows how to fix this issue.

Posted: Mon Jan 18, 2010 8:26 am
by hybrid
Are you sure that this creates an OpenGL capable window? It looks to me that it does not. Either try different window creation params, or try the software renderers.

Posted: Mon Jan 18, 2010 6:54 pm
by cleversight
hybrid wrote:Are you sure that this creates an OpenGL capable window? It looks to me that it does not. Either try different window creation params, or try the software renderers.
Yes, it does. Actually, this->driverType = video::EDT_OPENGL. I've tried also the EDT_SOFTWARE, without success.
It just cannot locate the window on my Ubuntu linux.

Btw, the irrlicht code works trully great. The problem emerged only when i started to deal with the wxWidgets integration, which only relies on these few lines of code. I know this is possible on Windows, i haven't tested yet but i'm confident that a Windows' window handle is correctly interpreted by irrLicht without a problem. I read that many people have the same problem as i do.

Posted: Mon Jan 18, 2010 8:29 pm
by hybrid
What I meant is if the wxWindow is really an OpenGL window, or just a X window.

Posted: Tue Jan 19, 2010 12:00 am
by cleversight
hybrid wrote:What I meant is if the wxWindow is really an OpenGL window, or just a X window.
It's a wxFrame window. Do you have an example by using an OpenGL window? Your help is very appreciated. I'll communicate my success (if any).

Thanks.

Posted: Tue Jan 19, 2010 1:06 am
by hybrid
Sorry, I only know about SDL window creation. And there you can choose from OpenGL and basic window.

Posted: Wed Jun 09, 2010 1:26 pm
by netpipe