Dark Bit Factory & Gravity
PROGRAMMING => Freebasic => Topic started by: Shockwave on September 10, 2006
-
I thought that the topic title would get your attention, in fact, what this is is a program that uses Jim Shaws excellent screen synch in conjuntion with a program that would port over to tinyptc with no modifications to create the archietypal amiga sine intro!! This is the sort of program that up until now was really difficult to write using gfx lib or tinyptc because the screen synch didn't work properly.
Now we have this.. Feast your eyes on a copper med res sine scroll with a paralax starfield and absolutely no glitches.
Exe attached for people without freebasic.
' SILKY SMOOTH PTC STYLE SINE SCROLLER BY SHOCKWAVE ^ DBF ^ SURPRISE ! PRODUCTIONS
' USING GL VBL SYNCH CODE BY JIM SHAW TAKEN FROM THE DBF / GRAVITY FORUMS.
' WWW.DBFINTERACTIVE.COM
'
'-------------------------------------------------------------------------------
' INCLUDES;
'
#include once "windows.bi"
#include once "gl/gl.bi"
#include once "gl/glext.bi"
#include once "fbgfx.bi"
option explicit
option static
CONST XRES = 640
CONST YRES = 480
'
' JIM SHAWS FUNCTION DEFS;
'
declare function ptc_open(byval title as zstring ptr, byval width as integer, byval height as integer ) as integer
declare function ptc_update(byval buff as integer ptr) as integer
declare function ptc_close() as integer
declare sub ptc_setflip(byval interval as integer)
dim shared FONT (81 * 59) as integer
declare sub DBFTEXT(BYVAL BX AS INTEGER , BYVAL BY AS INTEGER , BYVAL CH AS INTEGER , BYVAL CLR AS INTEGER)
DIM LP AS INTEGER
'-----------------------------------------------------------------
'Read In Our Font;
'-----------------------------------------------------------------
FOR LP=1 TO (81*59)
READ FONT(LP)
NEXT
'
'
'
dim shared buffer(XRES*YRES) as uinteger
dim x as integer
ptc_open("hello",XRES,YRES)
DIM SHARED MP AS INTEGER
DIM SHARED SCOFF AS INTEGER
DIM SHARED SCROLLYFUN AS STRING
SCROLLYFUN=" USE ALT+ENTER TO TOGGLE WINDOWED MODE AND ESCAPE TO QUIT! "
SCROLLYFUN=SCROLLYFUN+" ----------- YOU COULD BE FORGIVEN FOR THINKING YOU'D SWITCHED YOUR AMIGA ON BY MISTAKE!! "
SCROLLYFUN=SCROLLYFUN+"THIS PROGRAM IS NOT MEANT TO BE MIND BLOWING, BUT WHAT YOU SHOULD LOOK AT IS THE PERFECT "
SCROLLYFUN=SCROLLYFUN+"AND BEAUTIFUL VBL SYNCH... THIS PROGRAM ACTUALLY WORKS EXACTLY LIKE A PROGRAM THAT USES TINYPTC, IN FACT IT WOULD "
SCROLLYFUN=SCROLLYFUN+"PORT STRAIGHT OVER TO IT, HOWEVER THE VBL SYNCH IS USING OPENGL TO GET THIS PERFECTLY SMOOTH REFRESH.. THANK YOU JIM SHAW!! "
SCROLLYFUN=SCROLLYFUN+"THIS IS JUST ONE OF THE COOL TECHNIQUES THAT ARE BEING DEVELOPED AT WWW.DBFINTERACTIVE.COM USE THIS SOURCE FREELY BUT CREDIT WHAT YOU TAKE.. "
SCROLLYFUN=SCROLLYFUN+"SHOCKWAVE OF DBF AND SURPRISE ! PRODUCTIONS 2006.........."
SCROLLYFUN=SCROLLYFUN+" "
MP=0
SCOFF=0
DECLARE SUB SCROLLER()
DECLARE SUB GRADIENT_LINES()
DECLARE SUB GENERATE_COPPERS()
DIM SHARED SINEADD AS INTEGER
DIM SHARED SINEADD2 AS INTEGER
DIM SHARED COPPERLIST (YRES) AS UINTEGER
DIM SHARED STARNUM AS INTEGER :'NUMBER OF STARS ON EACH LAYER THERE ARE 4 LAYERS.
STARNUM=60
DIM SHARED STARX(STARNUM*4)
DIM SHARED STARY(STARNUM*4)
DECLARE SUB GENERATE_STARS()
DECLARE SUB DRAW_STARS()
GENERATE_COPPERS()
GENERATE_STARS()
do
GRADIENT_LINES()
DRAW_STARS()
SCROLLER()
ptc_update(@buffer(0))
ERASE BUFFER
loop until inkey$ = CHR$(27)
ptc_close()
end
SUB DRAW_STARS()
DIM A
FOR A=1 TO STARNUM
IF STARX(A)<XRES AND STARX(A)>0 THEN BUFFER(STARX(A)+(STARY(A)))=&H2222CC
STARX(A)=STARX(A)+1
IF STARX(A)>XRES THEN STARX(A)=STARX(A)-XRES
NEXT
FOR A=STARNUM+1 TO STARNUM*2
IF STARX(A)<XRES AND STARX(A)>0 THEN BUFFER(STARX(A)+(STARY(A)))=&H4444DD
STARX(A)=STARX(A)+2
IF STARX(A)>XRES THEN STARX(A)=STARX(A)-XRES
NEXT
FOR A=(STARNUM*2)+1 TO STARNUM*3
IF STARX(A)<XRES AND STARX(A)>0 THEN BUFFER(STARX(A)+(STARY(A)))=&H7777EE
STARX(A)=STARX(A)+3
IF STARX(A)>XRES THEN STARX(A)=STARX(A)-XRES
NEXT
FOR A=(STARNUM*3)+1 TO STARNUM*4
IF STARX(A)<XRES AND STARX(A)>0 THEN BUFFER(STARX(A)+(STARY(A)))=&HAAAAFF
STARX(A)=STARX(A)+4
IF STARX(A)>XRES THEN STARX(A)=STARX(A)-XRES
NEXT
END SUB
SUB GENERATE_STARS()
DIM A
FOR A=1 TO STARNUM*4
STARX(A)= RND*(XRES)
STARY(A)= (50+(RND*(YRES-101)))*XRES
NEXT
END SUB
SUB GENERATE_COPPERS()
DIM A
FOR A=0 TO YRES-1
COPPERLIST(A) = RGB( 120+119*SIN(A/123),120+119*SIN(A/73),120+119*SIN(A/53))
NEXT
END SUB
SUB GRADIENT_LINES()
DIM AS INTEGER FX1,FX2,TY,BY,CLR
TY=50*XRES
BY=(YRES-50)*XRES
FX2=XRES-1
FOR FX1=0 TO XRES-1
CLR=RGB(100+99*SIN((SINEADD2+FX1) / 132),100+99*SIN((SINEADD2+FX1) / 143),100+99*SIN((SINEADD2+FX1) / 144))
BUFFER(FX1+TY)=CLR
BUFFER(FX2+BY)=CLR
FX2=FX2-1
NEXT
END SUB
SUB SCROLLER()
SINEADD=SINEADD+1
SINEADD2=SINEADD2+10
DIM LL,CC
FOR LL=1 TO 33
CC=ASC(MID(SCROLLYFUN,LL+MP,1))-31
DBFTEXT ((LL*20)-SCOFF,180,CC,&H00000000)
NEXT
SCOFF=SCOFF+3
IF SCOFF>=40 THEN
SCOFF=SCOFF-20
MP=MP+1
IF MP>LEN(SCROLLYFUN)-33 THEN MP=0
END IF
END SUB
'-------------------------------------------------------------------------
'Sub To Draw A Letter AnyWhere On The Screen (With Clipping);
'-------------------------------------------------------------------------
sub DBFTEXT(BYVAL BX AS INTEGER , BYVAL BY AS INTEGER , BYVAL CH AS INTEGER , BYVAL CLR AS INTEGER)
dim AS INTEGER blx,bly,bm,mm,TXP,TYP,CLR2
DIM SV AS INTEGER
'---------------------------------
'Calculate Offset In Font Data;---
'---------------------------------
bm=(ch*81)-81
TYP = 0
FOR BLY=0 TO 8
TXP=0
FOR BLX=1 TO 9
SV=70+69*SIN((SINEADD+BX+TXP)/73)+59*COS((SINEADD-(BX+TXP))/43)
'--------
'Clip;---
'--------
IF (BX+TXP>1) AND (BX+TXP<XRES-1) AND (BY+TYP>1) AND (BY+TYP<YRES-1) THEN
'----------------------------------------------------
'Draw Pixel In Buffer If Onscreen And If Binary 1 ---
'----------------------------------------------------
MM= FONT(((BLY*9)+BLX)+BM)
IF MM >0 THEN
BUFFER (((BY+TYP+SV)*XRES)+BX+TXP)=COPPERLIST(BY+TYP+SV)
BUFFER (((BY+TYP+SV)*XRES)+BX+TXP+1)=COPPERLIST(BY+TYP+SV)
BUFFER (((BY+TYP+1+SV)*XRES)+BX+TXP+1)=COPPERLIST(BY+TYP+SV+1)
BUFFER (((BY+TYP+1+SV)*XRES)+BX+TXP)=COPPERLIST(BY+TYP+SV+1)
END IF
END IF
TXP=TXP+2
NEXT
TYP=TYP+2
NEXT
END SUB
'===============================================================================
'
' JIM SHAW'S SCREEN STUFF BELOW;
'
'===============================================================================
dim shared g_w as integer
dim shared g_h as integer
type PFNWGLSWAPINTERVALFARPROC as sub(byval interval as integer)
dim shared wglSwapIntervalEXT as PFNWGLSWAPINTERVALFARPROC
function ptc_open(byval title as zstring ptr, byval w as integer, byval h as integer) as integer
screenres w,h,32,0,3
wglSwapIntervalEXT = cast(PFNWGLSWAPINTERVALFARPROC,wglGetProcAddress("wglSwapIntervalEXT"))
ptc_setflip(1)
glViewport(0, 0, w,h)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0,w,h,0,0,1)
glPixelZoom(1,-1)
glRasterPos2i(0,0)
g_w=w
g_h=h
return 0
end function
function ptc_update(byval buff as integer ptr) as integer
glDrawPixels(g_w,g_h,GL_BGRA_EXT,GL_UNSIGNED_BYTE,buff)
flip
return 0
end function
function ptc_close() as integer
return 0
end function
sub ptc_setflip(byval interval as integer)
if wglSwapIntervalExt <> 0 then
wglSwapIntervalEXT(interval)
endif
end sub
'==============================================================================
' Binary Font By Shockwave / DBF; (59 Chars)
'==============================================================================
'space
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'!
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
'"
data 0,1,1,0,1,1,0,0,0
data 0,1,1,0,1,1,0,0,0
data 0,1,1,0,1,1,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'#
data 0,0,0,0,0,0,0,0,0
data 0,1,1,0,0,0,1,1,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,0,0,0,1,1,0
data 0,0,0,0,0,0,0,0,0
'£
data 0,0,1,1,1,1,0,0,0
data 0,1,1,1,1,1,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,1,1,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
'%
data 0,0,0,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,1,0,0
data 0,0,0,0,0,1,0,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,0,1,0,0,0,0,0
data 0,0,1,0,0,0,1,1,0
data 0,0,0,0,0,0,1,1,0
data 0,0,0,0,0,0,0,0,0
'&
data 0,0,0,1,1,1,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,1,1,0,1,1,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,1,1,0,1,1,0,0
data 0,1,1,0,0,1,1,1,1
data 0,1,1,1,0,0,1,1,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,1,1,0,0,0
''
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'(
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,1,1,1,1,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,0,1,1,1,1,0
data 0,0,0,0,0,1,1,1,0
')
data 0,1,1,1,0,0,0,0,0
data 0,1,1,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,1,1,1,1,0,0,0,0
data 0,1,1,1,0,0,0,0,0
'*
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,1,0,1,0,1,0,0
data 0,0,0,1,1,1,0,0,0
data 0,1,1,1,1,1,1,1,0
data 0,0,0,1,1,1,0,0,0
data 0,0,1,0,1,0,1,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'+
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
''
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,1,0,0,0,0
'-
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'.
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
'/
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,1,0
data 0,0,0,0,0,0,1,1,0
data 0,0,0,0,0,1,1,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,1,1,1,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'0
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,0,0,0,1,0,1,1
data 1,1,0,0,1,0,0,1,1
data 1,1,0,1,1,0,0,1,1
data 1,1,1,1,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'1
data 0,0,0,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,1,1,1,1,1,1,0,0
data 0,1,1,1,1,1,1,0,0
'2
data 0,0,1,1,1,1,1,1,0
data 0,0,1,1,1,1,1,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 0,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
'3
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,1,1,1,1,0
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
'4
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,1,1,0,0,0
data 1,1,0,0,1,1,0,0,0
data 1,1,1,1,1,1,1,1,1
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
'5
data 0,1,1,1,1,1,1,0,0
data 0,1,1,1,1,1,1,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,1,1,1,1,1,0
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'6
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,0
data 1,1,0,0,0,0,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'7
data 0,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,1,1,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
'8
data 0,0,1,1,1,1,1,0,0
data 0,1,1,1,1,1,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,0,1,1,1,1,1,0,0
data 1,1,1,0,0,0,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'9
data 0,0,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
data 0,1,1,0,0,0,0,1,1
data 0,1,1,0,0,0,0,1,1
data 0,0,1,1,1,1,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
':
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
';
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,1,0,0,0,0
'<
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,1,1,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,0,0,1,1,0,0
data 0,0,0,0,0,0,0,0,0
'=
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'>
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,1,1,1,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'?
data 0,0,1,1,1,1,1,0,0
data 0,1,1,1,1,1,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,0,0,0,0,0,1,1,0
data 0,0,0,1,1,1,1,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
'@
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,1,0,0,0,0,0,0,0
data 0,1,0,0,1,1,1,0,0
data 0,1,0,1,0,0,0,1,0
data 0,1,0,1,1,1,0,1,0
data 0,1,0,0,0,0,0,1,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,0,0,0,0,0
'a
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'b
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'c
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
'd
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'e
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,1,1,1,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
'f
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,1,1,1,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
'g
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,1,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'h
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'i
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
'j
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'k
data 1,1,0,0,0,0,1,1,0
data 1,1,0,0,0,0,1,1,0
data 1,1,0,0,0,0,1,1,0
data 1,1,0,0,0,0,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'l
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
'm
data 0,1,1,1,0,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,1,0,0,1,1
data 1,1,0,0,1,0,0,1,1
data 1,1,0,0,1,0,0,1,1
data 1,1,1,0,1,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'n
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'o
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'p
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
'q
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,1,0,1,1
data 1,1,1,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'r
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
's
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 0,1,1,1,1,1,1,1,0
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
't
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
'u
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'v
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,0,0,1,1,1
data 0,1,1,1,1,1,1,1,0
data 0,0,1,1,1,1,1,0,0
'w
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,1,0,0,1,1
data 1,1,1,0,1,0,0,1,1
data 1,1,1,0,1,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,0,1,1,1,0
'x
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,0,0,1,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'y
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 0,1,1,1,1,1,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'z
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,1,1,1
data 0,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
-
Shockwave - I am not worthy - that is soo amazing - Lots and lots of respect for this one! AND thanks for the code! AGAIN!
Drew
-
thats really cool shockwave fluid and fast with no tearing lovely ;)
-
Thanks both, but really this would never look authentic and Amiga like without using Jim's synch code. :)
-
yeah thats true,
me and jim origonally came up with the sync code for a 3d gl game im making but i would never have thought of yousing it like this very handy indeed.
-
:) I hope you post your game here when it's done Nino!
-
of course mate ;)
-
MAHAN! That looks extremely good!
If I see such a demo, my mouth gets full of water, my eyes are getting bigger and I feel like going insane!
Very good work man!
-
Cool Shockie!
That's lookiing like it's sure gonna cure some of my taring headaches; especially the problems I had with Bitmap Scrollers.
Nice one,
Clyde.
-
Very cool and smooth Shockie :||
Here's your example using the new tinyptc OGL framework.
Exe size: 40 kbytes
'---------------------------------------------------------------------------------
'Â Â Tinyptc OGL by Jim
'
'Â Â Window Framework by Rbraz
'
'Â Â 10 Sept 2006
'---------------------------------------------------------------------------------
'---------------------------------------------------------------------------------
' SILKY SMOOTH PTC STYLE SINE SCROLLER BY SHOCKWAVE ^ DBF ^ SURPRISE ! PRODUCTIONS
' USING GL VBL SYNCH CODE BY JIM SHAW TAKEN FROM THE DBF / GRAVITY FORUMS.
' WWW.DBFINTERACTIVE.COM
'
'---------------------------------------------------------------------------------
#include once "windows.bi"
#include once "gl/gl.bi"
#include once "gl/glext.bi"
#include once "crt.bi"
option explicit
option static
'Screen width x height
Const screenWidth = 640
Const screenHeight = 480
'Application name
Const AppicationName = "SILKY SMOOTH PTC STYLE SINE SCROLLER SHOCKWAVE^DBF^S!P"
'---------------------------------------------------------------------------------------------------------------
'Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Shockwave code
'---------------------------------------------------------------------------------------------------------------
    dim shared FONT (81 * 59) as integer   Â
    declare sub DBFTEXT(BYVAL BX AS INTEGER , BYVAL BY AS INTEGER , BYVAL CH AS INTEGER , BYVAL CLR AS INTEGER)   Â
    CONST XRES = screenWidth
    CONST YRES = screenHeight
   Â
