0 Members and 1 Guest are viewing this topic.
SuperStrictFramework BRL.GLMax2DImport BRL.PixmapImport BRL.PNGLoader'Import BRL.RandomImport BRL.RetroAppTitle="Rotozoom Magnify"SetGraphicsDriver GLMax2DDriver()Include "zSoftwareRenderFramework_v04.bmx"Const XRES:Int=800Const YRES:Int=600Graphics XRES,YRES,0Global timerUpd:Int = MilliSecs()Global timerFrq:Int = 1000/30 ' 30 fps' create an image buffer to store the screen inGlobal screenBuffer:zImageBuffer = zImageBuffer.make(XRES,YRES)' create an image buffer used for the magnification frameGlobal tmpImg:zImageBuffer = zImageBuffer.make(62,62)Const hxres:Int=XRES/2Const hyres:Int=YRES/2Local ang:Float=0.0Local c:Int,xo:Int,yo:Int,y:Int,x:Int,i:Int,j:IntRepeat ' clear screen buffer screenBuffer.clear() ang=ang+0.75 c=750*Cos(ang) xo=200+200*Sin(ang*2) yo=200+200*Cos(ang*3) For y=0 To yres-1 For x=0 To xres-192 i=x+xo-hxres j=y+yo-hyres screenBuffer.setpixel(x,y,(((i+j*c/256) & 255) ~ ((j-i*c/256) & 255)),0,0,255) Next Next ' copy rects from screen buffer to temporary buffers tmpImg.copyrectblock(screenBuffer,288,208,62,62,0,0) ' draw temporary buffers scaled to the screen buffer tmpImg.drawScaledBlock(screenBuffer,xres-188,4,3.0,3.0) tmpImg.drawScaledBlock(screenBuffer,xres-188,204,3.0,3.0) tmpImg.drawScaledBlock(screenBuffer,xres-188,yres-191,3.0,3.0) ' draw screenbuffer to the screen screenBuffer.blitToScreen() Flip While MilliSecs() < timerUpd+timerFrq Wend timerUpd = MilliSecs()Until KeyDown(KEY_ESCAPE)End
screenBuffer.clear()