From b79e969b11ef43136ce1b0c5b433082024e38f40 Mon Sep 17 00:00:00 2001 From: vlj Date: Fri, 26 Sep 2014 23:10:10 +0200 Subject: [PATCH] Remove some others deprecated calls --- lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp | 6 ++++-- src/states_screens/race_gui_base.cpp | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp b/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp index b5e37ba3c..b6d50060c 100644 --- a/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp +++ b/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp @@ -2530,14 +2530,16 @@ bool COpenGLDriver::setActiveTexture(u32 stage, const video::ITexture* texture) if (!texture) { - glDisable(GL_TEXTURE_2D); + if (!useCoreContext) + glDisable(GL_TEXTURE_2D); return true; } else { if (texture->getDriverType() != EDT_OPENGL) { - glDisable(GL_TEXTURE_2D); + if (!useCoreContext) + glDisable(GL_TEXTURE_2D); CurrentTexture.set(stage, 0); os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); return false; diff --git a/src/states_screens/race_gui_base.cpp b/src/states_screens/race_gui_base.cpp index 22fab2709..185c6ed5e 100644 --- a/src/states_screens/race_gui_base.cpp +++ b/src/states_screens/race_gui_base.cpp @@ -46,6 +46,14 @@ #include +namespace irr +{ + namespace video + { + extern bool useCoreContext; + } +} + RaceGUIBase::RaceGUIBase() { m_ignore_unimportant_messages = false; @@ -418,7 +426,8 @@ void RaceGUIBase::renderPlayerView(const Camera *camera, float dt) glviewport[3] = viewport.LowerRightCorner.Y; //glGetIntegerv(GL_VIEWPORT, glviewport); - glDisable(GL_TEXTURE_2D); + if (!irr::video::useCoreContext) + glDisable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); glDisable(GL_BLEND); glEnable(GL_BLEND); @@ -433,7 +442,8 @@ void RaceGUIBase::renderPlayerView(const Camera *camera, float dt) glVertex3d(glviewport[2],glviewport[3],0); glVertex3d(glviewport[2],glviewport[1],0); glEnd(); - glEnable(GL_TEXTURE_2D); + if (!irr::video::useCoreContext) + glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); #endif }