DIM SHARED MP AS INTEGER
DIM SHARED SCOFF AS INTEGER
DIM SHARED SCROLLYFUN AS STRING
SCROLLYFUN="Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "
SCROLLYFUN=SCROLLYFUN+" ----------- YOU COULD BE FORGIVEN FOR THINKING YOU'D SWITCHED YOUR AMIGA ON BY MISTAKE!!  "
SCROLLYFUN=SCROLLYFUN+"THIS PROGRAM IS NOT MEANT TO BE MIND BLOWING, BUT WHAT YOU SHOULD LOOK AT IS THE PERFECT "
SCROLLYFUN=SCROLLYFUN+"AND BEAUTIFUL VBL SYNCH... THIS PROGRAM ACTUALLY WORKS EXACTLY LIKE A PROGRAM THAT USES TINYPTC, IN FACT IT WOULD "
SCROLLYFUN=SCROLLYFUN+"PORT STRAIGHT OVER TO IT, HOWEVER THE VBL SYNCH IS USING OPENGL TO GET THIS PERFECTLY SMOOTH REFRESH.. THANK YOU JIM SHAW!!  "
SCROLLYFUN=SCROLLYFUN+"THIS IS JUST ONE OF THE COOL TECHNIQUES THAT ARE BEING DEVELOPED AT WWW.DBFINTERACTIVE.COM  USE THIS SOURCE FREELY BUT CREDIT WHAT YOU TAKE.. "
SCROLLYFUN=SCROLLYFUN+"SHOCKWAVE OF DBF AND SURPRISE ! PRODUCTIONS 2006.........."
SCROLLYFUN=SCROLLYFUN+"Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "
MP=0
SCOFF=0
DECLARE SUB SCROLLER()
DECLARE SUB GRADIENT_LINES()
DECLARE SUB GENERATE_COPPERS()
DIM SHARED SINEADD AS INTEGER
DIM SHARED SINEADD2 AS INTEGER
DIM SHARED COPPERLIST (YRES) AS UINTEGER
DIM SHARED STARNUM AS INTEGER :'NUMBER OF STARS ON EACH LAYER THERE ARE 4 LAYERS.
STARNUM=60
DIM SHARED STARX(STARNUM*4)
DIM SHARED STARY(STARNUM*4)
DECLARE SUB GENERATE_STARS()
DECLARE SUB DRAW_STARS()
'---------------------------------------------------------------------------------------------------------------
'DEVMODE bug, found the cure here --> http://www.freebasic.net/forum/viewtopic.php?t=5659&highlight=devmode
'Will be corrected by Victor in the next freebasic update
#undef DEVMODE
Type DEVMODE
  dmDeviceName As Zstring * CCHDEVICENAME
  dmSpecVersion As WORD
  dmDriverVersion As WORD
  dmSize As WORD
  dmDriverExtra As WORD
  dmFields As DWORD
  dmOrientation As Short
  dmPaperSize As Short
  dmPaperLength As Short
  dmPaperWidth As Short
  dmScale As Short
  dmCopies As Short
  dmDefaultSource As Short
  dmPrintQuality As Short
  dmColor As Short
  dmDuplex As Short
  dmYResolution As Short
  dmTTOption As Short
  dmCollate As Short
  dmFormName As Zstring * CCHFORMNAME
  dmLogPixels As WORD
  dmBitsPerPel As DWORD
  dmPelsWidth As DWORD
  dmPelsHeight As DWORD
  dmDisplayFlags As DWORD
  dmDisplayFrequency As DWORD
  dmICMMethod As DWORD
  dmICMIntent As DWORD
  dmMediaType As DWORD
  dmDitherType As DWORD
  dmReserved1 As DWORD
  dmReserved2 As DWORD
  dmPanningWidth As DWORD
  dmPanningHeight As DWORD
