You might want to take a look at my sample that uses Lazarus, SDL, and Lua together. It can run in SDL or OpenGL thru SDL modes (via command line switches), compiles fine for windows, mac, and linux, and comes with full source. It should show you everything you need to know.

Download here: http://www.eonclash.com/ViewProduct.php?ProductID=23