Fix some glez resize issues
This commit is contained in:
parent
a11631dc96
commit
e99a441066
@ -9,6 +9,7 @@
|
|||||||
#include "HookedMethods.hpp"
|
#include "HookedMethods.hpp"
|
||||||
#include "timer.hpp"
|
#include "timer.hpp"
|
||||||
#include <SDL2/SDL_syswm.h>
|
#include <SDL2/SDL_syswm.h>
|
||||||
|
#include <menu/menu/Menu.hpp>
|
||||||
|
|
||||||
static bool init{ false };
|
static bool init{ false };
|
||||||
static bool init_wminfo{ false };
|
static bool init_wminfo{ false };
|
||||||
@ -44,10 +45,15 @@ DEFINE_HOOKED_METHOD(SDL_GL_SwapWindow, void, SDL_Window *window)
|
|||||||
|
|
||||||
if (isHackActive() && !disable_visuals)
|
if (isHackActive() && !disable_visuals)
|
||||||
{
|
{
|
||||||
|
static int prev_width, prev_height;
|
||||||
PROF_SECTION(SWAPWINDOW_cathook);
|
PROF_SECTION(SWAPWINDOW_cathook);
|
||||||
if (not init)
|
if (not init || draw::width != prev_width || draw::height != prev_height)
|
||||||
{
|
{
|
||||||
|
prev_width = draw::width;
|
||||||
|
prev_height = draw::height;
|
||||||
draw::InitGL();
|
draw::InitGL();
|
||||||
|
if (zerokernel::Menu::instance)
|
||||||
|
zerokernel::Menu::instance->resize(draw::width, draw::height);
|
||||||
init = true;
|
init = true;
|
||||||
}
|
}
|
||||||
draw::BeginGL();
|
draw::BeginGL();
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <menu/GuiInterface.hpp>
|
#include <menu/GuiInterface.hpp>
|
||||||
#include "HookedMethods.hpp"
|
#include "HookedMethods.hpp"
|
||||||
|
|
||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -18,6 +17,7 @@ DEFINE_HOOKED_METHOD(SDL_PollEvent, int, SDL_Event *event)
|
|||||||
static Timer waitfirst{};
|
static Timer waitfirst{};
|
||||||
if (gui::handleSdlEvent(event))
|
if (gui::handleSdlEvent(event))
|
||||||
return 0;
|
return 0;
|
||||||
|
g_IEngine->GetScreenSize(draw::width, draw::height);
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user