Try to be more compatible with older systems

This commit is contained in:
UnknownShadow200 2024-06-19 12:31:30 +10:00
parent e8f6800096
commit edf81f7a71
13 changed files with 125 additions and 15 deletions

110
misc/linux/min-glx.h Normal file
View file

@ -0,0 +1,110 @@
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef GLX_H
#define GLX_H
#include <X11/Xlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Tokens for glXChooseVisual and glXGetConfig:
*/
#define GLX_USE_GL 1
#define GLX_BUFFER_SIZE 2
#define GLX_LEVEL 3
#define GLX_RGBA 4
#define GLX_DOUBLEBUFFER 5
#define GLX_STEREO 6
#define GLX_AUX_BUFFERS 7
#define GLX_RED_SIZE 8
#define GLX_GREEN_SIZE 9
#define GLX_BLUE_SIZE 10
#define GLX_ALPHA_SIZE 11
#define GLX_DEPTH_SIZE 12
#define GLX_STENCIL_SIZE 13
typedef struct __GLXcontextRec *GLXContext;
typedef XID GLXDrawable;
/* GLX 1.3 and later */
typedef struct __GLXFBConfigRec *GLXFBConfig;
typedef XID GLXFBConfigID;
typedef XID GLXContextID;
typedef XID GLXWindow;
extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
int *attribList );
extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
GLXContext shareList, Bool direct );
extern void glXDestroyContext( Display *dpy, GLXContext ctx );
extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
GLXContext ctx);
extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
/* GLX 1.1 and later */
extern const char *glXQueryExtensionsString( Display *dpy, int screen );
/* GLX 1.3 and later */
extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
const int *attribList, int *nitems );
extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
int *nelements );
extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
GLXFBConfig config );
/*
* ARB 2. GLX_ARB_get_proc_address
*/
typedef void (*__GLXextFuncPtr)(void);
extern __GLXextFuncPtr glXGetProcAddressARB (const char *);
/* GLX 1.4 and later */
extern void (*glXGetProcAddress(const char *procname))( void );
/* GLX 1.4 function pointer typedefs */
typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const char *procName);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -13,7 +13,6 @@
#include "Options.h" #include "Options.h"
#include "Queue.h" #include "Queue.h"
struct LightNode { struct LightNode {
IVec3 coords; /* 12 bytes */ IVec3 coords; /* 12 bytes */
cc_uint8 brightness; /* 1 byte */ cc_uint8 brightness; /* 1 byte */

View file

@ -1,7 +1,6 @@
#include "Core.h"
#ifndef CC_QUEUE_H #ifndef CC_QUEUE_H
#define CC_QUEUE_H #define CC_QUEUE_H
#include "Core.h"
struct Queue { struct Queue {
cc_uint8* entries; /* Buffer holding the bytes of the queue */ cc_uint8* entries; /* Buffer holding the bytes of the queue */

View file

@ -1315,7 +1315,9 @@ void Window_DisableRawMouse(void) {
*-------------------------------------------------------glX OpenGL--------------------------------------------------------* *-------------------------------------------------------glX OpenGL--------------------------------------------------------*
*#########################################################################################################################*/ *#########################################################################################################################*/
#if (CC_GFX_BACKEND & CC_GFX_BACKEND_GL_MASK) && !defined CC_BUILD_EGL #if (CC_GFX_BACKEND & CC_GFX_BACKEND_GL_MASK) && !defined CC_BUILD_EGL
#include <GL/glx.h> /* #include <GL/glx.h> */
#include "../misc/linux/min-glx.h"
static GLXContext ctx_handle; static GLXContext ctx_handle;
typedef int (*FP_SWAPINTERVAL)(int interval); typedef int (*FP_SWAPINTERVAL)(int interval);
typedef Bool (*FP_QUERYRENDERER)(int attribute, unsigned int* value); typedef Bool (*FP_QUERYRENDERER)(int attribute, unsigned int* value);