You are not logged in.

Read the FAQ and Knowledge Base before posting.
We won't make a 3DS/2DS emulator.



#51 2007-04-22 13:21:58

masscat
Member
From: UK
Registered: 2007-03-17
Posts: 73
Website

Re: GTK 3D implementation discussion

shash:
Good to see Mario is working for you. I did not spy the matrix * vertex function in the matrix.c code otherwise I would have used it.

snkmad and evilynux:
There maybe a slight problem with the gtk-glade port on non X Window platforms (it builds and runs 3D fine for me on Linux).
The gtk-glade code uses the HAVE_LIBGDKGLEXT_X11_1_0 macro to conditionally include 3D stuff. If you are using autotools (autoconf, automake, ./autogen.sh and ./configure) then this will only get defined on systems with X Window (Linux, BSDs and OSX?) since it is a check against the X Window target version of the gtkGLext library. There is now a macro, GTKGLEXT_AVAILABLE, which should be defined on all platforms with the gtkGLext library installed (assuming pkg-config is configured and working).

If you are building under Dev-Cpp/Visual C++ or similar then make sure that you define HAVE_LIBGDKGLEXT_X11_1_0 and GTKGLEXT_AVAILABLE as part of the C preprocessor arguments.

Offline

#52 2007-04-22 13:30:21

evilynux
Member
From: Montréal
Registered: 2007-03-17
Posts: 118
Website

Re: GTK 3D implementation discussion

masscat wrote:

The gtk-glade code uses the HAVE_LIBGDKGLEXT_X11_1_0 macro to conditionally include 3D stuff. If you are using autotools (autoconf, automake, ./autogen.sh and ./configure) then this will only get defined on systems with X Window (Linux, BSDs and OSX?) since it is a check against the X Window target version of the gtkGLext library. There is now a macro, GTKGLEXT_AVAILABLE, which should be defined on all platforms with the gtkGLext library installed (assuming pkg-config is configured and working).

If you are building under Dev-Cpp/Visual C++ or similar then make sure that you define HAVE_LIBGDKGLEXT_X11_1_0 and GTKGLEXT_AVAILABLE as part of the C preprocessor arguments.

That sounds right... perhaps all HAVE_LIBGDKGLEXT_X11_1_0 should be renamed to GTKGLEXT_AVAILABLE ...
Damdoum did most of the MS Windows work/testing... it'd be nice if this could be sorted out.

Offline

#53 2007-04-22 14:09:01

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Ok i added GLU32.dll and the glu errors are gone.
Now only these 2 to fix:
obj/main.o(.text+0x9ce):main.c: undefined reference to `init_opengl_gdk_3Demu'
obj/main.o(.data+0x4):main.c: undefined reference to `gpu3D_opengl_collector'

Note: im only trying to compile gtk glade on windows, because damdum asked if someone could help him test the win port.

Last edited by snkmad (2007-04-22 14:14:49)


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#54 2007-04-22 14:16:46

evilynux
Member
From: Montréal
Registered: 2007-03-17
Posts: 118
Website

Re: GTK 3D implementation discussion

snkmad wrote:

Ok i added GLU32.dll and the glu errors are gone.
Now only these 2 to fix:
obj/main.o(.text+0x9ce):main.c: undefined reference to `init_opengl_gdk_3Demu'
obj/main.o(.data+0x4):main.c: undefined reference to `gpu3D_opengl_collector'

Note: im only trying to compile gtk glade on windows, because damdum asked if someone could help him test the win port.

Your help is appreciated.
Are opengl_collector_3Demu.h and opengl_collector_3Demu.c included?

Last edited by evilynux (2007-04-22 14:17:05)

Offline

#55 2007-04-22 15:20:35

deufeufeu
Member
Registered: 2007-04-22
Posts: 4

Re: GTK 3D implementation discussion

You have to undergo some changes to take into account OSX. Headers on osx for open gl are in OpenGL/ not in GL/... There is also an issue with the fact that on Mac os x, we can't set GDK_GL_MODE_ALPHA as it is run under X11, disabling it make it runs well.

If you want me to commit some mac os x compliancy to the cvs, you can add me on sourceforge (deufeufeu).

Last edited by deufeufeu (2007-04-22 15:39:39)

Offline

#56 2007-04-22 17:29:14

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

snkmad wrote:

After adding gdk_3Demu.c gdk_3Demu.h and opengl_collector_3Demu.c opengl_collector_3Demu.h ...:

Yeah the 1st ones i added.


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#57 2007-04-22 18:22:14