End Type
declare function WinMain ( byval hInstance as HINSTANCE, _
              byval hPrevInstance as HINSTANCE, _
              szCmdLine as string, _
              byval iCmdShow as integer ) as integer
  '
  ' Entry point Â
  '
end WinMain( GetModuleHandle( null ), null, Command$, SW_NORMAL )
declare sub ChangeScreenResolution (byval wwidth as integer, byval hheight as integer, byval bitsPerPixel as integer)
declare function ptc_open(byval width as integer, byval height as integer ) as integer
declare function ptc_update(byval buff as integer ptr) as integer
declare function ptc_close() as integer
declare sub ptc_setflip(byval interval as integer)
declare sub Main()
declare sub Init()
dim shared buffer(screenWidth*screenHeight) as uinteger
dim shared g_w as integer
dim shared g_h as integer
'Global window device context
dim shared hDC as HDC
type PFNWGLSWAPINTERVALFARPROC as sub(byval interval as integer)
dim shared wglSwapIntervalEXT as PFNWGLSWAPINTERVALFARPROC
'' ::::::::
'' name: WndProc
'' desc: Processes windows messages
''
'' ::::::::
function WndProc ( byval hWnd as HWND, _
          byval message as UINT, _
          byval wParam as WPARAM, _
          byval lParam as LPARAM ) as LRESULT
 Â
  function = 0
 Â
  ''
  '' Process messages
  ''
  select case( message )
    ''
    '' Window was created
    ''   Â
    case WM_CREATE
      exit function
   Â
    ''
    '' Windows is being repainted
    ''
    case WM_PAINT
      exit function     Â
   Â
