Mail Archives: djgpp/1997/02/22/12:55:54
From: | gautam AT interlog DOT com (Gautam N. Lad)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | How do I shell-out from graphics-mode into text-mode and back, in GRX v2.0?
|
Date: | Sat, 22 Feb 97 16:55:34 GMT
|
Organization: | InterLog Internet Services
|
Lines: | 56
|
Message-ID: | <5enc9k$g9e@news.interlog.com>
|
NNTP-Posting-Host: | ip220-54.cc.interlog.com
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hi,
In my program (which has a GUI), there's a button that allows the user to
shell-out to DOS text-mode. I'm using POV-Ray (for
those who don't know it, it's a renderer), and in my program, when the user
presses the button, POV-Ray is launched to render an image. What I would like
to do is shell-out into text-mode, run POV-Ray, and then return back to my
GUI.
Here's a snippet of what happens when the button's pressed:
// determine if button's pressed. Return TRUE if so.
if (FILES[5].ClickedD(evt.x,evt.y))
{
FILES[5].ClickedUP(DGray,"Preview");
// Create the batch file that will be run
if((fp = fopen("PREVIEW.BAT","w"))==NULL)
{
sound(500); delay(100); nosound();
exit(0);
}
fprintf(fp,"POVRAY -w160 -h120 -iPREVIEW.POV -f +dgt +p");
fclose(fp);
// this function will write the scene that POV-Ray will render
ExportPOV();
// Change to text-mode. Am I doing this right?
GrSetMode(GR_default_text);
// Run the batch file
system("PREVIEW.BAT");
}
I'm using: GrSetMode(GR_width_height_color_graphics,800,600,256);
to set the graphics mode.
What I want is to return to that graphics mode, after system("PREVIEW.BAT");
is finished running.
BTW, When POV-Ray is rendering, it's also giving a preview as it renders the
image.
Thanks!
****************************************************
* Gautam N. Lad *
*--------------------------------------------------*
* *
* E-Mail : gautam AT interlog DOT com *
* Website : http://www.interlog.com/~gautam *
* *
* OS/2, DOS/Windows, Graphics Gallery, Software, *
* Links, Rayzor Editor/2, POV-Ray, and more. *
****************************************************
- Raw text -