-
Hi!
I'm trying to use GLSL 3.30 but it's always telling me that's not supported, I've changed this line and recompiled SFML but it doesn't work :
int attributes[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, static_cast<int>(m_settings.majorVersion),
GLX_CONTEXT_MINOR_VERSION_ARB, static_cast<int>(m_settings.minorVersion),
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
0, 0
};
Here is what the console shows :
glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD CEDAR
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.0-devel (git-ee2a818 trusty-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.3.0-devel (git-ee2a818 trusty-oibaf-ppa)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
Why doesn't he want to activate the new opengl profile ?
-
If you search the forum you can find a couple of threads on this exact topic that got fairly clear answers.
http://en.sfml-dev.org/forums/index.php?topic=15333.msg108809#msg108809
http://en.sfml-dev.org/forums/index.php?topic=15648.msg111519#msg111519
-
I'm sure GLX is going to give you a 2.0 core context. Oh wait...
Seriously, if you want to go ahead and modify the SFML source, at least understand how it works first. SFML context management takes time to understand, so have fun while you're at it.
If you don't want to mess with that, you can always install the proprietary catalyst driver from AMD. It supports OpenGL 4.4 along with GLSL 4.40 and all those other state of the art extensions (like SSBOs, compute shaders and ARB_buffer_storage) that every good OpenGL developer must use.
-
I'm sure GLX is going to give you a 2.0 core context. Oh wait...
Yes even if I ask a opengl3 context, SFML gives me an opengl 2 context.
Seriously, if you want to go ahead and modify the SFML source, at least understand how it works first. SFML context management takes time to understand, so have fun while you're at it.
Yes I have an hard time to understand how does it works.
If you don't want to mess with that, you can always install the proprietary catalyst driver from AMD. It supports OpenGL 4.4 along with GLSL 4.40 and all those other state of the art extensions (like SSBOs, compute shaders and ARB_buffer_storage) that every good OpenGL developer must use
I've tried but it gives me a black screen when I want to logon on my ubuntu so..., I've resinstalled the opensource drivers.
-
I've tried but it gives me a black screen when I want to logon on my ubuntu so..., I've resinstalled the opensource drivers.
If linux isn't up to par I guess the only solution is to use windows...
-
Erf I don't have windows..., it seems that it doesn't works with linux anyway, I've tried this code but it doesn't want to use the core profile which support the GLSL 330 version.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/gl.h>
#include <GL/glx.h>
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
// Helper to check for extension string presence. Adapted from:
// http://www.opengl.org/resources/features/OGLextensions/
static bool isExtensionSupported(const char *extList, const char *extension)
{
const char *start;
const char *where, *terminator;
/* Extension names should not have spaces. */
where = strchr(extension, ' ');
if (where || *extension == '\0')
return false;
/* It takes a bit of care to be fool-proof about parsing the
OpenGL extensions string. Don't be fooled by sub-strings,
etc. */
for (start=extList;;) {
where = strstr(start, extension);
if (!where)
break;
terminator = where + strlen(extension);
if ( where == start || *(where - 1) == ' ' )
if ( *terminator == ' ' || *terminator == '\0' )
return true;
start = terminator;
}
return false;
}
static bool ctxErrorOccurred = false;
static int ctxErrorHandler( Display *dpy, XErrorEvent *ev )
{
ctxErrorOccurred = true;
return 0;
}
int main(int argc, char* argv[])
{
Display *display = XOpenDisplay(NULL);
if (!display)
{
printf("Failed to open X display\n");
exit(1);
}
// Get a matching FB config
static int visual_attribs[] =
{
GLX_X_RENDERABLE , True,
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
GLX_RENDER_TYPE , GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
GLX_RED_SIZE , 8,
GLX_GREEN_SIZE , 8,
GLX_BLUE_SIZE , 8,
GLX_ALPHA_SIZE , 8,
GLX_DEPTH_SIZE , 24,
GLX_STENCIL_SIZE , 8,
GLX_DOUBLEBUFFER , True,
//GLX_SAMPLE_BUFFERS , 1,
//GLX_SAMPLES , 4,
None
};
int glx_major, glx_minor;
// FBConfigs were added in GLX version 1.3.
if ( !glXQueryVersion( display, &glx_major, &glx_minor ) ||
( ( glx_major == 1 ) && ( glx_minor < 3 ) ) || ( glx_major < 1 ) )
{
printf("Invalid GLX version");
exit(1);
}
printf( "Getting matching framebuffer configs\n" );
int fbcount;
GLXFBConfig* fbc = glXChooseFBConfig(display, DefaultScreen(display), visual_attribs, &fbcount);
if (!fbc)
{
printf( "Failed to retrieve a framebuffer config\n" );
exit(1);
}
printf( "Found %d matching FB configs.\n", fbcount );
// Pick the FB config/visual with the most samples per pixel
printf( "Getting XVisualInfos\n" );
int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999;
int i;
for (i=0; i<fbcount; ++i)
{
XVisualInfo *vi = glXGetVisualFromFBConfig( display, fbc[i] );
if ( vi )
{
int samp_buf, samples;
glXGetFBConfigAttrib( display, fbc[i], GLX_SAMPLE_BUFFERS, &samp_buf );
glXGetFBConfigAttrib( display, fbc[i], GLX_SAMPLES , &samples );
printf( " Matching fbconfig %d, visual ID 0x%2x: SAMPLE_BUFFERS = %d,"
" SAMPLES = %d\n",
i, vi -> visualid, samp_buf, samples );
if ( best_fbc < 0 || samp_buf && samples > best_num_samp )
best_fbc = i, best_num_samp = samples;
if ( worst_fbc < 0 || !samp_buf || samples < worst_num_samp )
worst_fbc = i, worst_num_samp = samples;
}
XFree( vi );
}
GLXFBConfig bestFbc = fbc[ best_fbc ];
// Be sure to free the FBConfig list allocated by glXChooseFBConfig()
XFree( fbc );
// Get a visual
XVisualInfo *vi = glXGetVisualFromFBConfig( display, bestFbc );
printf( "Chosen visual ID = 0x%x\n", vi->visualid );
printf( "Creating colormap\n" );
XSetWindowAttributes swa;
Colormap cmap;
swa.colormap = cmap = XCreateColormap( display,
RootWindow( display, vi->screen ),
vi->visual, AllocNone );
swa.background_pixmap = None ;
swa.border_pixel = 0;
swa.event_mask = StructureNotifyMask;
printf( "Creating window\n" );
Window win = XCreateWindow( display, RootWindow( display, vi->screen ),
0, 0, 100, 100, 0, vi->depth, InputOutput,
vi->visual,
CWBorderPixel|CWColormap|CWEventMask, &swa );
if ( !win )
{
printf( "Failed to create window.\n" );
exit(1);
}
// Done with the visual info data
XFree( vi );
XStoreName( display, win, "GL 3.0 Window" );
printf( "Mapping window\n" );
XMapWindow( display, win );
// Get the default screen's GLX extension list
const char *glxExts = glXQueryExtensionsString( display,
DefaultScreen( display ) );
// NOTE: It is not necessary to create or make current to a context before
// calling glXGetProcAddressARB
glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)
glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
GLXContext ctx = 0;
// Install an X error handler so the application won't exit if GL 3.0
// context allocation fails.
//
// Note this error handler is global. All display connections in all threads
// of a process use the same error handler, so be sure to guard against other
// threads issuing X commands while this code is running.
ctxErrorOccurred = false;
int (*oldHandler)(Display*, XErrorEvent*) =
XSetErrorHandler(&ctxErrorHandler);
// Check for the GLX_ARB_create_context extension string and the function.
// If either is not present, use GLX 1.3 context creation method.
if ( !isExtensionSupported( glxExts, "GLX_ARB_create_context" ) ||
!glXCreateContextAttribsARB )
{
printf( "glXCreateContextAttribsARB() not found"
" ... using old-style GLX context\n" );
ctx = glXCreateNewContext( display, bestFbc, GLX_RGBA_TYPE, 0, True );
}
// If it does, try to get a GL 3.0 context!
else
{
int context_attribs[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 0,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
//GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
None
};
printf( "Creating context\n" );
ctx = glXCreateContextAttribsARB( display, bestFbc, 0,
True, context_attribs );
// Sync to ensure any errors generated are processed.
XSync( display, False );
if ( !ctxErrorOccurred && ctx )
printf( "Created GL 3.0 context\n" );
else
{
// Couldn't create GL 3.0 context. Fall back to old-style 2.x context.
// When a context version below 3.0 is requested, implementations will
// return the newest context version compatible with OpenGL versions less
// than version 3.0.
// GLX_CONTEXT_MAJOR_VERSION_ARB = 1
context_attribs[1] = 1;
// GLX_CONTEXT_MINOR_VERSION_ARB = 0
context_attribs[3] = 0;
ctxErrorOccurred = false;
printf( "Failed to create GL 3.0 context"
" ... using old-style GLX context\n" );
ctx = glXCreateContextAttribsARB( display, bestFbc, 0,
True, context_attribs );
}
}
// Sync to ensure any errors generated are processed.
XSync( display, False );
// Restore the original error handler
XSetErrorHandler( oldHandler );
if ( ctxErrorOccurred || !ctx )
{
printf( "Failed to create an OpenGL context\n" );
exit(1);
}
// Verifying that context is a direct context
if ( ! glXIsDirect ( display, ctx ) )
{
printf( "Indirect GLX rendering context obtained\n" );
}
else
{
printf( "Direct GLX rendering context obtained\n" );
}
printf( "Making context current\n" );
glXMakeCurrent( display, win, ctx );
const unsigned char* glslversion = glGetString(GL_SHADING_LANGUAGE_VERSION);
printf("%s\n", glslversion);
const unsigned char* openglversion = glGetString(GL_VERSION);
printf("%s\n", openglversion);
glClearColor( 0, 0.5, 1, 1 );
glClear( GL_COLOR_BUFFER_BIT );
glXSwapBuffers ( display, win );
sleep( 1 );
glClearColor ( 1, 0.5, 0, 1 );
glClear ( GL_COLOR_BUFFER_BIT );
glXSwapBuffers ( display, win );
sleep( 1 );
glXDestroyContext( display, ctx );
glXMakeCurrent( display, 0, 0 );
XDestroyWindow( display, win );
XFreeColormap( display, cmap );
XCloseDisplay( display );
return 0;
}
GL_SHADING_LANGUAGE_VERSION is always telling me that the most supported version is GLSL 130. (and not GLSL 330)
This is strange because this command tells me that the core profile support GLSL 330 :
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD CEDAR
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.0-devel (git-ee2a818 trusty-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.3.0-devel (git-ee2a818 trusty-oibaf-ppa)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
And the older version is an extension of the core profile so..., but it always use the core profile's extension., and not the core profile and I don't know why. :/
-
I had only to set the minor version to 3, I didn't know what this parameter means until know, but, it's the second number of the version right ?
If the version is 3.30 the major version number is 3 and the minor version number is 3 right ?
And if the version is 3.00 the major version number is 3 and the minor version number is 0.
-
Yes, that is how software version numbers work.
When a third digit is involved, eg v1.0.13, the third number is sometimes called the "patch version."
-
Ok, anyway when I request a version greater than 2 SFML fails to create the context, so I think I need to modify the SFML source code a bit. :P
-
For those who stumble upon this thread in the future:
Creating a context with a major version of 3 or greater is already possible even without modifications to the SFML source.
Some people would rather just resort to trial and error because they don't know any better...
-
Creating a context with a major version of 3 or greater is already possible even without modifications to the SFML source.
Haha.
And how do you do that, I never modified the source code of the sf::Window module because I totaly sucks in this domain.
And if I try to create a 3.3 context it fails :
sf::VideoMode mode(800, 600, 32);
sf::ContextSettings settings(32, 32, 4, 3, 3);
sf::RenderWindow window(mode, "test", sf::Style::Default, settings);
const unsigned char* glslversion = glGetString(GL_SHADING_LANGUAGE_VERSION);
printf("%s\n", glslversion);
const unsigned char* openglversion = glGetString(GL_VERSION);
printf("%s\n", openglversion);
while (window.isOpen()) {
sf::Event event;
while(window.pollEvent(event)) {
if (event == sf::Event::Closed) {
window.close();
}
}
window.display();
window.clear();
}
return 0;
It's displaying me that it's a context of 3.0 and I request a context of 3.3.
But this following code (without SFML) works :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/gl.h>
#include <GL/glx.h>
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
// Helper to check for extension string presence. Adapted from:
// http://www.opengl.org/resources/features/OGLextensions/
static bool isExtensionSupported(const char *extList, const char *extension)
{
const char *start;
const char *where, *terminator;
/* Extension names should not have spaces. */
where = strchr(extension, ' ');
if (where || *extension == '\0')
return false;
/* It takes a bit of care to be fool-proof about parsing the
OpenGL extensions string. Don't be fooled by sub-strings,
etc. */
for (start=extList;;) {
where = strstr(start, extension);
if (!where)
break;
terminator = where + strlen(extension);
if ( where == start || *(where - 1) == ' ' )
if ( *terminator == ' ' || *terminator == '\0' )
return true;
start = terminator;
}
return false;
}
static bool ctxErrorOccurred = false;
static int ctxErrorHandler( Display *dpy, XErrorEvent *ev )
{
ctxErrorOccurred = true;
return 0;
}
int main(int argc, char* argv[])
{
Display *display = XOpenDisplay(NULL);
if (!display)
{
printf("Failed to open X display\n");
exit(1);
}
// Get a matching FB config
static int visual_attribs[] =
{
GLX_X_RENDERABLE , True,
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
GLX_RENDER_TYPE , GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
GLX_RED_SIZE , 8,
GLX_GREEN_SIZE , 8,
GLX_BLUE_SIZE , 8,
GLX_ALPHA_SIZE , 8,
GLX_DEPTH_SIZE , 24,
GLX_STENCIL_SIZE , 8,
GLX_DOUBLEBUFFER , True,
//GLX_SAMPLE_BUFFERS , 1,
//GLX_SAMPLES , 4,
None
};
int glx_major, glx_minor;
// FBConfigs were added in GLX version 1.3.
if ( !glXQueryVersion( display, &glx_major, &glx_minor ) ||
( ( glx_major == 1 ) && ( glx_minor < 3 ) ) || ( glx_major < 1 ) )
{
printf("Invalid GLX version");
exit(1);
}
printf( "Getting matching framebuffer configs\n" );
int fbcount;
GLXFBConfig* fbc = glXChooseFBConfig(display, DefaultScreen(display), visual_attribs, &fbcount);
if (!fbc)
{
printf( "Failed to retrieve a framebuffer config\n" );
exit(1);
}
printf( "Found %d matching FB configs.\n", fbcount );
// Pick the FB config/visual with the most samples per pixel
printf( "Getting XVisualInfos\n" );
int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999;
int i;
for (i=0; i<fbcount; ++i)
{
XVisualInfo *vi = glXGetVisualFromFBConfig( display, fbc[i] );
if ( vi )
{
int samp_buf, samples;
glXGetFBConfigAttrib( display, fbc[i], GLX_SAMPLE_BUFFERS, &samp_buf );
glXGetFBConfigAttrib( display, fbc[i], GLX_SAMPLES , &samples );
printf( " Matching fbconfig %d, visual ID 0x%2x: SAMPLE_BUFFERS = %d,"
" SAMPLES = %d\n",
i, vi -> visualid, samp_buf, samples );
if ( best_fbc < 0 || samp_buf && samples > best_num_samp )
best_fbc = i, best_num_samp = samples;
if ( worst_fbc < 0 || !samp_buf || samples < worst_num_samp )
worst_fbc = i, worst_num_samp = samples;
}
XFree( vi );
}
GLXFBConfig bestFbc = fbc[ best_fbc ];
// Be sure to free the FBConfig list allocated by glXChooseFBConfig()
XFree( fbc );
// Get a visual
XVisualInfo *vi = glXGetVisualFromFBConfig( display, bestFbc );
printf( "Chosen visual ID = 0x%x\n", vi->visualid );
printf( "Creating colormap\n" );
XSetWindowAttributes swa;
Colormap cmap;
swa.colormap = cmap = XCreateColormap( display,
RootWindow( display, vi->screen ),
vi->visual, AllocNone );
swa.background_pixmap = None ;
swa.border_pixel = 0;
swa.event_mask = StructureNotifyMask;
printf( "Creating window\n" );
Window win = XCreateWindow( display, RootWindow( display, vi->screen ),
0, 0, 100, 100, 0, vi->depth, InputOutput,
vi->visual,
CWBorderPixel|CWColormap|CWEventMask, &swa );
if ( !win )
{
printf( "Failed to create window.\n" );
exit(1);
}
// Done with the visual info data
XFree( vi );
XStoreName( display, win, "GL 3.0 Window" );
printf( "Mapping window\n" );
XMapWindow( display, win );
// Get the default screen's GLX extension list
const char *glxExts = glXQueryExtensionsString( display,
DefaultScreen( display ) );
// NOTE: It is not necessary to create or make current to a context before
// calling glXGetProcAddressARB
glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)
glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
GLXContext ctx = 0;
// Install an X error handler so the application won't exit if GL 3.0
// context allocation fails.
//
// Note this error handler is global. All display connections in all threads
// of a process use the same error handler, so be sure to guard against other
// threads issuing X commands while this code is running.
ctxErrorOccurred = false;
int (*oldHandler)(Display*, XErrorEvent*) =
XSetErrorHandler(&ctxErrorHandler);
// Check for the GLX_ARB_create_context extension string and the function.
// If either is not present, use GLX 1.3 context creation method.
if ( !isExtensionSupported( glxExts, "GLX_ARB_create_context" ) ||
!glXCreateContextAttribsARB )
{
printf( "glXCreateContextAttribsARB() not found"
" ... using old-style GLX context\n" );
ctx = glXCreateNewContext( display, bestFbc, GLX_RGBA_TYPE, 0, True );
}
// If it does, try to get a GL 3.0 context!
else
{
int context_attribs[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
//GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
None
};
printf( "Creating context\n" );
ctx = glXCreateContextAttribsARB( display, bestFbc, 0,
True, context_attribs );
// Sync to ensure any errors generated are processed.
XSync( display, False );
if ( !ctxErrorOccurred && ctx )
printf( "Created GL 3.0 context\n" );
else
{
// Couldn't create GL 3.0 context. Fall back to old-style 2.x context.
// When a context version below 3.0 is requested, implementations will
// return the newest context version compatible with OpenGL versions less
// than version 3.0.
// GLX_CONTEXT_MAJOR_VERSION_ARB = 1
context_attribs[1] = 1;
// GLX_CONTEXT_MINOR_VERSION_ARB = 0
context_attribs[3] = 0;
ctxErrorOccurred = false;
printf( "Failed to create GL 3.0 context"
" ... using old-style GLX context\n" );
ctx = glXCreateContextAttribsARB( display, bestFbc, 0,
True, context_attribs );
}
}
// Sync to ensure any errors generated are processed.
XSync( display, False );
// Restore the original error handler
XSetErrorHandler( oldHandler );
if ( ctxErrorOccurred || !ctx )
{
printf( "Failed to create an OpenGL context\n" );
exit(1);
}
// Verifying that context is a direct context
if ( ! glXIsDirect ( display, ctx ) )
{
printf( "Indirect GLX rendering context obtained\n" );
}
else
{
printf( "Direct GLX rendering context obtained\n" );
}
printf( "Making context current\n" );
glXMakeCurrent( display, win, ctx );
const unsigned char* glslversion = glGetString(GL_SHADING_LANGUAGE_VERSION);
printf("%s\n", glslversion);
const unsigned char* openglversion = glGetString(GL_VERSION);
printf("%s\n", openglversion);
glClearColor( 0, 0.5, 1, 1 );
glClear( GL_COLOR_BUFFER_BIT );
glXSwapBuffers ( display, win );
sleep( 1 );
glClearColor ( 1, 0.5, 0, 1 );
glClear ( GL_COLOR_BUFFER_BIT );
glXSwapBuffers ( display, win );
sleep( 1 );
glXDestroyContext( display, ctx );
glXMakeCurrent( display, 0, 0 );
XDestroyWindow( display, win );
XFreeColormap( display, cmap );
XCloseDisplay( display );
return 0;
}
I'm just asking now how will I modify this SFML code to make it works, SFML use a shared context and doesn't seems to work with the same way.
On windows it works maybe but not on unix.
-
You seem to have missed the fact that this is happening because SFML requires a compatibility context, and for some reason Mesa refuses to give compatibility contexts of v3.3 even though it's happy with core contexts of v3.3. Relevant quote from binary from a post I linked you earlier:
SFML will never give you a core-only profile. It needs a compatibility profile to function properly. Normally this should not be a problem, because as its name implies, the compatibility profile is meant to be compatible with both core and legacy GL usage. If what you say is true and GLSL 3.30 only works with a core profile and not a compatibility profile then that is a serious bug (or unimplemented feature) in the driver and if it hasn't already been reported/fixed, you should file a bug report.
Also:
Creating a context with a major version of 3 or greater is already possible ...
And how do you do that ... if I try to create a 3.3 context ... it's a context of 3.0
He only said major version of 3. You've already achieved that.
-
Ha, ok.
So if SFML refuse me to give me a context of 3.3 with mesa (but only a context of 3.0), this means that, this version'll not work correctly with SFML. O_O
-
We're working on adding a "core" option to sf::ContextSettings and it should be pushed soon (it's already implemented). So you'll be able to create a 3.3 core context with Mesa. However you won't be able to use sfml-graphics with such a context -- I don't know if you intended to do that.
-
Seriously dude... How much research do you actually do before coming to these conclusions?
If you visit http://www.mesa3d.org/ you will see that they only support context versions >= 3.2 as core contexts only for the time being. This means... when you request a context from GLX, unless you request it to be a core context as well, GLX will always give you <= 3.0 since it is the last version that Mesa provides that supports all legacy functionality.
You also probably don't even understand what profiles are based on what you have posted so far. If you read up on it a bit you will realize that they only exist for context versions 3.2 and greater. Profile selection didn't exist yet in 3.1, it is comparable to a core profile context but isn't a core profile context. 3.0 and less are always legacy and don't have profile selection.
If you want a core context, you will have to 1) request a core context by setting the core attribute bit and 2) request a context with version 3.2 or greater. If you don't get a 3.2 or greater core context it means that you did not do one of those points properly. I'm not going to list in detail all the modifications you have to make to succeed, because I think if you are serious about what you are trying to do, you will be able to figure this out yourself.
This is one of those things that you can't quickly copy and paste from websites (good luck searching) and requires deep understanding of how SFML works, so judging from what I've seen from you up to now, it is probably almost impossible for you to achieve without actually learning something new.
-
I've created one!!!
I had just to set the sencil bit to 0 and the dephbit to a less value than 32.
sf::ContextSettings settings(24, 0, 4, 3, 3);
Because it seems it doesn't support all values for the buffers yet.
The graphics module of SFML is not compatible yet with this version of opengl, It's telling me that my system doesn't support shader (or it's the case!)
I hope it'll be compatible with sfml soon. :)
-
Ha, ok, the functions are not the same to create shaders with opengl 3.3. (and more)
I suppose that I've to rewrite a part of the SFML graphics module because I need to have a shader which support the 3.3 version at least. (With layout qualifiers)
-
I had just to set the sencil bit to 0 and the dephbit to a less value than 32.
sf::ContextSettings settings(24, 0, 4, 3, 3);
Here is what the console shows :
glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD CEDAR
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.0-devel (git-ee2a818 trusty-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.3.0-devel (git-ee2a818 trusty-oibaf-ppa)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
So... you know how to use glxinfo but don't even bother reading the output? If you didn't immediately grep the output (you probably just copied the command from somewhere as well) you would notice a fairly long list of valid formats. From that information, you would see that 32-bit depth is not supported by your hardware, so you shouldn't even try to request it.
If you are really using Linux, the most important thing to do is learn to read things. It is much more textual than any other operating system and you will get nowhere if you don't bother inspecting what is printed out all over the place.
And please... now that you have solved the problem this thread dealt with, we don't need daily updates about your progress rewriting every bit of SFML.