void _glfwPlatformWaitEvents( void ) { // Wait for new events Wait( 1L << _glfwWin.Window->UserPort->mp_SigBit ); // Poll new events _glfwPlatformPollEvents(); }
void _glfwPlatformWaitEvents( void ) { EventRef event; // Wait for new events ReceiveNextEvent( 0, NULL, kEventDurationForever, FALSE, &event ); // Poll new events _glfwPlatformPollEvents(); }
GLFWAPI void GLFWAPIENTRY glfwPollEvents( void ) { if( !_glfwInitialized || !_glfwWin.opened ) { return; } // Poll for new events _glfwPlatformPollEvents(); }
void _glfwPlatformWaitEvents(void) { XEvent event; // Block waiting for an event to arrive XNextEvent(_glfwLibrary.X11.display, &event); XPutBackEvent(_glfwLibrary.X11.display, &event); _glfwPlatformPollEvents(); }
void _glfwPlatformWaitEvents(void) { pthread_mutex_lock(&_glfw.mir.event_mutex); if (emptyEventQueue(_glfw.mir.event_queue)) pthread_cond_wait(&_glfw.mir.event_cond, &_glfw.mir.event_mutex); pthread_mutex_unlock(&_glfw.mir.event_mutex); _glfwPlatformPollEvents(); }
GLFWAPI void glfwPollEvents(void) { if (!_glfwInitialized) { _glfwInputError(GLFW_NOT_INITIALIZED, NULL); return; } clearScrollOffsets(); _glfwPlatformPollEvents(); }
void _glfwPlatformWaitEvents(void) { int fd; fd_set fds; fd = ConnectionNumber(_glfwLibrary.X11.display); FD_ZERO(&fds); FD_SET(fd, &fds); XFlush(_glfwLibrary.X11.display); if (select(fd + 1, &fds, NULL, NULL, NULL) > 0) _glfwPlatformPollEvents(); }
void _glfwPlatformWaitEventsTimeout(double timeout) { pthread_mutex_lock(&_glfw.mir.event_mutex); if (emptyEventQueue(_glfw.mir.event_queue)) { struct timespec time; clock_gettime(CLOCK_REALTIME, &time); time.tv_sec += (long) timeout; time.tv_nsec += (long) ((timeout - (long) timeout) * 1e9); pthread_cond_timedwait(&_glfw.mir.event_cond, &_glfw.mir.event_mutex, &time); } pthread_mutex_unlock(&_glfw.mir.event_mutex); _glfwPlatformPollEvents(); }
int _glfwPlatformInit(void) { if (!_glfwInitThreadLocalStorageWin32()) return GLFW_FALSE; // To make SetForegroundWindow work as we want, we need to fiddle // with the FOREGROUNDLOCKTIMEOUT system setting (we do this as early // as possible in the hope of still being the foreground process) SystemParametersInfoW(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &_glfw.win32.foregroundLockTimeout, 0); SystemParametersInfoW(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, UIntToPtr(0), SPIF_SENDCHANGE); if (!loadLibraries()) return GLFW_FALSE; createKeyTables(); if (_glfw_SetProcessDPIAwareness) _glfw_SetProcessDPIAwareness(PROCESS_PER_MONITOR_DPI_AWARE); else if (_glfw_SetProcessDPIAware) _glfw_SetProcessDPIAware(); if (!_glfwRegisterWindowClassWin32()) return GLFW_FALSE; _glfw.win32.helperWindow = createHelperWindow(); if (!_glfw.win32.helperWindow) return GLFW_FALSE; _glfwPlatformPollEvents(); #if defined(_GLFW_WGL) if (!_glfwInitWGL()) return GLFW_FALSE; #elif defined(_GLFW_EGL) if (!_glfwInitEGL()) return GLFW_FALSE; #endif _glfwInitTimerWin32(); _glfwInitJoysticksWin32(); return GLFW_TRUE; }
void _glfwPlatformWaitEvents(void) { if (!XPending(_glfw.x11.display)) { fd_set fds; const int fd = ConnectionNumber(_glfw.x11.display); FD_ZERO(&fds); FD_SET(fd, &fds); // select(1) is used instead of an X function like XNextEvent, as the // wait inside those are guarded by the mutex protecting the display // struct, locking out other threads from using X (including GLX) if (select(fd + 1, &fds, NULL, NULL, NULL) < 0) return; } _glfwPlatformPollEvents(); }
int _glfwPlatformOpenWindow( int width, int height, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig ) { while( _glfwWin.initialized != GL_TRUE ) { _glfwPlatformPollEvents(); } { const EGLint attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_DEPTH_SIZE, 16, EGL_NONE }; EGLint w, h, format; EGLint numConfigs; EGLConfig config; EGLSurface surface; EGLContext context; EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(display, 0, 0); eglChooseConfig(display, attribs, &config, 1, &numConfigs); eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format); ANativeWindow_setBuffersGeometry(_glfwWin.app->window, 0, 0, format ); surface = eglCreateWindowSurface(display, config, _glfwWin.app->window, NULL); context = eglCreateContext(display, config, NULL, NULL); if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) { return GL_FALSE; } eglQuerySurface(display, surface, EGL_WIDTH, &w); eglQuerySurface(display, surface, EGL_HEIGHT, &h); _glfwWin.display = display; _glfwWin.context = context; _glfwWin.surface = surface; _glfwWin.width = w; _glfwWin.height = h; _glfwWin.resized = GL_TRUE; } return GL_TRUE; }
GLFWAPI void glfwPollEvents(void) { _GLFW_REQUIRE_INIT(); _glfwPlatformPollEvents(); }
void _glfwPlatformWaitEvents(void) { WaitMessage(); _glfwPlatformPollEvents(); }
void _glfwPlatformWaitEventsTimeout(double timeout) { MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD) (timeout * 1e3), QS_ALLEVENTS); _glfwPlatformPollEvents(); }
void _glfwPlatformWaitEvents(void) { _glfwPlatformPollEvents(); }