src/video/wincommon/SDL_wingl_c.h
author Ryan C. Gordon <icculus@icculus.org>
Fri, 06 Jan 2006 13:20:10 +0000
changeset 1234 73676c1f56ee
parent 769 b8d311d90021
child 1312 c9b51268668f
permissions -rw-r--r--
For sanity's sake, removed the '&' when passing copy_row array to asm.
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@769
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@0
     6
    modify it under the terms of the GNU Library General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@0
     8
    version 2 of the License, or (at your option) any later version.
slouken@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@0
    13
    Library General Public License for more details.
slouken@0
    14
slouken@0
    15
    You should have received a copy of the GNU Library General Public
slouken@0
    16
    License along with this library; if not, write to the Free
slouken@0
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@252
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@0
    22
slouken@0
    23
#ifdef SAVE_RCSID
slouken@0
    24
static char rcsid =
slouken@0
    25
 "@(#) $Id$";
slouken@0
    26
#endif
slouken@0
    27
slouken@0
    28
/* WGL implementation of SDL OpenGL support */
slouken@0
    29
slouken@0
    30
#include "SDL_sysvideo.h"
slouken@0
    31
slouken@0
    32
slouken@0
    33
struct SDL_PrivateGLData {
slouken@0
    34
    int gl_active; /* to stop switching drivers while we have a valid context */
slouken@0
    35
slouken@0
    36
#ifdef HAVE_OPENGL
slouken@0
    37
    PIXELFORMATDESCRIPTOR GL_pfd;
slouken@0
    38
    HDC GL_hdc;
slouken@0
    39
    HGLRC GL_hrc;
slouken@655
    40
    int pixel_format;
slouken@655
    41
    int wgl_arb_pixel_format;
slouken@0
    42
slouken@0
    43
    void * (WINAPI *wglGetProcAddress)(const char *proc);
slouken@0
    44
slouken@0
    45
    HGLRC (WINAPI *wglCreateContext)(HDC hdc);
slouken@0
    46
slouken@0
    47
    BOOL (WINAPI *wglDeleteContext)(HGLRC hglrc);
slouken@0
    48
slouken@0
    49
    BOOL (WINAPI *wglMakeCurrent)(HDC hdc, HGLRC hglrc);
slouken@655
    50
   
slouken@655
    51
    BOOL (WINAPI *wglChoosePixelFormatARB)(HDC hdc, const int *piAttribIList,
slouken@655
    52
                                           const FLOAT *pfAttribFList,
slouken@655
    53
                                           UINT nMaxFormats, int *piFormats,
slouken@655
    54
                                           UINT *nNumFormats);
slouken@655
    55
    BOOL (WINAPI *wglGetPixelFormatAttribivARB)(HDC hdc, int iPixelFormat,
slouken@655
    56
                                                int iLayerPlane,
slouken@655
    57
                                                UINT nAttributes, 
slouken@655
    58
                                                const int *piAttributes,
slouken@655
    59
                                                int *piValues);
slouken@0
    60
#endif /* HAVE_OPENGL */
slouken@0
    61
};
slouken@0
    62
slouken@0
    63
/* Old variable names */
slouken@0
    64
#define gl_active	(this->gl_data->gl_active)
slouken@0
    65
#define GL_pfd		(this->gl_data->GL_pfd)
slouken@0
    66
#define GL_hdc		(this->gl_data->GL_hdc)
slouken@0
    67
#define GL_hrc		(this->gl_data->GL_hrc)
slouken@655
    68
#define pixel_format	(this->gl_data->pixel_format)
slouken@0
    69
slouken@0
    70
/* OpenGL functions */
slouken@0
    71
extern int WIN_GL_SetupWindow(_THIS);
slouken@0
    72
extern void WIN_GL_ShutDown(_THIS);
slouken@0
    73
#ifdef HAVE_OPENGL
slouken@0
    74
extern int WIN_GL_MakeCurrent(_THIS);
slouken@0
    75
extern int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
slouken@0
    76
extern void WIN_GL_SwapBuffers(_THIS);
slouken@0
    77
extern void WIN_GL_UnloadLibrary(_THIS);
slouken@0
    78
extern int WIN_GL_LoadLibrary(_THIS, const char* path);
slouken@0
    79
extern void *WIN_GL_GetProcAddress(_THIS, const char* proc);
slouken@0
    80
#endif
slouken@0
    81
slouken@655
    82
#ifdef HAVE_OPENGL
slouken@655
    83
slouken@655
    84
