Added ogfx::WindowBase::enableResizable function
This commit is contained in:
parent
a622db4b1a
commit
055aa4f01c
3 changed files with 10 additions and 3 deletions
2
build.nr
2
build.nr
|
|
@ -1 +1 @@
|
|||
1880
|
||||
1883
|
||||
|
|
|
|||
|
|
@ -110,6 +110,13 @@ namespace ogfx
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void WindowBase::enableResizable(bool enable)
|
||||
{
|
||||
SDL_SetWindowResizable(m_window, (enable ? SDL_TRUE : SDL_FALSE));
|
||||
}
|
||||
|
||||
|
||||
void WindowBase::handleEvents(void)
|
||||
{
|
||||
if (!m_initialized) return;
|
||||
|
|
@ -149,7 +156,7 @@ namespace ogfx
|
|||
{
|
||||
MouseEventData mmd = l_getMouseState();
|
||||
if (isMouseDragEventEnabled() && mmd.button != MouseEventData::eButton::None)
|
||||
ostd::SignalHandler::emitSignal(ostd::tBuiltinSignals::WindowClosed, ostd::tSignalPriority::RealTime, mmd);
|
||||
ostd::SignalHandler::emitSignal(ostd::tBuiltinSignals::MouseDragged, ostd::tSignalPriority::RealTime, mmd);
|
||||
else
|
||||
ostd::SignalHandler::emitSignal(ostd::tBuiltinSignals::MouseMoved, ostd::tSignalPriority::RealTime, mmd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ namespace ogfx
|
|||
void setSize(int32_t width, int32_t height);
|
||||
void setTitle(const ostd::String& title);
|
||||
void setCursor(eCursor cursor);
|
||||
void enableResizable(bool enable = true);
|
||||
|
||||
inline virtual void onRender(void) { }
|
||||
inline virtual void onUpdate(void) { }
|
||||
|
|
@ -41,7 +42,6 @@ namespace ogfx
|
|||
inline void enableMouseDragEvent(bool enable = true) { m_deagEventEnabled = enable; }
|
||||
inline ostd::Color getClearColor(void) const { return m_clearColor; }
|
||||
inline void setClearColor(const ostd::Color& color) { m_clearColor = color; }
|
||||
|
||||
private:
|
||||
void handleEvents(void);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue