vvmbw@sargent.lerc.nasa.gov (Mary Vickerman) (03/29/91)
I'm having problems creating a graphical object that contains
a string created with the font manager routines (fmprstr).
If I don't put the string in an object, it displays fine.
But if I put it in an object, the string is not displayed
when I do callob. Is this one of those routines that you
can't use in an object? (It didn't say so in the manual.)
Here's what my code lloks like when it works. Put the calls
to makeobj, closeobj, and callobj back in, and "Hello..."
doesn't print:
#include "gl.h"
#include "device.h"
#include "fmclient.h"
main()
{
Object objnum;
short val;
fmfonthandle f1,f25;
prefsize(240,210);
winopen("Hello");
/* makeobj(objnum=genobj()); */
color(BLACK);
clear();
color(GREEN);
fminit();
if ((f1 =fmfindfont("Times-Roman")) == 0) exit(1);
f25 = fmscalefont(f1,25.0);
fmsetfont(f25);
cmov2i(30,100);
fmprstr("Hello World");
cmov2i(30,50);
charstr("Goodbye World");
/* closeobj(); */
/* callobj(objnum); */
sleep(2);
exit;
}
Any ideas? Post or email. Thanks.
--
-----------------------------------------------------------------------
Mary B. Vickerman vvmbw@sargent.lerc.nasa.gov (128.156.1.92)
Computer Graphics Branch, NASA Lewis Research Center, Cleveland, OH
(216) 433-5067
ib@ivan.esd.sgi.com (Ivan Bach) (03/29/91)
If you put the statement: makeobj(objnum=genobj()); ahead of the statement: winopen("Hello"); instead of after it, your program will work as expected. Ivan Bach, ib@sgi.com Any opinions expressed above are mine, not SGI's.