cwc@calmasd.GE.COM (Walt Croom) (09/28/88)
I'm having trouble doing GPR write pixel display to a window which has an overlapping and potentially obscuring second window. The GPR clipping code seems to distort the display on DN660, DN570, and DN580 machines, but not on DN3000 or DN4000's. If anyone has experience with this, I would appreciate a clue on what I am doing wrong. Thanks - Walt Croom cwc@calmasd.GE.COM GE-Calma Company ph. 619-587-3273 9805 Scranton Road San Diego, CA 92121-1765 ----------------------- cut here ---------------------------- /* test_clip.c */ /* This program demonstrates an apparent Apollo window clipping problem (SR9.7). Presence of obscuring window distorts write pixel display on DN660, DN570, and DN580, but O.K. on DN3000 and DN4000. Display should be red, green, yellow, and blue color bars of equal width. */ #include "/sys/ins/base.ins.c" #include "/sys/ins/pad.ins.c" #include "/sys/ins/gpr.ins.c" #include "/sys/ins/error.ins.c" /* Maximum number of display rectangles (depends upon maximum number and location of obscuring windows */ #define max_slots 32 status_$t status; main() { /* Declare local variables */ char input_string[80]; short count, n, i; short slots_available = max_slots, slots_total; short disp_len = sizeof(gpr_$disp_char_t), disp_len_returned; gpr_$bitmap_desc_t display_bitmap; gpr_$offset_t display_bitmap_size; gpr_$rgb_plane_t hi_plane; gpr_$disp_char_t display_characteristics; gpr_$window_t vis_list[max_slots]; /* gpr_$pixel_array_t pixbuf; */ long pixbuf[600]; long color_offset; gpr_$window_t dest_window; gpr_$color_vector_t color_map; stream_$id_t stream_id, stream_id_obs; static name_$pname_t pname = "test_clip"; static pad_$window_desc_t dm_window = {0, 0, 800, 600}; static pad_$window_desc_t dm_window_obs = {75, 500, 175, 75}; /* Create output window */ pad_$create_window (pname,(short)strlen(pname),pad_$transcript, (short)1,dm_window,stream_id,status); check (1); /* Create partially obscuring window */ pad_$create_window (" ",(short)0,pad_$transcript, (short)1,dm_window_obs,stream_id_obs,status); check (2); /* Set auto-delete for windows */ pad_$set_auto_close (stream_id,(short)1,true,status); check (3); pad_$set_auto_close (stream_id_obs,(short)1,true,status); check (4); /* Initialize GPR */ gpr_$inq_disp_characteristics (gpr_$direct,stream_id,disp_len, display_characteristics,disp_len_returned,status); check (5); display_bitmap_size.x_size = display_characteristics.x_window_size; display_bitmap_size.y_size = display_characteristics.y_window_size; hi_plane = display_characteristics.n_planes - 1; gpr_$init (gpr_$direct,stream_id,display_bitmap_size,hi_plane, display_bitmap,status); check (6); /* Allow display to obscured window */ gpr_$set_obscured_opt (gpr_$ok_if_obs,status); check (7); /* Acquire display */ gpr_$acquire_display (status); check (8); /* Set up for clipping */ gpr_$inq_vis_list (slots_available,slots_total,vis_list,status); check (9); gpr_$set_clipping_active (true,status); check (10); /* Load color map */ color_map[0] = gpr_$red; color_map[1] = gpr_$green; color_map[2] = gpr_$yellow; color_map[3] = gpr_$blue; if (hi_plane > 3) color_offset = 1; else color_offset = 16; gpr_$set_color_map (color_offset,(short)4,color_map,status); check (11); /* /* Set up for pixel scan line color bar display */ for (i = 0; i < 600; i++) pixbuf[i] = i/150 + 1; dest_window.window_base.x_coord = 100; dest_window.window_size.x_size = 600; dest_window.window_size.y_size = 1; /* Loop over display rectangles */ for (n = 0; n < slots_total; n++) { gpr_$set_clip_window (vis_list[n],status); check (12); /* Display color bars */ for (i = 200; i < 400; i++) { dest_window.window_base.y_coord = i; gpr_$write_pixels (pixbuf,dest_window,status); check (13); } } /* Release display so we can prompt */ gpr_$release_display (status); check (14); printf ("\nRed, green, yellow, and blue color bars should be of equal width."); printf ("\nEnter <CR> to quit: "); gets (input_string); /* Terminate GPR */ gpr_$terminate (false,status); check (15); } /* Function check */ check (location) int location; { if (status.all != gpr_$operation_ok) { printf ("\n--> error at location %d",location); error_$print (status); } }
oj@apollo.COM (Ellis Oliver Jones) (09/30/88)
In article <79@calmasd.GE.COM> cwc@calmasd.UUCP (Walt Croom) writes: >I'm having trouble doing GPR write pixel display to a window >which has an overlapping and potentially obscuring second >window....I would >appreciate a clue on what I am doing wrong... You're not doing anything wrong...GPR is. Thanks for the good test case! /Ollie Jones