コード例 #1
0
ファイル: amigaos_window.c プロジェクト: jaekim708/kiss
void _glfwPlatformWaitEvents( void )
{
    // Wait for new events
    Wait( 1L << _glfwWin.Window->UserPort->mp_SigBit );

    // Poll new events
    _glfwPlatformPollEvents();
}
コード例 #2
0
ファイル: macosx_window.c プロジェクト: x-y-z/SteerSuite-CUDA
void _glfwPlatformWaitEvents( void )
{
    EventRef event;

    // Wait for new events
    ReceiveNextEvent( 0, NULL, kEventDurationForever, FALSE, &event );

    // Poll new events
    _glfwPlatformPollEvents();
}
コード例 #3
0
ファイル: window.c プロジェクト: ajbetteridge/Conception
GLFWAPI void GLFWAPIENTRY glfwPollEvents( void )
{
    if( !_glfwInitialized || !_glfwWin.opened )
    {
        return;
    }

    // Poll for new events
    _glfwPlatformPollEvents();
}
コード例 #4
0
ファイル: x11_window.c プロジェクト: bioinfornatics/glfw
void _glfwPlatformWaitEvents(void)
{
    XEvent event;

    // Block waiting for an event to arrive
    XNextEvent(_glfwLibrary.X11.display, &event);
    XPutBackEvent(_glfwLibrary.X11.display, &event);

    _glfwPlatformPollEvents();
}
コード例 #5
0
ファイル: mir_window.c プロジェクト: odinsbane/glfw
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();
}
コード例 #6
0
ファイル: window.c プロジェクト: kayson/glfw
GLFWAPI void glfwPollEvents(void)
{
    if (!_glfwInitialized)
    {
        _glfwInputError(GLFW_NOT_INITIALIZED, NULL);
        return;
    }

    clearScrollOffsets();

    _glfwPlatformPollEvents();
}
コード例 #7
0
ファイル: x11_window.c プロジェクト: Ape/DCPUToolchain
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();
}
コード例 #8
0
ファイル: mir_window.c プロジェクト: mohsinhasan/glfw
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();
}
コード例 #9
0
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;
}
コード例 #10
0
ファイル: x11_window.c プロジェクト: jjiezheng/lfant
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();
}
コード例 #11
0
ファイル: android_window.c プロジェクト: KTaskn/MMDAgent
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;
}
コード例 #12
0
ファイル: window.c プロジェクト: coolexp/glfw
GLFWAPI void glfwPollEvents(void)
{
    _GLFW_REQUIRE_INIT();
    _glfwPlatformPollEvents();
}
コード例 #13
0
void _glfwPlatformWaitEvents(void)
{
    WaitMessage();

    _glfwPlatformPollEvents();
}
コード例 #14
0
ファイル: win32_window.c プロジェクト: kypp/glfw
void _glfwPlatformWaitEventsTimeout(double timeout)
{
    MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD) (timeout * 1e3), QS_ALLEVENTS);

    _glfwPlatformPollEvents();
}
コード例 #15
0
ファイル: screen_window.c プロジェクト: adasworks/glfw
void _glfwPlatformWaitEvents(void)
{
    _glfwPlatformPollEvents();
}