home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12467 < prev    next >
Encoding:
Text File  |  1992-08-15  |  2.9 KB  |  124 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!seas.gwu.edu!loew1
  3. From: loew1@seas.gwu.edu (Murray Loew)
  4. Subject: GL-Motif problem
  5. Message-ID: <1992Aug15.204758.2651@seas.gwu.edu>
  6. Originator: loew1@seas.gwu.edu
  7. Sender: news@seas.gwu.edu
  8. Organization: George Washington University
  9. Distribution: usa
  10. Date: Sat, 15 Aug 1992 20:47:58 GMT
  11. Lines: 111
  12.  
  13. Hi everyone,
  14.  
  15. We recently upgraded from 4.0 to 4.0.4 and one of my mixed GL-motif 
  16. programs doesn't work anymore, it coredumps on the second redraw 
  17. (or resize). The code that follows should reproduce the problem. It 
  18. runs fine if the calls to pixmode are left out. Am I missing
  19. something here ? Any help before I call for assistance would be greatly
  20. appreciated. If you prefer email to 
  21.  
  22. loew1@seas.gwu.edu or
  23. max@vision.seas.gwu.edu
  24.  
  25. Thank you
  26.  
  27. max karasso
  28.  
  29. System: 4D320GTXB with hinv
  30.  
  31. 2 33 MHZ IP7 Processors
  32. FPU: MIPS R2010A/R3010 VLSI Floating Point Chip Revision: 2.0
  33. CPU: MIPS R2000A/R3000 Processor Chip Revision: 2.0
  34. On-board serial ports: 2 per CPU board
  35. Data cache size: 64 Kbytes
  36. Instruction cache size: 64 Kbytes
  37. Secondary data cache size: 256 Kbytes
  38. Main memory size: 32 Mbytes
  39. I/O board, slot F: IO2 revision 2
  40. Integral Ethernet: et0
  41. GT Graphics option installed
  42. Tape drive: unit 7 on SCSI controller 0: QIC 150
  43. Disk drive: unit 1 on SCSI controller 0
  44. Integral SCSI controller 0: Version WD33C93
  45.  
  46. /* test.c : Draw a black square in a GlxMDraw widget. If calls to
  47.  pixmode are left out runs fine. Else coredumps on second redraw
  48.  or resize */
  49.  
  50. #include<X11/Intrinsic.h>
  51. #include<X11/StringDefs.h>
  52.  
  53. #include<Xm/Xm.h>
  54. #include<X11/Xirisw/GlxMDraw.h>
  55. #include<gl/gl.h>
  56.  
  57. #define BASE 256
  58. #define ASIZE 512
  59.  
  60. GLXconfig db_rgb[]={
  61. {GLX_NORMAL,GLX_COLORMAP,TRUE},
  62. {0,0,0}
  63. };
  64.  
  65. unsigned long dum[ASIZE*ASIZE];
  66. void exposeCB(Widget, Display *, GlxDrawCallbackStruct *);
  67. void redraw(void);
  68.  
  69. main(int argc,char **argv)
  70. {
  71.   XtAppContext app;
  72.   Widget toplevel,glw;
  73.   Display *dpy;
  74.   Arg args[10];
  75.   int n;
  76.   XtToolkitInitialize();
  77.   app=XtCreateApplicationContext();
  78.   dpy=XtOpenDisplay(app,"",argv[0],"Xim",NULL,0,&argc,argv);
  79.  
  80.   toplevel=XtAppCreateShell(argv[0],"Test",
  81.                             applicationShellWidgetClass,
  82.                             dpy,NULL,0);
  83.   n=0; 
  84.   XtSetArg(args[n], XtNwidth, ASIZE); n++;
  85.   XtSetArg(args[n], XtNheight, ASIZE); n++; 
  86.   XtSetArg(args[n],GlxNglxConfig,db_rgb); n++;
  87.   glw=XtCreateManagedWidget("glx",glxMDrawWidgetClass,toplevel,args,n);
  88.   XtAddCallback(glw,GlxNexposeCallback,exposeCB,dpy);
  89.   XtRealizeWidget(toplevel);
  90.   XtAppMainLoop(app);
  91. }
  92.  
  93.  
  94. void exposeCB(Widget w,Display *dpy,GlxDrawCallbackStruct *call_data)
  95. {
  96.    GLXwinset(dpy,call_data->window);
  97.    redraw(); 
  98. }
  99.  
  100. void redraw(void)
  101. {
  102.   pixmode(PM_TTOB,(long)1); 
  103.   pixmode(PM_ADD24,BASE);      /* offending calls */
  104.   lrectwrite(0,0,511,511,dum); 
  105. }
  106.  
  107.  
  108. /* makefile: same problem if shared libraries are used */
  109.  
  110. OBJS= test.o
  111. LIBS= -lXirisw -lXm -lXt -lgl_s -lX11 -lm 
  112.  
  113. CC= cc  
  114.  
  115. .c.o : $*.c
  116.     $(CC) -c $*.c
  117.  
  118. test: $(OBJS)
  119.     $(CC) -o test $(OBJS) $(LIBS)
  120.  
  121.  
  122.  
  123.  
  124.