diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp b/tools/emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp index f20f51c78..bb5dd908c 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp @@ -18,7 +18,7 @@ #include #include -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); diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglDisplay.h b/tools/emulator/opengl/host/libs/Translator/EGL/EglDisplay.h index f60c90f86..587e92a9c 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglDisplay.h +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglDisplay.h @@ -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 diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglGlobalInfo.cpp b/tools/emulator/opengl/host/libs/Translator/EGL/EglGlobalInfo.cpp index 955f66c09..cd372ff30 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglGlobalInfo.cpp +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglGlobalInfo.cpp @@ -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(*it) == dpy) { - delete (*it); - m_displays.remove(*it); + for(DisplaysMap::iterator it = m_displays.begin(); it != m_displays.end() ;it++) { + if(static_cast((*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(*it) == dpy) return (*it); - } - return NULL; + DisplaysMap::iterator it = m_displays.find(static_cast(dpy)); + return (it != m_displays.end() ? (*it).first : NULL); +} + +EGLNativeInternalDisplayType EglGlobalInfo::generateInternalDisplay(EGLNativeDisplayType dpy){ + return EglOS::getInternalDisplay(dpy); } diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglGlobalInfo.h b/tools/emulator/opengl/host/libs/Translator/EGL/EglGlobalInfo.h index 5e03e72d7..6be76efc1 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglGlobalInfo.h +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglGlobalInfo.h @@ -24,17 +24,18 @@ #include "EglConfig.h" #include "EglContext.h" -typedef std::list DisplaysList; +typedef std::mapDisplaysMap; 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 diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp b/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp index 17fb33eb0..8b64b94a0 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp @@ -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())) { diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglMacApi.cpp b/tools/emulator/opengl/host/libs/Translator/EGL/EglMacApi.cpp index 10f3f4ac6..b5e7d6726 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglMacApi.cpp +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglMacApi.cpp @@ -212,4 +212,12 @@ EGLNativeSurfaceType createPixmapSurface(EGLNativePixmapType pix){ void destroySurface(EGLNativeSurfaceType srfc){ } + +EGLNativeInternalDisplayType getInternalDisplay(EGLNativeDisplayType dpy){ + return (EGLNativeInternalDisplayType)dpy; +} + +void deleteDisplay(EGLNativeInternalDisplayType idpy){ +} + }; diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglOsApi.h b/tools/emulator/opengl/host/libs/Translator/EGL/EglOsApi.h index 8ad5d520a..c1662209b 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglOsApi.h +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglOsApi.h @@ -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); diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp b/tools/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp index 8ad226ba0..4f8d4b439 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp @@ -49,7 +49,9 @@ private: void WinDisplay::releaseAll(){ for(std::map::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(dpy); + return static_cast(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; } + + }; diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp b/tools/emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp index 1d761fab0..44044af11 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp @@ -294,4 +294,11 @@ void destroySurface(EGLNativeSurfaceType srfc){ delete srfc; }; +EGLNativeInternalDisplayType getInternalDisplay(EGLNativeDisplayType dpy){ + return dpy; +} + +void deleteDisplay(EGLNativeInternalDisplayType idpy){ +} + }; diff --git a/tools/emulator/opengl/host/libs/Translator/include/EGL/eglinternalplatform.h b/tools/emulator/opengl/host/libs/Translator/include/EGL/eglinternalplatform.h index 319e6f950..c387043b2 100644 --- a/tools/emulator/opengl/host/libs/Translator/include/EGL/eglinternalplatform.h +++ b/tools/emulator/opengl/host/libs/Translator/include/EGL/eglinternalplatform.h @@ -30,10 +30,14 @@ typedef SURFACE EGLNativeSurfaceType; #define WGL_WGLEXT_PROTOTYPES #include +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 #include -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" diff --git a/tools/emulator/opengl/host/libs/Translator/include/EGL/eglplatform.h b/tools/emulator/opengl/host/libs/Translator/include/EGL/eglplatform.h index 95aaa22f0..b159cd7f7 100644 --- a/tools/emulator/opengl/host/libs/Translator/include/EGL/eglplatform.h +++ b/tools/emulator/opengl/host/libs/Translator/include/EGL/eglplatform.h @@ -66,11 +66,9 @@ #endif #include -class WinDisplay; //defined in EglWindows.cpp -typedef WinDisplay* DISPLAY; -typedef DISPLAY EGLNativeDisplayType; +typedef HDC EGLNativeDisplayType; typedef HBITMAP EGLNativePixmapType; typedef HWND EGLNativeWindowType;