mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
OpenGL3: new version format
This commit is contained in:
@ -11,8 +11,19 @@ namespace video {
|
||||
return EDT_OGLES2;
|
||||
}
|
||||
|
||||
OpenGLVersion COpenGLES2Driver::getVersionFromOpenGL() const {
|
||||
auto version_string = reinterpret_cast<const char *>(glGetString(GL_VERSION));
|
||||
int major, minor;
|
||||
if (sscanf(version_string, "OpenGL ES %d.%d", &major, &minor) != 2) {
|
||||
os::Printer::log("Failed to parse OpenGL ES version string", version_string, ELL_ERROR);
|
||||
return {OpenGLSpec::ES, 0, 0, 0};
|
||||
}
|
||||
return {OpenGLSpec::ES, (u8)major, (u8)minor, 0};
|
||||
}
|
||||
|
||||
IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)
|
||||
{
|
||||
os::Printer::log("Using COpenGLES2Driver", ELL_INFORMATION);
|
||||
COpenGLES2Driver* driver = new COpenGLES2Driver(params, io, contextManager);
|
||||
driver->genericDriverInit(params.WindowSize, params.Stencilbuffer); // don't call in constructor, it uses virtual function calls of driver
|
||||
return driver;
|
||||
|
@ -8,11 +8,17 @@
|
||||
namespace irr {
|
||||
namespace video {
|
||||
|
||||
/// OpenGL ES 2+ driver
|
||||
///
|
||||
/// For OpenGL ES 2.0 and higher.
|
||||
class COpenGLES2Driver : public COpenGL3DriverBase {
|
||||
friend IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager);
|
||||
public:
|
||||
using COpenGL3DriverBase::COpenGL3DriverBase;
|
||||
E_DRIVER_TYPE getDriverType() const override;
|
||||
|
||||
protected:
|
||||
OpenGLVersion getVersionFromOpenGL() const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user