OPENGL: Allow engines to detect OpenGL info without switching

For now only OpenGL type and shaders support are available
This commit is contained in:
Le Philousophe 2022-04-02 18:10:06 +02:00
parent 06bc7a25fa
commit b978cd1caa
7 changed files with 52 additions and 9 deletions

View file

@ -29,6 +29,7 @@
#include "common/ustr.h"
#include "graphics/pixelformat.h"
#include "graphics/mode.h"
#include "graphics/opengl/context.h"
namespace Audio {
class Mixer;
@ -406,6 +407,12 @@ public:
*/
kFeatureOpenGLForGame,
/**
* This feature flag can be used to check if shaders are supported
* and can be used for 3D game rendering.
*/
kFeatureShadersForGame,
/**
* If supported, this feature flag can be used to check if
* waiting for vertical sync before refreshing the screen to reduce
@ -728,6 +735,20 @@ public:
return Common::Array<uint>();
}
/**
* Return the chosen OpenGL type.
*
* This function works even when a 2D graphical manager is active and
* let to select a proper renderer before changing mode.
* Implementation having feature kFeatureOpenGLForGame are expected to
* override this function.
*
* @return the OpenGL type of context which is supported.
*/
virtual OpenGL::ContextOGLType getOpenGLType() const {
return OpenGL::kOGLContextNone;
}
/**
* Retrieve a list of all hardware shaders supported by this backend.
*