src/video/windows/SDL_windowsopengl.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 18 May 2018 13:09:30 -0700
changeset 11983 3a50eb90e4b2
parent 11811 5d94cb6b24d3
child 12201 8bdc4d340419
permissions -rw-r--r--
Merged latest changes from Steam Link app
slouken@1913
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@11811
     3
  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
slouken@1913
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@1913
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@1913
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@1913
    20
*/
icculus@8093
    21
#include "../../SDL_internal.h"
slouken@1913
    22
slouken@11382
    23
#ifndef SDL_windowsopengl_h_
slouken@11382
    24
#define SDL_windowsopengl_h_
slouken@1913
    25
slouken@1952
    26
#if SDL_VIDEO_OPENGL_WGL
slouken@1913
    27
slouken@1913
    28
struct SDL_GLDriverData
slouken@1913
    29
{
icculus@6382
    30
    SDL_bool HAS_WGL_ARB_pixel_format;
icculus@6382
    31
    SDL_bool HAS_WGL_EXT_swap_control_tear;
icculus@9413
    32
    SDL_bool HAS_WGL_ARB_context_flush_control;
icculus@11332
    33
    SDL_bool HAS_WGL_ARB_create_context_robustness;
flibitijibibo@11347
    34
    SDL_bool HAS_WGL_ARB_create_context_no_error;
slouken@1913
    35
slouken@10806
    36
	/* Max version of OpenGL ES context that can be created if the
slouken@10806
    37
	   implementation supports WGL_EXT_create_context_es2_profile.
slouken@10806
    38
	   major = minor = 0 when unsupported.
slouken@10806
    39
	 */
slouken@10806
    40
	struct {
slouken@10806
    41
		int major;
slouken@10806
    42
		int minor;
slouken@10806
    43
	} es_profile_max_supported_version;
slouken@10806
    44
slouken@10806
    45
	void *(WINAPI * wglGetProcAddress) (const char *proc);
slouken@1913
    46
      HGLRC(WINAPI * wglCreateContext) (HDC hdc);
slouken@1913
    47
      BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
slouken@1913
    48
      BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
slouken@6393
    49
      BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2);
slouken@1913
    50
      BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
slouken@1913
    51
                                              const int *piAttribIList,
slouken@1913
    52
                                              const FLOAT * pfAttribFList,
slouken@1913
    53
                                              UINT nMaxFormats,
slouken@1913
    54
                                              int *piFormats,
slouken@1913
    55
                                              UINT * nNumFormats);
slouken@1913
    56
      BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
slouken@1913
    57
                                                   int iLayerPlane,
slouken@1913
    58
                                                   UINT nAttributes,
slouken@1913
    59
                                                   const int *piAttributes,
slouken@1913
    60
                                                   int *piValues);
icculus@6384
    61
    BOOL (WINAPI * wglSwapIntervalEXT) (int interval);
slouken@1913
    62
    int (WINAPI * wglGetSwapIntervalEXT) (void);
slouken@1913
    63
};
slouken@1913
    64
slouken@1913
    65
/* OpenGL functions */
slouken@1913
    66
extern int WIN_GL_LoadLibrary(_THIS, const char *path);
slouken@1913
    67
extern void *WIN_GL_GetProcAddress(_THIS, const char *proc);
slouken@3057
    68
extern void WIN_GL_UnloadLibrary(_THIS);
slouken@10806
    69
extern SDL_bool WIN_GL_UseEGL(_THIS);
slouken@1913
    70
extern int WIN_GL_SetupWindow(_THIS, SDL_Window * window);
slouken@1913
    71
extern SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window * window);
slouken@1913
    72
extern int WIN_GL_MakeCurrent(_THIS, SDL_Window * window,
slouken@1913
    73
                              SDL_GLContext context);
slouken@1913
    74
extern int WIN_GL_SetSwapInterval(_THIS, int interval);
slouken@1913
    75
extern int WIN_GL_GetSwapInterval(_THIS);
slouken@10690
    76
extern int WIN_GL_SwapWindow(_THIS, SDL_Window * window);
slouken@1913
    77
extern void WIN_GL_DeleteContext(_THIS, SDL_GLContext context);
gabomdq@8021
    78
extern void WIN_GL_InitExtensions(_THIS);
slouken@8144
    79
extern SDL_bool WIN_GL_SetPixelFormatFrom(_THIS, SDL_Window * fromWindow, SDL_Window * toWindow);
slouken@1913
    80
slouken@1913
    81
#ifndef WGL_ARB_pixel_format
slouken@1913
    82
#define WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000
slouken@1913
    83
#define WGL_DRAW_TO_WINDOW_ARB         0x2001
slouken@1913
    84
