irrLicht + wxWidgets + Linux

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
cleversight
Posts: 4
Joined: Mon Jan 18, 2010 3:04 am

irrLicht + wxWidgets + Linux

Post 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
netpipe
Posts: 670
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Post by netpipe »

keep reading then cause no one knows how to fix this issue.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
cleversight
Posts: 4
Joined: Mon Jan 18, 2010 3:04 am

Post 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.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

What I meant is if the wxWindow is really an OpenGL window, or just a X window.
cleversight
Posts: 4
Joined: Mon Jan 18, 2010 3:04 am

Post 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.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Sorry, I only know about SDL window creation. And there you can choose from OpenGL and basic window.
netpipe
Posts: 670
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Post by netpipe »

Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
Post Reply