am ce5934c3: am 89bccc8b: Merge "this checkin supports windows OS in all Translator libs"

* commit 'ce5934c3a025d656a7c268e15b766b0b8f20af53':
  this checkin supports windows OS in all Translator libs
This commit is contained in:
David Turner
2011-05-17 04:45:07 -07:00
committed by Android Git Automerger
12 changed files with 1319 additions and 125 deletions

View File

@@ -54,7 +54,7 @@ public:
EGLint trans_red_val, EGLint trans_red_val,
EGLint trans_green_val, EGLint trans_green_val,
EGLint trans_blue_val, EGLint trans_blue_val,
EGLNativePixelFormatType frmt = 0); EGLNativePixelFormatType frmt);
EglConfig(const EglConfig& conf); EglConfig(const EglConfig& conf);

View File

@@ -23,6 +23,9 @@ EglGlobalInfo* EglGlobalInfo::m_singleton = NULL;
EglGlobalInfo::EglGlobalInfo(){ EglGlobalInfo::EglGlobalInfo(){
m_default = EglOS::getDefaultDisplay(); m_default = EglOS::getDefaultDisplay();
#ifdef _WIN32
EglOS::initPtrToWglFunctions();
#endif
memset(m_gles_ifaces,0,sizeof(m_gles_ifaces)); memset(m_gles_ifaces,0,sizeof(m_gles_ifaces));
} }

View File

@@ -13,12 +13,18 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifdef _WIN32
#undef EGLAPI
#define EGLAPI __declspec(dllexport)
#endif
#include <EGL/egl.h> #include <EGL/egl.h>
#include <dlfcn.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h>
#include <GLcommon/ThreadInfo.h> #include <GLcommon/ThreadInfo.h>
#include <GLcommon/TranslatorIfaces.h> #include <GLcommon/TranslatorIfaces.h>
#include <OpenglOsUtils/osDynLibrary.h>
#include "EglWindowSurface.h" #include "EglWindowSurface.h"
#include "EglPbufferSurface.h" #include "EglPbufferSurface.h"
@@ -31,6 +37,7 @@
#include "EglConfig.h" #include "EglConfig.h"
#include "EglOsApi.h" #include "EglOsApi.h"
#define MINOR 1 #define MINOR 1
#define MAJOR 4 #define MAJOR 4
@@ -141,14 +148,27 @@ EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id) {
} }
#define TRANSLATOR_GETIFACE_NAME "__translator_getIfaces"
static __translator_getGLESIfaceFunc loadIfaces(const char* libName){ static __translator_getGLESIfaceFunc loadIfaces(const char* libName){
void* libGLES = dlopen(libName, RTLD_NOW); osUtils::dynLibrary* libGLES = osUtils::dynLibrary::open(libName);
if(!libGLES) return NULL; if(!libGLES) return NULL;
__translator_getGLESIfaceFunc func = (__translator_getGLESIfaceFunc)dlsym(libGLES,"__translator_getIfaces"); __translator_getGLESIfaceFunc func = (__translator_getGLESIfaceFunc)libGLES->findSymbol(TRANSLATOR_GETIFACE_NAME);
if(!func) return NULL; if(!func) return NULL;
return func; return func;
} }
#ifdef _WIN32
#define LIB_GLES_NAME "libGLES_CM_translator"
#elif __linux__
#define LIB_GLES_NAME "libGLES_CM_translator.so"
#else
#define LIB_GLES_NAME "libGLES_CM_translator"
#endif
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay display, EGLint *major, EGLint *minor) { EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay display, EGLint *major, EGLint *minor) {
EglDisplay* dpy = g_eglInfo->getDisplay(display); EglDisplay* dpy = g_eglInfo->getDisplay(display);
if(!dpy) { if(!dpy) {
@@ -157,12 +177,13 @@ EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay display, EGLint *major, E
if(major) *major = MAJOR; if(major) *major = MAJOR;
if(minor) *minor = MINOR; if(minor) *minor = MINOR;
if(!g_eglInfo->getIface(GLES_1_1)) { if(!g_eglInfo->getIface(GLES_1_1)) {
__translator_getGLESIfaceFunc func = loadIfaces("libGLES_CM_translator.so"); __translator_getGLESIfaceFunc func = loadIfaces(LIB_GLES_NAME);
if(func){ if(func){
g_eglInfo->setIface(func(&s_eglIface),GLES_1_1); g_eglInfo->setIface(func(&s_eglIface),GLES_1_1);
} else { } else {
fprintf(stderr,"could not find ifaces...\n");
return EGL_FALSE; return EGL_FALSE;
} }
} }
@@ -170,7 +191,6 @@ EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay display, EGLint *major, E
return EGL_TRUE; return EGL_TRUE;
} }
//TODO check this func definitions later on
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay display) { EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay display) {
VALIDATE_DISPLAY(display); VALIDATE_DISPLAY(display);
dpy->terminate(); dpy->terminate();
@@ -389,10 +409,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay display, const EGLint *
} }
} }
} }
EGLNativePixelFormatType tmpfrmt = PIXEL_FORMAT_INITIALIZER;
EglConfig dummy(red_size,green_size,blue_size,alpha_size,caveat,config_id,depth_size, EglConfig dummy(red_size,green_size,blue_size,alpha_size,caveat,config_id,depth_size,
frame_buffer_level,0,0,0,native_renderable,0,native_visual_type, frame_buffer_level,0,0,0,native_renderable,0,native_visual_type,
samples_per_pixel,stencil_size,surface_type,transparent_type, samples_per_pixel,stencil_size,surface_type,transparent_type,
trans_red_val,trans_green_val,trans_blue_val); trans_red_val,trans_green_val,trans_blue_val,tmpfrmt);
*num_config = dpy->chooseConfigs(dummy,configs,config_size); *num_config = dpy->chooseConfigs(dummy,configs,config_size);
@@ -607,7 +629,6 @@ EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay display, EGLConfig con
iface->deleteGLESContext(glesCtx); iface->deleteGLESContext(glesCtx);
} }
return EGL_NO_CONTEXT; return EGL_NO_CONTEXT;
} }

View File

@@ -48,6 +48,9 @@ namespace EglOS{
EGLNativeDisplayType getDefaultDisplay(); EGLNativeDisplayType getDefaultDisplay();
EGLNativePbufferType createPbuffer(EGLNativeDisplayType dpy,EglConfig* cfg,EglPbufferSurface* pb); EGLNativePbufferType createPbuffer(EGLNativeDisplayType dpy,EglConfig* cfg,EglPbufferSurface* pb);
EGLNativeContextType createContext(EGLNativeDisplayType dpy,EglConfig* cfg,EGLNativeContextType sharedContext); EGLNativeContextType createContext(EGLNativeDisplayType dpy,EglConfig* cfg,EGLNativeContextType sharedContext);
#ifdef _WIN32
void initPtrToWglFunctions();
#endif
}; };
#endif #endif

View File

@@ -31,6 +31,6 @@ public:
static bool alreadyAssociatedWithConfig(EGLNativePixmapType pix); static bool alreadyAssociatedWithConfig(EGLNativePixmapType pix);
private: private:
EGLNativePixmapType m_pixmap; EGLNativePixmapType m_pixmap;
static std::set<EGLNativeWindowType> s_associatedPixmaps; static std::set<EGLNativePixmapType> s_associatedPixmaps;
}; };
#endif #endif

View File

