🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.sgi.graphics
3 messages
3 total messages Started by Ron Janzen Thu, 07 Jan 1993 17:02
can you make readdisplay() read back buffer
#86
Author: Ron Janzen
Date: Thu, 07 Jan 1993 17:02
10 lines
771 bytes
Does anybody know of a way to read the back buffer in the same way as
readdisplay() can read what is displayed on the screen? It must be
possible since snoop (a demo program supplied by SGI) can do it.

I've tried using fullscrn()/endfullscrn() and setting readsource
appropriately, but I always end up reading the front buffer contents.
--
Ron Janzen
Alias Research Inc., Toronto
rjanzen@alias.com
Re: can you make readdisplay() read back buffer
#88
Author: Robert Keller
Date: Thu, 07 Jan 1993 22:31
43 lines
2385 bytes
rjanzen@alias.com (Ron Janzen) writes:
>Does anybody know of a way to read the back buffer in the same way as
>readdisplay() can read what is displayed on the screen? 

from the man page:

    readdisplay(3G) reads a rectangular screen region, returning displayed
    pixel colors in a packed RGB format
    :
    readdisplay generates the displayed value of each addressed pixel, taking
    into account all display bitplanes and modes except those of the cursor.

What this means is that readdisplay returns a packed RGB format stream
of data the EXACTLY matches what is being displayed on the glass of your
monitor (except for the cursor).

No matter if you have colour index windows with seperate colourmaps, RGB 
windows, overlay/pup/underlay drawing, etc...  readdisplay() figures it
all out and returns a single packed RGB format stream.  Figuring this 
stuff out is non-trivial, since much of what is being displayed is controlled
on a per pixel basis by hardware, readdisplay needs an intimate knowledge of 
the backend of the graphics subsytem.  

A simple example is for colour index windows, readdisplay must read the 
colourindex value from the framebuffer, determine which hardware colourmap is 
transforming it, lookup the colourindex in that colourmap, read out the RGB 
triple from the colourmap.  Things can get complicated when you have overlay
or underlay framebuffers, multiple colourmaps, etc...

Programs like scrsave and snapshot use readdisplay() to grab an .rgb 
file of what you see on your screen.  What you see on the screen depends
on more that just what is in the framebuffer.

Since readdisplay gives you what you currently see on your screen, and
you can't (by definition) see the backbuffer, readdisplay will not read
the backbuffer.

>It must be
>possible since snoop (a demo program supplied by SGI) can do it.

snoop uses lrectread(3G) to just Rambo-out the pixels.

...robert
Re: can you make readdisplay() read back buffer
#96
Author: Ron Janzen
Date: Fri, 08 Jan 1993 21:11
26 lines
1424 bytes
In <1iiavsINN8p4@fangio.asd.sgi.com> rck@fangio.asd.sgi.com (Robert Keller) writes:
>rjanzen@alias.com (Ron Janzen) writes:
>>Does anybody know of a way to read the back buffer in the same way as
>>readdisplay() can read what is displayed on the screen? 
>
><...good description of how readdisplay() works and why I couldn't use it>
>
>>It must be
>>possible since snoop (a demo program supplied by SGI) can do it.
>
>snoop uses lrectread(3G) to just Rambo-out the pixels.

I had tried using lrectread() and readsource() but I always figured you
had to do some weird junk to read outside the bounds of your window.
So I messed around with fullscrn()/endfullscrn() and other distasteful
routines all to no avail.

Anyways after reading this article, I changed my program to just read
outside the bounds of my window and presto! it worked.

thanks for the hint,
ron
--
Ron Janzen
Alias Research Inc., Toronto
rjanzen@alias.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads