cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

SDL_windowsopengl.h (5680B)


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