nullstare / ReiLua

Lua game development framework based on Raylib.
MIT License
10 stars 2 forks source link

[Windows] ReiLua closes immediately after opening #1

Open Nathan-MV opened 7 months ago

Nathan-MV commented 7 months ago

It seems to be happening with all ReiLua examples Tested in: eda4eac

PS C:\Users\Nathan\Desktop\ReiLua\build> .\ReiLua.exe ..\examples\platformer\
INFO: ReiLua 0.7.0-Dev
INFO: Lua 5.4
INFO: Initializing raylib 5.0
INFO: Platform backend: DESKTOP (GLFW)
INFO: Supported raylib modules:
INFO:     > rcore:..... loaded (mandatory)
INFO:     > rlgl:...... loaded (mandatory)
INFO:     > rshapes:... loaded (optional)
INFO:     > rtextures:. loaded (optional)
INFO:     > rtext:..... loaded (optional)
INFO:     > rmodels:... loaded (optional)
INFO:     > raudio:.... loaded (optional)
INFO: DISPLAY: Device initialized successfully
INFO:     > Display size: 1920 x 1080
INFO:     > Screen size:  800 x 600
INFO:     > Render size:  800 x 600
INFO:     > Viewport offsets: 0, 0
INFO: GLAD: OpenGL extensions loaded successfully
INFO: GL: Supported extensions count: 358
INFO: GL: OpenGL device information:
INFO:     > Vendor:   NVIDIA Corporation
INFO:     > Renderer: NVIDIA GeForce GTX 750 Ti/PCIe/SSE2
INFO:     > Version:  3.3.0 NVIDIA 551.23
INFO:     > GLSL:     3.30 NVIDIA via Cg compiler
INFO: GL: VAO extension detected, VAO functions loaded successfully
INFO: GL: NPOT textures extension detected, full NPOT textures supported
INFO: GL: DXT compressed textures supported
INFO: GL: ETC2/EAC compressed textures supported
INFO: PLATFORM: DESKTOP (GLFW): Initialized successfully
INFO: TEXTURE: [ID 1] Texture loaded successfully (1x1 | R8G8B8A8 | 1 mipmaps)
INFO: TEXTURE: [ID 1] Default texture loaded successfully
INFO: SHADER: [ID 1] Vertex shader compiled successfully
INFO: SHADER: [ID 2] Fragment shader compiled successfully
INFO: SHADER: [ID 3] Program shader loaded successfully
INFO: SHADER: [ID 3] Default shader loaded successfully
INFO: RLGL: Render batch vertex buffers loaded successfully in RAM (CPU)
INFO: RLGL: Render batch vertex buffers loaded successfully in VRAM (GPU)
INFO: RLGL: Default OpenGL state initialized successfully
INFO: TEXTURE: [ID 2] Texture loaded successfully (128x128 | GRAY_ALPHA | 1 mipmaps)
INFO: FONT: Default font loaded successfully (224 glyphs)
PS C:\Users\Nathan\Desktop\ReiLua\build>
nullstare commented 7 months ago

Not sure why in the email it showed INFO: Initializing raylib 5.1-dev This project currently officially supports raylib 5.0 but I tested with the latest with Linux and did't have any issues. Have you tested the raylib itself that it doesn't have this problem?

Nathan-MV commented 7 months ago

Not sure why in the email it showed INFO: Initializing raylib 5.1-dev This project currently officially supports raylib 5.0 but I tested with the latest with Linux and did't have any issues. Have you tested the raylib itself that it doesn't have this problem?

Yes, i tested it first with 5.1-dev and then i thought "uh, the problem must be 5.1-dev", but then i tested it with 5.0 and it didn't start correctly either, it starts normally Raylib C examples

Nathan-MV commented 7 months ago
PS C:\Users\Nathan\Desktop\ReiLua\build> cmake -G "MinGW Makefiles" ..
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/w64devkit/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/w64devkit/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Static
-- Configuring done (4.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/Nathan/Desktop/ReiLua/build
PS C:\Users\Nathan\Desktop\ReiLua\build> mingw32-make
[  6%] Building C object CMakeFiles/ReiLua.dir/src/audio.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 12%] Building C object CMakeFiles/ReiLua.dir/src/core.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 18%] Building C object CMakeFiles/ReiLua.dir/src/easings.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 25%] Building C object CMakeFiles/ReiLua.dir/src/gl.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 31%] Building C object CMakeFiles/ReiLua.dir/src/lights.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 37%] Building C object CMakeFiles/ReiLua.dir/src/lua_core.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 43%] Building C object CMakeFiles/ReiLua.dir/src/main.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 50%] Building C object CMakeFiles/ReiLua.dir/src/models.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 56%] Building C object CMakeFiles/ReiLua.dir/src/rgui.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 62%] Building C object CMakeFiles/ReiLua.dir/src/rlgl.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 68%] Building C object CMakeFiles/ReiLua.dir/src/rmath.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 75%] Building C object CMakeFiles/ReiLua.dir/src/shapes.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 81%] Building C object CMakeFiles/ReiLua.dir/src/state.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 87%] Building C object CMakeFiles/ReiLua.dir/src/text.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[ 93%] Building C object CMakeFiles/ReiLua.dir/src/textures.c.obj
<command-line>: warning: ISO C99 requires whitespace after the macro name
[100%] Linking C executable ReiLua.exe
[100%] Built target ReiLua

reilua_bug

nullstare commented 7 months ago

I kind of looks like it cannot find the main.lua but it should give error message about that. The path should be to the directory where the main.lua is and not to the file so like you did before "./ReiLua ../examples/platformer/" I don't know if the slashes affect anything if it's / or \ . One more thing you could try is to have the ReiLua exe on the same directory as the main.lua so then it atleast should find it without any path. Other than that I don't know right now, I haven't made windows build in a while so should probably test that myself.

Nathan-MV commented 7 months ago

reilua_bug

nullstare commented 7 months ago

I confirm there seems to be something wrong with the windows version.

nullstare commented 7 months ago

The issue seems to be glfwSet*Callback functions here. https://github.com/nullstare/ReiLua/blob/eda4eacfce4f62ca09fb4f6559f9b7aeabe3cc31/src/platforms/core_desktop.c#L620 For now you could disable those by not calling platformRegisterEvents here https://github.com/nullstare/ReiLua/blob/eda4eacfce4f62ca09fb4f6559f9b7aeabe3cc31/src/platforms/core_desktop.c#L652C6-L652C27 Those are not necessarily required. So far I have been unable to fix these so maybe I just disable them on Windows for now or add compiler flag to enable them. Should probably look into the platform SDL events since those are handled differently.