apicici / cimgui-love

LÖVE module for Dear ImGui obtained by wrapping cimgui with LuaJIT FFI.
MIT License
76 stars 6 forks source link

Error on module import when window is not yet initialized #8

Closed majorcob closed 2 years ago

majorcob commented 2 years ago

The Alpha8_shader initialization in love.lua calls love.graphics.newShader, which raises an error when the module is imported if the window is not yet initialized (for example, when https://love2d.org/wiki/Config_Files#window is set to nil).

Error: lib/cimgui/love.lua:181: love.graphics cannot function without a window!

Could this be instead set up during Init(), or some other time where we can assume that the window has been created?

apicici commented 2 years ago

Thanks for pointing this out, I will change it so that the shader is created by the Init function.