#include #include #include #include #include #include #include "game.h" #include "gl.h" #include "aglRenderers.h" #include "agl.h" #include "macdisplays.h" #include "macapp.h" #include "descent.h" #include "pstypes.h" #include "config.h" #include "application.h" #include "rend_opengl.h" const RGBColor rgbBlack = { 0x0000, 0x0000, 0x0000 }; const RGBColor rgbWhite = { 0xFFFF, 0xFFFF, 0xFFFF }; /* globals */ DSpContextAttributes gDSpContextAttributes[N_SUPPORTED_VIDRES]; DSpContextReference gDSpContext[N_SUPPORTED_VIDRES] = {NULL, NULL, NULL}; short current_context = DSP_640x480; DSpContextReference * gpContextRefUnused = NULL; GDHandle hGD; void WindowReset (WindowPtr pWindow, short width, short height); short gnumDevices = 0; // Set up DSp screens, handles multi-monitor correctly void SetupScreen (CGrafPtr *ppWin) //void SetupScreen (GDHandle *hGD, CGrafPtr *ppWin) //void SetupScreen (GDHandle *hGD, CGrafPtr *ppWin, short *numDevices) { DSpContextAttributes foundAttributes; DisplayIDType displayID; Rect rectWin; RGBColor rgbSave; GrafPtr pGrafSave; OSStatus err; int i; // check number of screens GDHandle hDevice = DMGetFirstScreenDevice (true); do { gnumDevices++; hDevice = DMGetNextScreenDevice (hDevice, true); } while (hDevice); // start DSp and find a good context err = DSpStartup(); if( err ) Error("%s:%d DSpStartup: Error %d ", __FILE__, __LINE__, err); #ifdef DAJ_DEBUG DSpSetDebugMode(true); #endif // Note: DSp currently REQUIRES the back buffer attributes even if only one buffer is required // Also note: Choose either 16 or 32 bpp #ifdef USE_OPENGL for(i = 0; iportRect)); RGBForeColor (&rgbSave); // ensure color is reset for proper blitting SetPort (pGrafSave); }