mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Example setMode invocation: love.graphics.setMode(800, 600, {fullscreen = false, vsync = true, borderless = true})
t.screen.resizable and t.screen.borderless are available in love.conf
And love.resize(w, h) gets called if it exists on a resize event.
NOTE: love.handlers.resize(w, h) does the required setMode, but that does mean a visual reload
--HG--
branch : minor
This commit is contained in:
@@ -33,6 +33,15 @@ namespace love
|
||||
namespace window
|
||||
{
|
||||
|
||||
struct WindowFlags
|
||||
{
|
||||
bool fullscreen; // = false
|
||||
bool vsync; // = true
|
||||
int fsaa; // = 0
|
||||
bool resizable; // = false
|
||||
bool borderless; // = false
|
||||
}; // WindowFlags
|
||||
|
||||
class Window : public Module
|
||||
{
|
||||
public:
|
||||
@@ -44,8 +53,8 @@ public:
|
||||
|
||||
virtual ~Window();
|
||||
|
||||
virtual bool setWindow(int width = 800, int height = 600, bool fullscreen = false, bool vsync = true, int fsaa = 0) = 0;
|
||||
virtual void getWindow(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa) = 0;
|
||||
virtual bool setWindow(int width, int height, WindowFlags *flags = 0) = 0;
|
||||
virtual void getWindow(int &width, int &height, WindowFlags &flags) = 0;
|
||||
|
||||
virtual bool checkWindowSize(int width, int height, bool fullscreen) = 0;
|
||||
virtual WindowSize **getFullscreenSizes(int &n) = 0;
|
||||
|
||||
Reference in New Issue
Block a user