Hm, I think if SDL2 is in the repositories, Lua 5.2 should also be. And the difference between 5.2 and 5.1 is not that much as with Python 2 and Python 3.
Anyway, I wanted to let you know that I am making progress. The first thing I want to implement is a working windowing system. There is one thing to consider: a render context (and texture, what I call sprite) is always bound to a window. So one has to adress the target window in every function. Well, that seemed a bit too much of typing for me:
mywindow = openwindow (640,480,20,20,"First test")
myimage = loadimage ("test.png")
mysprite = createsprite (myimage, mywindow)
drawsprite (mysprite, mywindow, 320, 240,1,1,45)
(Yes, you don't draw images anymore onto the screen, because we want to have hardware acceleration.)
So instead I came up with the following (actually working Pascal code!):
win1:=openwindow ('Hello World',SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480);
win2:=openwindow ('Hello World2',10, 10 , 320, 240);
bmp := loadimage ('media/fighter1.png');
setactivewindow (win1);
tex := createsprite (bmp);
//We no longer need the surface
freeimage(bmp);
bmp := loadimage ('media/laser.png');
setactivewindow (win2);
tex2:=createsprite (bmp);
freeimage (bmp);
setactivewindow (win1);
backcolor (155,10,10,255);
clearwindow;
setactivewindow (win2);
backcolor (55,110,10,255);
for i:= 0 to 360 do begin
setactivewindow (win2);
clearwindow;
drawsprite (tex2,160,100,1,1,i);
redraw;
setactivewindow (win1);
clearwindow;
drawsprite (tex,320,200,1,1,i);
redraw;
wait (5);
end;
SDL_ShowSimpleMessageBox (SDL_MESSAGEBOX_INFORMATION, 'Beware', 'That''s all folks.', nil);
closewindow(win1);
closewindow (win2);
SDL_Quit();
The messagebox will be wrapped up, too and of course on does not have to add SDL_Quit.
This is how drawsprite will work:
drawsprite (spritetexture,x,y,xzoom,yzoom,angle)