#define WGL_DRAW_TO_BITMAP_ARB         0x2002
slouken@1913
    85
#define WGL_ACCELERATION_ARB           0x2003
slouken@1913
    86
#define WGL_NEED_PALETTE_ARB           0x2004
slouken@1913
    87
#define WGL_NEED_SYSTEM_PALETTE_ARB    0x2005
slouken@1913
    88
#define WGL_SWAP_LAYER_BUFFERS_ARB     0x2006
slouken@1913
    89
#define WGL_SWAP_METHOD_ARB            0x2007
slouken@1913
    90
#define WGL_NUMBER_OVERLAYS_ARB        0x2008
slouken@1913
    91
#define WGL_NUMBER_UNDERLAYS_ARB       0x2009
slouken@1913
    92
#define WGL_TRANSPARENT_ARB            0x200A
slouken@1913
    93
#define WGL_TRANSPARENT_RED_VALUE_ARB  0x2037
slouken@1913
    94
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
slouken@1913
    95
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
slouken@1913
    96
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
slouken@1913
    97
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
slouken@1913
    98
#define WGL_SHARE_DEPTH_ARB            0x200C
slouken@1913
    99
#define WGL_SHARE_STENCIL_ARB          0x200D
slouken@1913
   100
#define WGL_SHARE_ACCUM_ARB            0x200E
slouken@1913
   101
#define WGL_SUPPORT_GDI_ARB            0x200F
slouken@1913
   102
#define WGL_SUPPORT_OPENGL_ARB         0x2010
slouken@1913
   103
#define WGL_DOUBLE_BUFFER_ARB          0x2011
slouken@1913
   104
#define WGL_STEREO_ARB                 0x2012
slouken@1913
   105
#define WGL_PIXEL_TYPE_ARB             0x2013
slouken@1913
   106
#define WGL_COLOR_BITS_ARB             0x2014
slouken@1913
   107
#define WGL_RED_BITS_ARB               0x2015
slouken@1913
   108
#define WGL_RED_SHIFT_ARB              0x2016
slouken@1913
   109
#define WGL_GREEN_BITS_ARB             0x2017
slouken@1913
   110
#define WGL_GREEN_SHIFT_ARB            0x2018
slouken@1913
   111
#define WGL_BLUE_BITS_ARB              0x2019
slouken@1913
   112
#define WGL_BLUE_SHIFT_ARB             0x201A
slouken@1913
   113
#define WGL_ALPHA_BITS_ARB             0x201B
slouken@1913
   114
#define WGL_ALPHA_SHIFT_ARB            0x201C
slouken@1913
   115
#define WGL_ACCUM_BITS_ARB             0x201D
slouken@1913
   116
#define WGL_ACCUM_RED_BITS_ARB         0x201E
slouken@1913
   117
#define WGL_ACCUM_GREEN_BITS_ARB       0x201F
slouken@1913
   118
#define WGL_ACCUM_BLUE_BITS_ARB        0x2020
slouken@1913
   119
#define WGL_ACCUM_ALPHA_BITS_ARB       0x2021
slouken@1913
   120
#define WGL_DEPTH_BITS_ARB             0x2022
slouken@1913
   121
#define WGL_STENCIL_BITS_ARB           0x2023
slouken@1913
   122
#define WGL_AUX_BUFFERS_ARB            0x2024
slouken@1913
   123
#define WGL_NO_ACCELERATION_ARB        0x2025
slouken@1913
   124
#define WGL_GENERIC_ACCELERATION_ARB   0x2026
slouken@1913
   125
#define WGL_FULL_ACCELERATION_ARB      0x2027
slouken@1913
   126
#define WGL_SWAP_EXCHANGE_ARB          0x2028
slouken@1913
   127
#define WGL_SWAP_COPY_ARB              0x2029
slouken@1913
   128
#define WGL_SWAP_UNDEFINED_ARB         0x202A
slouken@1913
   129
#define WGL_TYPE_RGBA_ARB              0x202B
slouken@1913
   130
#define WGL_TYPE_COLORINDEX_ARB        0x202C
slouken@1913
   131
#endif
slouken@1913
   132
slouken@1913
   133
#ifndef WGL_ARB_multisample
slouken@1913
   134
#define WGL_SAMPLE_BUFFERS_ARB         0x2041
slouken@1913
   135
#define WGL_SAMPLES_ARB                0x2042
slouken@1913
   136
#endif
slouken@1913
   137
slouken@1952
   138
#endif /* SDL_VIDEO_OPENGL_WGL */
slouken@1913
   139
slouken@11382
   140
#endif /* SDL_windowsopengl_h_ */
slouken@1913
   141
slouken@1913
   142
/* vi: set ts=4 sw=4 expandtab: */