Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Advanced OpenGL context support  (Read 7536 times)

0 Members and 2 Guests are viewing this topic.

aqnuep

  • Newbie
  • *
  • Posts: 7
    • MSN Messenger - aqnuep@hotmail.com
    • Yahoo Instant Messenger - rakos_d@yahoo.com
    • View Profile
Advanced OpenGL context support
« on: December 04, 2009, 05:25:48 pm »
Hi,

I just noticed this library and it seems quite nice. Almost exactly what I would like to use.

However, I have a few concerns about the current OpenGL context support. There is the lack of the following:

1. OpenGL 3 context support - this is very important, support for WGL_ARB_create_context shall be added ASAP, I think.
2. Pure memory contexts - using memory contexts is very important when you would like to maximize the use of the GPU in different scenarios without having an additional dummy window.
3. SLI/CrossFire contexts - this is not so important, however it would be nice to have it. Currently both NVIDIA and AMD shipped extensions to take advantage of multiple GPUs with OpenGL (WGL_NV_gpu_affinity and WGL_AMD_gpu_association).

The first two ones is a must for me and I don't really have enough time to create a so well made windowing and context library like yours.
The library would also take huge advantage by having these features implemented as no library supports them currently very well.
GLFW has almost full-featured OpenGL 3 context support but no way to have multiple contexts and no memory contexts at all.
SDL has some OpenGL 3 context support (at least they say that, but I've never seen a working version on Windows with ATI).
If you would have implemented these features SFML can be the ultimate choice for OpenGL developers as myself.

Thanks in advance!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Advanced OpenGL context support
« Reply #1 on: December 04, 2009, 06:37:26 pm »
Hi

Quote
1. OpenGL 3 context support - this is very important, support for WGL_ARB_create_context shall be added ASAP, I think.

This is already implemented in SFML 2, that you can download and compile from the SVN repository (sfml2 branch).

Quote
2. Pure memory contexts - using memory contexts is very important when you would like to maximize the use of the GPU in different scenarios without having an additional dummy window.

This is already implemented in SFML 2 as well. However, it is currently implemented using a dummy window in both Windows and Linux (the Mac OS X port has not been updated yet). On Windows I'm almost sure it is impossible to create a context from something else than a window (except a P-Buffer). On Linux there seems to be a solution with Pixmaps, but I haven't looked into it yet.
However the current solution works fine, nobody can tell that there's a dummy window behind the context.

Quote
3. SLI/CrossFire contexts - this is not so important, however it would be nice to have it. Currently both NVIDIA and AMD shipped extensions to take advantage of multiple GPUs with OpenGL (WGL_NV_gpu_affinity and WGL_AMD_gpu_association).

Maybe one day ;)
Laurent Gomila - SFML developer

aqnuep

  • Newbie
  • *
  • Posts: 7
    • MSN Messenger - aqnuep@hotmail.com
    • Yahoo Instant Messenger - rakos_d@yahoo.com
    • View Profile
Advanced OpenGL context support
« Reply #2 on: December 04, 2009, 07:03:29 pm »
Quote from: "Laurent"
Quote
1. OpenGL 3 context support - this is very important, support for WGL_ARB_create_context shall be added ASAP, I think.

This is already implemented in SFML 2, that you can download and compile from the SVN repository (sfml2 branch).

That's nice! I haven't seen the usage of the wglCreateContextAttribsARB function in the online browsable version of the code, but maybe it's not up-to-date. Thanks! I'll check out the SVN repo.
It also supports the new version of WGL_ARB_create_context introduced with OpenGL 3.2? Nevermind, I'll check out myself in the code :P

Quote from: "Laurent"
Quote
2. Pure memory contexts - using memory contexts is very important when you would like to maximize the use of the GPU in different scenarios without having an additional dummy window.

This is already implemented in SFML 2 as well. However, it is currently implemented using a dummy window in both Windows and Linux (the Mac OS X port has not been updated yet). On Windows I'm almost sure it is impossible to create a context from something else than a window (except a P-Buffer). On Linux there seems to be a solution with Pixmaps, but I haven't looked into it yet.
However the current solution works fine, nobody can tell that there's a dummy window behind the context.

For Windows one can use e.g. pbuffers and for Linux, yes, pixmaps are the solution. However if it is already working well with dummy windows, I totally accept this solution :)

Quote from: "Laurent"
Quote
3. SLI/CrossFire contexts - this is not so important, however it would be nice to have it. Currently both NVIDIA and AMD shipped extensions to take advantage of multiple GPUs with OpenGL (WGL_NV_gpu_affinity and WGL_AMD_gpu_association).

Maybe one day ;)

This was just an advice.
However I would be up to implement it for you if you wish.
I've just noticed this library but it looks so perfect for my needs! I would spend time to improve it if you need help.
I had tried many similar libraries but they either lack of functionalities or they are overcomplicated, but SFML looks really nice!

