Re: [GtkGLExt] What about GTK+-3.0 support?



On Wed, Jul 27, 2011 at 16:10, Mike Paul <mike wyzardry net> wrote:
> On Wed, 2011-07-27 at 10:57 +0200, dagecko free fr wrote:
>> It is quite easy to make it more automatic, by using if statements in
>> the row, just like this:
>>
>> if (cannot create context GL 4.1)
>>    if (cannot create context GL 4.0)
>>       if (cannot create context GL 3.1)
>>          if (cannot create context GL 3.0)
>>             create old default context
>
> It's not safe to just use the newest version available, because newer
> versions may remove deprecated features and the application might rely
> on those features.  That's why the application has to specify what
> version it wants.
>
> The application also has to specify whether the context should be
> "forward-compatible", which makes deprecated features unavailable.  And
> for OpenGL 3.2 or newer, it has to specify which profile it wants:  core
> or compatibility.
>
> I think GtkGLExt should provide something similar to
> glXCreateContextAttribsARB(), where the application provides a list of
> attributes including the desired GL version, but it should be abstracted
> enough that the application doesn't have to refer to any GLX-specific
> constants.  If the GL implementation supports GLX_ARB_create_context, we
> can just call glXCreateContextAttribsARB(); if not, we'd fall back to
> glXCreateNewContext() if the app requested major version 1 or 2, or
> report an error if the app asked for GL 3 or newer.

For inspiration, take a look at Java's OpenGL bindings, which
introduce the concept of 'profiles'. They are very easy to use:
http://michael-bien.com/mbien/entry/jogl_2_opengl_profiles_explained

-- 
Remco


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]