Changeset 326
- Timestamp:
- May 28, 2009, 12:33:59 PM (16 years ago)
- Location:
- Daodan
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/BFW_Motoko_Draw.h
r297 r326 13 13 } M3tDisplayMode; 14 14 15 typedef struct 16 { 17 int Type; 18 char Name[64]; 19 char a[64]; 20 int b, c, d; 21 short DisplayModeCount; 22 M3tDisplayMode DisplayModes[12]; 23 char e[990]; 24 } M3tDrawEngineCaps; 25 26 typedef struct 27 { 28 int Context_New; 29 int Context_Delete; 30 int Texture_ResetAll; 31 int PrivateState_Size; 32 int PrivateState_New; 33 int PrivateState_Delete; 34 int State_Update; 35 } M3tDrawEngine; 36 37 typedef struct 38 { 39 int FrameStart; 40 int FrameEnd; 41 int FrameSync; 42 int Triangle; 43 int Quad; 44 int Pent; 45 int Line; 46 int Point; 47 int TriSprite; 48 int Sprite; 49 int SpriteArray; 50 int ScreenCapture; 51 int PointVisible; 52 int SupportsPointVisible; 53 int TextureFormatAvailable; 54 int SetResolution; 55 int ResetFog; 56 int TextureLoad; 57 int TextureUnload; 58 int SinglePassMultitextureCapable; 59 } M3tDrawContext; 60 61 typedef struct 62 { 63 float *Position; 64 int *Color; 65 float *TexCoord0; 66 float *TexCoord1; 67 void *Texture0; 68 void *Texture1; 69 void *State6; 70 void *State7; 71 void *State8; 72 } M3tDrawPtrState; 73 74 extern char M3gResolutionSwitch; 75 15 76 #endif -
Daodan/src/BFW_Utility.h
r322 r326 14 14 void ONICALL UUrPlatform_Terminate(); 15 15 16 int __cdecl AUrMessageBox(int Buttons, char *Message, ...); 17 16 18 extern FILE* ONgFileStartup; 17 19 -
Daodan/src/Daodan.c
r323 r326 85 85 // Windowed mode 86 86 DDrPatch_MakeJump(ONrPlatform_Initialize, DDrPlatform_Initialize); 87 DDrPatch_MakeJump(gl_platform_initialize, daodangl_platform_initialize); 88 89 init_daodan_gl(); 87 90 88 91 ONiMain(argc, argv); -
Daodan/src/Daodan_Win32.c
r323 r326 3 3 #include "Daodan.h" 4 4 #include "Daodan_Win32.h" 5 6 #include "BFW_Utility.h" 5 7 6 8 #include "Oni.h" … … 15 17 16 18 WndClass.cbSize = sizeof(WndClass); 17 WndClass.style = WS_OVERLAPPED | WS_MAXIMIZEBOX | WS_MINIMIZEBOX |CS_VREDRAW | CS_HREDRAW | CS_OWNDC;19 WndClass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC; 18 20 WndClass.cbClsExtra = 0; 19 21 WndClass.cbWndExtra = 0; … … 33 35 Rect.right = Rect.left + Width; 34 36 Rect.bottom = Rect.top + Height; 35 AdjustWindowRect(&Rect, W ndClass.style, FALSE);37 AdjustWindowRect(&Rect, WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP, FALSE); 36 38 37 PlatformData->Window = CreateWindowEx(0, "ONI ", "ONI ", WS_ POPUP, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, NULL, NULL, PlatformData->Instance, NULL);39 PlatformData->Window = CreateWindowEx(0, "ONI ", "ONI ", WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, NULL, NULL, PlatformData->Instance, NULL); 38 40 ShowWindow(PlatformData->Window, SW_SHOWNORMAL); 39 41 UpdateWindow(PlatformData->Window); 40 42 41 43 ShowCursor(FALSE); 42 44 45 // I dont know why this is needed but Oni doesn't init without it. 46 ONgPlatformData.Window = PlatformData->Window; 47 //ONgPlatformData.Instance = PlatformData->Instance; 48 43 49 return 0; 44 50 } -
Daodan/src/Oni.h
r323 r326 2 2 #ifndef ONI_H 3 3 #define ONI_H 4 5 #include "Daodan.h" 4 6 5 7 typedef struct … … 14 16 15 17 extern HINSTANCE g_Instance; 18 extern ONtPlatformData ONgPlatformData; 16 19 17 20 #endif -
Daodan/src/Oni_Symbols.S
r323 r326 16 16 17 17 symbol ( _g_Instance , 0x0021f9e4 ) 18 symbol ( _ONgPlatformData , 0x0023100c ) 19 20 //Oni Persistance 21 symbol ( @ONrPersist_GetGamma@0 , 0x0010f450 ) 18 22 19 23 // BFW_Utility … … 27 31 symbol ( @UUrPlatform_Terminate@0 , 0x00026310 ) 28 32 33 symbol ( _AUrMessageBox , 0x000378c0 ) 34 35 // Motoko 36 37 symbol ( _M3gResolutionSwitch , 0x00131634 ) 38 29 39 // OpenGL 30 40 symbol ( @gl_enumerate_valid_display_modes@4 , 0x000083a0 ) 41 symbol ( @gl_platform_set_pixel_format@4 , 0x00007b50 ) 42 symbol ( @gl_platform_initialize@0 , 0x00007da0 ) 43 44 symbol ( _gl , 0x00160600 ) 45 symbol ( _gl_api , 0x00160604 ) 46 symbol ( _gl_gamma_ramp , 0x0015fdfc ) 47 symbol ( _gl_gamma_ramp_valid , 0x001603fc ) -
Daodan/src/daodan_gl.c
r316 r326 1 #include <windows.h> 2 #include <math.h> 3 4 #include "Oni.h" 5 #include "Oni_Persistence.h" 6 #include "Daodan_Utility.h" 7 8 #include "BFW_Utility.h" 9 1 10 #include "daodan_gl.h" 11 #include "oni_gl.h" 2 12 3 13 #define max_modes (104) // Dirty hack to add more resolutions, it really should only be 16 ^_^ … … 36 46 const short daodan_resdepths[] = { 16, 32 }; 37 47 48 DEVMODE orig_devmode, cur_devmode, new_devmode; 49 50 void init_daodan_gl() 51 { 52 memset(&orig_devmode, 0, sizeof(orig_devmode)); 53 orig_devmode.dmSize = sizeof(orig_devmode); 54 55 if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &orig_devmode)) 56 { 57 orig_devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; 58 orig_devmode.dmBitsPerPel = 32; 59 orig_devmode.dmPelsWidth = GetSystemMetrics(SM_CXSCREEN); 60 orig_devmode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN); 61 } 62 63 memcpy(&cur_devmode, &orig_devmode, sizeof(orig_devmode)); 64 memcpy(&new_devmode, &orig_devmode, sizeof(orig_devmode)); 65 } 66 67 void update_cdmode() 68 { 69 if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &cur_devmode)) 70 { 71 cur_devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; 72 cur_devmode.dmBitsPerPel = 32; 73 cur_devmode.dmPelsWidth = GetSystemMetrics(SM_CXSCREEN); 74 cur_devmode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN); 75 } 76 } 77 38 78 unsigned int ONICALL daodan_enumerate_valid_display_modes(M3tDisplayMode modes[max_modes]) 39 79 { 40 80 unsigned int vmodes = 0; 41 unsigned int screen_x = GetSystemMetrics(SM_CXSCREEN);42 unsigned int screen_y = GetSystemMetrics(SM_CYSCREEN);81 unsigned int screen_x = orig_devmode.dmPelsWidth; 82 unsigned int screen_y = orig_devmode.dmPelsHeight; 43 83 44 84 int i, j; … … 65 105 } 66 106 67 modes[vmodes].Width = GetSystemMetrics(SM_CXSCREEN);68 modes[vmodes].Height = GetSystemMetrics(SM_CYSCREEN);107 modes[vmodes].Width = screen_x; 108 modes[vmodes].Height = screen_y; 69 109 modes[vmodes].Depth = daodan_resdepths[i]; 70 110 … … 90 130 return (ChangeDisplaySettings(&devmode, CDS_TEST) == DISP_CHANGE_SUCCESSFUL); 91 131 } 132 133 int daodan_set_display_mode(short width, short height, short depth) 134 { 135 if (M3gResolutionSwitch) 136 { 137 DEVMODE new_devmode; 138 new_devmode.dmSize = sizeof(new_devmode); 139 new_devmode.dmFields = DM_BITSPERPEL | DM_PELSHEIGHT | DM_PELSWIDTH; 140 new_devmode.dmPelsWidth = width; 141 new_devmode.dmPelsHeight = height; 142 new_devmode.dmBitsPerPel = depth; 143 144 if (ChangeDisplaySettings(&new_devmode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL) 145 return 0; 146 147 if (ChangeDisplaySettings(&new_devmode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) 148 return 0; 149 150 update_cdmode(); 151 gl->DisplayMode.Width = cur_devmode.dmPelsWidth; 152 gl->DisplayMode.Height = cur_devmode.dmPelsHeight; 153 if (cur_devmode.dmBitsPerPel > depth) 154 gl->DisplayMode.Depth = cur_devmode.dmBitsPerPel; 155 } 156 else 157 { 158 update_cdmode(); 159 if (cur_devmode.dmBitsPerPel > depth) 160 gl->DisplayMode.Depth = cur_devmode.dmBitsPerPel; 161 } 162 return 1; 163 } 164 165 void daodan_set_gamma(float gamma) 166 { 167 WORD ramp[3 * 256]; 168 int i; 169 170 if (!gl_gamma_ramp_valid) 171 return; 172 173 gamma = (1.0f - gamma) * 1.2f + 0.4f; 174 175 for (i = 0; i < sizeof(ramp); i++) 176 { 177 int value = (int)(pow(gl_gamma_ramp[i] / 65535.0f, gamma) * 65535.0f); 178 179 if (value < 0) 180 value = 0; 181 else if (value > 65535) 182 value = 65535; 183 184 ramp[i] = value; 185 } 186 187 if (gl_api->wglSetDeviceGammaRamp3DFX) 188 gl_api->wglSetDeviceGammaRamp3DFX(gl->HDC, ramp); 189 else 190 SetDeviceGammaRamp(gl->HDC, ramp); 191 } 192 193 int ONICALL daodangl_platform_initialize() 194 { 195 static M3tDisplayMode lastmode = {0, 0, 0, 0}; 196 197 if (lastmode.Width != gl->DisplayMode.Width || lastmode.Height != gl->DisplayMode.Height || lastmode.Depth != gl->DisplayMode.Depth) 198 if (!daodan_set_display_mode(gl->DisplayMode.Width, gl->DisplayMode.Height, gl->DisplayMode.Depth)) 199 if (gl->DisplayMode.Width != 640 || gl->DisplayMode.Height != 480 || gl->DisplayMode.Depth != 16) 200 { 201 gl->DisplayMode.Width = 640; 202 gl->DisplayMode.Height = 480; 203 if (!daodan_set_display_mode(640, 480, 16)) 204 goto exit_err; 205 } 206 207 if (lastmode.Width != gl->DisplayMode.Width || lastmode.Height != gl->DisplayMode.Height) 208 { 209 RECT Rect; 210 Rect.left = (GetSystemMetrics(SM_CXSCREEN) / 2) - (gl->DisplayMode.Width / 2); 211 Rect.top = (GetSystemMetrics(SM_CYSCREEN) / 2) - (gl->DisplayMode.Height / 2); 212 Rect.right = Rect.left + gl->DisplayMode.Width; 213 Rect.bottom = Rect.top + gl->DisplayMode.Height; 214 AdjustWindowRect(&Rect, WS_OVERLAPPED | WS_MAXIMIZEBOX | WS_MINIMIZEBOX, FALSE); 215 216 SetWindowPos(ONgPlatformData.Window, NULL, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, SWP_NOACTIVATE | SWP_NOZORDER); 217 } 218 219 if (gl->HDC == NULL) 220 if ((gl->HDC = GetDC(ONgPlatformData.Window)) == NULL) 221 goto exit_err; 222 223 if (gl_api->wglGetDeviceGammaRamp3DFX != NULL) 224 { 225 DDrStartupMessage("Using 3DFX gamma adjustment"); 226 227 if (gl_api->wglGetDeviceGammaRamp3DFX(gl->HDC, gl_gamma_ramp)) 228 gl_gamma_ramp_valid = 1; 229 } 230 else 231 { 232 DDrStartupMessage("Using standard Windows gamma adjustment"); 233 234 if (GetDeviceGammaRamp(gl->HDC, gl_gamma_ramp)) 235 gl_gamma_ramp_valid = 1; 236 } 237 238 // if (gl_gamma_ramp_valid) 239 // daodan_set_gamma(ONrPersist_GetGamma()); Its not working :( 240 // else 241 DDrStartupMessage("gamma adjustment not supported"); 242 243 if (!gl_platform_set_pixel_format(gl->HDC)) 244 if (gl->DisplayMode.Depth != 16) 245 { 246 if (!daodan_set_display_mode(gl->DisplayMode.Width, gl->DisplayMode.Height, 16)) 247 goto exit_err; 248 249 if (!gl_platform_set_pixel_format(gl->HDC)) 250 goto exit_err; 251 } 252 253 lastmode.Width = gl->DisplayMode.Width; 254 lastmode.Height = gl->DisplayMode.Height; 255 lastmode.Depth = gl->DisplayMode.Depth; 256 257 return 0; 258 259 exit_err: 260 AUrMessageBox(1, "Failed to initialize OpenGL contexts; Oni will now exit."); 261 exit(0); 262 return 1; 263 } -
Daodan/src/daodan_gl.h
r316 r326 6 6 #include "BFW_Motoko_Draw.h" 7 7 8 #include "oni_gl.h" 9 10 void init_daodan_gl(); 11 void update_cdmode(); 8 12 unsigned int ONICALL daodan_enumerate_valid_display_modes(M3tDisplayMode modes[16]); 9 13 bool daodan_testmode(M3tDisplayMode mode); 14 int daodan_set_display_mode(short width, short height, short depth); 15 void daodan_set_gamma(float gamma); 16 int ONICALL daodangl_platform_initialize(); 10 17 11 18 #endif -
Daodan/src/oni_gl.h
r297 r326 3 3 #define ONI_GL_H 4 4 5 #include <GL/GL.h> 6 5 7 #include "Daodan.h" 6 8 #include "BFW_Motoko_Draw.h" 7 9 10 typedef struct 11 { 12 int a; 13 M3tDrawEngineCaps DrawEngineCaps; 14 M3tDrawEngine DrawEngine; 15 M3tDrawContext DrawContext; 16 M3tDisplayMode DisplayMode; 17 int b; 18 int Textures[2]; 19 short c; 20 short d; 21 int IntState; 22 M3tDrawPtrState *PtrState; 23 int e; 24 int Color; 25 int MaxTetxureSize; 26 int DoubleBufferSupported; 27 int MaxTextureUnits; 28 char *VendorString; 29 char *RendererString; 30 char *VersionString; 31 char *ExtensionsString; 32 int MultipassCapable; 33 int f_0588; 34 char f_058C; 35 char SupportsDepthReads; 36 char FogDisabled; 37 char f_058F; 38 int CompressedTextureFormats[16]; 39 int NumCompressedTextureFormats; 40 int f_05D4; 41 float FogStart; 42 float FogEnd; 43 char FogStartChanged; 44 char FogEndChanged; 45 short f_05E2; 46 int f_05E4[4]; 47 float FogColor_R; 48 float FogColor_G; 49 float FogColor_B; 50 int Fog_1_; 51 char Fog_2_; 52 char f_0605[3]; 53 float ClearColor[4]; 54 int LastError; 55 char *LastErrorString; 56 short RenderMode; 57 char BufferClear; 58 char DoubleBuffer; 59 int f_0624; 60 char *TextureBuffer; 61 HDC HDC; 62 HGLRC HGLRC; 63 char vsync; 64 char f_0635[3]; 65 void (*DisplayBackBuffer)(void); 66 } gl_engine_t; 67 68 typedef struct 69 { 70 void (WINAPI *glAccum)(GLenum op, GLfloat value); 71 void (WINAPI *glAlphaFunc)(GLenum func, GLclampf ref); 72 GLboolean (WINAPI *glAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences); 73 void (WINAPI *glArrayElement)(GLint i); 74 void (WINAPI *glBegin)(GLenum mode); 75 void (WINAPI *glBindTexture)(GLenum target, GLuint texture); 76 void (WINAPI *glBitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); 77 void (WINAPI *glBlendFunc)(GLenum sfactor, GLenum dfactor); 78 void (WINAPI *glCallList)(GLuint list); 79 void (WINAPI *glCallLists)(GLsizei n, GLenum type, const GLvoid *lists); 80 void (WINAPI *glClear)(GLbitfield mask); 81 void (WINAPI *glClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); 82 void (WINAPI *glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 83 void (WINAPI *glClearDepth)(GLclampd depth); 84 void (WINAPI *glClearIndex)(GLfloat c); 85 void (WINAPI *glClearStencil)(GLint s); 86 void (WINAPI *glClipPlane)(GLenum plane, const GLdouble *equation); 87 void (WINAPI *glColor3b)(GLbyte red, GLbyte green, GLbyte blue); 88 void (WINAPI *glColor3bv)(const GLbyte *v); 89 void (WINAPI *glColor3d)(GLdouble red, GLdouble green, GLdouble blue); 90 void (WINAPI *glColor3dv)(const GLdouble *v); 91 void (WINAPI *glColor3f)(GLfloat red, GLfloat green, GLfloat blue); 92 void (WINAPI *glColor3fv)(const GLfloat *v); 93 void (WINAPI *glColor3i)(GLint red, GLint green, GLint blue); 94 void (WINAPI *glColor3iv)(const GLint *v); 95 void (WINAPI *glColor3s)(GLshort red, GLshort green, GLshort blue); 96 void (WINAPI *glColor3sv)(const GLshort *v); 97 void (WINAPI *glColor3ub)(GLubyte red, GLubyte green, GLubyte blue); 98 void (WINAPI *glColor3ubv)(const GLubyte *v); 99 void (WINAPI *glColor3ui)(GLuint red, GLuint green, GLuint blue); 100 void (WINAPI *glColor3uiv)(const GLuint *v); 101 void (WINAPI *glColor3us)(GLushort red, GLushort green, GLushort blue); 102 void (WINAPI *glColor3usv)(const GLushort *v); 103 void (WINAPI *glColor4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); 104 void (WINAPI *glColor4bv)(const GLbyte *v); 105 void (WINAPI *glColor4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); 106 void (WINAPI *glColor4dv)(const GLdouble *v); 107 void (WINAPI *glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); 108 void (WINAPI *glColor4fv)(const GLfloat *v); 109 void (WINAPI *glColor4i)(GLint red, GLint green, GLint blue, GLint alpha); 110 void (WINAPI *glColor4iv)(const GLint *v); 111 void (WINAPI *glColor4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); 112 void (WINAPI *glColor4sv)(const GLshort *v); 113 void (WINAPI *glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); 114 void (WINAPI *glColor4ubv)(const GLubyte *v); 115 void (WINAPI *glColor4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); 116 void (WINAPI *glColor4uiv)(const GLuint *v); 117 void (WINAPI *glColor4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); 118 void (WINAPI *glColor4usv)(const GLushort *v); 119 void (WINAPI *glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); 120 void (WINAPI *glColorMaterial)(GLenum face, GLenum mode); 121 void (WINAPI *glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); 122 void (WINAPI *glCopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); 123 void (WINAPI *glCopyTexImage1D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); 124 void (WINAPI *glCopyTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); 125 void (WINAPI *glCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); 126 void (WINAPI *glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); 127 void (WINAPI *glCullFace)(GLenum mode); 128 void (WINAPI *glDeleteLists)(GLuint list, GLsizei range); 129 void (WINAPI *glDeleteTextures)(GLsizei n, const GLuint *textures); 130 void (WINAPI *glDepthFunc)(GLenum func); 131 void (WINAPI *glDepthMask)(GLboolean flag); 132 void (WINAPI *glDepthRange)(GLclampd zNear, GLclampd zFar); 133 void (WINAPI *glDisable)(GLenum cap); 134 void (WINAPI *glDisableClientState)(GLenum array); 135 void (WINAPI *glDrawArrays)(GLenum mode, GLint first, GLsizei count); 136 void (WINAPI *glDrawBuffer)(GLenum mode); 137 void (WINAPI *glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); 138 void (WINAPI *glDrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); 139 void (WINAPI *glEdgeFlag)(GLboolean flag); 140 void (WINAPI *glEdgeFlagPointer)(GLsizei stride, const GLvoid *pointer); 141 void (WINAPI *glEdgeFlagv)(const GLboolean *flag); 142 void (WINAPI *glEnable)(GLenum cap); 143 void (WINAPI *glEnableClientState)(GLenum array); 144 void (WINAPI *glEnd)(void); 145 void (WINAPI *glEndList)(void); 146 void (WINAPI *glEvalCoord1d)(GLdouble u); 147 void (WINAPI *glEvalCoord1dv)(const GLdouble *u); 148 void (WINAPI *glEvalCoord1f)(GLfloat u); 149 void (WINAPI *glEvalCoord1fv)(const GLfloat *u); 150 void (WINAPI *glEvalCoord2d)(GLdouble u, GLdouble v); 151 void (WINAPI *glEvalCoord2dv)(const GLdouble *u); 152 void (WINAPI *glEvalCoord2f)(GLfloat u, GLfloat v); 153 void (WINAPI *glEvalCoord2fv)(const GLfloat *u); 154 void (WINAPI *glEvalMesh1)(GLenum mode, GLint i1, GLint i2); 155 void (WINAPI *glEvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); 156 void (WINAPI *glEvalPoint1)(GLint i); 157 void (WINAPI *glEvalPoint2)(GLint i, GLint j); 158 void (WINAPI *glFeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer); 159 void (WINAPI *glFinish)(void); 160 void (WINAPI *glFlush)(void); 161 void (WINAPI *glFogf)(GLenum pname, GLfloat param); 162 void (WINAPI *glFogfv)(GLenum pname, const GLfloat *params); 163 void (WINAPI *glFogi)(GLenum pname, GLint param); 164 void (WINAPI *glFogiv)(GLenum pname, const GLint *params); 165 void (WINAPI *glFrontFace)(GLenum mode); 166 void (WINAPI *glFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); 167 GLuint (WINAPI *glGenLists)(GLsizei range); 168 void (WINAPI *glGenTextures)(GLsizei n, GLuint *textures); 169 void (WINAPI *glGetBooleanv)(GLenum pname, GLboolean *params); 170 void (WINAPI *glGetClipPlane)(GLenum plane, GLdouble *equation); 171 void (WINAPI *glGetDoublev)(GLenum pname, GLdouble *params); 172 GLenum (WINAPI *glGetError)(void); 173 void (WINAPI *glGetFloatv)(GLenum pname, GLfloat *params); 174 void (WINAPI *glGetIntegerv)(GLenum pname, GLint *params); 175 void (WINAPI *glGetLightfv)(GLenum light, GLenum pname, GLfloat *params); 176 void (WINAPI *glGetLightiv)(GLenum light, GLenum pname, GLint *params); 177 void (WINAPI *glGetMapdv)(GLenum target, GLenum query, GLdouble *v); 178 void (WINAPI *glGetMapfv)(GLenum target, GLenum query, GLfloat *v); 179 void (WINAPI *glGetMapiv)(GLenum target, GLenum query, GLint *v); 180 void (WINAPI *glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params); 181 void (WINAPI *glGetMaterialiv)(GLenum face, GLenum pname, GLint *params); 182 void (WINAPI *glGetPixelMapfv)(GLenum map, GLfloat *values); 183 void (WINAPI *glGetPixelMapuiv)(GLenum map, GLuint *values); 184 void (WINAPI *glGetPixelMapusv)(GLenum map, GLushort *values); 185 void (WINAPI *glGetPointerv)(GLenum pname, GLvoid* *params); 186 void (WINAPI *glGetPolygonStipple)(GLubyte *mask); 187 const GLubyte * (WINAPI *glGetString)(GLenum name); 188 void (WINAPI *glGetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params); 189 void (WINAPI *glGetTexEnviv)(GLenum target, GLenum pname, GLint *params); 190 void (WINAPI *glGetTexGendv)(GLenum coord, GLenum pname, GLdouble *params); 191 void (WINAPI *glGetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params); 192 void (WINAPI *glGetTexGeniv)(GLenum coord, GLenum pname, GLint *params); 193 void (WINAPI *glGetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); 194 void (WINAPI *glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params); 195 void (WINAPI *glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params); 196 void (WINAPI *glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params); 197 void (WINAPI *glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params); 198 void (WINAPI *glHint)(GLenum target, GLenum mode); 199 void (WINAPI *glIndexMask)(GLuint mask); 200 void (WINAPI *glIndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer); 201 void (WINAPI *glIndexd)(GLdouble c); 202 void (WINAPI *glIndexdv)(const GLdouble *c); 203 void (WINAPI *glIndexf)(GLfloat c); 204 void (WINAPI *glIndexfv)(const GLfloat *c); 205 void (WINAPI *glIndexi)(GLint c); 206 void (WINAPI *glIndexiv)(const GLint *c); 207 void (WINAPI *glIndexs)(GLshort c); 208 void (WINAPI *glIndexsv)(const GLshort *c); 209 void (WINAPI *glIndexub)(GLubyte c); 210 void (WINAPI *glIndexubv)(const GLubyte *c); 211 void (WINAPI *glInitNames)(void); 212 void (WINAPI *glInterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer); 213 GLboolean (WINAPI *glIsEnabled)(GLenum cap); 214 GLboolean (WINAPI *glIsList)(GLuint list); 215 GLboolean (WINAPI *glIsTexture)(GLuint texture); 216 void (WINAPI *glLightModelf)(GLenum pname, GLfloat param); 217 void (WINAPI *glLightModelfv)(GLenum pname, const GLfloat *params); 218 void (WINAPI *glLightModeli)(GLenum pname, GLint param); 219 void (WINAPI *glLightModeliv)(GLenum pname, const GLint *params); 220 void (WINAPI *glLightf)(GLenum light, GLenum pname, GLfloat param); 221 void (WINAPI *glLightfv)(GLenum light, GLenum pname, const GLfloat *params); 222 void (WINAPI *glLighti)(GLenum light, GLenum pname, GLint param); 223 void (WINAPI *glLightiv)(GLenum light, GLenum pname, const GLint *params); 224 void (WINAPI *glLineStipple)(GLint factor, GLushort pattern); 225 void (WINAPI *glLineWidth)(GLfloat width); 226 void (WINAPI *glListBase)(GLuint base); 227 void (WINAPI *glLoadIdentity)(void); 228 void (WINAPI *glLoadMatrixd)(const GLdouble *m); 229 void (WINAPI *glLoadMatrixf)(const GLfloat *m); 230 void (WINAPI *glLoadName)(GLuint name); 231 void (WINAPI *glLogicOp)(GLenum opcode); 232 void (WINAPI *glMap1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); 233 void (WINAPI *glMap1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); 234 void (WINAPI *glMap2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); 235 void (WINAPI *glMap2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); 236 void (WINAPI *glMapGrid1d)(GLint un, GLdouble u1, GLdouble u2); 237 void (WINAPI *glMapGrid1f)(GLint un, GLfloat u1, GLfloat u2); 238 void (WINAPI *glMapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); 239 void (WINAPI *glMapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); 240 void (WINAPI *glMaterialf)(GLenum face, GLenum pname, GLfloat param); 241 void (WINAPI *glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params); 242 void (WINAPI *glMateriali)(GLenum face, GLenum pname, GLint param); 243 void (WINAPI *glMaterialiv)(GLenum face, GLenum pname, const GLint *params); 244 void (WINAPI *glMatrixMode)(GLenum mode); 245 void (WINAPI *glMultMatrixd)(const GLdouble *m); 246 void (WINAPI *glMultMatrixf)(const GLfloat *m); 247 void (WINAPI *glNewList)(GLuint list, GLenum mode); 248 void (WINAPI *glNormal3b)(GLbyte nx, GLbyte ny, GLbyte nz); 249 void (WINAPI *glNormal3bv)(const GLbyte *v); 250 void (WINAPI *glNormal3d)(GLdouble nx, GLdouble ny, GLdouble nz); 251 void (WINAPI *glNormal3dv)(const GLdouble *v); 252 void (WINAPI *glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz); 253 void (WINAPI *glNormal3fv)(const GLfloat *v); 254 void (WINAPI *glNormal3i)(GLint nx, GLint ny, GLint nz); 255 void (WINAPI *glNormal3iv)(const GLint *v); 256 void (WINAPI *glNormal3s)(GLshort nx, GLshort ny, GLshort nz); 257 void (WINAPI *glNormal3sv)(const GLshort *v); 258 void (WINAPI *glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer); 259 void (WINAPI *glOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); 260 void (WINAPI *glPassThrough)(GLfloat token); 261 void (WINAPI *glPixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat *values); 262 void (WINAPI *glPixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint *values); 263 void (WINAPI *glPixelMapusv)(GLenum map, GLsizei mapsize, const GLushort *values); 264 void (WINAPI *glPixelStoref)(GLenum pname, GLfloat param); 265 void (WINAPI *glPixelStorei)(GLenum pname, GLint param); 266 void (WINAPI *glPixelTransferf)(GLenum pname, GLfloat param); 267 void (WINAPI *glPixelTransferi)(GLenum pname, GLint param); 268 void (WINAPI *glPixelZoom)(GLfloat xfactor, GLfloat yfactor); 269 void (WINAPI *glPointSize)(GLfloat size); 270 void (WINAPI *glPolygonMode)(GLenum face, GLenum mode); 271 void (WINAPI *glPolygonOffset)(GLfloat factor, GLfloat units); 272 void (WINAPI *glPolygonStipple)(const GLubyte *mask); 273 void (WINAPI *glPopAttrib)(void); 274 void (WINAPI *glPopClientAttrib)(void); 275 void (WINAPI *glPopMatrix)(void); 276 void (WINAPI *glPopName)(void); 277 void (WINAPI *glPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities); 278 void (WINAPI *glPushAttrib)(GLbitfield mask); 279 void (WINAPI *glPushClientAttrib)(GLbitfield mask); 280 void (WINAPI *glPushMatrix)(void); 281 void (WINAPI *glPushName)(GLuint name); 282 void (WINAPI *glRasterPos2d)(GLdouble x, GLdouble y); 283 void (WINAPI *glRasterPos2dv)(const GLdouble *v); 284 void (WINAPI *glRasterPos2f)(GLfloat x, GLfloat y); 285 void (WINAPI *glRasterPos2fv)(const GLfloat *v); 286 void (WINAPI *glRasterPos2i)(GLint x, GLint y); 287 void (WINAPI *glRasterPos2iv)(const GLint *v); 288 void (WINAPI *glRasterPos2s)(GLshort x, GLshort y); 289 void (WINAPI *glRasterPos2sv)(const GLshort *v); 290 void (WINAPI *glRasterPos3d)(GLdouble x, GLdouble y, GLdouble z); 291 void (WINAPI *glRasterPos3dv)(const GLdouble *v); 292 void (WINAPI *glRasterPos3f)(GLfloat x, GLfloat y, GLfloat z); 293 void (WINAPI *glRasterPos3fv)(const GLfloat *v); 294 void (WINAPI *glRasterPos3i)(GLint x, GLint y, GLint z); 295 void (WINAPI *glRasterPos3iv)(const GLint *v); 296 void (WINAPI *glRasterPos3s)(GLshort x, GLshort y, GLshort z); 297 void (WINAPI *glRasterPos3sv)(const GLshort *v); 298 void (WINAPI *glRasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); 299 void (WINAPI *glRasterPos4dv)(const GLdouble *v); 300 void (WINAPI *glRasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); 301 void (WINAPI *glRasterPos4fv)(const GLfloat *v); 302 void (WINAPI *glRasterPos4i)(GLint x, GLint y, GLint z, GLint w); 303 void (WINAPI *glRasterPos4iv)(const GLint *v); 304 void (WINAPI *glRasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); 305 void (WINAPI *glRasterPos4sv)(const GLshort *v); 306 void (WINAPI *glReadBuffer)(GLenum mode); 307 void (WINAPI *glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); 308 void (WINAPI *glRectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); 309 void (WINAPI *glRectdv)(const GLdouble *v1, const GLdouble *v2); 310 void (WINAPI *glRectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); 311 void (WINAPI *glRectfv)(const GLfloat *v1, const GLfloat *v2); 312 void (WINAPI *glRecti)(GLint x1, GLint y1, GLint x2, GLint y2); 313 void (WINAPI *glRectiv)(const GLint *v1, const GLint *v2); 314 void (WINAPI *glRects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); 315 void (WINAPI *glRectsv)(const GLshort *v1, const GLshort *v2); 316 GLint (WINAPI *glRenderMode)(GLenum mode); 317 void (WINAPI *glRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); 318 void (WINAPI *glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); 319 void (WINAPI *glScaled)(GLdouble x, GLdouble y, GLdouble z); 320 void (WINAPI *glScalef)(GLfloat x, GLfloat y, GLfloat z); 321 void (WINAPI *glScissor)(GLint x, GLint y, GLsizei width, GLsizei height); 322 void (WINAPI *glSelectBuffer)(GLsizei size, GLuint *buffer); 323 void (WINAPI *glShadeModel)(GLenum mode); 324 void (WINAPI *glStencilFunc)(GLenum func, GLint ref, GLuint mask); 325 void (WINAPI *glStencilMask)(GLuint mask); 326 void (WINAPI *glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass); 327 void (WINAPI *glTexCoord1d)(GLdouble s); 328 void (WINAPI *glTexCoord1dv)(const GLdouble *v); 329 void (WINAPI *glTexCoord1f)(GLfloat s); 330 void (WINAPI *glTexCoord1fv)(const GLfloat *v); 331 void (WINAPI *glTexCoord1i)(GLint s); 332 void (WINAPI *glTexCoord1iv)(const GLint *v); 333 void (WINAPI *glTexCoord1s)(GLshort s); 334 void (WINAPI *glTexCoord1sv)(const GLshort *v); 335 void (WINAPI *glTexCoord2d)(GLdouble s, GLdouble t); 336 void (WINAPI *glTexCoord2dv)(const GLdouble *v); 337 void (WINAPI *glTexCoord2f)(GLfloat s, GLfloat t); 338 void (WINAPI *glTexCoord2fv)(const GLfloat *v); 339 void (WINAPI *glTexCoord2i)(GLint s, GLint t); 340 void (WINAPI *glTexCoord2iv)(const GLint *v); 341 void (WINAPI *glTexCoord2s)(GLshort s, GLshort t); 342 void (WINAPI *glTexCoord2sv)(const GLshort *v); 343 void (WINAPI *glTexCoord3d)(GLdouble s, GLdouble t, GLdouble r); 344 void (WINAPI *glTexCoord3dv)(const GLdouble *v); 345 void (WINAPI *glTexCoord3f)(GLfloat s, GLfloat t, GLfloat r); 346 void (WINAPI *glTexCoord3fv)(const GLfloat *v); 347 void (WINAPI *glTexCoord3i)(GLint s, GLint t, GLint r); 348 void (WINAPI *glTexCoord3iv)(const GLint *v); 349 void (WINAPI *glTexCoord3s)(GLshort s, GLshort t, GLshort r); 350 void (WINAPI *glTexCoord3sv)(const GLshort *v); 351 void (WINAPI *glTexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); 352 void (WINAPI *glTexCoord4dv)(const GLdouble *v); 353 void (WINAPI *glTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); 354 void (WINAPI *glTexCoord4fv)(const GLfloat *v); 355 void (WINAPI *glTexCoord4i)(GLint s, GLint t, GLint r, GLint q); 356 void (WINAPI *glTexCoord4iv)(const GLint *v); 357 void (WINAPI *glTexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); 358 void (WINAPI *glTexCoord4sv)(const GLshort *v); 359 void (WINAPI *glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); 360 void (WINAPI *glTexEnvf)(GLenum target, GLenum pname, GLfloat param); 361 void (WINAPI *glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params); 362 void (WINAPI *glTexEnvi)(GLenum target, GLenum pname, GLint param); 363 void (WINAPI *glTexEnviv)(GLenum target, GLenum pname, const GLint *params); 364 void (WINAPI *glTexGend)(GLenum coord, GLenum pname, GLdouble param); 365 void (WINAPI *glTexGendv)(GLenum coord, GLenum pname, const GLdouble *params); 366 void (WINAPI *glTexGenf)(GLenum coord, GLenum pname, GLfloat param); 367 void (WINAPI *glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params); 368 void (WINAPI *glTexGeni)(GLenum coord, GLenum pname, GLint param); 369 void (WINAPI *glTexGeniv)(GLenum coord, GLenum pname, const GLint *params); 370 void (WINAPI *glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); 371 void (WINAPI *glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); 372 void (WINAPI *glTexParameterf)(GLenum target, GLenum pname, GLfloat param); 373 void (WINAPI *glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params); 374 void (WINAPI *glTexParameteri)(GLenum target, GLenum pname, GLint param); 375 void (WINAPI *glTexParameteriv)(GLenum target, GLenum pname, const GLint *params); 376 void (WINAPI *glTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); 377 void (WINAPI *glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); 378 void (WINAPI *glTranslated)(GLdouble x, GLdouble y, GLdouble z); 379 void (WINAPI *glTranslatef)(GLfloat x, GLfloat y, GLfloat z); 380 void (WINAPI *glVertex2d)(GLdouble x, GLdouble y); 381 void (WINAPI *glVertex2dv)(const GLdouble *v); 382 void (WINAPI *glVertex2f)(GLfloat x, GLfloat y); 383 void (WINAPI *glVertex2fv)(const GLfloat *v); 384 void (WINAPI *glVertex2i)(GLint x, GLint y); 385 void (WINAPI *glVertex2iv)(const GLint *v); 386 void (WINAPI *glVertex2s)(GLshort x, GLshort y); 387 void (WINAPI *glVertex2sv)(const GLshort *v); 388 void (WINAPI *glVertex3d)(GLdouble x, GLdouble y, GLdouble z); 389 void (WINAPI *glVertex3dv)(const GLdouble *v); 390 void (WINAPI *glVertex3f)(GLfloat x, GLfloat y, GLfloat z); 391 void (WINAPI *glVertex3fv)(const GLfloat *v); 392 void (WINAPI *glVertex3i)(GLint x, GLint y, GLint z); 393 void (WINAPI *glVertex3iv)(const GLint *v); 394 void (WINAPI *glVertex3s)(GLshort x, GLshort y, GLshort z); 395 void (WINAPI *glVertex3sv)(const GLshort *v); 396 void (WINAPI *glVertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); 397 void (WINAPI *glVertex4dv)(const GLdouble *v); 398 void (WINAPI *glVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); 399 void (WINAPI *glVertex4fv)(const GLfloat *v); 400 void (WINAPI *glVertex4i)(GLint x, GLint y, GLint z, GLint w); 401 void (WINAPI *glVertex4iv)(const GLint *v); 402 void (WINAPI *glVertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); 403 void (WINAPI *glVertex4sv)(const GLshort *v); 404 void (WINAPI *glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); 405 void (WINAPI *glViewport)(GLint x, GLint y, GLsizei width, GLsizei height); 406 407 BOOL (WINAPI *wglCopyContext)(HGLRC, HGLRC, UINT); 408 HGLRC (WINAPI *wglCreateContext)(HDC); 409 HGLRC (WINAPI *wglCreateLayerContext)(HDC, int); 410 BOOL (WINAPI *wglDeleteContext)(HGLRC); 411 HGLRC (WINAPI *wglGetCurrentContext)(VOID); 412 HDC (WINAPI *wglGetCurrentDC)(VOID); 413 PROC (WINAPI *wglGetProcAddress)(LPCSTR); 414 BOOL (WINAPI *wglMakeCurrent)(HDC, HGLRC); 415 BOOL (WINAPI *wglShareLists)(HGLRC, HGLRC); 416 417 int f_0564; 418 419 int glActiveTextureARB; 420 int glClientActiveTextureARB; 421 int glMultiTexCoord4fARB; 422 int glMultiTexCoord2fvARB; 423 int glBlendColor; 424 int f_057C; 425 int f_0580; 426 int f_0584; 427 int f_0588; 428 int glCompressedTexImaged3DARB; 429 int glCompressedTexImaged2DARB; 430 int glCompressedTexImage1DARB; 431 int glCompressedTexSubImage3DARB; 432 int glCompressedTexSubImage2DARB; 433 int glCompressedTexSubImage1DARB; 434 int glCompressedTexImageARB; 435 436 GLboolean (WINAPI *wglSwapIntervalEXT)(GLint interval); 437 438 GLint (WINAPI *wglSetDeviceGammaRamp3DFX)(HDC, GLvoid *); 439 GLint (WINAPI *wglGetDeviceGammaRamp3DFX)(HDC, GLvoid *); 440 } gl_api_t; 441 442 extern gl_engine_t* gl; 443 extern gl_api_t* gl_api; 444 445 extern WORD gl_gamma_ramp[3 * 256]; 446 extern int gl_gamma_ramp_valid; 447 8 448 unsigned int ONICALL gl_enumerate_valid_display_modes(M3tDisplayMode modes[16]); 449 int ONICALL gl_platform_set_pixel_format(HDC hdc); 450 int ONICALL gl_platform_initialize(); 9 451 10 452 #endif
Note:
See TracChangeset
for help on using the changeset viewer.