mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Error for misspelled / invalid window attributes in love.window.setMode (resolves issue #736)
This commit is contained in:
@@ -38,7 +38,7 @@ void Window::swapBuffers()
|
||||
{
|
||||
}
|
||||
|
||||
WindowFlags::WindowFlags()
|
||||
WindowAttributes::WindowAttributes()
|
||||
: fullscreen(false)
|
||||
, fstype(Window::FULLSCREEN_TYPE_NORMAL)
|
||||
, vsync(true)
|
||||
@@ -62,6 +62,32 @@ bool Window::getConstant(Window::FullscreenType in, const char *&out)
|
||||
return fullscreenTypes.find(in, out);
|
||||
}
|
||||
|
||||
bool Window::getConstant(const char *in, Window::Attribute &out)
|
||||
{
|
||||
return attributes.find(in, out);
|
||||
}
|
||||
|
||||
bool Window::getConstant(Window::Attribute in, const char *&out)
|
||||
{
|
||||
return attributes.find(in, out);
|
||||
}
|
||||
|
||||
StringMap<Window::Attribute, Window::ATTRIB_MAX_ENUM>::Entry Window::attributeEntries[] =
|
||||
{
|
||||
{"fullscreen", ATTRIB_FULLSCREEN},
|
||||
{"fullscreentype", ATTRIB_FULLSCREEN_TYPE},
|
||||
{"vsync", ATTRIB_VSYNC},
|
||||
{"fsaa", ATTRIB_FSAA},
|
||||
{"resizable", ATTRIB_RESIZABLE},
|
||||
{"minwidth", ATTRIB_MIN_WIDTH},
|
||||
{"minheight", ATTRIB_MIN_HEIGHT},
|
||||
{"borderless", ATTRIB_BORDERLESS},
|
||||
{"centered", ATTRIB_CENTERED},
|
||||
{"display", ATTRIB_DISPLAY}
|
||||
};
|
||||
|
||||
StringMap<Window::Attribute, Window::ATTRIB_MAX_ENUM> Window::attributes(Window::attributeEntries, sizeof(Window::attributeEntries));
|
||||
|
||||
StringMap<Window::FullscreenType, Window::FULLSCREEN_TYPE_MAX_ENUM>::Entry Window::fullscreenTypeEntries[] =
|
||||
{
|
||||
{"normal", Window::FULLSCREEN_TYPE_NORMAL},
|
||||
|
||||
Reference in New Issue
Block a user