Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OMG! OMG! OMG! I found QB64's lost HOLY GRAIL!!
#1
OMG!

OMG!! 

OMG!!!

Are you guys as excited as I am??!!

OMG! OMG!! OMG!!!  WOOOOO!!!!

I has finally found one of the most baffling parts of QB64 that has been missing and lost and disappeared to us just like the Holy Grail has long been disappeared!!

I give to you....   Dum dum de dummmmm.....

HARDWARE1:

Code: (Select All)
Screen _NewImage(640, 480, 32)

Red = _NewImage(200, 200, 32)
Green = _NewImage(200, 200, 32)

Cls , &HFFFF0000, Red
Cls , &HFF00FF00, Green

RedHW = _CopyImage(Red, 33)
GreenHW = _CopyImage(Green, 33)
order = -1

Do
    k = _KeyHit
    Select Case k
        Case 32 'space will toggle
            order = Not order
            If order Then
                _DisplayOrder _Hardware , _Hardware1
            Else
                _DisplayOrder _Hardware1 , _Hardware
            End If
        Case 27
            System
    End Select
    _PutImage (100, 100), RedHW
    _PutImage (200, 200), GreenHW, 1    'The comma 1 here says to put that hardware image to Hardware 1!
    _Display
    _Limit 30
Loop


Forever and ever and ever and ever and ever and ever, if you look at the command _DISPLAYORDER, you see this:

Code: (Select All)
_DISPLAYORDER [{_SOFTWARE|_HARDWARE|_HARDWARE1|_GLRENDER}][, ...][, ...][, ...][, ...]

And since forever and ever and ever ago, I have asked everyone from users to devs to my local priest, *HOW THE BLEEP DO WE USE HARDWARE1*???

We have 4 screens to layer to and set in any sort of display order we want.  (Maybe even more than that, but I haven't worried with trying ,2 or ,3 or whatnot yet to see...)   

We have:
_SOFTWARE  <-- the software screen
_GLRENDER  <-- the SUB _GL stuff
_HARDWARE  <-- hardware image
_HARDWARE1  <-- a second hardware screen

By changing the _DISPLAYORDER, we can change which order things are drawn on our screen.  Think of a game:  Background (clouds and buildings), and then the character on one overlay with enemies, and then bushes and trees and such in front of him.  We can choose the way we want to layer those screens on top of each other.

But then, the question arises, like I've asked for ages, *HOW DOES ONE PUT ANYTHING ON HARDWARE1?????*




The answer to that is very simple:  _PUTIMAGE (x,y)-(x1,y1), hardware_image_handle, 1

See that comma 1 there at the end??

That's all it takes to put it on _HARDWARE1 instead of _HARDWARE.

WHO KNEW????!!!

I feel like I has found the long long lost treasure of QB64.  Tongue

Try the demo above and see if it makes sense how those two layers are being overlaid on top of each other.  Each is a perfectly independent layer, and has zero impact on the other layers.

WOOOW OH WOW OH WOW!!!  Big Grin Big Grin Big Grin
Reply


Messages In This Thread
OMG! OMG! OMG! I found QB64's lost HOLY GRAIL!! - by SMcNeill - 09-20-2024, 11:33 PM



Users browsing this thread: 13 Guest(s)