www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/31/11:40:28

Date: Tue, 31 May 1994 10:44:15 -0400 (EDT)
From: Edwin Phillips <flaregun AT strauss DOT udel DOT edu>
Subject: Re: How do I grab the screen and then put it back?
To: Gamble C O <gambcl AT essex DOT ac DOT uk>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

On Tue, 31 May 1994, Gamble C O wrote:

> Hi all,
> 	I am using the GRX graphics package and I am writing a rendering program. At the moment it draws wireframes, constant shaded and Gouraud shaded objects.
> I would like to be able to grab the screen somehow (temporarily), then print
> up some info, help, etc. and then restore the screen to its original picture.
> 
> 	Is there a quick, easy way to do this using GRX?
> 
> Any help much appreciated, many thanx in advance.
> 

	Use GrCreateContext() to create a new context that is the same 
dimensions as the screen (GetMaxX(), GetMaxY()).  Then you can use 
GrBitBlt to copy the entire screen to your new context.  After the screen 
is saved to the new context, you can draw to the screen context.  
When you want to restore the screen to its original state, do a 
GrBitBlt() back to the screen.
	If I remember correctly, you use NULL to designate the current 
context in GrBitBlt(), and you can use GrSetContext(NULL), to select the 
physical screen for drawing.  All of this works very nicely!  (way to go 
Csaba :)

	Ed

/****************************************************************************/
/* Ed Phillips  flaregun AT strauss DOT udel DOT edu      University of Delaware       */
/* Jr Systems Programmer  (302) 831-6082   CNS/Network and Systems Services */
/****************************************************************************/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019