''
'' Key pressed
''
case WM_KEYDOWN
if( lobyte( wParam ) = 27 ) then
PostMessage( hWnd, WM_CLOSE, 0, 0 )
end if
    ''
    '' Window was closed
    ''
  case WM_DESTROY
      PostQuitMessage( 0 )
      exit function
  end select
 Â
  ''
  '' Message doesn't concern us, send it to the default handler
  '' and get result
  ''
  function = DefWindowProc( hWnd, message, wParam, lParam ) Â
 Â
end function
'' ::::::::
'' name: WinMain
'' desc: A win2 gui program entry point
''
'' ::::::::
function WinMain ( byval hInstance as HINSTANCE, _
          byval hPrevInstance as HINSTANCE, _
          szCmdLine as string, _
          byval iCmdShow as integer ) as integer Â
  Â
  dim wMsg as MSG
  dim wcls as WNDCLASS  Â
  dim hWnd as HWND
  dim windowStyle as DWORD
  dim windowExtendedStyle as DWORD
  dim windowRect as RECT
  dim pfd as PIXELFORMATDESCRIPTOR
  Â
  function = 0
 Â
'Window size
  windowRect.left  = 0
  windowRect.top  = 0
  windowRect.right = screenWidth
  windowRect.bottom = screenHeight
  Â
  ''
  '' Setup window class
  ''
  with wcls
  .style     = CS_HREDRAW or CS_VREDRAW or CS_OWNDC
  .lpfnWndProc  = @WndProc
  .cbClsExtra  = 0
  .cbWndExtra  = 0
  .hInstance   = hInstance
  .hIcon     = LoadIcon( NULL, IDI_APPLICATION )
  .hCursor    = LoadCursor( NULL, IDC_ARROW )
  .hbrBackground = GetStockObject( WHITE_BRUSH )
  .lpszMenuName = NULL
  .lpszClassName = strptr( AppicationName )
  end with
    Â
  ''
  '' Register the window class  Â
  ''  Â
  if( RegisterClass( @wcls ) = FALSE ) then
    MessageBox( NULL, "Failed to register window class!", AppicationName, MB_ICONERROR )
    exit function
  end if
 Â
