Need help with Suncore under 4.1

Scott Paisley paisley at cme.nist.gov
Wed Jun 13 00:05:59 AEST 1990


I know that core is no longer supported under 4.1, however I have a
program that needs to run, and prevents us to upgrade some of our systems
to 4.1 :-( (at least until we switch to a different graphics package)

Anyway I have compiled the following program under 4.1 (with -Bstatic) and
the 4.1 binary runs under 4.0.3.  This tells me that something in the OS
has changed out from under core.  BTW, I'm using the core libraries in 4.1
which can be found in /usr/old.  Has anyone found a fix to this?  The
error message I get under 4.1 is: 

initialize_view_surface:
No physical surface is associated with the specified logical surface.
select_view_surface:
The specified surface has not been initialized.
create_retained_segment:
No view surface is currently selected.
polyline_rel_2:
No segment is open.
line_rel_2:
No segment is open.
close_retained_segment:
Invocation when no open segment.
deselect_view_surface:
The specified surface has not been initialized.

It's as if a pseudo device is missing or something.  If the program is
modified NOT to create a new window (see comments in the program), then
the program works under 4.1.  ANY ideas would be greatly appreciated...

/* to compile use

   cc -Bstatic testcore.c -lsuntool -lcore -lsunwindow -lpixrect -lm

   we use -Bstatic so that the 4.1 binary won't complain about missing
   libs under 4.0.3

   this program runs fine under 4.0.3 but barfs in 4.1
 */

#include <usercore.h>

static float glassdx[]={-10.0,9.0, 0.0,-14.0,30.0,-14.0,  0.0, 9.0,-10.0};
static float glassdy[]={  0.0,1.0,19.0, 15.0, 0.0,-15.0,-19.0,-1.0,  0.0};

int pixwindd() ;

/* the following line will work under 4.1 (does not create a new window */

/*struct vwsurf vwsurf = DEFAULT_VWSURF( pixwindd ); */

/* this does not work under 4.1.  Creates a new window.. */
#define NEW_VWSURF(ddname) {"", "", 0, ddname, 0, 0, "", 1, 0}
struct vwsurf vwsurf = NEW_VWSURF( pixwindd );

main(argc,argv)
int  argc;
char **argv;
{
        initialize_core(BASIC,NOINPUT,TWOD) ;
        initialize_view_surface(&vwsurf,FALSE) ;
        select_view_surface(&vwsurf) ;
        set_viewport_2 (0.125, 0.875, 0.125, 0.75);
        set_window (-50.0, 50.0, -10.0, 80.0);

        create_retained_segment(1);

        move_abs_2(0.0,0.0);                    /* move to origin */
        polyline_rel_2(glassdx,glassdy,9);      /* draw glass outline */
        move_rel_2(-12.0,33.0);                 /* move to liquid surface */
        line_rel_2(24.0,0.0);                   /* draw liquid surface */

        close_retained_segment();

        sleep(10) ;

        deselect_view_surface(&vwsurf);
        terminate_core();
}

Scott Paisley        paisley at cme.nist.gov      ..!uunet!cme-durer!paisley



More information about the Comp.sys.sun mailing list