Author Topic: Sdl2 Render Demo  (Read 1668 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Sdl2 Render Demo
« on: February 28, 2016, 02:29:35 AM »
Hello,
Code: [Select]
include "sdx.inc"
window 800,600, 1
SetFrames 60

LoadSpr 1,"bmp/hello.bmp",8
LoadBmp 2,"bmp/p2.bmp"
LoadBmp 3,"bmp/texture01.bmp"

single v
sys c[6]

for i=0 to 7
    c[i] = rnd(0,7)
next

while key(27)=0
cls 0, 0, 255

DrawBmp 3,160,120
SetAlpha 160
DrawBmp 2,xmouse()-32,ymouse()-32

DrawSpr 1,220, 20,c[0]
DrawSpr 1,400,100,c[1]
DrawSpr 1, 20,100,c[2]
DrawSpr 1, 20,300,c[3]
DrawSpr 1,400,300,c[4]

color 0,255,0,128
fillrect 400,0,50,50

color 0,255,0,240
fillrect 450,0,50,50
v +=.1
if v >=1
   v=0
   for i=0 to 7
       c[i] +=1
       if c[i]=6 then c[i]=0
   next
end if

button = MouseButton()
SetWinTitle "Mouse_Button " & button
Sync()
wend
Quit()



.