Jump to content

  • Log In with Google      Sign In   
  • Create Account


screensavers


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Zirco   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 02:55 PM

hi, i''m wondering how to turn my .exe openGL program into a screensaver.

Sponsor:

#2 Heretic   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 03:13 PM

Heh, you could try to change the file`s extension to "scr"

#3 subminiature   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 03:21 PM

try

http://www.ite.mh.se/~danli97/opengl/

havn''t checked the code at all though. A search for ''minimal.zip screensaver'' on google has a couple other suggestions.

#4 Laeeq Hamid   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 04:19 PM

you must change you extension from .exe to .scr and keep in the mind about the command line parameter /f /w /z /s these are regarding your settings , full screen , window etc paremeters from windows O.S.

#5 Midnight Coder   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 05:07 PM

Screen savers are programmed a little differently. Besides the extension, screen savers do not have a WinMain() function and don't need to create a message loop.

To create a screen saver, you must include SCRNSAVE.H and you must include SCRNSAVE.LIB in your libraries when linking.

A screen saver must have a ScreenSaverProc() function, which is the screen saver's window procedure. It is passed messages like a normal window. However, for default message processing, a screen saver should call DefScreenSaverProc() instead of DefWindowProc(). ScreenSaverProc() has the following prototype:

LRESULT WINAPI ScreenSaverProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);  


You must also have a ScreenSaverConfigureDialog(). This function can be empty, but if you want to allow your screen saver to be configurable (from within the Windows display settings), then you must open a dialog in this function to allow configuration. This function is basically called when the user clicks the Settings button in the Windows display properties control panel when your screen saver is selected. ScreenSaverConfigureDialog() has the following prototype:

BOOL WINAPI ScreenSaverConfigureDialog(HWND hdWnd, UINT message, WPARAM wParam, LPARAM lParam);  


Finally, your screen saver must supply a RegisterDialogClasses() function. This function is used to register custom window classes. If you don't need custom windows classes, just leave this function empty and return nonzero. RegisterDialogClasses() has the following prototype:

BOOL WINAPI RegisterDialogClasses(HANDLE hInst);  


In addition to that, all screen savers must have two resources: an icon and a string. The icon must have the ID "ID_APP". The string must have the ID "IDS_DESCRIPTION" and be no more than 24 characters long, and must contain the name or description of the screen saver. This is what will show up inside the list of screen savers inside the display properties control panel (your screen saver must be in the WINDOWS\SYSTEM folder to show up though).

To convert a game to a screen saver isn't much work, you just have to change the initialization a little.

I also must mention, that to get the instance handle of your screen saver, use the hMainInstance variable (defined in scrnsave.h).

In addition to what I said, you must change the extension to .SCR

I hope I have helped. Let me know if you have questions.

Edited by - Midnight Coder on August 20, 2001 12:11:53 AM

#6 Scraniel   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 November 2001 - 06:38 PM

I followed these instructions and it stil says "initialization failed" when Windows tries to run the screensaver. What do you suggest I do? Thanks.

~Scraniel~

#7 masonium   Members   -  Reputation: 118

Like
Likes
Like

Posted 07 November 2001 - 04:18 PM

  
// in WndProc somewhere


case WM_KEYDOWN:
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_MOUSEMOVE:
{
PostQuitMessage(0);
}


That should do it. And change the extension to .scr




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS