mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
[gl] Explicitly request compatibility profile
And core profile for glsl
This commit is contained in:
parent
7ca3b56620
commit
00362e9f4e
5 changed files with 14 additions and 6 deletions
|
@ -8,7 +8,7 @@ typedef struct gl_ctx_s {
|
|||
GL_context context;
|
||||
void (*load_gl) (void);
|
||||
void (*choose_visual) (struct gl_ctx_s *ctx);
|
||||
void (*create_context) (struct gl_ctx_s *ctx);
|
||||
void (*create_context) (struct gl_ctx_s *ctx, int core);
|
||||
void (*init_gl) (void);
|
||||
void *(*get_proc_address) (const char *name, qboolean crit);
|
||||
void (*end_rendering) (void);
|
||||
|
|
|
@ -147,7 +147,7 @@ gl_vid_render_choose_visual (void *data)
|
|||
static void
|
||||
gl_vid_render_create_context (void *data)
|
||||
{
|
||||
gl_ctx->create_context (gl_ctx);
|
||||
gl_ctx->create_context (gl_ctx, 0);
|
||||
}
|
||||
|
||||
static vid_model_funcs_t model_funcs = {
|
||||
|
|
|
@ -55,7 +55,7 @@ glsl_vid_render_choose_visual (void *data)
|
|||
static void
|
||||
glsl_vid_render_create_context (void *data)
|
||||
{
|
||||
glsl_ctx->create_context (glsl_ctx);
|
||||
glsl_ctx->create_context (glsl_ctx, 1);
|
||||
}
|
||||
|
||||
static vid_model_funcs_t model_funcs = {
|
||||
|
|
|
@ -117,7 +117,7 @@ wgl_set_pixel_format (void)
|
|||
}
|
||||
|
||||
static void
|
||||
wgl_create_context (gl_ctx_t *ctx)
|
||||
wgl_create_context (gl_ctx_t *ctx, int core)
|
||||
{
|
||||
DWORD lasterror;
|
||||
|
||||
|
|
|
@ -66,6 +66,12 @@
|
|||
#define GLX_STENCIL_SIZE 13 // number of stencil bits
|
||||
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define GLX_CONTEXT_FLAGS_ARB 0x2094
|
||||
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
|
||||
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
|
||||
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
|
@ -187,12 +193,14 @@ glx_choose_visual (gl_ctx_t *ctx)
|
|||
}
|
||||
|
||||
static void
|
||||
glx_create_context (gl_ctx_t *ctx)
|
||||
glx_create_context (gl_ctx_t *ctx, int core)
|
||||
{
|
||||
int attribs[] = {
|
||||
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
|
||||
GLX_CONTEXT_MINOR_VERSION_ARB, 0,
|
||||
//GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
|
||||
GLX_CONTEXT_PROFILE_MASK_ARB,
|
||||
core ? GLX_CONTEXT_CORE_PROFILE_BIT_ARB
|
||||
: GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
|
||||
None
|
||||
};
|
||||
XSync (x_disp, 0);
|
||||
|
|
Loading…
Reference in a new issue