The hints should be at least:
the depth buffer size ( 0, 16, 24 )
the stencil buffer bits ( 0, 8 )
the accumulation buffer bits ( 0, 32, 64 )
the multisample buffer bits ( 0, 2, 4, 8, 16, 32 )
and something to specify the OpenGL profile to be used (backward compatible, 3.2 or greater, debug profile, etc.)
the more... the better
The hints should be treated as such: PB should try to set the requested value, or the nearest possible.
This way could be feasible to write crossplatform OpenGL code using PB to provide the environment (full screen, screen inside a PB window and the rendering context).
At the moment, not having control on how the OpenGL rendering context is created, you have to dig yourself in a LOT of platform specific code to initialize OpenGL the way you want.
If you use the OpenGL screen created by PB there is no guarantee about the settings you will find enabled (and you can't change them anyway) and there is no guarantee these settings will be still the same in the next version, so it's not a reliable solution.
By the way: how the OpenGL RC is currently created by PB on the various OS ?
Natively directly by you with the appropriate code or using some third party library (SDL for example or something else) ?
EDIT after this post by Fred -> http://www.purebasic.fr/english/viewtop ... 92#p445892
1) I think what would be required is not something specific to the OpenglGadget, but to the opengl subsytem as a whole.
That way you could get the same flexibility for both the gadget and the pb screen (windowed and fullscreen).
What would be nice would be a method to specify the RC creation attributes before opening a screen or creating a gadget, something like, for example:
SetOpenglCreationAttribute (attribute, value)
where attribute could be: #PB_GL_DepthBufferSize, #PB_GL_StencilBufferBits, #PB_GL_AccumulationBufferBits, #PB_GL_MultisampleBufferBits.
For the possible range of accepted values see above.
The defaults for the attributes not specified could be whatever value you find sensible to make the standard PB graphical commands works.
This could be a very good start.
Even better would be the ability to decide if the context has to be backward compatible or just core profile (modern opengl commands only) but that could be done in a second moment after we have the mechanism above in place, tested and working.
The important thing is, please, this should not be for the opengl gadget only.
The command above should also contain a clear disclaimer in the manual explaining the settings specified here could have negative effects on the PB graphical commands and so the above should be used only when you want to use opengl by yourself and not mixing it with PB graphical commands. Or you should do it at your own risk.
That way PB programmers are happy and can use the usual PB command-set for games etc. Opengl programmers can have a RC created as they requires for any kind of opengl programming.
2) Complementary to that, would be nice to have a specular command to call AFTER we created the gadget or the screen, something like:
ret = GetOpenglCreationAttribute (attribute)
This should return the ACTUAL value you were able to set. For example I could have requested 32 bit accumulation buffer, but that value could have been not available at all or not available in conjunction with the other attributes I specified.
So I could find for example it has been set to 64 (the next best). Or 0 (if not available at all).
3) Another important thing, much needed just after this, would be a method to retrieve the opengl extensions functions addresses.
The equivalent of wglGetProcAddress() for Win, glXGetProcAddress() for linux etc, or alternatively you could made available a cross plaform lib like GLEW or GLEE to manage extensions.
Some work I know, I did all the above and more in my code so I know too well ! Thanks for considering it.
