'ScriptBasic
'proposed use of DLLC dll interface
'11:07 16/02/2013 CP
 
'DLLC MODULE HEADER
 
declare sub dllfile alias "dllfile" lib "dllc"
declare sub dllproc alias "dllproc" lib "dllc"
declare sub dllcall alias "dllcall" lib "dllc"
declare sub dlltype alias "dlltype" lib "dllc"
declare sub dlldimv alias "dlldimv" lib "dllc"
declare sub dllfill alias "dllfill" lib "dllc"
declare sub dllgetv alias "dllgetv" lib "dllc"
declare sub dllputv alias "dllputv" lib "dllc"
 
'PARTIAL SW DLL HEADER
 
sw=dllfile("sw.dll")
Window      = dllproc( sw,"Window        (i,i,i)"       )
SetCaption  = dllproc( sw,"SetCaption    (c*)"          )
Cls         = dllproc( sw,"Cls           (i)"           )
Key         = dllproc( sw,"Key         i=(i)"           )
GetHeight   = dllproc( sw,"GetHeight   i=()"            )
GetWidth    = dllproc( sw,"GetWidth    i=()"            )
Box         = dllproc( sw,"Box           (i,i,i,i,i,i)" )
DrawLine    = dllproc( sw,"DrawLine      (i,i,i,i,i,i)" )
RGB         = dllproc( sw,"RGB           (i,i,i)"       )
Rand        = dllproc( sw,"Rand          (i,i)"         )
Sync        = dllproc( sw,"Sync          ()"            )
CloseWindow = dllproc( sw,"CloseWindow   ()"            )
 
'CODE
 
dllcall Window, 640, 480, 1
dllcall SetCaption,"SB/SW - Morning Light"
 
WHILE dllcall(Key,27) = 0 
dllcall Cls,0
FOR y = 0 TO dllcall(GetHeight) STEP 10
  FOR x = 0 TO dllcall(GetWidth) STEP 10
    dllcall Box, x, y, 8, 8, 1, 0xC0C0F8
    dllcall DrawLine x, y, 240, 69, 2, dllcall (RGB,dllcall (Rand,64,255), dllcall(Rand,64,255), dllcall(Rand,64,255))
  NEXT
NEXT 
dllcall Sync
WEND
dllcall CloseWindow
dllfile 0