@@ -15,131 +15,331 @@
*/ */
#include "EglOsApi.h" #include "EglOsApi.h"
#include <windows.h> #include <windows.h>
#include <wingdi.h>
#include <GL/wglext.h> #include <GL/wglext.h>
#define IS_TRUE(a) \ #define IS_TRUE(a) \
if(a != true) return false; if(a != true) return false;
struct DisplayInfo{
DisplayInfo():dc(NULL),hwnd(NULL),isPixelFormatSet(false){};
DisplayInfo(HDC hdc,HWND wnd):isPixelFormatSet(false){dc = hdc; hwnd = wnd;};
HDC dc;
HWND hwnd;
bool isPixelFormatSet;
};
class WinDisplay{
public:
typedef enum {
DEFAULT_DISPLAY = 0
};
WinDisplay():m_current(DEFAULT_DISPLAY){};
DisplayInfo& getInfo(int configurationIndex){ return m_map[configurationIndex];}
HDC getCurrentDC(){return m_map[m_current].dc;}
void setDefault(const DisplayInfo& info){m_map[DEFAULT_DISPLAY] = info; m_current = DEFAULT_DISPLAY;}
void setCurrent(int configurationIndex,const DisplayInfo& info);
bool isCurrentPixelFormatSet(){ return m_map[m_current].isPixelFormatSet;}
void currentPixelFormatWasSet(){m_map[m_current].isPixelFormatSet = true;}
void releaseAll();
private:
std::map<int,DisplayInfo> m_map;
int m_current;
};
void WinDisplay::releaseAll(){
for(std::map<int,DisplayInfo>::iterator it = m_map.begin(); it != m_map.end();it++){
DestroyWindow((*it).second.hwnd);
DeleteDC((*it).second.dc);
}
}
void WinDisplay::setCurrent(int configurationIndex,const DisplayInfo& info){
if(m_map.find(configurationIndex) != m_map.end()) return;
m_map[configurationIndex] = info;
m_current = configurationIndex;
}
namespace EglOS{ namespace EglOS{
bool WGLExtensionSupported(const char *extension_name)
struct WglExtProcs{
PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB;
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB;
PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB;
PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB;
PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB;
PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB;
PFNWGLMAKECONTEXTCURRENTARBPROC wglMakeContextCurrentARB;
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT;
};
static WglExtProcs* s_wglExtProcs = NULL;
PROC wglGetExtentionsProcAddress(HDC hdc,const char *extension_name,const char* proc_name)
{ {
// this is pointer to function which returns pointer to string with list of all wgl extensions // this is pointer to function which returns pointer to string with list of all wgl extensions
PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglGetExtensionsStringEXT = NULL; PFNWGLGETEXTENSIONSSTRINGARBPROC _wglGetExtensionsStringARB = NULL;
// determine pointer to wglGetExtensionsStringEXT function // determine pointer to wglGetExtensionsStringEXT function
_wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) wglGetProcAddress("wglGetExtensionsStringEXT"); _wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB");
if(!_wglGetExtensionsStringARB){
fprintf(stderr,"could not get wglGetExtensionsStringARB\n");
return NULL;
}
if (strstr(_wglGetExtensionsString(), extension_name) == NULL) if (!_wglGetExtensionsStringARB || strstr(_wglGetExtensionsStringARB(hdc), extension_name) == NULL)
{ {
fprintf(stderr,"extension %s was not found\n",extension_name);
// string was not found // string was not found
return false; return NULL;
} }
// extension is supported // extension is supported
return true; return wglGetProcAddress(proc_name);
}
LRESULT CALLBACK dummyWndProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
HWND createDummyWindow(){
WNDCLASSEX wcx;
wcx.cbSize = sizeof(wcx); // size of structure
wcx.style = CS_OWNDC |CS_HREDRAW |CS_VREDRAW; // redraw if size changes
wcx.lpfnWndProc = dummyWndProc; // points to window procedure
wcx.cbClsExtra = 0; // no extra class memory
wcx.cbWndExtra = sizeof(void*); // save extra window memory, to store VasWindow instance
wcx.hInstance = NULL; // handle to instance
wcx.hIcon = NULL; // predefined app. icon
wcx.hCursor = NULL;
wcx.hbrBackground = NULL; // no background brush
wcx.lpszMenuName = NULL; // name of menu resource
wcx.lpszClassName = "DummyWin"; // name of window class
wcx.hIconSm = (HICON) NULL; // small class icon
ATOM winClass = RegisterClassEx(&wcx);
HWND hwnd = CreateWindowEx(WS_EX_CLIENTEDGE,
"DummyWin",
"Dummy",
WS_POPUP,
0,
0,
1,
1,
NULL,
NULL,
0,0);
return hwnd;
} }
EGLNativeDisplayType getDefaultDisplay() { EGLNativeDisplayType getDefaultDisplay() {
return GetDC(); WinDisplay* dpy = new WinDisplay();
HWND hwnd = createDummyWindow();
HDC hdc = GetDC(hwnd);
dpy->setDefault(DisplayInfo(hdc,hwnd));
return static_cast<EGLNativeDisplayType>(dpy);
} }
bool releaseDisplay(EGLNativeDisplay dpy) {
return DeleteDC(dpy); void initPtrToWglFunctions(){
HWND hwnd = createDummyWindow();
HDC dpy = GetDC(hwnd);
if(!hwnd || !dpy){
fprintf(stderr,"error while getting DC\n");
return;
}
EGLNativeContextType ctx = NULL;
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};
int iPixelFormat,err;
iPixelFormat = ChoosePixelFormat(dpy, &pfd);
if(iPixelFormat < 0){
fprintf(stderr,"error while choosing pixel format\n");
return;
}
if(!SetPixelFormat(dpy,iPixelFormat,&pfd)){
int err = GetLastError();
fprintf(stderr,"error while setting pixel format 0x%x\n",err);
return;
}
ctx = wglCreateContext(dpy);
if(!ctx){
err = GetLastError();
printf("error while creating dummy context %d\n",err);
}
if(!wglMakeCurrent(dpy,ctx)){
err = GetLastError();
printf("error while making dummy context current %d\n",err);
}
if(!s_wglExtProcs){
s_wglExtProcs = new WglExtProcs();
s_wglExtProcs->wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)wglGetExtentionsProcAddress(dpy,"WGL_ARB_pixel_format","wglGetPixelFormatAttribivARB");
s_wglExtProcs->wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetExtentionsProcAddress(dpy,"WGL_ARB_pixel_format","wglPixelFormatARB");
s_wglExtProcs->wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)wglGetExtentionsProcAddress(dpy,"WGL_ARB_pbuffer","wglCreatePbufferARB");
s_wglExtProcs->wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)wglGetExtentionsProcAddress(dpy,"WGL_ARB_pbuffer","wglReleasePbufferDCARB");
s_wglExtProcs->wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)wglGetExtentionsProcAddress(dpy,"WGL_ARB_pbuffer","wglDestroyPbufferARB");
s_wglExtProcs->wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)wglGetExtentionsProcAddress(dpy,"WGL_ARB_pbuffer","wglGetPbufferDCARB");
s_wglExtProcs->wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)wglGetExtentionsProcAddress(dpy,"WGL_ARB_make_current_read","wglMakeContextCurrentARB");
s_wglExtProcs->wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetExtentionsProcAddress(dpy,"WGL_EXT_swap_control","wglSwapIntervalEXT");
}
wglMakeCurrent(dpy,NULL);
DestroyWindow(hwnd);
DeleteDC(dpy);
}
bool releaseDisplay(EGLNativeDisplayType dpy) {
dpy->releaseAll();
return true;
} }
EglConfig* pixelFormatToConfig(EGLNativeDisplayType dpy,EGLNativePixelFormatType* frmt,int index){ EglConfig* pixelFormatToConfig(EGLNativeDisplayType display,EGLNativePixelFormatType* frmt,int index){
int supportedSurfaces,visualType,visualId; EGLint red,green,blue,alpha,depth,stencil;
int caveat,transparentType,samples; EGLint supportedSurfaces,visualType,visualId;
int tRed,tGreen,tBlue; EGLint transparentType,samples;
int pMaxWidth,pMaxHeight,pMaxPixels; EGLint tRed,tGreen,tBlue;
int configId,level,renderable; EGLint pMaxWidth,pMaxHeight,pMaxPixels;
bool window,bitmap,pbuffer,transparent; EGLint configId,level;
EGLint window,bitmap,pbuffer,transparent;
HDC dpy = display->getCurrentDC();
if(frmt->iPixelType != PFD_TYPE_RGBA) return NULL; // other formats are not supported yet if(frmt->iPixelType != PFD_TYPE_RGBA) return NULL; // other formats are not supported yet
if(!((frmt->dwFlags & PFD_SUPPORT_OPENGL) && (frmt->dwFlags & PFD_DOUBLEBUFFER))) return NULL; //pixel format does not supports opengl or double buffer
int attribs [] = {
WGL_DRAW_TO_WINDOW_ARB,
WGL_DRAW_TO_BITMAP_ARB,
WGL_DRAW_TO_PBUFFER_ARB,
WGL_TRANSPARENT_ARB,
WGL_TRANSPARENT_RED_VALUE_ARB,
WGL_TRANSPARENT_GREEN_VALUE_ARB,
WGL_TRANSPARENT_BLUE_VALUE_ARB
};
supportedSurfaces = 0; supportedSurfaces = 0;
IS_TRUE(wglGetPixelFormatAttribivARB(dpy,index,0,1,WGL_DRAW_TO_WINDOW_ARB,&window)); if(!s_wglExtProcs->wglGetPixelFormatAttribivARB) return NULL;
IS_TRUE(wglGetPixelFormatAttribivARB(dpy,index,0,1,WGL_DRAW_TO_BITMAP_ARB,&bitmap));
IS_TRUE(wglGetPixelFormatAttribivARB(dpy,index,0,1,WGL_DRAW_TO_PBUFFER_ARB,&pbuffer)); IS_TRUE(s_wglExtProcs->wglGetPixelFormatAttribivARB(dpy,index,0,1,&attribs[0],&window));
IS_TRUE(s_wglExtProcs->wglGetPixelFormatAttribivARB(dpy,index,0,1,&attribs[1],&bitmap));
IS_TRUE(s_wglExtProcs->wglGetPixelFormatAttribivARB(dpy,index,0,1,&attribs[2],&pbuffer));
if(window) supportedSurfaces |= EGL_WINDOW_BIT; if(window) supportedSurfaces |= EGL_WINDOW_BIT;
if(bitmap) supportedSurfaces |= EGL_PIXMAP_BIT; if(bitmap) supportedSurfaces |= EGL_PIXMAP_BIT;
if(pbuffer) supportedSurfaces |= EGL_PBUFFER_BIT; if(pbuffer) supportedSurfaces |= EGL_PBUFFER_BIT;
//default values if(!supportedSurfaces) return NULL;
visualId = 0;
visualType = EGL_NONE;
caveat = EGL_NONE;
pMaxWidth = PBUFFER_MAX_WIDTH;
pMaxHeight = PBUFFER_MAX_HEIGHT;
pMaxPixels = PBUFFER_MAX_PIXELS;
samples = 0 ;
level = 0 ;
renderable = EGL_FALSE;
IS_TRUE(wglGetPixelFormatAttribivARB(dpy,index,0,1,WGL_TRANSPARENT_ARB,&transparent)); //default values
visualId = 0;
visualType = EGL_NONE;
EGLenum caveat = EGL_NONE;
EGLBoolean renderable = EGL_FALSE;
pMaxWidth = PBUFFER_MAX_WIDTH;
pMaxHeight = PBUFFER_MAX_HEIGHT;
pMaxPixels = PBUFFER_MAX_PIXELS;
samples = 0 ;
level = 0 ;
IS_TRUE(s_wglExtProcs->wglGetPixelFormatAttribivARB(dpy,index,0,1,&attribs[3],&transparent));
if(transparent) { if(transparent) {
transparentType = EGL_TRANSPARENT_RGB; transparentType = EGL_TRANSPARENT_RGB;
IS_TRUE(wglGetPixelFormatAttribivARB(dpy,index,0,1,WGL_TRANSPARENT_RED_VALUE_ARB,&tRed)); IS_TRUE(s_wglExtProcs->wglGetPixelFormatAttribivARB(dpy,index,0,1,&attribs[4],&tRed));
IS_TRUE(wglGetPixelFormatAttribivARB(dpy,index,0,1,WGL_TRANSPARENT_GREEN_VALUE_ARB,&tGreen)); IS_TRUE(s_wglExtProcs->wglGetPixelFormatAttribivARB(dpy,index,0,1,&attribs[5],&tGreen));
IS_TRUE(wglGetPixelFormatAttribivARB(dpy,index,0,1,WGL_TRANSPARENT_BLUE_VALUE_ARB,&tBlue)); IS_TRUE(s_wglExtProcs->wglGetPixelFormatAttribivARB(dpy,index,0,1,&attribs[6],&tBlue));
} else { } else {
transparentType = EGL_NONE; transparentType = EGL_NONE;
} }
return new EglConfig(frmt->cRedBits,frmt->cGreenBits,frmt->cBlueBits,frmt->cAlphaBits,caveat, red = frmt->cRedBits;
index,frmt->cDepthBits,level,pMaxWidth,pMaxHeight,pMaxPixels,renderable, green = frmt->cGreenBits;
visualId,visualType,samples,frmt->cStencilBits,supportedSurfaces,transparentType,tRed,tGreen,tBlue,frmt); blue = frmt->cBlueBits;
alpha = frmt->cAlphaBits;
depth = frmt->cDepthBits;
stencil = frmt->cStencilBits;
return new EglConfig(red,green,blue,alpha,caveat,(EGLint)index,depth,level,pMaxWidth,pMaxHeight,pMaxPixels,renderable,
visualId,visualType,samples,stencil,supportedSurfaces,transparentType,tRed,tGreen,tBlue,*frmt);
} }
void queryConfigs(EGLNativeDisplayType dpy,ConfigList& listOut) {
void queryConfigs(EGLNativeDisplayType display,ConfigsList& listOut) {
PIXELFORMATDESCRIPTOR pfd; PIXELFORMATDESCRIPTOR pfd;
int iPixelFormat = 1; int iPixelFormat = 1;
HDC dpy = display->getCurrentDC();
//quering num of formats //quering num of formats
nFormats = DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd); int nFormats = DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd);
EglConfig* p = pixelFormatToConfig(dpy,&pfd,iPixelFormat);
//inserting first format
if(p) listOut.push_front(p);
//inserting rest of formats //inserting rest of formats
for(iPixelFormat++;iPixelFormat < nFormats; iPixelFormat++) { for(iPixelFormat;iPixelFormat < nFormats; iPixelFormat++) {
DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd); DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd);
EglConfig* pConfig = pixelFormatToConfig(dpy,&pfd,iPixelFormat); EglConfig* pConfig = pixelFormatToConfig(display,&pfd,iPixelFormat);
if(pConfig) listOut.push_front(pConfig); if(pConfig) listOut.push_back(pConfig);
} }
} }
bool validNativeWin(EGLNativeDisplayType dpy, EGLNativeWindowType win) { bool validNativeWin(EGLNativeDisplayType dpy,EGLNativeWindowType win) {
return IsWindow(win); return IsWindow(win);
} }
bool validNativePixmap(EGLNativeDisplayType dpy, EGLNativePixmapType pix) { bool validNativePixmap(EGLNativeDisplayType dpy,EGLNativePixmapType pix) {
BITMAP bm; BITMAP bm;
return GetObject(pix, sizeof(BITMAP), (LPSTR)&bm); return GetObject(pix, sizeof(BITMAP), (LPSTR)&bm);
} }
static bool setPixelFormat(EGLNativeDisplayType dpy,EglConfig* cfg) { static bool setPixelFormat(HDC dc,EglConfig* cfg) {
int iPixelFormat = ChoosePixelFormat(dpy,cfg->nativeConfig()); EGLNativePixelFormatType frmt = cfg->nativeConfig();
int iPixelFormat = ChoosePixelFormat(dc,&frmt);
if(!iPixelFormat) return false; if(!iPixelFormat) return false;
if(!SetPixelFormat(dpy,iPixelFormat,cfg->nativeConfig())) return false; return SetPixelFormat(dc,iPixelFormat,&frmt);
return true;
} }
bool checkWindowPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativeWindowType win,EglConfig* cfg,unsigned int* width,unsigned int* height) { bool checkWindowPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativeWindowType win,EglConfig* cfg,unsigned int* width,unsigned int* height) {
RECT r; RECT r;
if(!GetClientRect(win,&r)) return false; if(!GetClientRect(win,&r)) return false;
*width = r.right - r.left; *width = r.right - r.left;
*height = r.bottom - r.top; *height = r.bottom - r.top;
HDC dc = GetDC(win);
return setPixelFormat(dpy,cfg); bool ret = setPixelFormat(dc,cfg);
DeleteDC(dc);
return ret;
} }
bool checkPixmapPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativePixmapType pix,EglConfig* cfg) { bool checkPixmapPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativePixmapType pix,EglConfig* cfg,unsigned int* width,unsigned int* height){
BITMAP bm; BITMAP bm;
if(!GetObject(pix, sizeof(BITMAP), (LPSTR)&bm)) return false; if(!GetObject(pix, sizeof(BITMAP), (LPSTR)&bm)) return false;
@@ -147,24 +347,24 @@ bool checkPixmapPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativePixmapType pi
*width = bm.bmWidth; *width = bm.bmWidth;
*height = bm.bmHeight; *height = bm.bmHeight;
return setPixelFormat(dpy,cfg); return true;
} }
EGLNativePbufferType createPbuffer(EGLNativeDisplayType dpy,EglConfig* cfg,EglPbSurface* pbSurface) { EGLNativePbufferType createPbuffer(EGLNativeDisplayType display,EglConfig* cfg,EglPbufferSurface* pbSurface) {
//converting configuration into WGL pixel Format //converting configuration into WGL pixel Format
EGLint red,green,blue,alpha,depth,stencil; EGLint red,green,blue,alpha,depth,stencil;
bool gotAttribs = getConfAttrib(EGL_RED_SIZE,&red) && bool gotAttribs = cfg->getConfAttrib(EGL_RED_SIZE,&red) &&
getConfAttrib(EGL_GREEN_SIZE,&green) && cfg->getConfAttrib(EGL_GREEN_SIZE,&green) &&
getConfAttrib(EGL_BLUE_SIZE,&blue) && cfg->getConfAttrib(EGL_BLUE_SIZE,&blue) &&
getConfAttrib(EGL_ALPHA_SIZE,&alpha) && cfg->getConfAttrib(EGL_ALPHA_SIZE,&alpha) &&
getConfAttrib(EGL_DEPTH_SIZE,&depth) && cfg->getConfAttrib(EGL_DEPTH_SIZE,&depth) &&
getConfAttrib(EGL_STENCIL_SIZE,&stencil) ; cfg->getConfAttrib(EGL_STENCIL_SIZE,&stencil) ;
if(!gotAttribs) return false; if(!gotAttribs) return false;
int wglPixelFormatAttribs[] = { int wglPixelFormatAttribs[] = {
WGL_SUPPORT_OPENGL_ARB ,TRUE, WGL_SUPPORT_OPENGL_ARB ,TRUE,
WGL_DRAW_TO_BUFFER_ARB ,TRUE, WGL_DRAW_TO_PBUFFER_ARB ,TRUE,
WGL_BIND_TO_TEXTURE_RGBA_ARB ,TRUE, WGL_BIND_TO_TEXTURE_RGBA_ARB ,TRUE,
WGL_COLOR_BITS_ARB ,red+green+blue, WGL_COLOR_BITS_ARB ,red+green+blue,
WGL_RED_BITS_ARB ,red, WGL_RED_BITS_ARB ,red,
@@ -177,9 +377,10 @@ EGLNativePbufferType createPbuffer(EGLNativeDisplayType dpy,EglConfig* cfg,EglPb
0 0
}; };
HDC dpy = display->getCurrentDC();
int pixfmt; int pixfmt;
unsigned int numpf; unsigned int numpf;
if(!wglChoosePixelFormatARB(dpy,wglPixelFormatAttribs, NULL, 1, &pixfmt, &numpf)) { if(!s_wglExtProcs->wglChoosePixelFormatARB || !s_wglExtProcs->wglChoosePixelFormatARB(dpy,wglPixelFormatAttribs, NULL, 1, &pixfmt, &numpf)) {
DWORD err = GetLastError(); DWORD err = GetLastError();
return NULL; return NULL;
} }
@@ -197,17 +398,17 @@ EGLNativePbufferType createPbuffer(EGLNativeDisplayType dpy,EglConfig* cfg,EglPb
wglTexFormat = WGL_TEXTURE_RGB_ARB; wglTexFormat = WGL_TEXTURE_RGB_ARB;
break; break;
case EGL_TEXTURE_RGBA: case EGL_TEXTURE_RGBA:
wglTexFormat = WGL_TEXTURE_RGB_ARBA; wglTexFormat = WGL_TEXTURE_RGBA_ARB;
break; break;
} }
int pbAttribs[] = { int pbAttribs[] = {
WGL_TEXTURE_TARGET_ARB ,wglTexTarget, WGL_TEXTURE_TARGET_ARB ,wglTexTarget,
WGL_TEXTURE_FORMAT_ARB ,wglTexFormat, WGL_TEXTURE_FORMAT_ARB ,wglTexFormat,
WGL_TEXTURE_LARGEST_ARB ,largest,
0 0
}; };
EGLNativePbufferType pb = wglCreatePbufferARB(dpy,pixfmt,width,height,pbAttribs); if(!s_wglExtProcs->wglCreatePbufferARB) return NULL;
EGLNativePbufferType pb = s_wglExtProcs->wglCreatePbufferARB(dpy,pixfmt,width,height,pbAttribs);
if(!pb) { if(!pb) {
DWORD err = GetLastError(); DWORD err = GetLastError();
return NULL; return NULL;
@@ -215,20 +416,30 @@ EGLNativePbufferType createPbuffer(EGLNativeDisplayType dpy,EglConfig* cfg,EglPb
return pb; return pb;
} }
bool releasePbuffer(EGLNativeDisplayType dis,EGLNativePbufferType pb) { bool releasePbuffer(EGLNativeDisplayType display,EGLNativePbufferType pb) {
if(wglReleasePbufferDCARB(pb,dis) || wglDestroyPbufferArb(pb)){ HDC dis = display->getCurrentDC();
if(!s_wglExtProcs->wglReleasePbufferDCARB || !s_wglExtProcs->wglDestroyPbufferARB) return false;
if(!s_wglExtProcs->wglReleasePbufferDCARB(pb,dis) || !s_wglExtProcs->wglDestroyPbufferARB(pb)){
DWORD err = GetLastError(); DWORD err = GetLastError();
return false; return false;
} }
return true; return true;
} }
EGLNativeContextType createContext(EGLNativeDisplayType dpy,EglConfig* cfg,EGLNativeContextType sharedContext) { EGLNativeContextType createContext(EGLNativeDisplayType display,EglConfig* cfg,EGLNativeContextType sharedContext) {
EGLNativeContextType ctx = NULL; EGLNativeContextType ctx = NULL;
HWND hwnd = createDummyWindow();
HDC dpy = GetDC(hwnd);
display->setCurrent(cfg->id(),DisplayInfo(dpy,hwnd));
if(!display->isCurrentPixelFormatSet()){
if(!setPixelFormat(dpy,cfg)) return NULL;
display->currentPixelFormatWasSet();
}
if(!setPixelFormat(dpy,cfg)) return NULL;
ctx = wglCreateContext(dpy); ctx = wglCreateContext(dpy);
if(ctx && sharedContext) { if(ctx && sharedContext) {
if(!wglShareLists(sharedContext,ctx)) { if(!wglShareLists(sharedContext,ctx)) {
wglDeleteContext(ctx); wglDeleteContext(ctx);
@@ -246,16 +457,61 @@ bool destroyContext(EGLNativeDisplayType dpy,EGLNativeContextType ctx) {
return true; return true;
} }
bool makeCurrent(EGLNativeDisplayType dpy,EglSurface* read,EglSurface* draw,EGLNativeContextType ctx) {
return ctx ? :wglMakeCurrent(dpy,NULL): wglMakeContextCurrentARB(dpy,draw->native(),read->native());
HDC getSurfaceDC(EGLNativeDisplayType dpy,EglSurface* srfc){
switch(srfc->type()){
case EglSurface::WINDOW:
return GetDC(static_cast<EGLNativeWindowType>(srfc->native()));
case EglSurface::PBUFFER:
if(!s_wglExtProcs->wglGetPbufferDCARB) return NULL;
return s_wglExtProcs->wglGetPbufferDCARB(static_cast<EGLNativePbufferType>(srfc->native()));
case EglSurface::PIXMAP: //not supported;
default:
return NULL;
}
} }
void swapBuffers(EGLNativeDisplayType dpy,EGLNativeWindowType win) { bool releaseSurfaceDC(EGLNativeDisplayType dpy,HDC dc,EglSurface*srfc){
if(!SwapBuffers(dpy)) { switch(srfc->type()){
case EglSurface::WINDOW:
ReleaseDC(static_cast<EGLNativeWindowType>(srfc->native()),dc);
return true;
case EglSurface::PBUFFER:
if(!s_wglExtProcs->wglReleasePbufferDCARB) return false;
s_wglExtProcs->wglReleasePbufferDCARB(static_cast<EGLNativePbufferType>(srfc->native()),dc);
return true;
case EglSurface::PIXMAP: //not supported;
default:
return false;
}
}
bool makeCurrent(EGLNativeDisplayType display,EglSurface* read,EglSurface* draw,EGLNativeContextType ctx) {
HDC hdcRead = getSurfaceDC(display,read);
HDC hdcDraw = getSurfaceDC(display,draw);
bool retVal = false;
if(!s_wglExtProcs->wglMakeContextCurrentARB ){
if(hdcRead == hdcDraw){
return wglMakeCurrent(hdcDraw,ctx);
}
if(!hdcRead || !hdcDraw) return false;
}
retVal = s_wglExtProcs->wglMakeContextCurrentARB(hdcDraw,hdcRead,ctx);
releaseSurfaceDC(display,hdcRead,read);
releaseSurfaceDC(display,hdcDraw,draw);
return retVal;
}
void swapBuffers(EGLNativeDisplayType display,EGLNativeWindowType win) {
HDC dc = GetDC(win);
if(!SwapBuffers(dc)) {
DWORD err = GetLastError(); DWORD err = GetLastError();
} }
ReleaseDC(win,dc);
} }
@@ -264,15 +520,9 @@ void waitNative(){}
void swapInterval(EGLNativeDisplayType dpy,EGLNativeWindowType win,int interval) { void swapInterval(EGLNativeDisplayType dpy,EGLNativeWindowType win,int interval) {
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL; if (s_wglExtProcs->wglSwapIntervalEXT){
s_wglExtProcs->wglSwapIntervalEXT(interval);
if (WGLExtensionSupported("WGL_EXT_swap_control"))
{
// Extension is supported, init pointers.
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) LogGetProcAddress("wglSwapIntervalEXT");
} }
wglSwapIntervalEXT(interval);
} }
}; };

View File

@@ -15,6 +15,7 @@
*/ */
#include "GLDispatch.h" #include "GLDispatch.h"
#include <stdio.h> #include <stdio.h>
#include <OpenglOsUtils/osDynLibrary.h>
#ifdef __linux__ #ifdef __linux__
#include <GL/glx.h> #include <GL/glx.h>
@@ -25,17 +26,24 @@
typedef void (*GL_FUNC_PTR)(); typedef void (*GL_FUNC_PTR)();
static GL_FUNC_PTR getGLFuncAddress(const char *funcName) { static GL_FUNC_PTR getGLFuncAddress(const char *funcName) {
GL_FUNC_PTR ret = NULL;
#ifdef __linux__ #ifdef __linux__
return (GL_FUNC_PTR)glXGetProcAddress((const GLubyte*)funcName); static osUtils::dynLibrary* libGL = osUtils::dynLibrary::open("libGL.so");
ret = (GL_FUNC_PTR)glXGetProcAddress((const GLubyte*)funcName);
#elif defined(WIN32) #elif defined(WIN32)
return (GL_FUNC_PTR)wglGetProcAddress(funcName); static osUtils::dynLibrary* libGL = osUtils::dynLibrary::open("opengl32");
ret = (GL_FUNC_PTR)wglGetProcAddress(funcName);
#endif #endif
if(!ret && libGL){
ret = libGL->findSymbol(funcName);
}
return ret;
} }
#define LOAD_GL_FUNC(name) { void * funcAddrs = NULL; \ #define LOAD_GL_FUNC(name) { void * funcAddrs = NULL; \
funcAddrs = (void *)getGLFuncAddress(#name); \ funcAddrs = (void *)getGLFuncAddress(#name); \
if(funcAddrs) \ if(funcAddrs) \
*(void**)(&name) = funcAddrs; \ *(void**)(&name) = funcAddrs; \
else \ else \
fprintf(stderr,"could not load func %s\n",#name); } fprintf(stderr,"could not load func %s\n",#name); }
@@ -46,7 +54,6 @@ void GLDispatch::dispatchFuncs() {
android::Mutex::Autolock mutex(m_lock); android::Mutex::Autolock mutex(m_lock);
if(m_isLoaded) if(m_isLoaded)
return; return;
LOAD_GL_FUNC(glActiveTexture); LOAD_GL_FUNC(glActiveTexture);
LOAD_GL_FUNC(glAlphaFunc); LOAD_GL_FUNC(glAlphaFunc);
LOAD_GL_FUNC(glBegin); LOAD_GL_FUNC(glBegin);

View File

@@ -13,6 +13,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifdef _WIN32
#undef GL_API
#define GL_API __declspec(dllexport)
#endif
#include <stdio.h> #include <stdio.h>
#include "GLDispatch.h" #include "GLDispatch.h"
#include "GLEScontext.h" #include "GLEScontext.h"
@@ -27,13 +32,6 @@
#include <GLES/glext.h> #include <GLES/glext.h>
#include <cmath> #include <cmath>
extern "C" { extern "C" {
//decleration //decleration
@@ -55,13 +53,15 @@ static ExtentionDescriptor s_glesExtentions[] = {
{"glEGLImageTargetTexture2DOES",(__translatorMustCastToProperFunctionPointerType)glEGLImageTargetTexture2DOES} {"glEGLImageTargetTexture2DOES",(__translatorMustCastToProperFunctionPointerType)glEGLImageTargetTexture2DOES}
}; };
/****************************************************************************************************************/ /****************************************************************************************************************/
typedef void(*FUNCPTR)();
static EGLiface* s_eglIface = NULL; static EGLiface* s_eglIface = NULL;
static GLESiface s_glesIface = { static GLESiface s_glesIface = {
createGLESContext:createGLESContext, createGLESContext:createGLESContext,
initContext :initContext, initContext :initContext,
deleteGLESContext:deleteGLESContext, deleteGLESContext:deleteGLESContext,
flush :glFlush, flush :(FUNCPTR)glFlush,
finish :glFinish, finish :(FUNCPTR)glFinish,
setShareGroup :setShareGroup, setShareGroup :setShareGroup,
getProcAddress :getProcAddress getProcAddress :getProcAddress
}; };
@@ -94,7 +94,7 @@ static __translatorMustCastToProperFunctionPointerType getProcAddress(const char
} }
return NULL; return NULL;
} }
GLESiface* __translator_getIfaces(EGLiface* eglIface){ GL_API GLESiface* __translator_getIfaces(EGLiface* eglIface){
s_eglIface = eglIface; s_eglIface = eglIface;
return & s_glesIface; return & s_glesIface;
} }
@@ -113,12 +113,14 @@ GLESiface* __translator_getIfaces(EGLiface* eglIface){
#define GET_CTX() \ #define GET_CTX() \
GET_THREAD(); \ GET_THREAD(); \
if(!thrd) return; \ if(!thrd) return; \
GLEScontext *ctx = static_cast<GLEScontext*>(thrd->glesContext); GLEScontext *ctx = static_cast<GLEScontext*>(thrd->glesContext); \
if(!ctx) return;
#define GET_CTX_RET(failure_ret) \ #define GET_CTX_RET(failure_ret) \
GET_THREAD(); \ GET_THREAD(); \
if(!thrd) return failure_ret; \ if(!thrd) return failure_ret; \
GLEScontext *ctx = static_cast<GLEScontext*>(thrd->glesContext); GLEScontext *ctx = static_cast<GLEScontext*>(thrd->glesContext); \
if(!ctx) return failure_ret;
#define SET_ERROR_IF(condition,err) if((condition)) { \ #define SET_ERROR_IF(condition,err) if((condition)) { \

View File

@@ -65,13 +65,21 @@
#define WIN32_LEAN_AND_MEAN 1 #define WIN32_LEAN_AND_MEAN 1
#endif #endif
#include <windows.h> #include <windows.h>
#include <GL/gl.h>
#define WGL_WGLEXT_PROTOTYPES
#include <GL/wglext.h>
typedef PIXELFORMATDESCRIPTOR EGLNativePixelFormatType; class WinDisplay; //defined in EglWindows.cpp
typedef HGLRC EGLNativeContextType; typedef WinDisplay* DISPLAY;
typedef HPBUFFERARB EGLNativePbufferType;
typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType; typedef PIXELFORMATDESCRIPTOR EGLNativePixelFormatType;
typedef HWND EGLNativeWindowType; #define PIXEL_FORMAT_INITIALIZER {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
typedef HGLRC EGLNativeContextType;
typedef HPBUFFERARB EGLNativePbufferType;
typedef DISPLAY EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
typedef HWND EGLNativeWindowType;
#elif defined(__APPLE__) #elif defined(__APPLE__)
@@ -91,6 +99,7 @@ typedef int EGLNativeWindowType;
#include <X11/Xutil.h> #include <X11/Xutil.h>
typedef GLXFBConfig EGLNativePixelFormatType; typedef GLXFBConfig EGLNativePixelFormatType;
#define PIXEL_FORMAT_INITIALIZER 0;
typedef GLXContext EGLNativeContextType; typedef GLXContext EGLNativeContextType;
typedef GLXPbuffer EGLNativePbufferType; typedef GLXPbuffer EGLNativePbufferType;
typedef Display * EGLNativeDisplayType; typedef Display * EGLNativeDisplayType;

View File

@@ -0,0 +1,901 @@
#ifndef __wglext_h_
#define __wglext_h_
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
/*************************************************************/
/* Header file version number */
/* wglext.h last updated 2010/08/06 */
/* Current version at http://www.opengl.org/registry/ */
#define WGL_WGLEXT_VERSION 22
#ifndef WGL_ARB_buffer_region
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
#endif
#ifndef WGL_ARB_multisample
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
#endif
#ifndef WGL_ARB_extensions_string
#endif
#ifndef WGL_ARB_pixel_format
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
#define WGL_ACCELERATION_ARB 0x2003
#define WGL_NEED_PALETTE_ARB 0x2004
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
#define WGL_SWAP_METHOD_ARB 0x2007
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
#define WGL_TRANSPARENT_ARB 0x200A
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
#define WGL_SHARE_DEPTH_ARB 0x200C
#define WGL_SHARE_STENCIL_ARB 0x200D
#define WGL_SHARE_ACCUM_ARB 0x200E
#define WGL_SUPPORT_GDI_ARB 0x200F
#define WGL_SUPPORT_OPENGL_ARB 0x2010
#define WGL_DOUBLE_BUFFER_ARB 0x2011
#define WGL_STEREO_ARB 0x2012
#define WGL_PIXEL_TYPE_ARB 0x2013
#define WGL_COLOR_BITS_ARB 0x2014
#define WGL_RED_BITS_ARB 0x2015
#define WGL_RED_SHIFT_ARB 0x2016
#define WGL_GREEN_BITS_ARB 0x2017
#define WGL_GREEN_SHIFT_ARB 0x2018
#define WGL_BLUE_BITS_ARB 0x2019
#define WGL_BLUE_SHIFT_ARB 0x201A
#define WGL_ALPHA_BITS_ARB 0x201B
#define WGL_ALPHA_SHIFT_ARB 0x201C
#define WGL_ACCUM_BITS_ARB 0x201D
#define WGL_ACCUM_RED_BITS_ARB 0x201E
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
#define WGL_DEPTH_BITS_ARB 0x2022
#define WGL_STENCIL_BITS_ARB 0x2023
#define WGL_AUX_BUFFERS_ARB 0x2024
#define WGL_NO_ACCELERATION_ARB 0x2025
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
#define WGL_FULL_ACCELERATION_ARB 0x2027
#define WGL_SWAP_EXCHANGE_ARB 0x2028
#define WGL_SWAP_COPY_ARB 0x2029
#define WGL_SWAP_UNDEFINED_ARB 0x202A
#define WGL_TYPE_RGBA_ARB 0x202B
#define WGL_TYPE_COLORINDEX_ARB 0x202C
#endif
#ifndef WGL_ARB_make_current_read
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
#endif
#ifndef WGL_ARB_pbuffer
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
#define WGL_PBUFFER_LARGEST_ARB 0x2033
#define WGL_PBUFFER_WIDTH_ARB 0x2034
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
#define WGL_PBUFFER_LOST_ARB 0x2036
#endif
#ifndef WGL_ARB_render_texture
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
#define WGL_TEXTURE_FORMAT_ARB 0x2072
#define WGL_TEXTURE_TARGET_ARB 0x2073
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
#define WGL_TEXTURE_RGB_ARB 0x2075
#define WGL_TEXTURE_RGBA_ARB 0x2076
#define WGL_NO_TEXTURE_ARB 0x2077
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
#define WGL_TEXTURE_1D_ARB 0x2079
#define WGL_TEXTURE_2D_ARB 0x207A
#define WGL_MIPMAP_LEVEL_ARB 0x207B
#define WGL_CUBE_MAP_FACE_ARB 0x207C
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
#define WGL_FRONT_LEFT_ARB 0x2083
#define WGL_FRONT_RIGHT_ARB 0x2084
#define WGL_BACK_LEFT_ARB 0x2085
#define WGL_BACK_RIGHT_ARB 0x2086
#define WGL_AUX0_ARB 0x2087
#define WGL_AUX1_ARB 0x2088
#define WGL_AUX2_ARB 0x2089
#define WGL_AUX3_ARB 0x208A
#define WGL_AUX4_ARB 0x208B
#define WGL_AUX5_ARB 0x208C
#define WGL_AUX6_ARB 0x208D
#define WGL_AUX7_ARB 0x208E
#define WGL_AUX8_ARB 0x208F
#define WGL_AUX9_ARB 0x2090
#endif
#ifndef WGL_ARB_pixel_format_float
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
#endif
#ifndef WGL_ARB_framebuffer_sRGB
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
#endif
#ifndef WGL_ARB_create_context
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
#define WGL_CONTEXT_FLAGS_ARB 0x2094
#define ERROR_INVALID_VERSION_ARB 0x2095
#endif
#ifndef WGL_ARB_create_context_profile
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
#define ERROR_INVALID_PROFILE_ARB 0x2096
#endif
#ifndef WGL_ARB_create_context_robustness
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
#endif
#ifndef WGL_EXT_make_current_read
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
#endif
#ifndef WGL_EXT_pixel_format
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
#define WGL_ACCELERATION_EXT 0x2003
#define WGL_NEED_PALETTE_EXT 0x2004
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
#define WGL_SWAP_METHOD_EXT 0x2007
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
#define WGL_TRANSPARENT_EXT 0x200A
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
#define WGL_SHARE_DEPTH_EXT 0x200C
#define WGL_SHARE_STENCIL_EXT 0x200D
#define WGL_SHARE_ACCUM_EXT 0x200E
#define WGL_SUPPORT_GDI_EXT 0x200F
#define WGL_SUPPORT_OPENGL_EXT 0x2010
#define WGL_DOUBLE_BUFFER_EXT 0x2011
#define WGL_STEREO_EXT 0x2012
#define WGL_PIXEL_TYPE_EXT 0x2013
#define WGL_COLOR_BITS_EXT 0x2014
#define WGL_RED_BITS_EXT 0x2015
#define WGL_RED_SHIFT_EXT 0x2016
#define WGL_GREEN_BITS_EXT 0x2017
#define WGL_GREEN_SHIFT_EXT 0x2018
#define WGL_BLUE_BITS_EXT 0x2019
#define WGL_BLUE_SHIFT_EXT 0x201A
#define WGL_ALPHA_BITS_EXT 0x201B
#define WGL_ALPHA_SHIFT_EXT 0x201C
#define WGL_ACCUM_BITS_EXT 0x201D
#define WGL_ACCUM_RED_BITS_EXT 0x201E
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
#define WGL_DEPTH_BITS_EXT 0x2022
#define WGL_STENCIL_BITS_EXT 0x2023
#define WGL_AUX_BUFFERS_EXT 0x2024
#define WGL_NO_ACCELERATION_EXT 0x2025
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
#define WGL_FULL_ACCELERATION_EXT 0x2027
#define WGL_SWAP_EXCHANGE_EXT 0x2028
#define WGL_SWAP_COPY_EXT 0x2029
#define WGL_SWAP_UNDEFINED_EXT 0x202A
#define WGL_TYPE_RGBA_EXT 0x202B
#define WGL_TYPE_COLORINDEX_EXT 0x202C
#endif
#ifndef WGL_EXT_pbuffer
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
#define WGL_PBUFFER_LARGEST_EXT 0x2033
#define WGL_PBUFFER_WIDTH_EXT 0x2034
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
#endif
#ifndef WGL_EXT_depth_float
#define WGL_DEPTH_FLOAT_EXT 0x2040
#endif
#ifndef WGL_3DFX_multisample
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
#define WGL_SAMPLES_3DFX 0x2061
#endif
#ifndef WGL_EXT_multisample
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
#define WGL_SAMPLES_EXT 0x2042
#endif
#ifndef WGL_I3D_digital_video_control
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
#endif
#ifndef WGL_I3D_gamma
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
#endif
#ifndef WGL_I3D_genlock
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
#endif
#ifndef WGL_I3D_image_buffer
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
#endif
#ifndef WGL_I3D_swap_frame_lock
#endif
#ifndef WGL_NV_render_depth_texture
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
#define WGL_DEPTH_COMPONENT_NV 0x20A7
#endif
#ifndef WGL_NV_render_texture_rectangle
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
#endif
#ifndef WGL_ATI_pixel_format_float
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
#endif
#ifndef WGL_NV_float_buffer
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
#endif
#ifndef WGL_3DL_stereo_control
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
#endif
#ifndef WGL_EXT_pixel_format_packed_float
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
#endif
#ifndef WGL_EXT_framebuffer_sRGB
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
#endif
#ifndef WGL_NV_present_video
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
#endif
#ifndef WGL_NV_video_out
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
#define WGL_VIDEO_OUT_FRAME 0x20C8
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
#endif
#ifndef WGL_NV_swap_group
#endif
#ifndef WGL_NV_gpu_affinity
#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
#endif
#ifndef WGL_AMD_gpu_association
#define WGL_GPU_VENDOR_AMD 0x1F00
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
#define WGL_GPU_RAM_AMD 0x21A3
#define WGL_GPU_CLOCK_AMD 0x21A4
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
#define WGL_GPU_NUM_RB_AMD 0x21A7
#define WGL_GPU_NUM_SPI_AMD 0x21A8
#endif
#ifndef WGL_NV_video_capture
#define WGL_UNIQUE_ID_NV 0x20CE
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
#endif
#ifndef WGL_NV_copy_image
#endif
#ifndef WGL_NV_multisample_coverage
#define WGL_COVERAGE_SAMPLES_NV 0x2042
#define WGL_COLOR_SAMPLES_NV 0x20B9
#endif
#ifndef WGL_EXT_create_context_es2_profile
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
#endif
/*************************************************************/
#ifndef WGL_ARB_pbuffer
DECLARE_HANDLE(HPBUFFERARB);
#endif
#ifndef WGL_EXT_pbuffer
DECLARE_HANDLE(HPBUFFEREXT);
#endif
#ifndef WGL_NV_present_video
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
#endif
#ifndef WGL_NV_video_output
DECLARE_HANDLE(HPVIDEODEV);
#endif
#ifndef WGL_NV_gpu_affinity
DECLARE_HANDLE(HPGPUNV);
DECLARE_HANDLE(HGPUNV);
typedef struct _GPU_DEVICE {
DWORD cb;
CHAR DeviceName[32];
CHAR DeviceString[128];
DWORD Flags;
RECT rcVirtualScreen;
} GPU_DEVICE, *PGPU_DEVICE;
#endif
#ifndef WGL_NV_video_capture
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
#endif
#ifndef WGL_ARB_buffer_region
#define WGL_ARB_buffer_region 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
#endif
#ifndef WGL_ARB_multisample
#define WGL_ARB_multisample 1
#endif
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
#endif
#ifndef WGL_ARB_pixel_format
#define WGL_ARB_pixel_format 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
#ifndef WGL_ARB_make_current_read
#define WGL_ARB_make_current_read 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
extern HDC WINAPI wglGetCurrentReadDCARB (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
#endif
#ifndef WGL_ARB_pbuffer
#define WGL_ARB_pbuffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
#endif
#ifndef WGL_ARB_render_texture
#define WGL_ARB_render_texture 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
#endif
#ifndef WGL_ARB_pixel_format_float
#define WGL_ARB_pixel_format_float 1
#endif
#ifndef WGL_ARB_framebuffer_sRGB
#define WGL_ARB_framebuffer_sRGB 1
#endif
#ifndef WGL_ARB_create_context
#define WGL_ARB_create_context 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
#endif
#ifndef WGL_ARB_create_context_profile
#define WGL_ARB_create_context_profile 1
#endif
#ifndef WGL_ARB_create_context_robustness
#define WGL_ARB_create_context_robustness 1
#endif
#ifndef WGL_EXT_display_color_table
#define WGL_EXT_display_color_table 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
#endif
#ifndef WGL_EXT_extensions_string
#define WGL_EXT_extensions_string 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern const char * WINAPI wglGetExtensionsStringEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
#endif
#ifndef WGL_EXT_make_current_read
#define WGL_EXT_make_current_read 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
#endif
#ifndef WGL_EXT_pbuffer
#define WGL_EXT_pbuffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
#endif
#ifndef WGL_EXT_pixel_format
#define WGL_EXT_pixel_format 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
#ifndef WGL_EXT_swap_control
#define WGL_EXT_swap_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglSwapIntervalEXT (int interval);
extern int WINAPI wglGetSwapIntervalEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
#endif
#ifndef WGL_EXT_depth_float
#define WGL_EXT_depth_float 1
#endif
#ifndef WGL_NV_vertex_array_range
#define WGL_NV_vertex_array_range 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
extern void WINAPI wglFreeMemoryNV (void *pointer);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
#endif
#ifndef WGL_3DFX_multisample
#define WGL_3DFX_multisample 1
#endif
#ifndef WGL_EXT_multisample
#define WGL_EXT_multisample 1
#endif
#ifndef WGL_OML_sync_control
#define WGL_OML_sync_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
#endif
#ifndef WGL_I3D_digital_video_control
#define WGL_I3D_digital_video_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
#endif
#ifndef WGL_I3D_gamma
#define WGL_I3D_gamma 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
#endif
#ifndef WGL_I3D_genlock
#define WGL_I3D_genlock 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
#endif
#ifndef WGL_I3D_image_buffer
#define WGL_I3D_image_buffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
#endif
#ifndef WGL_I3D_swap_frame_lock
#define WGL_I3D_swap_frame_lock 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnableFrameLockI3D (void);
extern BOOL WINAPI wglDisableFrameLockI3D (void);
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
#endif
#ifndef WGL_I3D_swap_frame_usage
#define WGL_I3D_swap_frame_usage 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
#endif
#ifndef WGL_ATI_pixel_format_float
#define WGL_ATI_pixel_format_float 1
#endif
#ifndef WGL_NV_float_buffer
#define WGL_NV_float_buffer 1
#endif
#ifndef WGL_3DL_stereo_control
#define WGL_3DL_stereo_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
#endif
#ifndef WGL_EXT_pixel_format_packed_float
#define WGL_EXT_pixel_format_packed_float 1
#endif
#ifndef WGL_EXT_framebuffer_sRGB
#define WGL_EXT_framebuffer_sRGB 1
#endif
#ifndef WGL_NV_present_video
#define WGL_NV_present_video 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
#endif
#ifndef WGL_NV_video_output
#define WGL_NV_video_output 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif
#ifndef WGL_NV_swap_group
#define WGL_NV_swap_group 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
#endif
#ifndef WGL_NV_gpu_affinity
#define WGL_NV_gpu_affinity 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
#endif
#ifndef WGL_AMD_gpu_association
#define WGL_AMD_gpu_association 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif
#ifndef WGL_NV_video_capture
#define WGL_NV_video_capture 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#endif
#ifndef WGL_NV_copy_image
#define WGL_NV_copy_image 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
#ifndef WGL_NV_multisample_coverage
#define WGL_NV_multisample_coverage 1
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -25,7 +25,9 @@ ifneq ($(HOST_OS),windows)
osThreadUnix.cpp \ osThreadUnix.cpp \
osDynLibrary.cpp osDynLibrary.cpp
else # windows LOCAL_LDLIBS := -ldl
else # !linux
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
osProcessWin.cpp \ osProcessWin.cpp \
@@ -34,11 +36,7 @@ else # windows
endif # windows endif # windows
ifneq (,$(LOCAL_SRC_FILES)) # do not build if host platform not supported
LOCAL_MODULE_TAGS := debug LOCAL_MODULE_TAGS := debug
LOCAL_MODULE := libOpenglOsUtils LOCAL_MODULE := libOpenglOsUtils
include $(BUILD_HOST_STATIC_LIBRARY) include $(BUILD_HOST_STATIC_LIBRARY)
endif

View File

@@ -52,7 +52,7 @@ childProcess::create(const char *p_cmdLine, const char *p_startdir)
// close the thread handle we do not need it, // close the thread handle we do not need it,
// keep the process handle for wait/trywait operations, will // keep the process handle for wait/trywait operations, will
// be closed on destruction // be closed on destruction
CloseHandle(m_proc.hThread); CloseHandle(child->m_proc.hThread);
return child; return child;
} }
@@ -60,7 +60,7 @@ childProcess::create(const char *p_cmdLine, const char *p_startdir)
childProcess::~childProcess() childProcess::~childProcess()
{ {
if (m_proc.hProcess) { if (m_proc.hProcess) {
CloseHandle(child->m_proc.hProcess); CloseHandle(m_proc.hProcess);
} }
} }