' Ask The User Which Screen Mode They Prefer
if (MessageBox(NULL,"Fullscreen Mode ?", AppicationName,MB_YESNO or MB_ICONQUESTION)=IDNO) then
 Â
    'Windowed style
    windowStyle = WS_BORDER or WS_CAPTION or WS_SYSMENU or WS_POPUP or WS_MINIMIZEBOX
    windowExtendedStyle = WS_EX_APPWINDOWÂ
    'Adjust Window, Account For Window Borders
    AdjustWindowRectEx (@windowRect, windowStyle, 0, windowExtendedStyle)
   Â
  else
    ShowCursor(false)
    ChangeScreenResolution (screenWidth, screenHeight, 32)
    windowStyle = WS_POPUP or WS_VISIBLE
    windowExtendedStyle = WS_EX_TOPMOST
  end if
 Â
''AppicationName
  '' Create the window and show it
  ''
'Create our Window
hWnd =Â Â CreateWindowEx(windowExtendedStyle, _
AppicationName, _
           AppicationName, _
windowStyle, _
               0, 0, _
               windowRect.right - windowRect.left, _
     windowRect.bottom - windowRect.top, _
               HWND_DESKTOP, 0, _
hInstance, 0)
              Â
  'Get window device context
hDC = GetDC(hWnd)
  'Set pixel format
  pfd.cColorBits = pfd.cDepthBits = 32
  pfd.dwFlags  = PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER
  SetPixelFormat ( hDC, ChoosePixelFormat ( hDC, @pfd) , @pfd )
  wglMakeCurrent ( hDC, wglCreateContext(hDC) )
 Â
  'Get actual screen resolution and center screen
  dim as integer iSw, iSh
  iSw = (GetSystemMetrics(SM_CXSCREEN)-screenWidth) / 2
  iSh = (GetSystemMetrics(SM_CYSCREEN)-screenHeight) / 2
  MoveWindow(hWnd, iSw, iSh, screenWidth, screenHeight, TRUE)
            Â
  'Show window/update
  ShowWindow( hWnd, iCmdShow )
  UpdateWindow( hWnd )
 Â
  ' Initialyze tinyptc opengl
  ptc_open(screenWidth,screenHeight)
 Â
  'Initialyze demo/intro
  Init()
 Â
  ''
  '' Process windows messages
  ''
  while( GetMessage( @wMsg, NULL, 0, 0 ) <> FALSE ) Â
    TranslateMessage( @wMsg )
    DispatchMessage( @wMsg )
   Â
    'Run main function
    Main()
   Â
  wend
 Â
  ' Switch Back To Desktop Resolution
  ChangeDisplaySettings (NULL,0)
 Â
  ' Ends a process and all its threads.
  ExitProcess(0)
 Â
  ''
  '' Program has ended
  ''
  function = wMsg.wParam
end function
'Change The Screen Resolution
sub ChangeScreenResolution (byval wwidth as integer, byval hheight as integer, byval bitsPerPixel as integer)
dim dmScreenSettings as DEVMODE
ZeroMemory(@dmScreenSettings, sizeof (DEVMODE))
dmScreenSettings.dmSize = sizeof(DEVMODE)
dmScreenSettings.dmPelsWidth = wwidth
dmScreenSettings.dmPelsHeight = hheight
dmScreenSettings.dmBitsPerPel = bitsPerPixel
dmScreenSettings.dmFields = DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT
  if (ChangeDisplaySettings (@dmScreenSettings, CDS_FULLSCREEN) <> DISP_CHANGE_SUCCESSFUL) then
    MessageBox(NULL,"Change Display Error", AppicationName,MB_OK or MB_ICONEXCLAMATION)
end -1
end if
 Â
end sub
function ptc_open(byval w as integer, byval h as integer) as integer
  wglSwapIntervalEXT = cast(PFNWGLSWAPINTERVALFARPROC,wglGetProcAddress("wglSwapIntervalEXT"))
  ptc_setflip(1)
  glViewport(0, 0, w,h)
  glMatrixMode(GL_PROJECTION)
  glLoadIdentity()
  glOrtho(0,w,h,0,0,1)
  glPixelZoom(1,-1)
  glRasterPos2i(0,0)
  g_w=w
  g_h=h
