diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.h b/tools/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.h index 3e3e2e24b..4d80f74d5 100644 --- a/tools/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.h +++ b/tools/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.h @@ -73,7 +73,7 @@ public: EGLDisplay getDisplay() const { return m_eglDisplay; } EGLContext getContext() const { return m_eglContext; } - + EGLNativeWindowType getSubWindow() const { return m_subWin; } bool bind_locked(); bool unbind_locked(); diff --git a/tools/emulator/opengl/host/renderer/main.cpp b/tools/emulator/opengl/host/renderer/main.cpp index 5f338b48e..709ed7599 100644 --- a/tools/emulator/opengl/host/renderer/main.cpp +++ b/tools/emulator/opengl/host/renderer/main.cpp @@ -125,7 +125,32 @@ int main(int argc, char *argv[]) return -1; } +#ifndef _WIN32 + // + // run the server listener loop + // server->Main(); // never returns +#else + // + // on windows we need to handle messages for the + // created subwindow. So we run the server on a seperate + // thread and running the windows message pump loop + // in this main thread. + // + server->start(); + + // + // Dispatch events for the subwindow + // + MSG msg; + HWND hWnd = FrameBuffer::getFB()->getSubWindow(); + bool done = 0; + while(!done) { + GetMessage(&msg, hWnd, 0, 0); + TranslateMessage(&msg); + DispatchMessage(&msg); + } +#endif return 0; }