53 lines
939 B
Plaintext
53 lines
939 B
Plaintext
|
|
extern "grogs"
|
||
|
|
|
||
|
|
struct -rectangle
|
||
|
|
init &topx -int
|
||
|
|
init &topy -int
|
||
|
|
init &bottomx -int
|
||
|
|
init &bottomy -int
|
||
|
|
init &red -int
|
||
|
|
init &green -int
|
||
|
|
init &blue -int
|
||
|
|
endstruct
|
||
|
|
|
||
|
|
fun -int !draw -rectangle &r
|
||
|
|
set &ycount $r.topy
|
||
|
|
@columnloop
|
||
|
|
set &xcount $r.topx
|
||
|
|
add 1 $ycount &ycount
|
||
|
|
greater $ycount $r.bottomy &cond
|
||
|
|
if $cond %endloop
|
||
|
|
@rowloop
|
||
|
|
pusharg $xcount $ycount $r.red $r.green $r.blue
|
||
|
|
!grogs:setPixel &out
|
||
|
|
add 1 $xcount &xcount
|
||
|
|
greater $xcount $r.bottomx &cond
|
||
|
|
if $cond %columnloop
|
||
|
|
jump %rowloop
|
||
|
|
@endloop
|
||
|
|
return 0
|
||
|
|
endfun
|
||
|
|
|
||
|
|
pusharg "Grogs Window" 640 480
|
||
|
|
!grogs:initSDL &status
|
||
|
|
|
||
|
|
init &rect -rectangle
|
||
|
|
set &rect.topx 10
|
||
|
|
set &rect.topy 10
|
||
|
|
set &rect.bottomx 150
|
||
|
|
set &rect.bottomy 100
|
||
|
|
set &rect.red 0
|
||
|
|
set &rect.blue 255
|
||
|
|
set &rect.green 255
|
||
|
|
|
||
|
|
@loop
|
||
|
|
pusharg $rect
|
||
|
|
!draw &out
|
||
|
|
!grogs:renderFrame &out
|
||
|
|
!grogs:pollEvent &out
|
||
|
|
equal $out 0 &cond
|
||
|
|
if $cond %end
|
||
|
|
jump %loop
|
||
|
|
|
||
|
|
@end
|