am b08fd409: am c9ad449f: am cea49c2f: Merge "translator EGL:fixing bug in eglGetDisplay caused in Windows Platform"
* commit 'b08fd409f7a8b04c18733012b0d919bb1cf06d71': translator EGL:fixing bug in eglGetDisplay caused in Windows Platform
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#include <GLcommon/GLutils.h>
|
||||
#include <utils/threads.h>
|
||||
|
||||
EglDisplay::EglDisplay(EGLNativeDisplayType dpy,bool isDefault) :
|
||||
EglDisplay::EglDisplay(EGLNativeInternalDisplayType dpy,bool isDefault) :
|
||||
m_dpy(dpy),
|
||||
m_initialized(false),
|
||||
m_configInitialized(false),
|
||||
@@ -53,9 +53,10 @@ EglDisplay::~EglDisplay() {
|
||||
|
||||
delete m_manager[GLES_1_1];
|
||||
delete m_manager[GLES_2_0];
|
||||
EglOS::deleteDisplay(m_dpy);
|
||||
}
|
||||
|
||||
EGLNativeDisplayType EglDisplay::nativeType(){return m_dpy;}
|
||||
EGLNativeInternalDisplayType EglDisplay::nativeType(){return m_dpy;}
|
||||
|
||||
void EglDisplay::initialize(int renderableType) {
|
||||
android::Mutex::Autolock mutex(m_lock);
|
||||
|
||||
@@ -38,8 +38,8 @@ class EglDisplay {
|
||||
public:
|
||||
|
||||
|
||||
EglDisplay(EGLNativeDisplayType dpy,bool isDefault = true);
|
||||
EGLNativeDisplayType nativeType();
|
||||
EglDisplay(EGLNativeInternalDisplayType dpy,bool isDefault = true);
|
||||
EGLNativeInternalDisplayType nativeType();
|
||||
int nConfigs(){ return m_configs.size();}
|
||||
int getConfigs(EGLConfig* configs,int config_size);
|
||||
int chooseConfigs(const EglConfig& dummy,EGLConfig* configs,int config_size);
|
||||
@@ -72,19 +72,19 @@ private:
|
||||
void addMissingConfigs(void);
|
||||
void initConfigurations(int renderableType);
|
||||
|
||||
EGLNativeDisplayType m_dpy;
|
||||
bool m_initialized;
|
||||
bool m_configInitialized;
|
||||
bool m_isDefault;
|
||||
ConfigsList m_configs;
|
||||
ContextsHndlMap m_contexts;
|
||||
SurfacesHndlMap m_surfaces;
|
||||
GlobalNameSpace m_globalNameSpace;
|
||||
ObjectNameManager *m_manager[MAX_GLES_VERSION];
|
||||
android::Mutex m_lock;
|
||||
ImagesHndlMap m_eglImages;
|
||||
unsigned int m_nextEglImageId;
|
||||
EGLNativeContextType m_globalSharedContext;
|
||||
EGLNativeInternalDisplayType m_dpy;
|
||||
bool m_initialized;
|
||||
bool m_configInitialized;
|
||||
bool m_isDefault;
|
||||
ConfigsList m_configs;
|
||||
ContextsHndlMap m_contexts;
|
||||
SurfacesHndlMap m_surfaces;
|
||||
GlobalNameSpace m_globalNameSpace;
|
||||
ObjectNameManager *m_manager[MAX_GLES_VERSION];
|
||||
android::Mutex m_lock;
|
||||
ImagesHndlMap m_eglImages;
|
||||
unsigned int m_nextEglImageId;
|
||||
EGLNativeContextType m_globalSharedContext;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,28 +47,27 @@ void EglGlobalInfo::delInstance() {
|
||||
|
||||
}
|
||||
|
||||
EglDisplay* EglGlobalInfo::addDisplay(EGLNativeDisplayType dpy) {
|
||||
EglDisplay* EglGlobalInfo::addDisplay(EGLNativeDisplayType dpy,EGLNativeInternalDisplayType idpy) {
|
||||
//search if it is not already exists
|
||||
android::Mutex::Autolock mutex(m_lock);
|
||||
for(DisplaysList::iterator it = m_displays.begin(); it != m_displays.end() ;it++) {
|
||||
if((*it)->nativeType() == dpy) return (*it);
|
||||
for(DisplaysMap::iterator it = m_displays.begin(); it != m_displays.end() ;it++) {
|
||||
if((*it).second == dpy) return (*it).first;
|
||||
}
|
||||
|
||||
EglDisplay* p_dpy = new EglDisplay(dpy);
|
||||
EglDisplay* p_dpy = new EglDisplay(idpy);
|
||||
if(p_dpy) {
|
||||
m_displays.push_front(p_dpy);
|
||||
m_displays[p_dpy] = dpy;
|
||||
return p_dpy;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool EglGlobalInfo::removeDisplay(EGLDisplay dpy) {
|
||||
|
||||
android::Mutex::Autolock mutex(m_lock);
|
||||
for(DisplaysList::iterator it = m_displays.begin(); it != m_displays.end() ;it++) {
|
||||
if(static_cast<EGLDisplay>(*it) == dpy) {
|
||||
delete (*it);
|
||||
m_displays.remove(*it);
|
||||
for(DisplaysMap::iterator it = m_displays.begin(); it != m_displays.end() ;it++) {
|
||||
if(static_cast<EGLDisplay>((*it).first) == dpy) {
|
||||
delete (*it).first;
|
||||
m_displays.erase(it);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -77,16 +76,18 @@ bool EglGlobalInfo::removeDisplay(EGLDisplay dpy) {
|
||||
|
||||
EglDisplay* EglGlobalInfo::getDisplay(EGLNativeDisplayType dpy) {
|
||||
android::Mutex::Autolock mutex(m_lock);
|
||||
for(DisplaysList::iterator it = m_displays.begin(); it != m_displays.end() ;it++) {
|
||||
if((*it)->nativeType() == dpy) return (*it);
|
||||
for(DisplaysMap::iterator it = m_displays.begin(); it != m_displays.end() ;it++) {
|
||||
if((*it).second == dpy) return (*it).first;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EglDisplay* EglGlobalInfo::getDisplay(EGLDisplay dpy) {
|
||||
android::Mutex::Autolock mutex(m_lock);
|
||||
for(DisplaysList::iterator it = m_displays.begin(); it != m_displays.end() ;it++) {
|
||||
if(static_cast<EGLDisplay>(*it) == dpy) return (*it);
|
||||
}
|
||||
return NULL;
|
||||
DisplaysMap::iterator it = m_displays.find(static_cast<EglDisplay*>(dpy));
|
||||
return (it != m_displays.end() ? (*it).first : NULL);
|
||||
}
|
||||
|
||||
EGLNativeInternalDisplayType EglGlobalInfo::generateInternalDisplay(EGLNativeDisplayType dpy){
|
||||
return EglOS::getInternalDisplay(dpy);
|
||||
}
|
||||
|
||||
@@ -24,17 +24,18 @@
|
||||
#include "EglConfig.h"
|
||||
#include "EglContext.h"
|
||||
|
||||
typedef std::list<EglDisplay*> DisplaysList;
|
||||
typedef std::map<EglDisplay*,EGLNativeDisplayType>DisplaysMap;
|
||||
|
||||
|
||||
class EglGlobalInfo {
|
||||
|
||||
public:
|
||||
EglDisplay* addDisplay(EGLNativeDisplayType dpy);
|
||||
EglDisplay* addDisplay(EGLNativeDisplayType dpy,EGLNativeInternalDisplayType idpy);
|
||||
EglDisplay* getDisplay(EGLNativeDisplayType dpy);
|
||||
EglDisplay* getDisplay(EGLDisplay dpy);
|
||||
bool removeDisplay(EGLDisplay dpy);
|
||||
EGLNativeDisplayType getDefaultNativeDisplay(){ return m_default;};
|
||||
EGLNativeInternalDisplayType getDefaultNativeDisplay(){ return m_default;};
|
||||
EGLNativeInternalDisplayType generateInternalDisplay(EGLNativeDisplayType dpy);
|
||||
|
||||
void setIface(GLESiface* iface,GLESVersion ver) { m_gles_ifaces[ver] = iface;};
|
||||
GLESiface* getIface(GLESVersion ver){ return m_gles_ifaces[ver];}
|
||||
@@ -49,13 +50,13 @@ private:
|
||||
EglGlobalInfo();
|
||||
~EglGlobalInfo(){};
|
||||
|
||||
static EglGlobalInfo* m_singleton;
|
||||
static int m_refCount;
|
||||
static EglGlobalInfo* m_singleton;
|
||||
static int m_refCount;
|
||||
|
||||
DisplaysList m_displays;
|
||||
EGLNativeDisplayType m_default;
|
||||
GLESiface* m_gles_ifaces[MAX_GLES_VERSION];
|
||||
android::Mutex m_lock;
|
||||
DisplaysMap m_displays;
|
||||
EGLNativeInternalDisplayType m_default;
|
||||
GLESiface* m_gles_ifaces[MAX_GLES_VERSION];
|
||||
android::Mutex m_lock;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -134,15 +134,20 @@ EGLAPI EGLint EGLAPIENTRY eglGetError(void) {
|
||||
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id) {
|
||||
EglDisplay* dpy = NULL;
|
||||
EGLNativeInternalDisplayType internalDisplay = NULL;
|
||||
|
||||
if( display_id == EGL_DEFAULT_DISPLAY) {
|
||||
display_id = g_eglInfo->getDefaultNativeDisplay();
|
||||
}
|
||||
|
||||
if ((dpy = g_eglInfo->getDisplay(display_id))) {
|
||||
return dpy;
|
||||
} else {
|
||||
dpy = g_eglInfo->addDisplay(display_id);
|
||||
|
||||
if( display_id == EGL_DEFAULT_DISPLAY) {
|
||||
internalDisplay = g_eglInfo->getDefaultNativeDisplay();
|
||||
} else {
|
||||
internalDisplay = g_eglInfo->generateInternalDisplay(display_id);
|
||||
}
|
||||
|
||||
dpy = g_eglInfo->addDisplay(display_id,internalDisplay);
|
||||
if(dpy) return dpy;
|
||||
return EGL_NO_DISPLAY;
|
||||
}
|
||||
@@ -726,7 +731,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay display, EGLSurface draw
|
||||
RETURN_ERROR(EGL_FALSE,EGL_BAD_MATCH);
|
||||
}
|
||||
|
||||
EGLNativeDisplayType nativeDisplay = dpy->nativeType();
|
||||
EGLNativeInternalDisplayType nativeDisplay = dpy->nativeType();
|
||||
EGLNativeSurfaceType nativeRead = newReadPtr->native();
|
||||
EGLNativeSurfaceType nativeDraw = newDrawPtr->native();
|
||||
//checking native window validity
|
||||
@@ -899,7 +904,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine) {
|
||||
SurfacePtr read = currCtx->read();
|
||||
SurfacePtr draw = currCtx->draw();
|
||||
|
||||
EGLNativeDisplayType nativeDisplay = dpy->nativeType();
|
||||
EGLNativeInternalDisplayType nativeDisplay = dpy->nativeType();
|
||||
if(read.Ptr()) {
|
||||
if(read->type() == EglSurface::WINDOW &&
|
||||
!EglOS::validNativeWin(nativeDisplay,read->native())) {
|
||||
|
||||
@@ -212,4 +212,12 @@ EGLNativeSurfaceType createPixmapSurface(EGLNativePixmapType pix){
|
||||
|
||||
void destroySurface(EGLNativeSurfaceType srfc){
|
||||
}
|
||||
|
||||
EGLNativeInternalDisplayType getInternalDisplay(EGLNativeDisplayType dpy){
|
||||
return (EGLNativeInternalDisplayType)dpy;
|
||||
}
|
||||
|
||||
void deleteDisplay(EGLNativeInternalDisplayType idpy){
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -33,23 +33,25 @@
|
||||
|
||||
namespace EglOS{
|
||||
|
||||
void queryConfigs(EGLNativeDisplayType dpy,int renderable_type,ConfigsList& listOut);
|
||||
bool releasePbuffer(EGLNativeDisplayType dis,EGLNativeSurfaceType pb);
|
||||
bool destroyContext(EGLNativeDisplayType dpy,EGLNativeContextType ctx);
|
||||
bool releaseDisplay(EGLNativeDisplayType dpy);
|
||||
bool validNativeWin(EGLNativeDisplayType dpy,EGLNativeSurfaceType win);
|
||||
bool validNativeWin(EGLNativeDisplayType dpy,EGLNativeWindowType win);
|
||||
bool validNativePixmap(EGLNativeDisplayType dpy,EGLNativeSurfaceType pix);
|
||||
bool checkWindowPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativeWindowType win,EglConfig* cfg,unsigned int* width,unsigned int* height);
|
||||
bool checkPixmapPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativePixmapType pix,EglConfig* cfg,unsigned int* width,unsigned int* height);
|
||||
bool makeCurrent(EGLNativeDisplayType dpy,EglSurface* read,EglSurface* draw,EGLNativeContextType);
|
||||
void swapBuffers(EGLNativeDisplayType dpy,EGLNativeSurfaceType srfc);
|
||||
void swapInterval(EGLNativeDisplayType dpy,EGLNativeSurfaceType win,int interval);
|
||||
void queryConfigs(EGLNativeInternalDisplayType dpy,int renderable_type,ConfigsList& listOut);
|
||||
bool releasePbuffer(EGLNativeInternalDisplayType dis,EGLNativeSurfaceType pb);
|
||||
bool destroyContext(EGLNativeInternalDisplayType dpy,EGLNativeContextType ctx);
|
||||
bool releaseDisplay(EGLNativeInternalDisplayType dpy);
|
||||
bool validNativeWin(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType win);
|
||||
bool validNativeWin(EGLNativeInternalDisplayType dpy,EGLNativeWindowType win);
|
||||
bool validNativePixmap(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType pix);
|
||||
bool checkWindowPixelFormatMatch(EGLNativeInternalDisplayType dpy,EGLNativeWindowType win,EglConfig* cfg,unsigned int* width,unsigned int* height);
|
||||
bool checkPixmapPixelFormatMatch(EGLNativeInternalDisplayType dpy,EGLNativePixmapType pix,EglConfig* cfg,unsigned int* width,unsigned int* height);
|
||||
bool makeCurrent(EGLNativeInternalDisplayType dpy,EglSurface* read,EglSurface* draw,EGLNativeContextType);
|
||||
void swapBuffers(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType srfc);
|
||||
void swapInterval(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType win,int interval);
|
||||
void waitNative();
|
||||
|
||||
EGLNativeDisplayType getDefaultDisplay();
|
||||
EGLNativeSurfaceType createPbufferSurface(EGLNativeDisplayType dpy,EglConfig* cfg,EglPbufferSurface* pb);
|
||||
EGLNativeContextType createContext(EGLNativeDisplayType dpy,EglConfig* cfg,EGLNativeContextType sharedContext);
|
||||
EGLNativeInternalDisplayType getDefaultDisplay();
|
||||
EGLNativeInternalDisplayType getInternalDisplay(EGLNativeDisplayType dpy);
|
||||
void deleteDisplay(EGLNativeInternalDisplayType idpy);
|
||||
EGLNativeSurfaceType createPbufferSurface(EGLNativeInternalDisplayType dpy,EglConfig* cfg,EglPbufferSurface* pb);
|
||||
EGLNativeContextType createContext(EGLNativeInternalDisplayType dpy,EglConfig* cfg,EGLNativeContextType sharedContext);
|
||||
EGLNativeSurfaceType createWindowSurface(EGLNativeWindowType wnd);
|
||||
EGLNativeSurfaceType createPixmapSurface(EGLNativePixmapType pix);
|
||||
void destroySurface(EGLNativeSurfaceType srfc);
|
||||
|
||||
@@ -49,7 +49,9 @@ private:
|
||||
|
||||
void WinDisplay::releaseAll(){
|
||||
for(std::map<int,DisplayInfo>::iterator it = m_map.begin(); it != m_map.end();it++){
|
||||
DestroyWindow((*it).second.hwnd);
|
||||
if((*it).second.hwnd){
|
||||
DestroyWindow((*it).second.hwnd);
|
||||
}
|
||||
DeleteDC((*it).second.dc);
|
||||
}
|
||||
}
|
||||
@@ -190,17 +192,22 @@ HWND createDummyWindow(){
|
||||
return hwnd;
|
||||
}
|
||||
|
||||
EGLNativeDisplayType getDefaultDisplay() {
|
||||
EGLNativeInternalDisplayType getDefaultDisplay() {
|
||||
WinDisplay* dpy = new WinDisplay();
|
||||
|
||||
HWND hwnd = createDummyWindow();
|
||||
HDC hdc = GetDC(hwnd);
|
||||
dpy->setInfo(WinDisplay::DEFAULT_DISPLAY,DisplayInfo(hdc,hwnd));
|
||||
return static_cast<EGLNativeDisplayType>(dpy);
|
||||
return static_cast<EGLNativeInternalDisplayType>(dpy);
|
||||
}
|
||||
|
||||
EGLNativeInternalDisplayType getInternalDisplay(EGLNativeDisplayType display){
|
||||
WinDisplay* dpy = new WinDisplay();
|
||||
dpy->setInfo(WinDisplay::DEFAULT_DISPLAY,DisplayInfo(display,NULL));
|
||||
return dpy;
|
||||
}
|
||||
|
||||
static HDC getDummyDC(EGLNativeDisplayType display,int cfgId){
|
||||
static HDC getDummyDC(EGLNativeInternalDisplayType display,int cfgId){
|
||||
|
||||
HDC dpy = NULL;
|
||||
if(display->infoExists(cfgId)){
|
||||
@@ -283,11 +290,17 @@ void initPtrToWglFunctions(){
|
||||
DeleteDC(dpy);
|
||||
}
|
||||
|
||||
bool releaseDisplay(EGLNativeDisplayType dpy) {
|
||||
bool releaseDisplay(EGLNativeInternalDisplayType dpy) {
|
||||
dpy->releaseAll();
|
||||
return true;
|
||||
}
|
||||
|
||||
void deleteDisplay(EGLNativeInternalDisplayType idpy){
|
||||
if(idpy){
|
||||
delete idpy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static bool initPixelFormat(HDC dc){
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
@@ -301,7 +314,7 @@ static bool initPixelFormat(HDC dc){
|
||||
}
|
||||
}
|
||||
|
||||
EglConfig* pixelFormatToConfig(EGLNativeDisplayType display,int renderableType,EGLNativePixelFormatType* frmt,int index){
|
||||
EglConfig* pixelFormatToConfig(EGLNativeInternalDisplayType display,int renderableType,EGLNativePixelFormatType* frmt,int index){
|
||||
|
||||
EGLint red,green,blue,alpha,depth,stencil;
|
||||
EGLint supportedSurfaces,visualType,visualId;
|
||||
@@ -371,7 +384,7 @@ EglConfig* pixelFormatToConfig(EGLNativeDisplayType display,int renderableType,E
|
||||
}
|
||||
|
||||
|
||||
void queryConfigs(EGLNativeDisplayType display,int renderableType,ConfigsList& listOut) {
|
||||
void queryConfigs(EGLNativeInternalDisplayType display,int renderableType,ConfigsList& listOut) {
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
int iPixelFormat = 1;
|
||||
HDC dpy = getDummyDC(display,WinDisplay::DEFAULT_DISPLAY);
|
||||
@@ -394,22 +407,22 @@ void queryConfigs(EGLNativeDisplayType display,int renderableType,ConfigsList& l
|
||||
}
|
||||
}
|
||||
|
||||
bool validNativeWin(EGLNativeDisplayType dpy,EGLNativeWindowType win) {
|
||||
bool validNativeWin(EGLNativeInternalDisplayType dpy,EGLNativeWindowType win) {
|
||||
return IsWindow(win);
|
||||
}
|
||||
|
||||
bool validNativeWin(EGLNativeDisplayType dpy,EGLNativeSurfaceType win) {
|
||||
bool validNativeWin(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType win) {
|
||||
if (!win) return false;
|
||||
return validNativeWin(dpy,win->getHwnd());
|
||||
}
|
||||
|
||||
bool validNativePixmap(EGLNativeDisplayType dpy,EGLNativeSurfaceType pix) {
|
||||
bool validNativePixmap(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType pix) {
|
||||
BITMAP bm;
|
||||
if (!pix) return false;
|
||||
return GetObject(pix->getBmap(), sizeof(BITMAP), (LPSTR)&bm);
|
||||
}
|
||||
|
||||
bool checkWindowPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativeWindowType win,EglConfig* cfg,unsigned int* width,unsigned int* height) {
|
||||
bool checkWindowPixelFormatMatch(EGLNativeInternalDisplayType dpy,EGLNativeWindowType win,EglConfig* cfg,unsigned int* width,unsigned int* height) {
|
||||
RECT r;
|
||||
if(!GetClientRect(win,&r)) return false;
|
||||
*width = r.right - r.left;
|
||||
@@ -420,7 +433,7 @@ bool checkWindowPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativeWindowType wi
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool checkPixmapPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativePixmapType pix,EglConfig* cfg,unsigned int* width,unsigned int* height){
|
||||
bool checkPixmapPixelFormatMatch(EGLNativeInternalDisplayType dpy,EGLNativePixmapType pix,EglConfig* cfg,unsigned int* width,unsigned int* height){
|
||||
|
||||
BITMAP bm;
|
||||
if(!GetObject(pix, sizeof(BITMAP), (LPSTR)&bm)) return false;
|
||||
@@ -431,7 +444,7 @@ bool checkPixmapPixelFormatMatch(EGLNativeDisplayType dpy,EGLNativePixmapType pi
|
||||
return true;
|
||||
}
|
||||
|
||||
EGLNativeSurfaceType createPbufferSurface(EGLNativeDisplayType display,EglConfig* cfg,EglPbufferSurface* pbSurface) {
|
||||
EGLNativeSurfaceType createPbufferSurface(EGLNativeInternalDisplayType display,EglConfig* cfg,EglPbufferSurface* pbSurface) {
|
||||
|
||||
|
||||
HDC dpy = getDummyDC(display,cfg->nativeId());
|
||||
@@ -466,7 +479,7 @@ EGLNativeSurfaceType createPbufferSurface(EGLNativeDisplayType display,EglConfig
|
||||
return new SrfcInfo(pb);
|
||||
}
|
||||
|
||||
bool releasePbuffer(EGLNativeDisplayType display,EGLNativeSurfaceType pb) {
|
||||
bool releasePbuffer(EGLNativeInternalDisplayType display,EGLNativeSurfaceType pb) {
|
||||
if (!pb) return false;
|
||||
if(!s_wglExtProcs->wglReleasePbufferDCARB || !s_wglExtProcs->wglDestroyPbufferARB) return false;
|
||||
if(!s_wglExtProcs->wglReleasePbufferDCARB(pb->getPbuffer(),pb->getDC()) || !s_wglExtProcs->wglDestroyPbufferARB(pb->getPbuffer())){
|
||||
@@ -476,7 +489,7 @@ bool releasePbuffer(EGLNativeDisplayType display,EGLNativeSurfaceType pb) {
|
||||
return true;
|
||||
}
|
||||
|
||||
EGLNativeContextType createContext(EGLNativeDisplayType display,EglConfig* cfg,EGLNativeContextType sharedContext) {
|
||||
EGLNativeContextType createContext(EGLNativeInternalDisplayType display,EglConfig* cfg,EGLNativeContextType sharedContext) {
|
||||
|
||||
EGLNativeContextType ctx = NULL;
|
||||
HDC dpy = getDummyDC(display,cfg->nativeId());
|
||||
@@ -499,7 +512,7 @@ EGLNativeContextType createContext(EGLNativeDisplayType display,EglConfig* cfg,E
|
||||
return ctx;
|
||||
}
|
||||
|
||||
bool destroyContext(EGLNativeDisplayType dpy,EGLNativeContextType ctx) {
|
||||
bool destroyContext(EGLNativeInternalDisplayType dpy,EGLNativeContextType ctx) {
|
||||
if(!wglDeleteContext(ctx)) {
|
||||
DWORD err = GetLastError();
|
||||
return false;
|
||||
@@ -508,7 +521,7 @@ bool destroyContext(EGLNativeDisplayType dpy,EGLNativeContextType ctx) {
|
||||
}
|
||||
|
||||
|
||||
bool makeCurrent(EGLNativeDisplayType display,EglSurface* read,EglSurface* draw,EGLNativeContextType ctx) {
|
||||
bool makeCurrent(EGLNativeInternalDisplayType display,EglSurface* read,EglSurface* draw,EGLNativeContextType ctx) {
|
||||
|
||||
HDC hdcRead = read ? read->native()->getDC(): NULL;
|
||||
HDC hdcDraw = draw ? draw->native()->getDC(): NULL;
|
||||
@@ -526,7 +539,7 @@ bool makeCurrent(EGLNativeDisplayType display,EglSurface* read,EglSurface* draw,
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void swapBuffers(EGLNativeDisplayType display,EGLNativeSurfaceType srfc){
|
||||
void swapBuffers(EGLNativeInternalDisplayType display,EGLNativeSurfaceType srfc){
|
||||
if(srfc && !SwapBuffers(srfc->getDC())) {
|
||||
DWORD err = GetLastError();
|
||||
}
|
||||
@@ -535,7 +548,7 @@ void swapBuffers(EGLNativeDisplayType display,EGLNativeSurfaceType srfc){
|
||||
|
||||
void waitNative(){}
|
||||
|
||||
void swapInterval(EGLNativeDisplayType dpy,EGLNativeSurfaceType win,int interval) {
|
||||
void swapInterval(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType win,int interval) {
|
||||
|
||||
if (s_wglExtProcs->wglSwapIntervalEXT){
|
||||
s_wglExtProcs->wglSwapIntervalEXT(interval);
|
||||
@@ -553,4 +566,6 @@ EGLNativeSurfaceType createPixmapSurface(EGLNativePixmapType pix){
|
||||
void destroySurface(EGLNativeSurfaceType srfc){
|
||||
delete srfc;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -294,4 +294,11 @@ void destroySurface(EGLNativeSurfaceType srfc){
|
||||
delete srfc;
|
||||
};
|
||||
|
||||
EGLNativeInternalDisplayType getInternalDisplay(EGLNativeDisplayType dpy){
|
||||
return dpy;
|
||||
}
|
||||
|
||||
void deleteDisplay(EGLNativeInternalDisplayType idpy){
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -30,10 +30,14 @@ typedef SURFACE EGLNativeSurfaceType;
|
||||
#define WGL_WGLEXT_PROTOTYPES
|
||||
#include <GL/wglext.h>
|
||||
|
||||
class WinDisplay; //defined in EglWindows.cpp
|
||||
typedef WinDisplay* DISPLAY;
|
||||
|
||||
typedef PIXELFORMATDESCRIPTOR EGLNativePixelFormatType;
|
||||
#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 EGLNativeInternalDisplayType;
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
@@ -41,6 +45,7 @@ typedef void* EGLNativePixelFormatType;
|
||||
#define PIXEL_FORMAT_INITIALIZER NULL
|
||||
typedef void* EGLNativeContextType;
|
||||
typedef void* EGLNativePbufferType;
|
||||
typedef EGLNativeDisplayType EGLNativeInternalDisplayType;
|
||||
|
||||
|
||||
#elif defined(__unix__)
|
||||
@@ -50,10 +55,11 @@ typedef void* EGLNativePbufferType;
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
typedef GLXFBConfig EGLNativePixelFormatType;
|
||||
typedef GLXFBConfig EGLNativePixelFormatType;
|
||||
#define PIXEL_FORMAT_INITIALIZER 0;
|
||||
typedef GLXContext EGLNativeContextType;
|
||||
typedef GLXPbuffer EGLNativePbufferType;
|
||||
typedef GLXContext EGLNativeContextType;
|
||||
typedef GLXPbuffer EGLNativePbufferType;
|
||||
typedef EGLNativeDisplayType EGLNativeInternalDisplayType;
|
||||
|
||||
#else
|
||||
#error "Platform not recognized"
|
||||
|
||||
@@ -66,11 +66,9 @@
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
class WinDisplay; //defined in EglWindows.cpp
|
||||
typedef WinDisplay* DISPLAY;
|
||||
|
||||
|
||||
typedef DISPLAY EGLNativeDisplayType;
|
||||
typedef HDC EGLNativeDisplayType;
|
||||
typedef HBITMAP EGLNativePixmapType;
|
||||
typedef HWND EGLNativeWindowType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user