Hi all,
I am modifying the CIrrDeviceWin32.cpp in order to change how my actual Irrlicht window is created (frameless, Z-ordering, etc.) which has worked fine so far.
Now I want to be able change things at runtime. Specifically, I want to be able to pass a value from my Main irrlicht program to this routine (located in the DLL?) so that I can change HOW my window behaves at runtime.
For example: in the LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) of CIrrDeviceWin32.cpp, I have added extra cases (WM_ACTIVE, etc) to handle the Z-ordering of the window, whether it can be activated, etc. These are currently always being run/called. What I would like to only use these extra cases based on a variable set by my main application.
Does anyone know how can I pass a variable (or set a value) into these routines in CIrrDeviceWin32.cpp at runtime?
Hope this makes sense!
Passing a value to routines in the Irrlicht DLL?
-
- Posts: 36
- Joined: Fri Feb 20, 2004 9:23 am
- Contact:
Implement it in the class CIrrDeviceWin32 (e.g. setYourCustomValue() ). In the WndProc you can then access it with:
Code: Select all
dev = getDeviceFromHWnd(hWnd);
if (dev) {
dev->getYourCustomValue();
}
It is like it is. And because it is like it is, things are like they are.
-
- Posts: 36
- Joined: Fri Feb 20, 2004 9:23 am
- Contact:
You'll have to add them as virtual member functions to the IrrlichtDevice interface (IrrlichtDevice.h) and possibly as empty function to the class CIrrDeviceStub a well. Then you can access them via Irr::Device-> .Liquidream wrote:Wow! Thanks for the quick reply. Will give it a go!
Another question: how can I call setYourCustomValue() (if I add it into class CIrrDeviceWin32) from my main program as I don't think it is accessible from Irr::Device-> or something like this?
Thank you for your help!
It is like it is. And because it is like it is, things are like they are.