Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Any way to mirror the complete output?

Credits go to gnolam and X-G for helping out!
This thread is locked; no one can reply to it. rss feed Print
Any way to mirror the complete output?
Reilly Hamilton
Member #8,609
May 2007

Is there any way to mirror the entire output in Allegro?

I'm developing a program that needs to be used in an environment where the display reflects off a mirror onto the final projection surface. Is there an easy way to do this in Allegro?

Rampage
Member #3,035
December 2002
avatar

The manual said:

These are like draw_sprite(), but they additionally flip the image vertically, horizontally, or both, respectively. Flipping vertically means that the y-axis is reversed, while flipping horizontally means that the x-axis is reversed, between the source and the destination. This produces exact mirror images, which is not the same as rotating the sprite (and it is a lot faster than the rotation routine). The sprite must be a memory bitmap.

-R

julian_boolean
Member #8,201
January 2007

Your talking about reflections right? Like looking into water or a mirror? Holy crap Allegro has functions for that?? Sweeeeet

Reilly Hamilton
Member #8,609
May 2007

I'm looking for a way to mirror the entire screen, not just a sprite.

Is there a way to mirror the display buffer?

X-G
Member #856
December 2000
avatar

Of course. When copying your backbuffer to the screen, simply draw it upside-down.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

gnolam
Member #2,030
March 2002
avatar

Be sure to clear the buffer with magenta/palette index 0 first though (iff you use it anywhere in your graphics, that is).

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

gillius
Member #119
April 2000

I'm really curious to hear where you have an environment where the user views the screen via a mirror...

Gillius
Gillius's Programming -- https://gillius.org/

Reilly Hamilton
Member #8,609
May 2007

We're creating a Heads-Up Display for use in automobiles. The image is reflected off of the windshield, and therefore needs to be flipped horizontally.

Thanks for the help, should be pretty simple.

gillius
Member #119
April 2000

Nice I was hoping it was something like that ;). I work on vehicle sensor systems and diagnostics... I wish we had that for our display ;). I doubt any of our vehicles have a suitable windshield as they are all either vertical or non-existent.

Gillius
Gillius's Programming -- https://gillius.org/

Rampage
Member #3,035
December 2002
avatar

Hey! Where are my cookies? >:(

-R

ixilom
Member #7,167
April 2006
avatar

I ate 'em, tasted bad :-X

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

ImLeftFooted
Member #3,935
October 2003
avatar

Cooool, allegro is taking over the automobile industry!

GullRaDriel
Member #3,861
September 2003
avatar

Heh, you do not know the new lamborghini Allegro VT ? ;-P

{"name":"lamborghini_diablo_sexycar_bis.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/5\/e52e5bcebe0bd930d78bea70dc79d93b.jpg","w":250,"h":324,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/5\/e52e5bcebe0bd930d78bea70dc79d93b"}lamborghini_diablo_sexycar_bis.jpg

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Kibiz0r
Member #6,203
September 2005
avatar

:o

Go to: