mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +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:
@@ -46,6 +46,8 @@
|
||||
#include "Canvas.h"
|
||||
#include "PixelEffect.h"
|
||||
|
||||
using love::window::WindowFlags;
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace graphics
|
||||
@@ -128,21 +130,17 @@ public:
|
||||
* Sets the current display mode.
|
||||
* @param width The window width.
|
||||
* @param height The window height.
|
||||
* @param fullscreen True if fullscreen, false otherwise.
|
||||
* @param vsync True if we should wait for vsync, false otherwise.
|
||||
* @param fsaa Number of full scene anti-aliasing buffer, or 0 for disabled.
|
||||
* @param flags An optional WindowFlags structure.
|
||||
**/
|
||||
bool setMode(int width, int height, bool fullscreen, bool vsync, int fsaa);
|
||||
bool setMode(int width, int height, WindowFlags *flags);
|
||||
|
||||
/**
|
||||
* Gets the current display mode.
|
||||
* @param width Pointer to an integer for the window width.
|
||||
* @param height Pointer to an integer for the window height.
|
||||
* @param fullscreen Pointer to a boolean for the fullscreen status.
|
||||
* @param vsync Pointer to a boolean for the vsync status.
|
||||
* @param fsaa Pointer to an integer for the current number of full scene anti-aliasing buffers.
|
||||
* @param flags A WindowFlags structure.
|
||||
**/
|
||||
void getMode(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa);
|
||||
void getMode(int &width, int &height, WindowFlags &flags);
|
||||
|
||||
/**
|
||||
* Toggles fullscreen. Note that this also needs to reload the
|
||||
|
||||
Reference in New Issue
Block a user