glut_fullscrn.c revision c041511d
1 2/* Copyright (c) Mark J. Kilgard, 1995, 1998. */ 3 4/* This program is freely distributable without licensing fees 5 and is provided without guarantee or warrantee expressed or 6 implied. This program is -not- in the public domain. */ 7 8#ifdef __VMS 9#include <GL/vms_x_fix.h> 10#endif 11 12#include <stdio.h> /* SunOS multithreaded assert() needs <stdio.h>. Lame. */ 13#include <assert.h> 14 15#if !defined(_WIN32) 16#include <X11/Xlib.h> 17#include <X11/Xatom.h> 18#endif 19 20/* SGI optimization introduced in IRIX 6.3 to avoid X server 21 round trips for interning common X atoms. */ 22#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) 23#include <X11/SGIFastAtom.h> 24#else 25#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) 26#endif 27 28#include "glutint.h" 29 30/* CENTRY */ 31void GLUTAPIENTRY 32glutFullScreen(void) 33{ 34 assert(!__glutCurrentWindow->parent); 35 IGNORE_IN_GAME_MODE(); 36#if !defined(_WIN32) 37 if (__glutMotifHints == None) { 38 __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS", 39 SGI_XA__MOTIF_WM_HINTS, 0); 40 if (__glutMotifHints == None) { 41 __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS."); 42 } 43 } 44#endif 45 46 __glutCurrentWindow->desiredX = 0; 47 __glutCurrentWindow->desiredY = 0; 48 __glutCurrentWindow->desiredWidth = __glutScreenWidth; 49 __glutCurrentWindow->desiredHeight = __glutScreenHeight; 50 __glutCurrentWindow->desiredConfMask |= CWX | CWY | CWWidth | CWHeight; 51 52 __glutPutOnWorkList(__glutCurrentWindow, 53 GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK); 54} 55 56/* ENDCENTRY */ 57