doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
macosx_sys.h
Go to the documentation of this file.
1 #import "../posix/posix_public.h"
2 
3 #import <Foundation/NSGeometry.h>
4 @class NSEvent, NSOpenGLContext, NSWindow;
5 
6 #import <ApplicationServices/ApplicationServices.h>
7 #import <OpenGL/CGLTypes.h>
8 
9 // sys
10 
11 const char *macosx_scanForLibraryDirectory(void);
12 
13 // In macosx_input.m
14 void Sys_InitInput(void);
15 void Sys_ShutdownInput(void);
16 CGDirectDisplayID Sys_DisplayToUse(void);
17 //extern void osxQuit();
18 void SetProgramPath(char *path);
19 void Sys_SetMouseInputRect(CGRect newRect);
20 
21 void Sys_AnnoyingBanner();
22 
23 // In macosx_glimp.m
24 bool Sys_Hide();
25 bool Sys_Unhide();
26 
27 typedef struct {
28  CGDirectDisplayID display;
29  CGTableCount tableSize;
30  CGGammaValue *red;
31  CGGammaValue *blue;
32  CGGammaValue *green;
33 } glwgamma_t;
34 
35 typedef struct
36 {
37  CGDirectDisplayID display;
38  NSDictionary *desktopMode;
39  NSDictionary *gameMode;
40 
41  CGDisplayCount displayCount;
45 
46  NSOpenGLContext *_ctx;
47  CGLContextObj _cgl_ctx;
49  NSWindow *window;
50 
51  FILE *log_fp;
52 
53  unsigned int bufferSwapCount;
54  unsigned int glPauseCount;
55 } glwstate_t;
56 
57 extern glwstate_t glw_state;
58 
59 #define OSX_SetGLContext(context) \
60 do { \
61  NSOpenGLContext *_context = (context); \
62  glw_state._ctx = _context; \
63  glw_state._cgl_ctx = [_context cglContext]; \
64 } while (0)
65 
66 #define OSX_GetNSGLContext() glw_state._ctx
67 #define OSX_GetCGLContext() glw_state._cgl_ctx
68 
69 #define OSX_GLContextIsCurrent() glw_state._ctx_is_current
70 #define OSX_GLContextSetCurrent() \
71 do { \
72  [glw_state._ctx makeCurrentContext]; \
73  glw_state._ctx_is_current = (glw_state._ctx != nil); \
74 } while (0)
75 
76 #define OSX_GLContextClearCurrent() \
77 do { \
78  [NSOpenGLContext clearCurrentContext]; \
79  glw_state._ctx_is_current = NO; \
80 } while (0)
81 
82 
83 void Sys_PauseGL();
84 void Sys_ResumeGL();
const char * macosx_scanForLibraryDirectory(void)
Definition: macosx_utils.mm:45
CGDisplayCount displayCount
Definition: macosx_sys.h:41
CGGammaValue * blue
Definition: macosx_sys.h:31
CGDirectDisplayID Sys_DisplayToUse(void)
NSOpenGLContext * _ctx
Definition: macosx_sys.h:46
CGTableCount tableSize
Definition: macosx_sys.h:29
void SetProgramPath(char *path)
void Sys_SetMouseInputRect(CGRect newRect)
bool _ctx_is_current
Definition: macosx_sys.h:48
void Sys_InitInput(void)
Definition: dedicated.cpp:39
NSWindow * window
Definition: macosx_sys.h:49
FILE * log_fp
Definition: macosx_sys.h:51
CGLContextObj _cgl_ctx
Definition: macosx_sys.h:47
CGDirectDisplayID display
Definition: macosx_sys.h:28
void Sys_ShutdownInput(void)
Definition: dedicated.cpp:41
const char * path
Definition: sws.c:117
void Sys_PauseGL()
CGDirectDisplayID display
Definition: macosx_sys.h:37
NSDictionary * gameMode
Definition: macosx_sys.h:39
CGGammaValue * green
Definition: macosx_sys.h:32
unsigned int bufferSwapCount
Definition: macosx_sys.h:53
bool Sys_Hide()
NSDictionary * desktopMode
Definition: macosx_sys.h:38
glwgamma_t inGameTable
Definition: macosx_sys.h:43
glwstate_t glw_state
Definition: macosx_glimp.mm:56
glwgamma_t tempTable
Definition: macosx_sys.h:44
unsigned int glPauseCount
Definition: macosx_sys.h:54
glwgamma_t * originalDisplayGammaTables
Definition: macosx_sys.h:42
bool Sys_Unhide()
CGGammaValue * red
Definition: macosx_sys.h:30
void Sys_AnnoyingBanner()
void Sys_ResumeGL()