return 0
end function
function ptc_update(byval buff as integer ptr) as integer
  glDrawPixels(g_w,g_h,GL_BGRA_EXT,GL_UNSIGNED_BYTE,buff)
  SwapBuffers ( hDc )
return 0
end function
function ptc_close() as integer
return 0
end function
sub ptc_setflip(byval interval as integer)
  if wglSwapIntervalExt <> 0 then
    wglSwapIntervalEXT(interval)
  endif
end sub
'-------------------------------------------------------------
'Â Â Â Â Â Â Â Â Â Â Â Initialyze
'-------------------------------------------------------------
sub Init()
'-----------------------------------------------------------------
'Read In Our Font;
'-----------------------------------------------------------------
DIM LP AS INTEGER
    FOR LP=1 TO (81*59)
        READ FONT(LP)
    NEXT
   Â
    GENERATE_COPPERS()
    GENERATE_STARS()
   Â
end sub
'-------------------------------------------------------------
'Â Â Â Â Â Â Â Â Main Code
'-------------------------------------------------------------
sub Main()
  GRADIENT_LINES()
  DRAW_STARS()
  SCROLLER()
 Â
  ptc_update(@buffer(0))
 Â
 Â
ERASE BUFFER
end sub
   Â
'---------------------------------------------------------------------------------------------------------------
'Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Shockwave code
'---------------------------------------------------------------------------------------------------------------
SUB DRAW_STARS()
  DIM A
  FOR A=1 TO STARNUM
    IF STARX(A)<XRES AND STARX(A)>0 THEN BUFFER(STARX(A)+(STARY(A)))=&H2222CC
    STARX(A)=STARX(A)+1
    IF STARX(A)>XRES THEN STARX(A)=STARX(A)-XRES       Â
  NEXT
  FOR A=STARNUM+1 TO STARNUM*2
    IF STARX(A)<XRES AND STARX(A)>0 THEN BUFFER(STARX(A)+(STARY(A)))=&H4444DD
    STARX(A)=STARX(A)+2
    IF STARX(A)>XRES THEN STARX(A)=STARX(A)-XRES       Â
  NEXT
  FOR A=(STARNUM*2)+1 TO STARNUM*3
    IF STARX(A)<XRES AND STARX(A)>0 THEN BUFFER(STARX(A)+(STARY(A)))=&H7777EE
    STARX(A)=STARX(A)+3
    IF STARX(A)>XRES THEN STARX(A)=STARX(A)-XRES       Â
  NEXT
  FOR A=(STARNUM*3)+1 TO STARNUM*4
    IF STARX(A)<XRES AND STARX(A)>0 THEN BUFFER(STARX(A)+(STARY(A)))=&HAAAAFF
    STARX(A)=STARX(A)+4
    IF STARX(A)>XRES THEN STARX(A)=STARX(A)-XRES       Â
  NEXT
END SUB
SUB GENERATE_STARS()
DIM A
FOR A=1 TO STARNUM*4
  STARX(A)= RND*(XRES)
  STARY(A)= (50+(RND*(YRES-101)))*XRES
NEXT
END SUB
SUB GENERATE_COPPERS()
  DIM A
  FOR A=0 TO YRES-1
    COPPERLIST(A) = RGB( 120+119*SIN(A/123),120+119*SIN(A/73),120+119*SIN(A/53))
  NEXT
END SUB
SUB GRADIENT_LINES()
DIM AS INTEGER FX1,FX2,TY,BY,CLR
TY=50*XRES
BY=(YRES-50)*XRES
FX2=XRES-1
FOR FX1=0 TO XRES-1
  CLR=RGB(100+99*SIN((SINEADD2+FX1) / 132),100+99*SIN((SINEADD2+FX1) / 143),100+99*SIN((SINEADD2+FX1) / 144))
  BUFFER(FX1+TY)=CLR
  BUFFER(FX2+BY)=CLR
  FX2=FX2-1
NEXT
END SUB
SUB SCROLLER()
  SINEADD=SINEADD+1
  SINEADD2=SINEADD2+10
  DIM LL,CC
  FOR LL=1 TO 33
    CC=ASC(MID(SCROLLYFUN,LL+MP,1))-31
    DBFTEXT ((LL*20)-SCOFF,180,CC,&H00000000)
  NEXT
  SCOFF=SCOFF+3
  IF SCOFF>=40 THEN
    SCOFF=SCOFF-20
    MP=MP+1
    IF MP>LEN(SCROLLYFUN)-33 THEN MP=0
  END IF
END SUB
'-------------------------------------------------------------------------
'Sub To Draw A Letter AnyWhere On The Screen (With Clipping);
'-------------------------------------------------------------------------
sub DBFTEXT(BYVAL BX AS INTEGER , BYVAL BY AS INTEGER , BYVAL CH AS INTEGER , BYVAL CLR AS INTEGER)
dim AS INTEGER blx,bly,bm,mm,TXP,TYP,CLR2
DIM SV AS INTEGER
  '---------------------------------
  'Calculate Offset In Font Data;---
  '---------------------------------
  bm=(ch*81)-81 Â
  TYP = 0
  FOR BLY=0 TO 8Â
   Â
  TXP=0
 Â
  FOR BLX=1 TO 9
    SV=70+69*SIN((SINEADD+BX+TXP)/73)+59*COS((SINEADD-(BX+TXP))/43)
    '--------
    'Clip;---
    '--------
    IF (BX+TXP>1) AND (BX+TXP<XRES-1) AND (BY+TYP>1) AND (BY+TYP<YRES-1) THEN
     Â
      '----------------------------------------------------
      'Draw Pixel In Buffer If Onscreen And If Binary 1 ---
      '----------------------------------------------------
     Â
      MM= FONT(((BLY*9)+BLX)+BM)
      IF MM >0 THEN
       Â
        BUFFER (((BY+TYP+SV)*XRES)+BX+TXP)=COPPERLIST(BY+TYP+SV)
        BUFFER (((BY+TYP+SV)*XRES)+BX+TXP+1)=COPPERLIST(BY+TYP+SV)
        BUFFER (((BY+TYP+1+SV)*XRES)+BX+TXP+1)=COPPERLIST(BY+TYP+SV+1)
        BUFFER (((BY+TYP+1+SV)*XRES)+BX+TXP)=COPPERLIST(BY+TYP+SV+1)
      END IF
     END IF
    TXP=TXP+2
  NEXT
    TYP=TYP+2
  NEXT