evilynux
Member
From: Montréal
Registered: 2007-03-17
Posts: 118
Website

Re: GTK 3D implementation discussion

deufeufeu wrote:

You have to undergo some changes to take into account OSX. Headers on osx for open gl are in OpenGL/ not in GL/... There is also an issue with the fact that on Mac os x, we can't set GDK_GL_MODE_ALPHA as it is run under X11, disabling it make it runs well.

If you want me to commit some mac os x compliancy to the cvs, you can add me on sourceforge (deufeufeu).

The best would be to use "defines" so we can remain multi-platform/os. Can we easily detect that we're running on MacOSX, does gcc define a variable?

I welcome patches.

Thanks for testing!

Offline

#58 2007-04-22 18:24:44

evilynux
Member
From: Montréal
Registered: 2007-03-17
Posts: 118
Website

Re: GTK 3D implementation discussion

snkmad wrote:
snkmad wrote:

After adding gdk_3Demu.c gdk_3Demu.h and opengl_collector_3Demu.c opengl_collector_3Demu.h ...:

Yeah the 1st ones i added.

gtk-glade/main.c includes gdk_3Demu.h and gdk_3Demu.h includes opengl_collector_3Demu.h...
so i don't know what else to suggest...

Offline

#59 2007-04-23 11:51:47

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Can someone post here a list of all necessary files needed to be into the project?


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#60 2007-04-23 12:20:07

evilynux
Member
From: Montréal
Registered: 2007-03-17
Posts: 118
Website

Re: GTK 3D implementation discussion

snkmad wrote:

Can someone post here a list of all necessary files needed to be into the project?

Based on Makefile.am:
        globals.h glade-xml.c \
        callbacks.c callbacks.h callbacks_IO.c callbacks_IO.h desmume.c desmume.h \
        keyval_names.c main.c printscreen.c gdk_gl.c gdk_gl.h \
        dTools/callbacks_1_ioregs.c dTools/callbacks_2_memview.c \
        dTools/callbacks_3_palview.c  dTools/callbacks_4_tileview.c \
        dTools/callbacks_dtools.h \
        dTools/dTools_display.h \
        gdk_3Demu.c gdk_3Demu.h \
        ../sndsdl.h ../sndsdl.c ../ctrlssdl.h ../ctrlssdl.c

Then, looking at the dev-cpp file it seems you also need to add all other used files.
Basically, everything else in src/ .

Offline

#61 2007-04-23 12:32:41

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Well that doesnt help, i have all files from gtk glade, and src folder into the project. It must be something else.
Sorry i cant help with this one.

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\desmume\src\gtk-glade\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\desmume\src\gtk-glade\Makefile.win" all
gcc.exe obj/callbacks.o obj/callbacks_IO.o obj/desmume.o obj/keyval_names.o obj/main.o obj/printscreen.o obj/arm_instructions.o obj/armcpu.o obj/bios.o obj/cflash.o obj/cp15.o obj/ctrlssdl.o obj/debug.o obj/Disassembler.o obj/FIFO.o obj/fs-windows.o obj/GPU.o obj/mc.o obj/MMU.o obj/NDSSystem.o obj/ROMReader.o obj/saves.o obj/sndsdl.o obj/SPU.o obj/thumb_instructions.o obj/wifi.o obj/callbacks_1_ioregs.o obj/callbacks_2_memview.o obj/callbacks_3_palview.o obj/gdk_gl.o obj/glade-xml.o obj/gl_vertex.o obj/callbacks_4_tileview.o obj/gdk_3Demu.o obj/opengl_collector_3Demu.o obj/render3D.o obj/matrix.o  -o "DeSmuME.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/GTK/LIB" -L"C:/Dev-Cpp/GTK/lib/glib-2.0" -L"C:/Dev-Cpp/GTK/lib/gtk-2.0" -L"C:/Dev-Cpp/GTK/lib/libglade" -L"C:/Dev-Cpp/GTK/lib/libglade/2.0" -L"C:/Dev-Cpp/GTK/lib/gtkglext-1.0" C:/Dev-Cpp/GTK/lib/z.lib C:/Dev-Cpp/GTK/lib/atk-1.0.lib C:/Dev-Cpp/GTK/lib/cairo.lib C:/Dev-Cpp/GTK/lib/gdk_pixbuf-2.0.lib C:/Dev-Cpp/GTK/lib/gdk-win32-2.0.lib C:/Dev-Cpp/GTK/lib/glade-2.0.lib C:/Dev-Cpp/GTK/lib/glib-2.0.lib C:/Dev-Cpp/GTK/lib/gmodule-2.0.lib C:/Dev-Cpp/GTK/lib/gobject-2.0.lib C:/Dev-Cpp/GTK/lib/gtk-win32-2.0.lib C:/Dev-Cpp/GTK/lib/pango-1.0.lib C:/Dev-Cpp/GTK/lib/pangocairo-1.0.lib C:/Dev-Cpp/GTK/lib/pangowin32-1.0.lib C:/Dev-Cpp/GTK/lib/xml2.lib C:/Dev-Cpp/dll/SDL.dll C:/Dev-Cpp/lib/libSDL.dll.a C:/Dev-Cpp/lib/libopengl32.a C:/Dev-Cpp/GTK/lib/libgdkglext-win32-1.0.dll.a C:/Dev-Cpp/GTK/lib/gtkglext-win32-1.0.lib ../../../lib/GLU32.DLL  -mwindows -march=pentium4 -msse2
Warning: resolving _WinMain@16 by linking to _WinMain
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
obj/main.o(.text+0x9ce):main.c: undefined reference to `init_opengl_gdk_3Demu'
obj/main.o(.data+0x4):main.c: undefined reference to `gpu3D_opengl_collector'
collect2: ld returned 1 exit status
make.exe: *** [DeSmuME.exe] Error 1
Execution terminated

