The following program works fine in XP, but using Vista Windows Aero it runs flipbuffers 10 times with a black titlebar, no name, etc. It runs 19 times with the revolving circular curser so you can't stop it before then. When closing, the screen flickers and you can see the desktop for a split second. If the length L is changed to 512 I get a compilation0.exe error. Using directx9 as a compiler option stops the program at a blank screen.
Don't know if this is my programming, Vista or what. Old Amiga programs using bitblit, etc seem to run ok. Any help for a great 70th will be appreciated. Any advice on the program is welcome. If someone has Windows7 I'd like to know how this runs.
When I try to run this code or even copy the original to a new tab I get a red line debug error in the plot(x,y...) line. Don't understand since the original works fine and I'm just copying it. My first attempt at submitting code so maybe I'm doing something wrong.
Code: Select all
;cyclic ca
InitSprite()
Define.w r,t,c,cc,l,lp1,m,n,c1,x,xx,x1,y,yy,y1,s
Define.l sco
l=500:lp1=l+1
Dim n.w(l,l):Dim nn.w(l,l)
r=5:t=10:c=10
m=Int(255/c)
hwnd=OpenWindow(0,0,0,l,l,"CCA",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(hwnd,0,0,l,l,0,0,0):sco=ScreenOutput()
ClearScreen(0):FlipBuffers()
For x=0 To l:For y=0 To l:cc=Random(c):n(x,y)=cc:Next:Next
Repeat:
StartDrawing(sco)
For x=0 To l:For y=0 To l:cc=n(x,y):c1=cc+1:If c1>c:c1=0:EndIf
s=0
For xx=x-r To x+r:x1=xx
If x1<0:x1+lp1:EndIf
If x1>l:x1-lp1:EndIf
For yy=y-r To y+r:y1=yy
If y1<0:y1+lp1:EndIf
If y1>l:y1-lp1:EndIf
If n(x1,y1)=c1:s+1:EndIf
If s=>t:cc=c1:Break 2:EndIf
Next:Next
nn(x,y)=cc:cc*m
Plot(x,y,RGB(cc,cc>>1,cc>>2))
Next:Next
StopDrawing()
Swap n(),nn()
FlipBuffers()
Until WindowEvent()=#PB_Event_CloseWindow
End
Bill Nee