GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
None
};
- int ctx_attribs[] =
+ int ctx_attribs_3_1[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
None
};
+ int ctx_attribs_3_2[] =
+ {
+ GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+ GLX_CONTEXT_MINOR_VERSION_ARB, 2,
+ GLX_RENDER_TYPE, GLX_RGBA_TYPE,
+ GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+ None
+ };
int surface_attribs[] = {
GLX_PBUFFER_WIDTH, 1,
GLX_PBUFFER_HEIGHT, 1,
const GLubyte *(GLAPIENTRY *GetStringi)(GLenum, GLuint) = NULL;
void (GLAPIENTRY *GetIntegerv)(GLenum, GLint*) = NULL;
GLint i, num_extensions = 0;
- GLint major = 0, minor = 0;
YAGL_EGL_GLX_ENTER(yagl_egl_glx_get_gl_version, NULL);
configs[0],
NULL,
True,
- ctx_attribs);
+ ctx_attribs_3_1);
if (!ctx) {
YAGL_LOG_INFO("glXCreateContextAttribsARB failed, using OpenGL 2.1");
* able to patch shaders and run them with GLSL 1.50.
*/
- GetIntegerv(GL_MAJOR_VERSION, &major);
- GetIntegerv(GL_MINOR_VERSION, &minor);
+ egl_glx->glXMakeContextCurrent(egl_glx->global_dpy, 0, 0, NULL);
+ egl_glx->glXDestroyContext(egl_glx->global_dpy, ctx);
+
+ ctx = egl_glx->glXCreateContextAttribsARB(egl_glx->global_dpy,
+ configs[0],
+ NULL,
+ True,
+ ctx_attribs_3_2);
- if ((major > 3) ||
- ((major == 3) && (minor >= 2))) {
+ if (ctx) {
YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, using OpenGL 3.2");
*version = yagl_gl_3_2;
- res = true;
- goto out;
+ } else {
+ YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, OpenGL 3.2 not supported, using OpenGL 3.1");
+ *version = yagl_gl_3_1;
}
- YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, OpenGL 3.2 not supported, using OpenGL 3.1");
- *version = yagl_gl_3_1;
res = true;
out:
{
struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
GLXContext ctx;
- int attribs[] =
+ int attribs_3_1[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
None
};
+ int attribs_3_2[] =
+ {
+ GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+ GLX_CONTEXT_MINOR_VERSION_ARB, 2,
+ GLX_RENDER_TYPE, GLX_RGBA_TYPE,
+ GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+ None
+ };
YAGL_EGL_GLX_ENTER(yagl_egl_glx_context_create,
"dpy = %p, share_context = %p, version = %d",
NULL
: (GLXContext)share_context),
True,
- attribs);
+ ((egl_glx->base.gl_version >= yagl_gl_3_2) ?
+ attribs_3_2 : attribs_3_1));
} else {
ctx = egl_glx->glXCreateNewContext(dpy,
(GLXFBConfig)cfg->driver_data,
WGL_STENCIL_BITS_ARB, 8,
0,
};
- int ctx_attribs[] =
+ int ctx_attribs_3_1[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
0
};
+ int ctx_attribs_3_2[] =
+ {
+ WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
+ WGL_CONTEXT_MINOR_VERSION_ARB, 2,
+ WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
+ 0
+ };
int pbuff_attribs[] =
{
WGL_PBUFFER_LARGEST_ARB, FALSE,
int config_id = 0;
UINT n = 0;
PIXELFORMATDESCRIPTOR pix_fmt;
- HGLRC ctx;
+ HGLRC ctx = NULL;
HPBUFFERARB pbuffer;
HDC pbuffer_dc;
const GLubyte *(GLAPIENTRY *GetStringi)(GLenum, GLuint) = NULL;
void (GLAPIENTRY *GetIntegerv)(GLenum, GLint*) = NULL;
GLint i, num_extensions = 0;
- GLint major = 0, minor = 0;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_get_gl_version, NULL);
ctx = egl_wgl->wglCreateContextAttribsARB(dc,
NULL,
- ctx_attribs);
+ ctx_attribs_3_1);
if (!ctx) {
YAGL_LOG_INFO("wglCreateContextAttribsARB failed, using OpenGL 2.1");
* able to patch shaders and run them with GLSL 1.50.
*/
- GetIntegerv(GL_MAJOR_VERSION, &major);
- GetIntegerv(GL_MINOR_VERSION, &minor);
+ egl_wgl->wglMakeCurrent(NULL, NULL);
+ egl_wgl->wglDeleteContext(ctx);
+
+ ctx = egl_wgl->wglCreateContextAttribsARB(dc,
+ NULL,
+ ctx_attribs_3_2);
- if ((major > 3) ||
- ((major == 3) && (minor >= 2))) {
+ if (ctx) {
YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, using OpenGL 3.2");
*version = yagl_gl_3_2;
- res = true;
- goto out7;
+ } else {
+ YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, OpenGL 3.2 not supported, using OpenGL 3.1");
+ *version = yagl_gl_3_1;
}
- YAGL_LOG_INFO("GL_ARB_ES3_compatibility not supported, OpenGL 3.2 not supported, using OpenGL 3.1");
- *version = yagl_gl_3_1;
res = true;
out7:
out5:
egl_wgl->wglDestroyPbufferARB(pbuffer);
out4:
- egl_wgl->wglDeleteContext(ctx);
+ if (ctx) {
+ egl_wgl->wglDeleteContext(ctx);
+ }
out3:
ReleaseDC(win, dc);
out2:
{
YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
YaglEglWglDpy *dpy = (YaglEglWglDpy *)egl_dpy;
- int attribs[] =
+ int attribs_3_1[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
0
};
+ int attribs_3_2[] =
+ {
+ WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
+ WGL_CONTEXT_MINOR_VERSION_ARB, 2,
+ WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
+ 0
+ };
HGLRC egl_wgl_ctx;
HDC dc;
if ((egl_wgl->base.gl_version > yagl_gl_2) && (version != 1)) {
egl_wgl_ctx = egl_wgl->wglCreateContextAttribsARB(dc,
share_context,
- attribs);
+ ((egl_wgl->base.gl_version >= yagl_gl_3_2) ?
+ attribs_3_2 : attribs_3_1));
} else {
egl_wgl_ctx = egl_wgl->wglCreateContext(dc);
}