Last edited by snkmad (2007-04-23 12:35:42)


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#62 2007-04-23 12:44:47

f1r3f0x
Member
Registered: 2007-03-17
Posts: 5

Re: GTK 3D implementation discussion

same error here sad

Offline

#63 2007-04-23 13:28:15

masscat
Member
From: UK
Registered: 2007-03-17
Posts: 73
Website

Re: GTK 3D implementation discussion

The contents of opengl_collector_3Demu.c will only be compiled is the preprocessor macros HAVE_GL_GL_H and HAVE_GL_GLU_H are defined. Similarly to the HAVE_LIBGDKGLEXT_X11_1_0 and GTKGLEXT_AVAILABLE macros, you should define these as part of the build parameters. If they are defined then during the compile something like -DHAVE_GL_GL_H=1 will be present.

As a test, you could edit opengl_collector_3Demu.c, gdk_3Demu.c and main.c (maybe others) and define the macros (e.g. #define HAVE_GL_GL_H 1) before the first #ifdef test. This way you will know that the code is being included and compiled and if the problem persists then it is a linker problem.


deufeufeu:
I was under the impression that GDK_GL_MODE_ALPHA was needed to include a alpha channel for the off-screen render target but this does not appear to be the case (works fine without it under Linux for me). Could you post a patch for the other OSX changes on the SourceForge page?

Offline

#64 2007-04-23 14:32:04

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Nice tip masscat.
Ill try to do it, but dont expect much w/out help, i can only code some a + b = c operations smile
Im not familiar with the #ifdef...


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#65 2007-04-23 14:44:45

masscat
Member
From: UK
Registered: 2007-03-17
Posts: 73
Website

Re: GTK 3D implementation discussion

At the start of the files gtk-glade/main.c, gtk-glade/gdk_3Demu.c and opengl_collector_3Demu.c put the following:

#define HAVE_GL_GL_H 1
#define HAVE_GL_GLU_H 1
#define HAVE_LIBGDKGLEXT_X11_1_0 1
#define GTKGLEXT_AVAILABLE 1

Offline

#66 2007-04-23 14:51:54

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Ok do i need to add
-DHAVE_GL_GL_H=1
-DHAVE_GL_GLU_H=1
to parameters?

EDIT: After doing what you said i now get the following errors:
../opengl_collector_3Demu.c: In function `SetupTexture':
../opengl_collector_3Demu.c:732: error: `GL_MIRRORED_REPEAT' undeclared (first use in this function)
../opengl_collector_3Demu.c:732: error: (Each undeclared identifier is reported only once
../opengl_collector_3Demu.c:732: error: for each function it appears in.)
../opengl_collector_3Demu.c: In function `get_line_3Dgl_collect':
../opengl_collector_3Demu.c:2527: error: `GL_BGRA' undeclared (first use in this function)
gcc.exe: unrecognized option `-rdynamic'
make.exe: *** [obj/opengl_collector_3Demu.o] Error 1
Execution terminated

Maybe i need another opengl lib where GL_MIRRORED_REPEAT and GL_BGRA are defined?

Last edited by snkmad (2007-04-23 14:59:52)


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#67 2007-04-23 15:48:13

masscat
Member
From: UK
Registered: 2007-03-17
Posts: 73
Website

Re: GTK 3D implementation discussion

Just had a look on a Windows machine:

GL_BGRA maybe defined in glext.h and GL_MIRRORED_REPEAT maybe called GL_MIRRORED_REPEAT_ARB.
So change the following in opengl_collector_3Demu.c:

#include <GL/gl.h>
#include <GL/glu.h>

to:

#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glu.h>

#ifndef GL_MIRRORED_REPEAT
#define GL_MIRRORED_REPEAT GL_MIRRORED_REPEAT_ARB
#endif

Anybody know a good way to make the code portable across platforms (see also the OSX problem posted earlier)?

Offline

#68 2007-04-23 16:55:03

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Finally it compiles!
Thx guys, this one was hard to get working.

EDIT: Well i just had time now to take a closer look. The compiler gives some errors, but it does compile:

Warning: resolving _gluErrorString by linking to _gluErrorString@4
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _WinMain@16 by linking to _WinMain
Execution terminated

But as i tried Mario 64, its like all 3d core/code isnt included.
t1764_mariogtk.JPG

I followed all the tips here, and also i had to include GLU32.LIB.

EDi2: Heres the reason:
t1769_gdkglext.JPG
Thx to cyborg_

Last edited by snkmad (2007-04-23 20:16:44)


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#69 2007-04-24 14:02:25

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Can you help me with this last problem?


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#70 2007-04-24 16:02:33

masscat
Member
From: UK
Registered: 2007-03-17
Posts: 73
Website

Re: GTK 3D implementation discussion

Try the follow edit of gdk_3Demu.c (about line 160):

change:

glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGBA   |
                                        GDK_GL_MODE_ALPHA  |
                                        GDK_GL_MODE_DEPTH  |
                                        GDK_GL_MODE_SINGLE);

to

glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGBA   |
                                        GDK_GL_MODE_DEPTH  |
                                        GDK_GL_MODE_SINGLE);

The GDK_GL_MODE_ALPHA flag is not necessary and also causes problems under OSX.

EDIT: Removed the GDK_GL_MODE_ALPHA flag from gtk and gtk-glade gdk_3Demu.c files in CVS.

Last edited by masscat (2007-04-24 16:25:48)

Offline

#71 2007-04-24 18:31:53

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Hum still same error.
(DeSmuME-glade-24-04.exe:2840): GdkGLExt-WARNING **: cannot set pixel format

(DeSmuME-glade-24-04.exe:2840): GdkGLExt-WARNING **: cannot create GdkGLPixmap

Failed to create the GdkGLPixmap
Failed to setup openGL 3D emulation; removing 3D support


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#72 2007-04-26 11:50:13

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Well shash said it wouldnt be hard to fix that.
Why its not being able to set the pixel format?
Maybe the opengl has to be initialized in a diferent way for windows?


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#73 2007-04-26 12:05:51

shash
Administrator
Registered: 2007-03-17
Posts: 897

Re: GTK 3D implementation discussion

I said I THINK it should be hard as long as it's only related to the pixelformat selection failing.

Offline

#74 2007-04-26 12:35:39

snkmad
Member
Registered: 2007-03-17
Posts: 141
Website

Re: GTK 3D implementation discussion

Well thats the problem right now.
Maybe its the only one, maybe others will arise if you guys fix it...


Athlon 64 X2 3800+ / 2Gb DDR2 800Mhz
Geforce 8600GT 256MB / Windows XP PRO SP3
http://desmume.org/compatibility-list/

Offline

#75 2007-05-01 20:02:23

damdoum
Member
Registered: 2007-03-21
Posts: 4

Re: GTK 3D implementation discussion

masscat wrote:

At the start of the files gtk-glade/main.c, gtk-glade/gdk_3Demu.c and opengl_collector_3Demu.c put the following:

#define HAVE_GL_GL_H 1
#define HAVE_GL_GLU_H 1
#define HAVE_LIBGDKGLEXT_X11_1_0 1
#define GTKGLEXT_AVAILABLE 1

If you have autotools / gcc toolchain then those are setup when you ./configure
if you use something like devcpp ... then that would be in the compiler options window ( pass -Ddefines to the compiler )
I would not know how to do it in other dev. environment but you get the idea. Those defines being in the headers are
*hackish* so I would not recommend it.

Good job :-)
I can't help right now, sorry, i dont have a computer outside work (i.e. abroad in internship)

Offline

Board footer

Powered by FluxBB