home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!seas.gwu.edu!loew1
- From: loew1@seas.gwu.edu (Murray Loew)
- Subject: GL-Motif problem
- Message-ID: <1992Aug15.204758.2651@seas.gwu.edu>
- Originator: loew1@seas.gwu.edu
- Sender: news@seas.gwu.edu
- Organization: George Washington University
- Distribution: usa
- Date: Sat, 15 Aug 1992 20:47:58 GMT
- Lines: 111
-
- Hi everyone,
-
- We recently upgraded from 4.0 to 4.0.4 and one of my mixed GL-motif
- programs doesn't work anymore, it coredumps on the second redraw
- (or resize). The code that follows should reproduce the problem. It
- runs fine if the calls to pixmode are left out. Am I missing
- something here ? Any help before I call for assistance would be greatly
- appreciated. If you prefer email to
-
- loew1@seas.gwu.edu or
- max@vision.seas.gwu.edu
-
- Thank you
-
- max karasso
-
- System: 4D320GTXB with hinv
-
- 2 33 MHZ IP7 Processors
- FPU: MIPS R2010A/R3010 VLSI Floating Point Chip Revision: 2.0
- CPU: MIPS R2000A/R3000 Processor Chip Revision: 2.0
- On-board serial ports: 2 per CPU board
- Data cache size: 64 Kbytes
- Instruction cache size: 64 Kbytes
- Secondary data cache size: 256 Kbytes
- Main memory size: 32 Mbytes
- I/O board, slot F: IO2 revision 2
- Integral Ethernet: et0
- GT Graphics option installed
- Tape drive: unit 7 on SCSI controller 0: QIC 150
- Disk drive: unit 1 on SCSI controller 0
- Integral SCSI controller 0: Version WD33C93
-
- /* test.c : Draw a black square in a GlxMDraw widget. If calls to
- pixmode are left out runs fine. Else coredumps on second redraw
- or resize */
-
- #include<X11/Intrinsic.h>
- #include<X11/StringDefs.h>
-
- #include<Xm/Xm.h>
- #include<X11/Xirisw/GlxMDraw.h>
- #include<gl/gl.h>
-
- #define BASE 256
- #define ASIZE 512
-
- GLXconfig db_rgb[]={
- {GLX_NORMAL,GLX_COLORMAP,TRUE},
- {0,0,0}
- };
-
- unsigned long dum[ASIZE*ASIZE];
- void exposeCB(Widget, Display *, GlxDrawCallbackStruct *);
- void redraw(void);
-
- main(int argc,char **argv)
- {
- XtAppContext app;
- Widget toplevel,glw;
- Display *dpy;
- Arg args[10];
- int n;
- XtToolkitInitialize();
- app=XtCreateApplicationContext();
- dpy=XtOpenDisplay(app,"",argv[0],"Xim",NULL,0,&argc,argv);
-
- toplevel=XtAppCreateShell(argv[0],"Test",
- applicationShellWidgetClass,
- dpy,NULL,0);
- n=0;
- XtSetArg(args[n], XtNwidth, ASIZE); n++;
- XtSetArg(args[n], XtNheight, ASIZE); n++;
- XtSetArg(args[n],GlxNglxConfig,db_rgb); n++;
- glw=XtCreateManagedWidget("glx",glxMDrawWidgetClass,toplevel,args,n);
- XtAddCallback(glw,GlxNexposeCallback,exposeCB,dpy);
- XtRealizeWidget(toplevel);
- XtAppMainLoop(app);
- }
-
-
- void exposeCB(Widget w,Display *dpy,GlxDrawCallbackStruct *call_data)
- {
- GLXwinset(dpy,call_data->window);
- redraw();
- }
-
- void redraw(void)
- {
- pixmode(PM_TTOB,(long)1);
- pixmode(PM_ADD24,BASE); /* offending calls */
- lrectwrite(0,0,511,511,dum);
- }
-
-
- /* makefile: same problem if shared libraries are used */
-
- OBJS= test.o
- LIBS= -lXirisw -lXm -lXt -lgl_s -lX11 -lm
-
- CC= cc
-
- .c.o : $*.c
- $(CC) -c $*.c
-
- test: $(OBJS)
- $(CC) -o test $(OBJS) $(LIBS)
-
-
-
-
-