Lua ↔ Qt ↔ OpenGL bindings

Post Reply
User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Lua ↔ Qt ↔ OpenGL bindings

Post by Vadi »

Given how we can have the Mapper view embedded in the main console, it would make sense to allow users to create their own 3d display areas that are embedded and display in them whatever they'd like.

The problem is of bindings. Up until now, Mudlets API bindings were done by hand (TLuaInterpreter.cpp) - it's quick and easy to do. But that's really not a feasible to do it for all if Qt's OpenGL: http://doc.trolltech.com/4.7/qtopengl.html

So a better solution is needed to make this tick. I'll google about over the next few days and see if anyone has generated such bindings that a) work and b) won't drive you insane while using them, or we can look into alternative ideas on how to make this all work such as automatic generation ourselves. There's a whole suit of options for the latter: http://lua-users.org/wiki/BindingCodeToLua

Edit: Ooh: http://lua-users.org/wiki/OpenGraphicsLibrary (actually this isn't useful because none are for Qt. But how they work / were generated might be relevant)

Edit2: Also: http://lua-users.org/wiki/LuaGraphics I just remembered that you can script shaders and I'd assume any gl elements with Lua in Spring RTS. That's one path to look at.

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: Lua ↔ Qt ↔ OpenGL bindings

Post by Vadi »

Some progress. I guess people out to start getting acquainted with http://luagl.sourceforge.net/#ref

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: Lua ↔ Qt ↔ OpenGL bindings

Post by Vadi »

Hmm. While looking about, found this piece of code:
Code: [show] | [select all] lua
-- define some GL constants that aren't available in luaglut
GL_TEXTURE_RECTANGLE_ARB          = 0x84F5
GL_TEXTURE_BINDING_RECTANGLE_ARB  = 0x84F6
GL_PROXY_TEXTURE_RECTANGLE_ARB    = 0x84F7
GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8
I guess adding some constants is just that easy, the binding just passes them on directly.

Post Reply