[comp.sys.sun] SunCore Problems with SunOS 4.1.1

rana@cs.uwa.oz.au (Ranadeva Peries) (06/05/91)

  Where is usercore.h file under SunOS 4.1.1. Is it /usr/old/usercore.h.

  Here is a simple C program (from the SunCore Manual). I have modified
  it to create a new View Surface and draw a glass. This works under
  SunOS 4.0.3 but does not create a New View Surface under SunOS 4.1.1.
  User SunOS 4.1.1 it creates the drawing and the view surface on the
  window it's running.

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 cgpixwindd();
struct vwsurf vwsurf = DEFAULT_VWSURF(cgpixwindd); 

main(argc, argv)
int argc;
char **argv;
{
    struct vwsurf *surf = &vwsurf;

    initialize_core(BASIC, NOINPUT, TWOD);
    surf->flags = 1;
    initialize_view_surface(surf, FALSE);

    select_view_surface(surf);
    set_viewport_2(0.125, 0.875, 0.125, 0.75);
    set_window(-50.0, 50.0, -10.0, 80.0);

    create_temporary_segment();
        move_abs_2(0.0, 0.0);
        polyline_rel_2(glassdx, glassdy, 9);
        move_rel_2(-12.0, 33.0);
        line_rel_2(24.0, 0.0);
    close_temporary_segment();

    sleep(10);

    deselect_view_surface(surf);
    terminate_core();
}

Rana Peries ( rana@cs.uwa.oz.au )
Department of Computer Science
University of Western Australia
Nedlands 6009.
W Australia.