OpenGL3: Add version check helper

This commit is contained in:
numzero 2023-04-16 01:00:41 +03:00 committed by sfan5
parent 78d0819a2c
commit 2e477a07d1
2 changed files with 10 additions and 0 deletions

@ -214,6 +214,14 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
Version = getVersionFromOpenGL(); Version = getVersionFromOpenGL();
} }
bool COpenGL3DriverBase::isVersionAtLeast(int major, int minor) const noexcept {
if (Version.Major < major)
return false;
if (Version.Major > major)
return true;
return Version.Minor >= minor;
}
bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32>& screenSize, bool stencilBuffer) bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32>& screenSize, bool stencilBuffer)
{ {
initVersion(); initVersion();

@ -290,6 +290,8 @@ namespace video
virtual void initFeatures() = 0; virtual void initFeatures() = 0;
bool isVersionAtLeast(int major, int minor = 0) const noexcept;
void chooseMaterial2D(); void chooseMaterial2D();
ITexture* createDeviceDependentTexture(const io::path& name, IImage* image) override; ITexture* createDeviceDependentTexture(const io::path& name, IImage* image) override;