Approaching using a header-only C library
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Approaching using a header-only C library
Use SWIG to convert it to Lua, but it's not recommended though because after that I couldn't tell you what to do next. I read this demo for SDL/OpenGL 3, from what I can see.. you need to integrate Nuklear library to LOVE (and Lua, also SDL) by hacking a few things in here and here, also maybe elsewhere. That's not going to be easy though.
Re: Approaching using a header-only C library
You should be able to get the window handle with SDL_GL_GetCurrentWindow.Tanner wrote:you're going to need access to Love's Window:getHandle which isn't exposed to Lua. This (someone correct me if I'm wrong) means that your best bet would be to compile your shared library against Love as well and get the SDL_Window instance there.
Try this:
Code: Select all
local ffi = require 'ffi'
local sdl = ffi.load 'SDL2'
ffi.cdef [[
typedef void SDL_Window;
SDL_Window* SDL_GL_GetCurrentWindow (void);
void SDL_MinimizeWindow (SDL_Window* window);
]]
local sdlWindow = sdl.SDL_GL_GetCurrentWindow()
sdl.SDL_MinimizeWindow(sdlWindow)
Re: Approaching using a header-only C library
Oooh, nice! Yeah, I'd definitely try that first.airstruck wrote:You should be able to get the window handle with SDL_GL_GetCurrentWindow.
Try this:
Code: Select all
local ffi = require 'ffi' local sdl = ffi.load 'SDL2' ffi.cdef [[ typedef void SDL_Window; SDL_Window* SDL_GL_GetCurrentWindow (void); void SDL_MinimizeWindow (SDL_Window* window); ]] local sdlWindow = sdl.SDL_GL_GetCurrentWindow() sdl.SDL_MinimizeWindow(sdlWindow)
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 80 guests