Tuesday Oct 25, 2005
Getting there with quake3 on solaris
Its been a long while since I've added anything here. Been busy find a place to live :) Finding some spare time (when not looking for new house and furniture) let me play about with this:
kashyyyk:~/src/q3/quake3/code/unix$ uname -a SunOS kashyyyk 5.11 snv_25 i86pc i386 i86pc kashyyyk:~/src/q3/quake3/code/unix$ kashyyyk:~/src/q3/quake3/code/unix$ gmake gmake targets B=releasei386 CFLAGS="-pipe -DDEBUG -g" gmake[1]: Entering directory `/export/home/sm97610/src/q3/quake3/code/unix' gcc -pipe -DDEBUG -g -o releasei386/client/unix_main.o -c ../unix/unix_main.c gcc -o releasei386/SunOSquake3 releasei386/client/cl_cgame.o releasei386/client/cl_cin.o releasei386/client/cl_console.o... ... ... kashyyyk:~/src/q3/quake3/code/unix/releasei386$ ls -l total 6150 drwxr-xr-x 9 sm97610 other 512 Oct 24 20:14 ./ drwxr-xr-x 6 sm97610 other 1024 Oct 24 23:39 ../ -rwxr-xr-x 1 sm97610 other 2981132 Oct 24 23:49 SunOSquake3* drwxr-xr-x 6 sm97610 other 512 Oct 24 23:40 baseq3/ drwxr-xr-x 2 sm97610 other 3072 Oct 24 23:49 client/ -rw-r--r-- 1 sm97610 other 135291 Oct 24 19:44 d2 drwxr-xr-x 2 sm97610 other 512 Oct 24 15:43 ded/ drwxr-xr-x 2 sm97610 other 512 Oct 24 15:43 ft2/ drwxr-xr-x 6 sm97610 other 512 Oct 24 15:43 missionpack/ drwxr-xr-x 2 sm97610 other 512 Oct 24 15:43 q3static/ drwxr-xr-x 2 sm97610 other 512 Oct 24 15:43 ref/ hashyyyk:~/src/q3/quake3/code/unix/releasei386$ isalist pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86 kashyyyk:~/src/q3/quake3/code/unix/releasei386$
I need to figure out why it can't call the opengl functions. It does load the libGL.so.1 Mesa library, but can't use em.
kashyyyk:~/src/q3/quake3/code/unix/releasei386$ ./SunOSquake3 ioQ3 1.33 sun-i386 Oct 24 2005 ----- FS_Startup ----- Current search path: /export/home/sm97610/.q3a/baseq3 /export/home/sm97610/src/q3/quake3/code/unix/releasei386/baseq3 ./baseq3 ---------------------- 0 files in pk3 files execing default.cfg couldn't exec q3config.cfg couldn't exec autoexec.cfg Hunk_Clear: reset the hunk ok ----- Client Initialization ----- ----- Initializing Renderer ---- ------------------------------- ----- Client Initialization Complete ----- ----- R_Init ----- ------- Input Initialization ------- ------------------------------------ ...loading libGL.so.1: Initializing OpenGL display ...setting mode 3: 640 480 Received signal 11, exiting... ----- CL_Shutdown ----- RE_Shutdown( 1 ) ----------------------- kashyyyk:~/src/q3/quake3/code/unix/releasei386$
Posted at 08:59AM Oct 25, 2005 by smg in quake3 | Comments[4]
Or, are you too busy?
Posted by Pete on October 28, 2005 at 11:48 AM IST #
I do remember that old Quake2 code. In fact theres a lot of common code between quake2 and quake3. I used it a lot for reference in the porting.
My problem is coming down to the use of function pointers to the opengl calls. The pointers don't point to the correct addresses.
Eg on both quake2 and qukae3 they do this:
#define GPA( a ) dlsym( glw_state.OpenGLLib, a ) qglXChooseVisual = GPA("glXChooseVisual");But its not doing this right with quake3. The addresses are wrong.
Quake2 LoadLibrary("./ref_glx.so") ref_gl version: GL 0.01 Using libGL.so for OpenGL... qglXChooseVisual = fe9a60b4 glXChooseVisual = fe9a60b4 Quake3 ...loading libGL.so: qglXChooseVisual = fef860b4 glXChooseVisual = 806e71cSee what I mean ?Posted by Sean on October 28, 2005 at 12:04 PM IST #
Posted by Pete on October 29, 2005 at 06:26 PM IST #
------- Input Initialization ------- ------------------------------------ ...loading libGL.so: qglXChooseVisual = fef860b4 89312f8 glXChooseVisual = 806e71c 806e71c Breakpoint 1, GLW_SetMode (drivername=0x8996d50 "libGL.so", mode=0, fullscreen=qfalse) at ../unix/solaris_glimp.c:875 875 int attrib[] = { (gdb) c Continuing. Initializing OpenGL display ...setting mode 0: 320 240 Program received signal SIGILL, Illegal instruction. 0x089312fb in qglXChooseVisual () (gdb) where #0 0x089312fb in qglXChooseVisual () #1 0x0815afaf in GLW_SetMode (drivername=0x8996d50 "libGL.so", mode=0, fullscreen=qfalse) at ../unix/solaris_glimp.c:1096 #2 0x0815aa72 in GLW_StartDriverAndSetMode (drivername=0x8996d50 "libGL.so", mode=0, fullscreen=qfalse) at ../unix/solaris_glimp.c:854 #3 0x0815b748 in GLW_LoadOpenGL (name=0x8996d50 "libGL.so") at ../unix/solaris_glimp.c:1349 #4 0x0815b902 in GLimp_Init () at ../unix/solaris_glimp.c:1436 #5 0x0812be8d in InitOpenGL () at ../renderer/tr_init.c:212 #6 0x0812e258 in R_Init () at ../renderer/tr_init.c:1086 #7 0x08136065 in RE_BeginRegistration (glconfigOut=0x8881cd4) at ../renderer/tr_model.c:862 #8 0x08081574 in CL_InitRenderer () at ../client/cl_main.c:2120 #9 0x0808161e in CL_StartHunkUsers () at ../client/cl_main.c:2149 #10 0x0809c1d8 in Com_Init (commandLine=0x89944d8 "") at ../qcommon/common.c:2492 #11 0x0814cdec in main (argc=1, argv=0x80471b0) at ../unix/unix_main.c:1374 (gdb)Its <tt>qglXChooseVisual</tty> isn't pointing to the right place. I may email the icculus.org dudes...Posted by Sean on October 31, 2005 at 10:46 AM GMT #