END SUB
'==============================================================================
' Binary Font By Shockwave / DBF; (59 Chars)
'==============================================================================
'space
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'!
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
'"
data 0,1,1,0,1,1,0,0,0
data 0,1,1,0,1,1,0,0,0
data 0,1,1,0,1,1,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'#
data 0,0,0,0,0,0,0,0,0
data 0,1,1,0,0,0,1,1,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,0,0,0,1,1,0
data 0,0,0,0,0,0,0,0,0
'£
data 0,0,1,1,1,1,0,0,0
data 0,1,1,1,1,1,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,1,1,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
'%
data 0,0,0,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,1,0,0
data 0,0,0,0,0,1,0,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,0,1,0,0,0,0,0
data 0,0,1,0,0,0,1,1,0
data 0,0,0,0,0,0,1,1,0
data 0,0,0,0,0,0,0,0,0
'&
data 0,0,0,1,1,1,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,1,1,0,1,1,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,1,1,0,1,1,0,0
data 0,1,1,0,0,1,1,1,1
data 0,1,1,1,0,0,1,1,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,1,1,0,0,0
''
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'(
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,1,1,1,1,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,0,1,1,1,1,0
data 0,0,0,0,0,1,1,1,0
')
data 0,1,1,1,0,0,0,0,0
data 0,1,1,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,1,1,1,1,0,0,0,0
data 0,1,1,1,0,0,0,0,0
'*
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,1,0,1,0,1,0,0
data 0,0,0,1,1,1,0,0,0
data 0,1,1,1,1,1,1,1,0
data 0,0,0,1,1,1,0,0,0
data 0,0,1,0,1,0,1,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'+
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,0,0,1,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
''
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,1,0,0,0,0
'-
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'.
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
'/
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,1,0
data 0,0,0,0,0,0,1,1,0
data 0,0,0,0,0,1,1,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,1,1,1,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'0
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,0,0,0,1,0,1,1
data 1,1,0,0,1,0,0,1,1
data 1,1,0,1,1,0,0,1,1
data 1,1,1,1,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'1
data 0,0,0,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,1,1,1,1,1,1,0,0
data 0,1,1,1,1,1,1,0,0
'2
data 0,0,1,1,1,1,1,1,0
data 0,0,1,1,1,1,1,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 0,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
'3
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,1,1,1,1,0
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
'4
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,1,1,0,0,0
data 1,1,0,0,1,1,0,0,0
data 1,1,1,1,1,1,1,1,1
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
'5
data 0,1,1,1,1,1,1,0,0
data 0,1,1,1,1,1,1,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,0,0,0,0,0,0
data 0,1,1,1,1,1,1,1,0
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'6
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,0
data 1,1,0,0,0,0,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'7
data 0,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,1,1,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
data 0,0,0,0,0,1,1,1,0
'8
data 0,0,1,1,1,1,1,0,0
data 0,1,1,1,1,1,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,0,1,1,1,1,1,0,0
data 1,1,1,0,0,0,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'9
data 0,0,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
data 0,1,1,0,0,0,0,1,1
data 0,1,1,0,0,0,0,1,1
data 0,0,1,1,1,1,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
':
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
';
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,1,0,0,0,0
'<
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,1,1,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,0,0,1,1,0,0
data 0,0,0,0,0,0,0,0,0
'=
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'>
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,1,1,0,0,0
data 0,0,0,0,1,1,1,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,1,1,1,0,0,0,0
data 0,1,1,1,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
'?
data 0,0,1,1,1,1,1,0,0
data 0,1,1,1,1,1,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,0,0,0,0,0,1,1,0
data 0,0,0,1,1,1,1,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
'@
data 0,0,0,0,0,0,0,0,0
data 0,0,1,1,1,1,1,0,0
data 0,1,0,0,0,0,0,0,0
data 0,1,0,0,1,1,1,0,0
data 0,1,0,1,0,0,0,1,0
data 0,1,0,1,1,1,0,1,0
data 0,1,0,0,0,0,0,1,0
data 0,0,1,1,1,1,1,0,0
data 0,0,0,0,0,0,0,0,0
'a
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'b
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'c
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
'd
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'e
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,1,1,1,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
'f
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,1,1,1,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
'g
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,1,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'h
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'i
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
'j
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,0
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'k
data 1,1,0,0,0,0,1,1,0
data 1,1,0,0,0,0,1,1,0
data 1,1,0,0,0,0,1,1,0
data 1,1,0,0,0,0,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'l
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,1
'm
data 0,1,1,1,0,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,1,0,0,1,1
data 1,1,0,0,1,0,0,1,1
data 1,1,0,0,1,0,0,1,1
data 1,1,1,0,1,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'n
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'o
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'p
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
'q
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,1,0,1,1
data 1,1,1,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'r
data 1,1,1,1,1,1,1,1,0
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
's
data 0,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,0,0,0,0,0,0,0
data 1,1,0,0,0,0,0,0,0
data 0,1,1,1,1,1,1,1,0
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
't
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
data 0,0,0,1,1,1,0,0,0
'u
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,1,1,1,1,0
'v
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,1,0,0,1,1,1
data 0,1,1,1,1,1,1,1,0
data 0,0,1,1,1,1,1,0,0
'w
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,1,0,1,0,0,1,1
data 1,1,1,0,1,0,0,1,1
data 1,1,1,0,1,0,0,1,1
data 1,1,1,1,1,1,1,1,1
data 0,1,1,1,0,1,1,1,0
'x
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,0,0,0,1,1,0
data 0,1,1,1,1,1,1,1,0
data 1,1,1,1,0,0,1,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
data 1,1,1,0,0,0,0,1,1
'y
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 1,1,0,0,0,0,0,1,1
data 0,1,1,1,1,1,1,1,1
data 0,0,0,0,0,0,1,1,1
data 0,0,0,0,0,0,1,1,1
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,0
'z
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
data 0,0,0,0,0,0,0,1,1
data 0,0,0,0,0,0,1,1,1
data 0,1,1,1,1,1,1,1,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1
'---------------------------------------------------------------------------------------------------------------
-
Updated for use with "tinyptc_OGL.bi" file ;D
Still in development...
:seesaw:
-
Perhaps it's something to do with my machine, but this runs very, very badly, like a frame a second on my machine... same with both the exe and the source . ?? Anyone else having this problem? Or... am I in possesion of the computer from HELL ? ;D
-
Sweet little proggy there. Theres just no mistaking that old amiga feel........
-
Perhaps it's something to do with my machine, but this runs very, very badly, like a frame a second on my machine... same with both the exe and the source . ?? Anyone else having this problem? Or... am I in possesion of the computer from HELL ?  ;D
I'll try to implement Jim's suggestion about Peekmessage/Getmessage, the way that I do it for C++ doesn't work for FB, the damn freebasic still bugged with some gui commands :(
-
@Rbraz - I get a brief pause before the effect(s) update. Also happens with my own effects via the Win PTC_Ogl method.
@Wham - Both run absolutely fine here and extremely quick.
-
I get a brief pause before the effect(s) update. Also happens with my own effects via the Win PTC_Ogl method
Yep, I saw that happening here in my notebook at work, I'll try to fix it later...
And it run super fast in windowed and fine in fullscreen mode, and using gfxlib version it doesn't work in windowed mode, it's too hard to make those things working properly in all windows/gfx board config. :-\
-
Wow, good to see some really cool replies. Some pertinent points, three first of all for Rbraz;
1: Thank you for further modifications of the code, hopefully this will be of use to lots of people :) Have some good Karma for that.
2: Thinking of the speed differnces between windowed mode and fullscreen. In the code it waits for the vertical retrace, so I would imagine that the differences are caused because the default refresh rate for fullscreen 640 X 480 might be different to whatever your desktop is running at? A combination with delta timing would definately fix this problem, though it might mean using more floating point variables to make sure it's nice and accurate and smooth.
3: When you said 40kb, I thought mmm. Ok you must have used Upx, but I ran the file and there was no pause so it seemed to me that it was uncrunched. KKrunchy gets it down to less than 10kb!
Wham, I have absolutely no idea why this would only run at 1fps on your box. I'll try and re-create the same problem here so I can fix it. Sorry mate. I think you might have liked to see the effect if it was running properly because it could be lifted straight out of Winaue. The lesson here is that you can guarantee that no matter how bomb proof you think it is, it will fail on some systems.
Looking forward to seeing this idea develop and to seeing some productions using this technique! :)
-
Hey Wham! Does it run properly if you whizz your mouse round-and-round while it's running? If so, that's the GetMessage/PeekMessage problem.
Shockwave you're right, in the desktop windowed mode it runs at the desktop refresh, not 60 or whatever the default for fullscreen is. Now, for LCD desktops, that's 60Hz anyway, but for CRTs anything under 75 is painful to watch so it might be 85. Not much you can do about that...delta timing will get you there though - the last frame's time needs to be part of the equation for the next frame's movement.
Jim
-
so are you saying jim that in a window the gl code will sync properly to what ever the desktop refresh is but in full screen it will sync to a default thus if the desktop is set diffrent you might still get some tearing?
-
No.
What it means is that each resolution can have a different refresh rate. It's very unlikely that you'll be running your desktop in 640 X 480. It will just sync to whatever refresh rate has been set as the default for that res on your card as it waits for the vertical blanking period.
-
Well I ran it on my office computer 2.8 P4, and the darn thing runs too fast for me to read the scroller.
Jim: I will try the mouse thing when I get home.
I guess I need something in between Athlon 1.2 and P4 2.8 lol ;)
-
Tried using the mouse stuff with no change on my home machine. :( One other thing is the CPU useage goes to 100% while the prog is running. >:(
-
Shit :( I was hoping that you wouldn't say that.
-
@Wham: Do you ever get that with any other OGL stuff?
-
Hi All
This is my first post here , so I want to say hello to everybody.
Mr. shockwave thank you for porting this demo from Amiga , the Amiga was and still is amazing computer.
I have ported your demo to my Magic Library , it is a DLL DirectX Library that allows making 2D drawing for Ogre 3D Engine , For details of Magic Library see My WebPage
http://www.freewebs.com/ogremagic/index.htm (http://www.freewebs.com/ogremagic/index.htm)
So I have used a Shader Language and texture to simulate the Pal effect.
See My Page in ShowCase of Ogre Forum
http://www.ogre3d.org/phpBB2/viewtopic.php?t=25924&start=125 (http://www.ogre3d.org/phpBB2/viewtopic.php?t=25924&start=125)
Also I have porting a plasma effect.
-
That dll looks very useful :hi: to the board, I think you'll get more traffic if I add you to the links. This could be of use to other people here :)
-
Ok , thanks a lot, I will try to port some of my demo to FreeBasic code. :)
BTW , My Library can be used with any 3D Engine , even you could use it without any 3D at all.
-
:hi: Emil_halim!
Jim
-
What url would you prefer me to add to the links?
-
@Jim:
Hi Jim
@Shockwave:
I think the first one will be nice , and it has a link to my Ogre page.
BTW , Does FreeBasic Support using DLL that written in C++ , and if can some one give me an example please for porting Some Magic samples to FreeBasic?
-
Link added to main page.
Freebasic can use dlls, you could search this forum for tinyptc , ufmod , fmod , bass etc.. Some people have made demos using sdl, it might even have support for Ogre, I'm not sure.
-
Ok , thanks i will check it.