Author Topic: Sdl2 Test  (Read 2277 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Sdl2 Test
« on: February 07, 2016, 08:43:46 AM »
Hello,

Here is the beginning of SDL2 library.
It is almost all sdl2 except the keyboard handling. Later, I want to use the sdl2 scancode.

Actually, I'm not so excited.
Documentaries are really sparse. Lazy Foo is the worst ever. What you are looking for is not to be found.

Is actually no better than SDL 1.2.

Code: [Select]
include "sdx.inc"
window 640,480,1
setframes 60

sys np=500, j, z, p, float v
sys px[500]
sys py[500]
sys pz[500]

loadspr 1,"bmp/phoenix.bmp",10
loadbmp 1,"bmp/centauri.bmp"

for j=0 to np
    px[j] = rnd(0,639)
    py[j] = rnd(0,479)
    pz[j] = rnd(0xFFFFFF,0xFFFFFFFF)
next

while key(27)=0
cls 0,0,0
'setalpha 128
drawbmp 1,128,64
for j=0 to np
    px[j] = px[j] -1
    if px[j] <0 then
       px[j] = 640
       py[j] = rnd(0,479)
    end if
    color (pz[j],pz[j],pz[j],255)
    setpoint px[j],py[j],2
next
drawspr 1,(640-128)/2,(480-128)/2,z

v += 0.2
if v >=1 then
   v = 0
   z +=1
   if z=10 then z=0
end if

Sync()
wend
Quit

.

JRS

  • Guest
Re: Sdl2 Test
« Reply #1 on: February 07, 2016, 10:15:53 AM »
Quote
Documentaries are really sparse. Lazy Foo is the worst ever. What you are looking for is not to be found.

SDL is a BYOD (Bring Your Own Docs) library.  :)

Peter

  • Guest
Re: Sdl2 Test
« Reply #2 on: February 08, 2016, 04:06:04 AM »
Quote
SDL is a BYOD (Bring Your Own Docs) library.

I like  BYOD,  shapelier verbalism!  ;D