src/video/winrt/SDL_winrtopengles.h
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 30 Oct 2016 21:01:33 +0100
changeset 10563 e3d84016cb79
parent 9998 f67cf37e9cd4
child 10695 e54fce44f677
permissions -rw-r--r--
Fixed outdated info in README.
slouken@8582
     1
/*
slouken@8582
     2
  Simple DirectMedia Layer
slouken@9998
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
slouken@8582
     4
slouken@8582
     5
  This software is provided 'as-is', without any express or implied
slouken@8582
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@8582
     7
  arising from the use of this software.
slouken@8582
     8
slouken@8582
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@8582
    10
  including commercial applications, and to alter it and redistribute it
slouken@8582
    11
  freely, subject to the following restrictions:
slouken@8582
    12
slouken@8582
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@8582
    14
     claim that you wrote the original software. If you use this software
slouken@8582
    15
     in a product, an acknowledgment in the product documentation would be
slouken@8582
    16
     appreciated but is not required.
slouken@8582
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@8582
    18
     misrepresented as being the original software.
slouken@8582
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@8582
    20
*/
slouken@8582
    21
#include "SDL_config.h"
slouken@8582
    22
slouken@8582
    23
#ifndef _SDL_winrtopengles_h
slouken@8582
    24
#define _SDL_winrtopengles_h
slouken@8582
    25
slouken@8582
    26
#if SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL
slouken@8582
    27
slouken@8582
    28
#include "../SDL_sysvideo.h"
slouken@8582
    29
#include "../SDL_egl_c.h"
slouken@8582
    30
slouken@8582
    31
/* OpenGLES functions */
slouken@8582
    32
#define WINRT_GLES_GetAttribute SDL_EGL_GetAttribute
slouken@8582
    33
#define WINRT_GLES_GetProcAddress SDL_EGL_GetProcAddress
slouken@8582
    34
#define WINRT_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
slouken@8582
    35
#define WINRT_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
slouken@8582
    36
#define WINRT_GLES_DeleteContext SDL_EGL_DeleteContext
slouken@8582
    37
slouken@8582
    38
extern int WINRT_GLES_LoadLibrary(_THIS, const char *path);
dludwig@8663
    39
extern void WINRT_GLES_UnloadLibrary(_THIS);
slouken@8582
    40
extern SDL_GLContext WINRT_GLES_CreateContext(_THIS, SDL_Window * window);
slouken@8582
    41
extern void WINRT_GLES_SwapWindow(_THIS, SDL_Window * window);
slouken@8582
    42
extern int WINRT_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
slouken@8582
    43
dludwig@8663
    44
dludwig@8663
    45
#ifdef __cplusplus
dludwig@8663
    46
dludwig@8663
    47
/* Typedefs for ANGLE/WinRT's C++-based native-display and native-window types,
dludwig@8663
    48
 * which are used when calling eglGetDisplay and eglCreateWindowSurface.
dludwig@8663
    49
 */
dludwig@9211
    50
typedef Microsoft::WRL::ComPtr<IUnknown> WINRT_EGLNativeWindowType_Old;
dludwig@8663
    51
dludwig@9211
    52
/* Function pointer typedefs for 'old' ANGLE/WinRT's functions, which may
dludwig@9211
    53
 * require that C++ objects be passed in:
dludwig@8663
    54
 */
dludwig@9211
    55
typedef EGLDisplay (EGLAPIENTRY *eglGetDisplay_Old_Function)(WINRT_EGLNativeWindowType_Old);
dludwig@9211
    56
typedef EGLSurface (EGLAPIENTRY *eglCreateWindowSurface_Old_Function)(EGLDisplay, EGLConfig, WINRT_EGLNativeWindowType_Old, const EGLint *);
dludwig@9211
    57
typedef HRESULT (EGLAPIENTRY *CreateWinrtEglWindow_Old_Function)(Microsoft::WRL::ComPtr<IUnknown>, int, IUnknown ** result);
dludwig@8663
    58
dludwig@8663
    59
#endif /* __cplusplus */
dludwig@8663
    60
dludwig@9211
    61
/* Function pointer typedefs for 'new' ANGLE/WinRT functions, which, unlike
dludwig@9211
    62
 * the old functions, do not require C++ support and work with plain C.
dludwig@9211
    63
 */
dludwig@9211
    64
typedef EGLDisplay (EGLAPIENTRY *eglGetPlatformDisplayEXT_Function)(EGLenum, void *, const EGLint *);
dludwig@9211
    65
slouken@8582
    66
#endif /* SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL */
slouken@8582
    67
slouken@8582
    68
#endif /* _SDL_winrtopengles_h */
slouken@8582
    69
slouken@8582
    70
/* vi: set ts=4 sw=4 expandtab: */