Skip to content

Commit

Permalink
Fix resolution change.
Browse files Browse the repository at this point in the history
  • Loading branch information
mooflu committed Oct 26, 2023
1 parent 059a335 commit d7cad0a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions game/Video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,26 @@ Video::~Video() {
}

void Video::reset(void) {
BitmapManagerS::instance()->reset();
FontManagerS::instance()->reset();
ModelManagerS::instance()->reset();

_titleA->reset();
_titleB->reset();

ProgramManagerS::instance()->reset();
}

void Video::reload(void) {
BitmapManagerS::instance()->reset();
FontManagerS::instance()->reset();
ModelManagerS::instance()->reset();
initGL3Test(); // re-creates shaders

BitmapManagerS::instance()->reload();
FontManagerS::instance()->reload();
ModelManagerS::instance()->reload();
MenuManagerS::instance()->reload();

_titleA->reload();
_titleB->reload();

ProgramManagerS::instance()->reset();
initGL3Test();
}

void Video::initGL3Test() {
Expand All @@ -139,8 +142,6 @@ void Video::initGL3Test() {
MatrixStack::model.push(glm::mat4(1.0f));
MatrixStack::projection.push(glm::mat4(1.0f));

ProgramManagerS::instance()->reset();

Program* progLight = ProgramManagerS::instance()->createProgram("lighting");
progLight->use();
progLight->release();
Expand Down Expand Up @@ -374,8 +375,8 @@ bool Video::setVideoMode(void) {
LOG_INFO << " GLEW : " << glewGetString(GLEW_VERSION) << endl;

#if defined(DEBUG_OPENGL) && !defined(EMSCRIPTEN) && !defined(__APPLE__)
// Not supported in gles and crashes on mac...
// During init, enable debug output
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
// Not supported in webgl (es 3.0) - needs 4.3+ or ES 3.2+
glEnable(GL_DEBUG_OUTPUT);
glDebugMessageCallback(MessageCallback, 0);
#endif
Expand Down

0 comments on commit d7cad0a

Please sign in to comment.