Advertisement

About screensavers (OpenGL and general)

Started by October 30, 2001 02:55 PM
7 comments, last by Xewren 23 years, 3 months ago
Hi all! I have been thinking about screensavers and OpenGL. I found many posts about the subject and know many URLs to read about this subject. Also msdn has something... I still have some basic questions that i didnt come across anywhere. 1) Why do some savers have so poor fps? Even the ones that come with OS. That world3d-thing works pretty smooth even as its quite complex. Has this problem something to do with OS testing for events at keyboard or mouse? 2) How big can a saver be? Usually savers are rather small. Can those be made bigger than 1MB for example? Is the available memory only restriction? 3) Does saver have to be in one single file? Can i load data from disk for the saver? Can savers be made with changing data? Xewren P.S. NeHe''s pages ROCK!
as far as i know SS can be whole proram (but no input o/c). there are a cple of really good ones out there about 4 meg. its prob because if its a bad SS it proberbly uses the same resoulutionas the DT instead of setting its own...

Click to goto my page
Advertisement
well, i''ll answer what I can.

2> A screensaver is for the most part just a regular executable with a .scr extension instead of a .exe extension. So the same limitations should apply to a screensaver as to a normal executable, so yes you should be able to have a screen saver that is larger than 1MB.

3> You can have a screen saver that loads data from somewhere, and you can even have an options dialog that allows the user to specify where to get the data. I know some of the OGL demo screensavers allow you to specify what bitmap to use as a texture.

j.w.
a screen saver program is exactly the same as a regular windows exe program except the extension is renamed to scr. you do put special command line options in screen savers, and this is how windows controls them.

so a screen saver can be any size, can do input and output through anything, and can access any file or resource any normal program can.

the opengl savers that come with windows all use the opengl software rendering engine which ships with the os. they create a small window which is why they are fairly smooth. microsoft did this so they would run on all systems no matter how crappy your video cards opengl driver is. and the software engine is much more stable.
In case you want to know, the command lines are:

/c for configuration mode
/s for standard active mode

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"

A screen saver application is compiled as a normal EXE is, but saying that it''s ''exactly the same'' is wrong (sorry mediamaster). A screen saver has to handle a surprising amount of things. (well I was surprised anyway)

The screen saver must handle the password code under Win95/98/ME (and this also includes event handling for the Password Change button on the Display Properties dialog box). If you also want a preview, that can be quite a bit of work if you are coding the screensaver without the aid of any helper libraries.

Here are the best sites I''ve found with information regarding screen saver creation:

Gravity Screensaver
http://www.geocities.com/SiliconValley/Code/1219/gravity.html
Gravity is the best example of an OpenGL screensaver that I''ve found on the ''net with the source code available for download. The plus and downside to this screensaver is that it uses the scrnsave.lib, which has its advantages and disadvantages. IMHO, the advantages outweigh the disadvantages.

Lucian Wischik''s How To Write A 32 Bit Screen Saver
http://www.wischik.com/scr/howtoscr.html
Lucian has written an insane amount of information about the ins and outs of 32-bit screen saver programming. It''s damn nice of him to do this, since he''s also selling his own screen saver library. This is where you should go to see what you''re getting yourself into when you start a screen saver project. One negative to this link is that Lucian doesn''t cover OpenGL screen savers at all, so you''re going to have to do a bit of Windows hacking to make that work.

Good luck!


ThomW
www.LMNOpc.com
Advertisement
Yikes! I see what you''re talking about!

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Im in heaven! This forum is the best one that ive come across yet. With a well made question you can get many good opinions and help from several ppl. Thanks all for your good answers!

Im pretty sure about that too that you cant have input with your screensaver. Its not needed, but lets try to get the facts right. The whole ss is based on the idea that computer does something, when its NOT used so why would we need a input...

ehh... as i was writing this i remembered a buddweiser-screensaver that i saw a little while ago. There was input with mouse in it. But the saver was ended in a different way. its not probably too easy thing to do for the first ss anyway

Yes, stupid me didnt remember that ive too seen a cube with bitmaps on it that the user had selected (i know my english sucz). So we can have separate data with the saver. Good!

Oh, the OS savers use SOFTWARE rendering. No wonder they are so slow, lol. I think i might be able to use hardware-rendering instead....

thanks for the urls. i must look at them when i have time (too many projects going on). I try to learn c++ at the same time as opengl. You guys wouldnt believe the amount ive read things this autumn. I have many ideas of projects in my head and i try to make some of them reality as i learn more.

Thanks for you all!

Xewren
If you''re really trying to make an interactive screensaver that will cause the mouse/keyboard to do something other than return to windows, you''re going to have to code the thing from scratch. That''s one of the bad things about using the screen saver library used by the Gravity screen saver.


ThomW
www.LMNOpc.com

This topic is closed to new replies.

Advertisement