#ifndef WGL_ARB_pixel_format
slouken@655
    85
#define WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000
slouken@655
    86
#define WGL_DRAW_TO_WINDOW_ARB         0x2001
slouken@655
    87
#define WGL_DRAW_TO_BITMAP_ARB         0x2002
slouken@655
    88
#define WGL_ACCELERATION_ARB           0x2003
slouken@655
    89
#define WGL_NEED_PALETTE_ARB           0x2004
slouken@655
    90
#define WGL_NEED_SYSTEM_PALETTE_ARB    0x2005
slouken@655
    91
#define WGL_SWAP_LAYER_BUFFERS_ARB     0x2006
slouken@655
    92
#define WGL_SWAP_METHOD_ARB            0x2007
slouken@655
    93
#define WGL_NUMBER_OVERLAYS_ARB        0x2008
slouken@655
    94
#define WGL_NUMBER_UNDERLAYS_ARB       0x2009
slouken@655
    95
#define WGL_TRANSPARENT_ARB            0x200A
slouken@655
    96
#define WGL_TRANSPARENT_RED_VALUE_ARB  0x2037
slouken@655
    97
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
slouken@655
    98
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
slouken@655
    99
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
slouken@655
   100
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
slouken@655
   101
#define WGL_SHARE_DEPTH_ARB            0x200C
slouken@655
   102
#define WGL_SHARE_STENCIL_ARB          0x200D
slouken@655
   103
#define WGL_SHARE_ACCUM_ARB            0x200E
slouken@655
   104
#define WGL_SUPPORT_GDI_ARB            0x200F
slouken@655
   105
#define WGL_SUPPORT_OPENGL_ARB         0x2010
slouken@655
   106
#define WGL_DOUBLE_BUFFER_ARB          0x2011
slouken@655
   107
#define WGL_STEREO_ARB                 0x2012
slouken@655
   108
#define WGL_PIXEL_TYPE_ARB             0x2013
slouken@655
   109
#define WGL_COLOR_BITS_ARB             0x2014
slouken@655
   110
#define WGL_RED_BITS_ARB               0x2015
slouken@655
   111
#define WGL_RED_SHIFT_ARB              0x2016
slouken@655
   112
#define WGL_GREEN_BITS_ARB             0x2017
slouken@655
   113
#define WGL_GREEN_SHIFT_ARB            0x2018
slouken@655
   114
#define WGL_BLUE_BITS_ARB              0x2019
slouken@655
   115
#define WGL_BLUE_SHIFT_ARB             0x201A
slouken@655
   116
#define WGL_ALPHA_BITS_ARB             0x201B
slouken@655
   117
#define WGL_ALPHA_SHIFT_ARB            0x201C
slouken@655
   118
#define WGL_ACCUM_BITS_ARB             0x201D
slouken@655
   119
#define WGL_ACCUM_RED_BITS_ARB         0x201E
slouken@655
   120
#define WGL_ACCUM_GREEN_BITS_ARB       0x201F
slouken@655
   121
#define WGL_ACCUM_BLUE_BITS_ARB        0x2020
slouken@655
   122
#define WGL_ACCUM_ALPHA_BITS_ARB       0x2021
slouken@655
   123
#define WGL_DEPTH_BITS_ARB             0x2022
slouken@655
   124
#define WGL_STENCIL_BITS_ARB           0x2023
slouken@655
   125
#define WGL_AUX_BUFFERS_ARB            0x2024
slouken@655
   126
#define WGL_NO_ACCELERATION_ARB        0x2025
slouken@655
   127
#define WGL_GENERIC_ACCELERATION_ARB   0x2026
slouken@655
   128
#define WGL_FULL_ACCELERATION_ARB      0x2027
slouken@655
   129
#define WGL_SWAP_EXCHANGE_ARB          0x2028
slouken@655
   130
#define WGL_SWAP_COPY_ARB              0x2029
slouken@655
   131
#define WGL_SWAP_UNDEFINED_ARB         0x202A
slouken@655
   132
#define WGL_TYPE_RGBA_ARB              0x202B
slouken@655
   133
#define WGL_TYPE_COLORINDEX_ARB        0x202C
slouken@655
   134
#endif
slouken@655
   135
slouken@655
   136
#ifndef WGL_ARB_multisample
slouken@655
   137
#define WGL_SAMPLE_BUFFERS_ARB         0x2041
slouken@655
   138
#define WGL_SAMPLES_ARB                0x2042
slouken@655
   139
#endif
slouken@655
   140
slouken@655
   141
#endif