An example on how to make screensavers with Irrlicht!

A forum to store posts deemed exceptionally wise and useful
Post Reply
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

An example on how to make screensavers with Irrlicht!

Post by disanti »

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 :P

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 :P.

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
Last edited by disanti on Tue Feb 22, 2011 7:58 am, edited 1 time in total.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

just so you know, your post should have gone in the 'howto' section. This thread is more for major projects which will be continually updated, than for tutorials or code snippets. :)
a screen cap is worth 0x100000 DWORDS
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

Hmm, doesn't build for me, get a link error saying some weird function is not found.
The Robomaniac
Project Head / Lead Programmer
Centaur Force
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Post by disanti »

What compiler are you using? I used Visual C++ 6.0 to compile it and it worked 0 errors, 0 warnings. :wink:
________
ROOR BONG PICTURES
Last edited by disanti on Tue Feb 22, 2011 7:58 am, edited 1 time in total.
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

Dev C++, i just imported the dsp file, and added my paths, compiles fine, but gets a linking error, i'll redownload it and recompile as i accidentally deleted it. Post my error tommorow
The Robomaniac
Project Head / Lead Programmer
Centaur Force
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Post by disanti »

I'm not sure if it will work in Dev C++ or not. I didn't try that. :wink:
________
LSD REHAB DICUSSION
Last edited by disanti on Tue Feb 22, 2011 7:58 am, edited 1 time in total.
Guest
Posts: 35
Joined: Mon Feb 02, 2004 7:17 pm
Location: Russia, Saint-Petersburg

Post by Guest »

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 :wink:

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...
agrif

Post by agrif »

The Blender game engine creates it's own window, and so does PyGame, but you can make those screensavers by just renaming the .exe to .scr.
Post Reply