src/video/windows/SDL_windowsopengles.c
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 21 Jun 2015 19:37:37 +0200
changeset 9773 dad226bc43a5
parent 9619 b94b6d0bff0f
child 9998 f67cf37e9cd4
permissions -rw-r--r--
Windows: Fixed crash if initialization of EGL failed but was tried again later.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
     1
/*
8026
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
     2
  Simple DirectMedia Layer
9619
b94b6d0bff0f Updated the copyright year to 2015
Sam Lantinga <slouken@libsdl.org>
parents: 8908
diff changeset
     3
  Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
     4
8026
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
     5
  This software is provided 'as-is', without any express or implied
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
     7
  arising from the use of this software.
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
     8
8026
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    11
  freely, subject to the following restrictions:
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    12
8026
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    14
     claim that you wrote the original software. If you use this software
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    16
     appreciated but is not required.
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    18
     misrepresented as being the original software.
27a998fdc771 Fixed spaces in license comment.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8021
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    20
*/
8093
b43765095a6f Make internal SDL sources include SDL_internal.h instead of SDL_config.h
Ryan C. Gordon <icculus@icculus.org>
parents: 8026
diff changeset
    21
#include "../../SDL_internal.h"
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    22
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    23
#if SDL_VIDEO_DRIVER_WINDOWS && SDL_VIDEO_OPENGL_EGL
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    24
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    25
#include "SDL_windowsvideo.h"
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    26
#include "SDL_windowsopengles.h"
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    27
#include "SDL_windowsopengl.h"
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    28
#include "SDL_log.h"
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    29
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    30
/* EGL implementation of SDL OpenGL support */
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    31
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    32
int
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    33
WIN_GLES_LoadLibrary(_THIS, const char *path) {
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    34
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    35
    /* If the profile requested is not GL ES, switch over to WIN_GL functions  */
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    36
    if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) {
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    37
#if SDL_VIDEO_OPENGL_WGL
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    38
        WIN_GLES_UnloadLibrary(_this);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    39
        _this->GL_LoadLibrary = WIN_GL_LoadLibrary;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    40
        _this->GL_GetProcAddress = WIN_GL_GetProcAddress;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    41
        _this->GL_UnloadLibrary = WIN_GL_UnloadLibrary;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    42
        _this->GL_CreateContext = WIN_GL_CreateContext;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    43
        _this->GL_MakeCurrent = WIN_GL_MakeCurrent;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    44
        _this->GL_SetSwapInterval = WIN_GL_SetSwapInterval;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    45
        _this->GL_GetSwapInterval = WIN_GL_GetSwapInterval;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    46
        _this->GL_SwapWindow = WIN_GL_SwapWindow;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    47
        _this->GL_DeleteContext = WIN_GL_DeleteContext;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    48
        return WIN_GL_LoadLibrary(_this, path);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    49
#else
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    50
        return SDL_SetError("SDL not configured with OpenGL/WGL support");
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    51
#endif
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    52
    }
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    53
    
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    54
    if (_this->egl_data == NULL) {
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    55
        return SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    56
    }
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    57
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    58
    return 0;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    59
}
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    60
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    61
SDL_GLContext
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    62
WIN_GLES_CreateContext(_THIS, SDL_Window * window)
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    63
{
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    64
    SDL_GLContext context;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    65
    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    66
8908
8333acde0b91 Fixed bug 2579 - SDL fails to compile on Windows when only EGL+OpenGL ES defined
Sam Lantinga <slouken@libsdl.org>
parents: 8273
diff changeset
    67
#if SDL_VIDEO_OPENGL_WGL
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    68
    if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) {
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    69
        /* Switch to WGL based functions */
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    70
        WIN_GLES_UnloadLibrary(_this);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    71
        _this->GL_LoadLibrary = WIN_GL_LoadLibrary;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    72
        _this->GL_GetProcAddress = WIN_GL_GetProcAddress;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    73
        _this->GL_UnloadLibrary = WIN_GL_UnloadLibrary;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    74
        _this->GL_CreateContext = WIN_GL_CreateContext;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    75
        _this->GL_MakeCurrent = WIN_GL_MakeCurrent;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    76
        _this->GL_SetSwapInterval = WIN_GL_SetSwapInterval;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    77
        _this->GL_GetSwapInterval = WIN_GL_GetSwapInterval;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    78
        _this->GL_SwapWindow = WIN_GL_SwapWindow;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    79
        _this->GL_DeleteContext = WIN_GL_DeleteContext;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    80
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    81
        if (WIN_GL_LoadLibrary(_this, NULL) != 0) {
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    82
            return NULL;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    83
        }
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    84
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    85
        return WIN_GL_CreateContext(_this, window);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    86
    }
8908
8333acde0b91 Fixed bug 2579 - SDL fails to compile on Windows when only EGL+OpenGL ES defined
Sam Lantinga <slouken@libsdl.org>
parents: 8273
diff changeset
    87
#endif
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    88
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    89
    context = SDL_EGL_CreateContext(_this, data->egl_surface);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    90
    return context;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    91
}
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    92
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    93
void
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    94
WIN_GLES_DeleteContext(_THIS, SDL_GLContext context)
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    95
{
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    96
    SDL_EGL_DeleteContext(_this, context);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    97
    WIN_GLES_UnloadLibrary(_this);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    98
}
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
    99
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   100
SDL_EGL_SwapWindow_impl(WIN)
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   101
SDL_EGL_MakeCurrent_impl(WIN)
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   102
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   103
int
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   104
WIN_GLES_SetupWindow(_THIS, SDL_Window * window)
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   105
{
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   106
    /* The current context is lost in here; save it and reset it. */
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   107
    SDL_WindowData *windowdata = (SDL_WindowData *) window->driverdata;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   108
    SDL_Window *current_win = SDL_GL_GetCurrentWindow();
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   109
    SDL_GLContext current_ctx = SDL_GL_GetCurrentContext();
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   110
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   111
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   112
    if (_this->egl_data == NULL) {
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   113
        if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY) < 0) {
9773
dad226bc43a5 Windows: Fixed crash if initialization of EGL failed but was tried again later.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9619
diff changeset
   114
            SDL_EGL_UnloadLibrary(_this);
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   115
            return -1;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   116
        }
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   117
    }
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   118
  
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   119
    /* Create the GLES window surface */
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   120
    windowdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType)windowdata->hwnd);
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   121
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   122
    if (windowdata->egl_surface == EGL_NO_SURFACE) {
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   123
        return SDL_SetError("Could not create GLES window surface");
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   124
    }
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   125
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   126
    return WIN_GLES_MakeCurrent(_this, current_win, current_ctx);    
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   127
}
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   128
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   129
int
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   130
WIN_GLES_SetSwapInterval(_THIS, int interval)
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   131
{
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   132
    /* FIXME: This should call SDL_EGL_SetSwapInterval, but ANGLE has a bug that prevents this
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   133
     * from working if we do (the window contents freeze and don't swap properly). So, we ignore
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   134
     * the request for now.
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   135
     */
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   136
    SDL_Log("WARNING: Ignoring SDL_GL_SetSwapInterval call due to ANGLE bug");
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   137
    return 0;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   138
}
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   139
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   140
#endif /* SDL_VIDEO_DRIVER_WINDOWS && SDL_VIDEO_OPENGL_EGL */
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   141
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff changeset
   142
/* vi: set ts=4 sw=4 expandtab: */