gdk: Add support for building with OpenGL on Xbox

This commit is contained in:
Caleb Cornett
2022-12-19 17:22:23 -05:00
committed by Ethan Lee
parent de871dc5f7
commit 3ebfb15469
5 changed files with 93 additions and 10 deletions

View File

@@ -25,6 +25,38 @@
#if SDL_VIDEO_OPENGL_WGL
#if __XBOXONE__ || __XBOXSERIES__
typedef struct tagPIXELFORMATDESCRIPTOR
{
WORD nSize;
WORD nVersion;
DWORD dwFlags;
BYTE iPixelType;
BYTE cColorBits;
BYTE cRedBits;
BYTE cRedShift;
BYTE cGreenBits;
BYTE cGreenShift;
BYTE cBlueBits;
BYTE cBlueShift;
BYTE cAlphaBits;
BYTE cAlphaShift;
BYTE cAccumBits;
BYTE cAccumRedBits;
BYTE cAccumGreenBits;
BYTE cAccumBlueBits;
BYTE cAccumAlphaBits;
BYTE cDepthBits;
BYTE cStencilBits;
BYTE cAuxBuffers;
BYTE iLayerType;
BYTE bReserved;
DWORD dwLayerMask;
DWORD dwVisibleMask;
DWORD dwDamageMask;
} PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
#endif
struct SDL_GLDriverData
{
SDL_bool HAS_WGL_ARB_pixel_format;
@@ -53,6 +85,19 @@ struct SDL_GLDriverData
BOOL (WINAPI *wglGetPixelFormatAttribivARB)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
BOOL (WINAPI *wglSwapIntervalEXT)(int interval);
int (WINAPI *wglGetSwapIntervalEXT)(void);
#if __XBOXONE__ || __XBOXSERIES__
BOOL (WINAPI *wglSwapBuffers)(HDC hdc);
int (WINAPI *wglDescribePixelFormat)(HDC hdc,
int iPixelFormat,
UINT nBytes,
LPPIXELFORMATDESCRIPTOR ppfd);
int (WINAPI *wglChoosePixelFormat)(HDC hdc,
const PIXELFORMATDESCRIPTOR *ppfd);
BOOL (WINAPI *wglSetPixelFormat)(HDC hdc,
int format,
const PIXELFORMATDESCRIPTOR *ppfd);
int (WINAPI *wglGetPixelFormat)(HDC hdc);
#endif
/* *INDENT-ON* */ /* clang-format on */
};