OK, you can download the example here:
http://www.santiproductions.com/files/screensaver.zip [5KB]
It compiles with 0 errors and 0 warnings. It MUST use Software mode or it crashes. I tried putting an Event Receiver in it but that crashed it too. I also named it the "Blue Saver of Death" because the only way to end it is to press Alt+F4. But atleast it works
This will show you how to implement Irrlicht into a screensaver very easily. You can use this as a template if you want. If you figure out how to get it to close without Alt+F4, please tell me .
REMEMBER: Rename the compiled exe extension to scr and copy to your windows directory to test.
Hope this helps anyone who wants to make a Screensaver~ John DiSanti
________
Pot
An example on how to make screensavers with Irrlicht!
An example on how to make screensavers with Irrlicht!
Last edited by disanti on Tue Feb 22, 2011 7:58 am, edited 1 time in total.
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
What compiler are you using? I used Visual C++ 6.0 to compile it and it worked 0 errors, 0 warnings.
________
ROOR BONG PICTURES
________
ROOR BONG PICTURES
Last edited by disanti on Tue Feb 22, 2011 7:58 am, edited 1 time in total.
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
Last edited by disanti on Tue Feb 22, 2011 7:58 am, edited 1 time in total.
In fact I'm not sure you can create screensaver with Irrlicht in general. Sorry, but your code is not a 100% screensaver (that's why you need to close it with Alt+F4).
I can explain the reasons.
1. Screensavers tech: OS creates(!) window for you and you just need to draw in this window. Also OS posts (or sends) all messages to this window.
2. Irrlicht creates its own(!) window. So if you debug your program you will see that you get two WM_CREATE messages for two different windows for example. Also you will see many interesting things if you just start debugging
So the way to solve it is to modify constructor of CIrrDeviceWin32 class (createDevice function just creates an instance of this class) so it will have an option not to create new but ATTACH to a given window (pass hWnd of already created window there). But for this moment engine cannot do this and as far as I see it won't be implemented since noone (except for you ) need this...
Sorry... Correct me if I'm wrong...
P.S.: BTW, there is no problem to pass your own EventListener but it will not help you as far as I see.
I can explain the reasons.
1. Screensavers tech: OS creates(!) window for you and you just need to draw in this window. Also OS posts (or sends) all messages to this window.
2. Irrlicht creates its own(!) window. So if you debug your program you will see that you get two WM_CREATE messages for two different windows for example. Also you will see many interesting things if you just start debugging
So the way to solve it is to modify constructor of CIrrDeviceWin32 class (createDevice function just creates an instance of this class) so it will have an option not to create new but ATTACH to a given window (pass hWnd of already created window there). But for this moment engine cannot do this and as far as I see it won't be implemented since noone (except for you ) need this...
Sorry... Correct me if I'm wrong...
P.S.: BTW, there is no problem to pass your own EventListener but it will not help you as far as I see.
there is another guest...