Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pcopy and pages
#1
Ive always wonderd how to use pcopy in my programs
with pages could any body tell me how to use it or any tutorials.
and what its for.
pen your other eyes.........
Reply
#2
PCOPY, along with seperate screen pages, lets you draw into a buffer inside your memory. Then, when you issue a PCOPY instruction, the contents of that buffer get copied into video memory, hence reducing flicker enormously.
Code:
SCREEN 7,0,1,0   'SCREEN 7 is a good screen mode that supports pages
LINE (10,10)-(20,20),2,BF
SLEEP  'press a key...
PCOPY 1,0   'copy screen buffer to video memory
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#3
When using a screen mode capable of storing more than one page
you can draw on a page without showing it on the screen
(that's good when one draws many things at the screen but wants
them to show up at the same time as the others)

whith pcopy you can then copy everything on the offscreen page
to the screen (or from screen to page, or page to page, if you have
more than one page)

example:

Code:
screen 7,,1,0  'setting op screenmode 7, drawing on page 1 showing page 0
cls  'clearing page 1 (all output commands work on apage (1))
print "You don't see any pixels yet do you?" 'text output to page 1
pcopy 1,0  'copying contents of page 1 to page 0 (showing it)
cls 'clearing page 1
for y=0 to 199 ' Just a graphical effect
for x=0 to 319 ' -
if (x*y) AND 1 then pset(x,y),rnd*16 ' -
next ' -
next ' -
print "but now you do!" ' -
sleep ' please press a key
pcopy 1,0 'show the graphical effect to the screen
/post]
Reply
#4
Funny, I always used PCOPY 0, 1...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)