1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Non-SDL: Add opengl3 support

This commit is contained in:
SmallJoker 2024-11-02 15:51:44 +01:00 committed by sfan5
parent 87ac32edea
commit 4838eb2f7d
10 changed files with 107 additions and 139 deletions

View file

@ -34,8 +34,14 @@ OpenGLVersion COpenGL3Driver::getVersionFromOpenGL() const
void COpenGL3Driver::initFeatures()
{
assert(Version.Spec == OpenGLSpec::Compat);
assert(isVersionAtLeast(3, 2));
if (Version.Spec != OpenGLSpec::Compat) {
os::Printer::log("OpenGL 3 driver requires Compatibility Mode", ELL_ERROR);
throw std::exception();
}
if (!isVersionAtLeast(3, 2)) {
os::Printer::log("OpenGL 3 driver requires OpenGL >= 3.2 ", ELL_ERROR);
throw std::exception();
}
initExtensions();
TextureFormats[ECF_A1R5G5B5] = {GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}; // WARNING: may not be renderable