mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Cleaned up the love.graphics code that deals with love.window to be more consistent with the rest of the codebase.
This commit is contained in:
@@ -529,8 +529,11 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_love_window(lua_State *L)
|
||||
{
|
||||
Window *instance = nullptr;
|
||||
luax_catchexcept(L, [&](){ instance = sdl::Window::createSingleton(); });
|
||||
Window *instance = instance();
|
||||
if (instance == nullptr)
|
||||
luax_catchexcept(L, [&](){ instance = new love::window::sdl::Window(); });
|
||||
else
|
||||
instance->retain();
|
||||
|
||||
WrappedModule w;
|
||||
w.module = instance;
|
||||
|
||||
Reference in New Issue
Block a user