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