-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation and usage for LOVE2D #20
Comments
From a sibling folder to the repo folder
but if you use https://github.com/sonoro1234/anima it will build GLFW, SDL and LuaJIT-ImGui for you |
Okay, honestly, I rarely collect anything because it's hard. What's an anima? I don't know what to do with it, so I need to clarify it for SDL2. If it's not difficult, how do you build it in more detail? |
https://github.com/sonoro1234/anima is my repo for working with opengl. |
Okay, thanks, maybe I'll figure it out later, but I couldn't. Here's the conclusion. Maybe I should specify luajit in DLUAJIT_BIN, I did it in an empty folder.
|
When you clone the repo you should do it recursively to also clone the git submodules. For LUAJIT_BIN use ""/home/sergey/anima" for example |
Okay, I did the first item, some files were not found there, but it went well. And "make install" at the end gave me errors.
|
implot source was not up to date. |
Now it was 96% I decided to restart, but it didn't help.
|
Yes, it did help. google |
Ugh, it helped, the assembly was successful. I take it now everything has to be searched in the directory I indicated? |
Yes In the anima\examples\LuaJIT-ImGui\examples folder you will find the LuaJIT examples, you should run them from a terminal (or your prefered code editor) |
The thing is that I'm using the LOVE2D framework and I need to run it, I thought it would be at the end of the .so dynamic library and I could connect them. |
It is not a LOVE2D module but just a LuaJIT module. Someone has to port it to LOVE2D. Perhaps https://github.com/Jarodwr/love-imgui-wip but I have not tried it and it seems to need more work for linux building. without using LuaJIT-imgui you have https://github.com/YoungNeer/lovely-imgui but I guess it will be not up to date with latest imgui |
Just LOVE2D is assembled with LuaJIT |
I was able to run your implementation in LOVE2D by copying the libraries to LOVE2D. And I put https://github.com/Jarodwr/love-imgui-wip, but alas, it didn't work. Thank you for trying to help me, I think you can close the issue. Next, if the author builds for linux, it'll be great.
|
Without a more detailed description of what you have done I wont be able to help you. Besides that: Actually it was quite simple to run imgui in LOVE2D without any modification at all: put imgui folder inside love/lua main.lua local imgui = require "imgui.sdl"
local ffi = require"ffi"
ffi.cdef[[
typedef struct SDL_Window SDL_Window;
SDL_Window *SDL_GL_GetCurrentWindow(void);
void* SDL_GL_GetCurrentContext(void);
]]
local sdl = jit.os == "Windows" and ffi.load("SDL2") or ffi.C
local instance
love.load = function(table)
local sdlwindow = sdl.SDL_GL_GetCurrentWindow()
local openglctx = sdl.SDL_GL_GetCurrentContext()
instance = imgui.Imgui_Impl_SDL_opengl3()
instance:Init(sdlwindow, openglctx)
end
love.draw = function()
instance:NewFrame()
if imgui.Button("Hello") then print("Hello") end
instance:Render()
end Tell me if this is working for you so I will make imgui.love2d.lua in order to avoid sdl stuff on main.lua @ocornut Could you please add LuaJIT-imgui to the list of LÖVE+LUA bindings? |
Probably should have said that I got it then, I just imgui put it in love/lua, but with a direct request SDL I did not. At https://github.com/Jarodwr/love-imgui-wip the renderer is not via SDL but via LOVE2D, so imgui takes a table of what to draw but with LOVE2D renderer. I'll try yours later.
|
Yes, sdl events were missing now there is imgui.love module and a love example. |
|
I think you are mixing the imgui lua modules from master branch with the module compiled from docking_inter branch (this is the module included in anima). |
So, I have to rebuild? I downloaded from github, copied from lua's folder, that's all. |
Or dont rebuild but take the lua modules from docking_inter branch (the one you get when you clone anima) |
Everything's okay, and it's working. |
I have also improved building LuaJIT-ImGui alone (without anima) with dependencies in the readme and a new linux script. |
Okay, I'll check. |
Added use_imgui_viewport, will only work in docking-inter branch. |
|
First of all: This is not a general imgui.love issue, (Compilation and usage for LOVE2D) you should open a new issue for things happening in the future. You should provide context information about the issue: version, commit, branch ... This error you are posting is not according to current imgui.sdl docking_inter branch https://github.com/sonoro1234/LuaJIT-ImGui/blob/docking_inter/lua/imgui/sdl.lua#L1342 |
please open new issue with this. Should be called undefined symbol |
Can you please give instructions on how to compile for linux?
The text was updated successfully, but these errors were encountered: