1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * File: glwindows.h 3*4882a593Smuzhiyun * Purpose: Header for GLX implementation using native Windows OpenGL library 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Authors: Alexander Gottwald 6*4882a593Smuzhiyun * Jon TURNEY 7*4882a593Smuzhiyun * 8*4882a593Smuzhiyun * Copyright (c) Jon TURNEY 2009 9*4882a593Smuzhiyun * Copyright (c) Alexander Gottwald 2004 10*4882a593Smuzhiyun * 11*4882a593Smuzhiyun * 12*4882a593Smuzhiyun * Permission is hereby granted, free of charge, to any person obtaining a 13*4882a593Smuzhiyun * copy of this software and associated documentation files (the "Software"), 14*4882a593Smuzhiyun * to deal in the Software without restriction, including without limitation 15*4882a593Smuzhiyun * the rights to use, copy, modify, merge, publish, distribute, sublicense, 16*4882a593Smuzhiyun * and/or sell copies of the Software, and to permit persons to whom the 17*4882a593Smuzhiyun * Software is furnished to do so, subject to the following conditions: 18*4882a593Smuzhiyun * 19*4882a593Smuzhiyun * The above copyright notice and this permission notice shall be included in 20*4882a593Smuzhiyun * all copies or substantial portions of the Software. 21*4882a593Smuzhiyun * 22*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23*4882a593Smuzhiyun * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 25*4882a593Smuzhiyun * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 26*4882a593Smuzhiyun * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 27*4882a593Smuzhiyun * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 28*4882a593Smuzhiyun * DEALINGS IN THE SOFTWARE. 29*4882a593Smuzhiyun */ 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun #ifndef GLWINDOWS_H 32*4882a593Smuzhiyun #define GLWINDOWS_H 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun #include <GL/gl.h> 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun typedef struct { 37*4882a593Smuzhiyun unsigned int enableDebug:1; 38*4882a593Smuzhiyun unsigned int enableTrace:1; 39*4882a593Smuzhiyun unsigned int dumpPFD:1; 40*4882a593Smuzhiyun unsigned int dumpHWND:1; 41*4882a593Smuzhiyun unsigned int dumpDC:1; 42*4882a593Smuzhiyun unsigned int enableGLcallTrace:1; 43*4882a593Smuzhiyun unsigned int enableWGLcallTrace:1; 44*4882a593Smuzhiyun } glxWinDebugSettingsRec; 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun extern glxWinDebugSettingsRec glxWinDebugSettings; 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun void glxWinPushNativeProvider(void); 49*4882a593Smuzhiyun void glAddSwapHintRectWINWrapper(GLint x, GLint y, GLsizei width, GLsizei height); 50*4882a593Smuzhiyun int glWinSelectImplementation(int native); 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun #if 1 53*4882a593Smuzhiyun #define GLWIN_TRACE_MSG(msg, args...) if (glxWinDebugSettings.enableTrace) ErrorF(msg " [%s:%d]\n" , ##args , __FUNCTION__, __LINE__ ) 54*4882a593Smuzhiyun #define GLWIN_DEBUG_MSG(msg, args...) if (glxWinDebugSettings.enableDebug) ErrorF(msg " [%s:%d]\n" , ##args , __FUNCTION__, __LINE__ ) 55*4882a593Smuzhiyun #else 56*4882a593Smuzhiyun #define GLWIN_TRACE_MSG(a, ...) 57*4882a593Smuzhiyun #define GLWIN_DEBUG_MSG(a, ...) 58*4882a593Smuzhiyun #endif 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun #endif 61