Home | Rules and Guide | Sign In/Create Account | Write a Post | Reddit | #LD48 | #ludumdare on irc.afternet.org (Info)

Ludum Dare 29 — April 25th-28th Weekend [9 PM EST] — Theme: ??? (Theme Voting!)
  • Ludum Dare 29 Compo (48 Hour+Solo+Scratch+Src) Begins: in 2 days, 2 hours, 17 minutes, 47 seconds
  • Ludum Dare 29 Jam (72 Hour+Teams OK+Relaxed) Begins: in 2 days, 2 hours, 17 minutes, 48 seconds
  • [ MiniLD 50 | Warmup Weekend | Real World Gatherings | Ludum Deals | Wallpaper ]


    Dynamic OpenGL for LuaJIT

    Posted by (twitter: @kamjau)
    April 20th, 2012 2:37 pm

    I’ve been toying around with LuaJIT lately. If you’re not familiar with LuaJIT, it’s a just-in-time compiler that not only makes your Lua code run super fast, but it also makes it possible to call native code from Lua without any native glue code at all. Pretty cool tech.

    OpenGL requires some special handling though, so I made an OpenGL loader for it that handles all the dynamic loading, version differences and extensions and such for you (based on the official spec files), and added some extra code to make shaders easier to work with. I didn’t really plan on using this for LD, but hey, might as well post it now so that I have the option: ld23base.zip (zlib license)

    That zip includes some example code using SDL + OpenGL to draw a spinning rectangle in pure Lua =).  I doubt anyone else will use this, but you’re of course welcome to if you want =). Please let me know if you do! It’s a bit WIP-y still, but fully usable and should be pretty straightforward if you’re familiar with SDL and OpenGL. It probably requires LuaJIT 2.0 (beta) to run, and it’s only been tested on 64-bit Linux, but it should hopefully run on anything supported by LuaJIT as long as SDL and OpenGL libs are available.

    Tags: , , , ,

    Leave a Reply

    You must be logged in to post a comment.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]