Hello
Been working on this for a couple of hours . . .
#include once "tinyptc_ext.bi"
#include once "crt.bi"
Const xres=600
Const yres=480
Declare Sub lin(Byval X1 as Integer, Byval Y1 as Integer, Byval X2 as Integer, Byval Y2 as Integer, Byval LR as Integer, Byval LG as Integer, Byval LB as Integer)
Dim Shared as UInteger Buffer(XRES*YRES)
Dim shared as String key
Dim Shared as Integer a,b,c,d,b1,e,f,lop,rr,gg,bb,rn
#define PP(x,y,argb) buffer(y*XRES+x)=argb
c=299:d=479:a=199:b=199:b1=1
rr=255:gg=0:bb=0
ptc_setdialog(1,"Do You Want Full Screen? ",0,0)
if ( ptc_open ( "Laser Test by Drew", xres, yres) = 0 ) then
end -1
end if
while key<>chr$(27)
key = inkey$()
lin(c,d,b,a,255,255,255)
for lop=0 to 63
rn=int(rnd(1)*10)
e=(int(rnd(1)*-14))+(int(rnd(1)*14))
f=1+(int(rnd(1)*-14))+(int(rnd(1)*14))
if rn<5 then rr=255:gg=0:bb=0
if rn>5 then rr=255:gg=255:bb=0
pp(b+e,(a+(f)),rgb(rr,gg,bb))
next lop
ptc_update@Buffer(0)
erase buffer
b=b+b1
if b>=499 then a=a+4
if b>=499 then b1=-1
if b<99 then a=a+4
if b<99 then b1=1
if a>299 then a=199
Wend
'LINE Drawing Routine by Shockwave (Thanks Dude!)
SUB LIN(BYVAL X1 AS INTEGER , BYVAL Y1 AS INTEGER , BYVAL X2 AS INTEGER , BYVAL Y2 AS INTEGER , BYVAL LR AS INTEGER, BYVAL LG AS INTEGER, BYVAL LB AS INTEGER)
DIM xdistance AS DOUBLE
DIM ydistance AS DOUBLE
DIM TC AS INTEGER
DIM i AS INTEGER
DIM h2 AS INTEGER
DIM StartX AS DOUBLE
DIM StartY AS DOUBLE
DIM XRatio AS DOUBLE
DIM YRatio AS DOUBLE
TC = RGB ( LR,LG,LB )
xdistance = X2 - X1
ydistance = Y2 - Y1
h2 = sqr( xdistance * xdistance + ydistance * ydistance )
StartX = X1
StartY = Y1
XRatio = xdistance * ( 1.0 / h2 )
YRatio = ydistance * ( 1.0 / h2 )
for i = 0 to h2
IF STARTX>0 AND STARTX<XRES AND STARTY>0 AND STARTY<YRES THEN
BUFFER ( INT(StartX) + (INT(StartY) * XRES ) ) = TC
END IF
StartX = StartX + XRatio
StartY = StartY + YRatio
next i
END SUB
when i go to fullscreen it just quits out . . . anybody any ideas?
windowed mode works fine!
Thanks - Drew