Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PCOPY use with hardware and software images
#7
(08-13-2024, 07:17 PM)Pete Wrote: Hey Terry,

Late to the party, because I'm finalizing a 4,000 sq ft roofing project. Just past final inspection, now.

I see you've made your decision on how to proceed, but just food for thought, if you want to preserve that initial image, you'd have to PCOPY it to page 2. Here is a more simplified SCREEN 0 text example...

Code: (Select All)

Locate 1, 1: Print "P"
PCopy 0, 1 ' Needed to preserve "P" when flipping pages. Also PCOPY to page 2, if needed.
Sleep
Do
    _Limit 30 '                          30 FPS
    Screen , , 1, 0 '                    active page 1, display page 0
    Locate 2, 1: Print "W" '_PutImage (100, 100), HWSprite '    draw hardware sprite on page 1
    PCopy 1, 0 '
    Sleep '                        copy page 1 to page 0
    Screen , , 2, 0 '                    active page 2, display page 0
    Locate 3, 1: Print "T" '_PutImage (200, 200), HWSprite '    draw hardware sprite on page 2
    PCopy 2, 0 '
    Sleep '                      copy page 2 to page 0
    Screen , , 0, 0 '
    Locate 4, 1: Print "Z" '_PutImage (220, 220), Sprite '      draw software sprite
    Sleep
Loop Until _KeyDown(27)
System

Pete
Yep, I was playing around with that same thing. I decided without screen pages being able to preserve alpha transparency it's going to be next to impossible to use PCOPY to implement layers the way I need.

At first I was just attaching a layer value to sprites then going through the sprite array looking for layer 8, draw first, layer 7, draw next, layer 6 ... this required too much overhead. I then decided just to make individual images to draw the sprites to and then at the end combine them into one image. Sped things up greatly. That's what got me thinking about PCOPY and how I could possibly use that instead. I thought that maybe each screen page also had it's own hardware layer as well ... until I came to my senses. Tongue
There are two ways to write error-free programs; only the third one works.
QB64 Tutorial
Reply


Messages In This Thread
RE: PCOPY use with hardware and software images - by TerryRitchie - 08-13-2024, 08:47 PM



Users browsing this thread: 4 Guest(s)