What libraries I need for my project:
1. Advanced OpenGL context handling (I've already started to work on my own implementation, however I don't have enough time to make it really nice and test it on all platforms).
2. Wrapper classes for OpenGL (I already made most of it).
3. Wrapper classes for OpenAL (I planned to make my own, but I've just seen that SFML uses OpenAL, cool :D).
4. Basic networking classes (There are a few useful libraries for this purpose on the internet, however, I don't need them no more, because SFML has it as well).

So basically what I would like to say is that this library is the perfect choice for me and maybe loads of other developers as well. Nice work!
Maybe it needs a bit more advertisement, because I accidentally found it, not even looking for something like this, but I'm pleased!

P.S.: So, to be serious, if you would like, I'll make the SLI/CrossFire implementation for you, sincerely, your project deserves at least this little contribution because it will help me alot :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Advanced OpenGL context support
« Reply #3 on: December 04, 2009, 07:12:44 pm »
Quote
I haven't seen the usage of the wglCreateContextAttribsARB function in the online browsable version of the code, but maybe it's not up-to-date. Thanks! I'll check out the SVN repo.

It's there:
http://sfml.svn.sourceforge.net/viewvc/sfml/branches/sfml2/src/SFML/Window/Win32/ContextWGL.cpp?view=markup

Quote
It also supports the new version of WGL_ARB_create_context introduced with OpenGL 3.2?

I don't know. What is that?

Quote
So, to be serious, if you would like, I'll make the SLI/CrossFire implementation for you, sincerely, your project deserves at least this little contribution because it will help me alot

No problem, go ahead ;)
Note that I'm very picky about external add-ons, and there's a chance that I don't accept your patch :lol:
Laurent Gomila - SFML developer

aqnuep

  • Newbie
  • *
  • Posts: 7
    • MSN Messenger - aqnuep@hotmail.com
    • Yahoo Instant Messenger - rakos_d@yahoo.com
    • View Profile
Advanced OpenGL context support
« Reply #4 on: December 04, 2009, 07:52:52 pm »
Quote from: "Laurent"
Quote
It also supports the new version of WGL_ARB_create_context introduced with OpenGL 3.2?

I don't know. What is that?

The profile mechanism. You can choose currently from two profiles:
Core profile - usual OpenGL 3 context with only the functionalities that are in the standard.
Compatibility profile - supports all deprecated stuff but still gives OpenGL 3 context (this is for those who cannot get rid of the old stuff).

Quote from: "Laurent"
Note that I'm very picky about external add-ons, and there's a chance that I don't accept your patch :lol:

No problem. However it does not need too much change in the code. Anyway I'll make the modification in a week or something (because unfortunately I have other duties) and you will review it if it fits your taste or not and maybe I'll change it in a way that is good for you.
I totally understand that you don't like others messing up your code, that's normal.

Oz1571

  • Newbie
  • *
  • Posts: 28
    • View Profile
Advanced OpenGL context support
« Reply #5 on: December 04, 2009, 07:54:19 pm »
I'd be interested in the ability to choose between core and compatability as well, it'd help me get rid of all my old opengl code to make sure I have everything updated to 3.2 specs.

aqnuep

  • Newbie
  • *
  • Posts: 7
    • MSN Messenger - aqnuep@hotmail.com
    • Yahoo Instant Messenger - rakos_d@yahoo.com
    • View Profile
Advanced OpenGL context support
« Reply #6 on: December 04, 2009, 08:44:45 pm »
Quote from: "Oz1571"
I'd be interested in the ability to choose between core and compatability as well, it'd help me get rid of all my old opengl code to make sure I have everything updated to 3.2 specs.


Btw without the profile selection you'll always get a Core context because before OpenGL 3.2 if you requested an OpenGL 3 context. It's only important above version 3.2.

This profile conception was introduced to ease the transition from legacy functionalities to the buffer-oriented design but still be able to fully take advantage of OpenGL 3 features.

Oz1571

  • Newbie
  • *
  • Posts: 28
    • View Profile
Advanced OpenGL context support
« Reply #7 on: December 04, 2009, 08:49:03 pm »
Oh yeah, I recall that. I'm actually not using 3.2 yet, though, I'm using 3.1, since ATI doesn't support 3.2 at the moment. I guess it will be just fine the way it is, at least for me, then. :)

aqnuep

  • Newbie
  • *
  • Posts: 7
    • MSN Messenger - aqnuep@hotmail.com
    • Yahoo Instant Messenger - rakos_d@yahoo.com
    • View Profile
Advanced OpenGL context support
« Reply #8 on: December 04, 2009, 09:49:54 pm »
Quote from: "Oz1571"
Oh yeah, I recall that. I'm actually not using 3.2 yet, though, I'm using 3.1, since ATI doesn't support 3.2 at the moment. I guess it will be just fine the way it is, at least for me, then. :)


I also have ATI, but that 3.2 driver will come out soon so I would like to be prepared. However, it is not the most crucial thing for me now :)