home *** CD-ROM | disk | FTP | other *** search
- /*#include <mgl/gl.h>*/
- #include "glmatrix.h"
- #include "glmatrix_prefs.h"
- #include "yarandom.h"
-
- int width;
- int height;
-
- static BOOL blanked = FALSE;
-
- void screenblanker_init(void)
- {
- MGLInit();
-
- mglChooseWindowMode(FALSE);
- ya_rand_init(0);
- }
-
- void screenblanker_destroy(void)
- {
- MGLTerm();
- }
-
- void screenblanker_display(void)
- {
- if (blanked)
- {
- mglLockDisplay();
-
- draw_matrix(mps);
- mglUnlockDisplay();
- mglSwitchDisplay();
- }
- }
-
-
- void screenblanker_blank(void)
- {
- if (!blanked)
- {
- switch (glmatrix_prefs->glm_ScreenSize)
- {
- case 1: /*800x600 */
- width = 800;
- height = 600;
- break;
- case 2: /*1024x768 */
- width = 1024;
- height = 768;
- break;
- case 3: /*1280x1024 */
- width = 1280;
- height = 1024;
- break;
- case 0: /*640x480 */
- default:
- width = 640;
- height = 480;
- break;
-
- }
-
- if (mglCreateContext(0,0, width, height))
- {
- mglLockMode(MGL_LOCK_MANUAL);
- init_matrix();
- }
-
- blanked = TRUE;
- }
- }
-
- void screenblanker_unblank(void)
- {
- if (blanked)
- {
- blanked = FALSE;
- mglDeleteContext();
- }
- }
-