Skip to content

Commit

Permalink
Merge pull request #76 from YGNI-RType/fix/resize-macos
Browse files Browse the repository at this point in the history
Fix/resize macos
  • Loading branch information
Popochounet authored Nov 5, 2024
2 parents 92fdf42 + 5faa566 commit 1ab8620
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set_target_properties(GEngine_static PROPERTIES
)

find_package(raylib CONFIG REQUIRED)
find_package(glfw3 CONFIG REQUIRED) #TODO a supp
find_package(glfw3 CONFIG REQUIRED)
find_package(portaudio CONFIG REQUIRED)
find_package(Opus REQUIRED)
find_package(BZip2 REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class AudioManager
break;
}
}
std::cout << "music: " << getMusicComponent().musicId << std::endl;
}

protected:
Expand Down
4 changes: 2 additions & 2 deletions include/GEngine/libdev/systems/driver/output/RenderWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class RenderWindow : public gengine::System<RenderWindow>, public LocalSystem {
void setTitle(const std::string &title);

private:
const int m_baseWidth;
const int m_baseHeight;
int m_baseWidth;
int m_baseHeight;
float m_width;
float m_height;
std::string m_title;
Expand Down
8 changes: 7 additions & 1 deletion source/GEngine/libdev/systems/driver/output/RenderWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ void RenderWindow::init(void) {

void RenderWindow::onStartEngine(gengine::system::event::StartEngine &e) {
SetTraceLogLevel(LOG_WARNING);
SetConfigFlags(FLAG_MSAA_4X_HINT | FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE); // TODO FLAG_WINDOW_RESIZABLE
SetConfigFlags(FLAG_MSAA_4X_HINT | FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE);
InitWindow(m_width, m_height, m_title.c_str());
SetWindowMonitor(0);

m_baseWidth = GetRenderWidth();
m_baseHeight = GetRenderHeight();
m_width = m_baseWidth;
m_height = m_baseHeight;
publishEvent(gengine::system::event::WindowResized({m_width / m_baseWidth, m_height / m_baseHeight}));
}

void RenderWindow::onMainLoop(gengine::system::event::MainLoop &e) {
Expand Down

0 comments on commit 1ab8620

Please sign in to comment.