Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Mar 19, 2024 4:42 am

All times are UTC




Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: my windows SDK
PostPosted: Wed Nov 07, 2007 7:44 pm 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
Hi,

First of all, I'd like to say that i am 100% new to Raydium game engine, i found it like 1 week ago and i am quite impressed with it. I was looking for a low 3rd party dependency engine with a nice feature set and i think i found it.

I tryed to use it and it seems that it is quite simple to get it working under linux, but although i use linux for work, for gaming i still prefer the always evil windows :)

So trying to compile this was some kind of PITA :) I first installed a gnu C compiler on my machine and visual studio 2005 express. I compiled all the dependencies on gcc (except the php support which i kindly stolen from ouille sdk) and made some scripts that allow me now to write my games (if i can call them that) from visual studio which is a nice ide and for free.

The difference is that now my games only depend on 2 dlls (3 if i compile the engine as a dll itself) instead of the huge amount from before.

My next step is to write LUA bindings for the whole engine, i already wrote a useless lua script that is able to start the main window with the following code:

window.create(320, 240, false, "hello from lua")

basically the idea is to map all the __rayapi functions from raydium_module_function to module.function in lua.

And again i develop from visual studio, without going to the command line (sort of) sometimes i need to use it too :)

If the moderators like the idea i can post here the full process or write a wiki describing it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 07, 2007 10:35 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

I work a long time on windows sdk, but i don't have your skill.

Perhaps we can try to make a decend windows sdk for both gnu and vc++.

Can you explain steps in the wiki, i'll try to add for gnu.

Can we continue this thread to decide the windows sdk structure ?

Have a nice day
Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 08, 2007 8:33 am 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
Ouille i think you got it wrong, i use gcc to build everything because i believe it is easier to keep the same code to run on almost every platform.

What i do then, is to setup visual studio express projects that will do all the standard stuff but instead of using the microsoft compiler they use GCC.

This is how i've done it:

Pre-requisites:
tar.gz, tar.bz2 decompressor (i use 7-Zip) Download it from:
http://downloads.sourceforge.net/sevenzip/7z456.exe

Visual Studio C++ Express
Download it from:
http://msdn.microsoft.com/vstudio/express/visualc/

I'll assume you are running windows XP (My development environment is Windows XP Media Center Edition 2005 but it will be the same as XP Pro)


Installation:

Before install some considerations. Raydium is developed using GCC, this compiler is ported to many platforms making it a good choice when building applications that themselves want to be portable too. On windows we have basically 2 options: Cygwin and Mingw. Cygwin is a posix emulator, that will compile and link against a cyg**.dll library to emulate all the missing functions from the windows OS. MinGW on the other hand compiles natively to win32 binaries without dependencies on emulators.

The problem here is that MinGW is not so well supported, updates seem to be not so frequent and on Cygwin, well, emulation is not a good thing (in this case it means an extra 4Mb dll to be shipped with your application).

So because of this i choose MinGW, although not so powerful and updated it is native.


Install the environment:

As everyone knows windows is not *nix and there is no bash interpreter and other tools, so because of this we also will install some extra tools to give us that compatibility layer.


Install MSYS:

Download from:
http://prdownloads.sourceforge.net/ming ... e?download

When prompted where to install, select C:\msys, instead of C:\msys\1.0. In the end a DOS box will ask if you want to configure msys, just say no, we'll do that later.

MSYS is outdated badly but no worries there is a recent build you can get from:
http://prdownloads.sourceforge.net/ming ... 2?download

Download and decompress the content of MSYS-1.0.11-20070729 over C:\msys

Do the same for the latest BASH interpreter and gnu-coreutils:
http://prdownloads.sourceforge.net/ming ... 2?download
http://prdownloads.sourceforge.net/ming ... 2?download

Ok, now you have a more updated bash environment with some core utils, next step is to fix the startup script, open the batch script C:\msys\msys.bat and add at the top:

set PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
call "%ProgramFiles%\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86

I am assuming you installed VS to the default directory.


Install The compiler

I'll install gcc and g++ 4.2.1

Download:
http://prdownloads.sourceforge.net/ming ... z?download
http://prdownloads.sourceforge.net/ming ... z?download
http://prdownloads.sourceforge.net/ming ... z?download
http://prdownloads.sourceforge.net/ming ... z?download
http://prdownloads.sourceforge.net/ming ... z?download

Decompress all to C:\msys\mingw

Under C:\msys\mingw\bin, copy (or rename) gcc-sjlj.exe to gcc.exe and g++-sjlj.exe to g++.exe.

We now have a GNU compiler working under windows but we need to integrate it to MSYS, for that create the file C:\msys\etc\fstab and add line:

c:/msys/mingw /mingw

At this moment you have a bash shell and a fully working gcc 4.2.1 compiler.

This would be enough to build raydium, but raydium depends on some 3rd party libraries, and some of these depend on perl and other tools.


Install old MSYSDTK because of perl
Download it from:
http://prdownloads.sourceforge.net/ming ... e?download

and install to C:\msys. DTK is really outdated but perl is still good enough. Now we need to get some up-to-date autotools.


Install autotools:
Download:
ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2

unpack to your msys home
./configure --prefix=/usr
make
make install

Download:
ftp://ftp.gnu.org/gnu/automake/automake-1.10.tar.bz2
unpack to your msys home
./configure --prefix=/usr
make
make install

Download:
ftp://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz
unpack to your msys home
./configure --prefix=/usr
make
make install


Install PKG-CONFIG

Some other libraries such as Ogg and Vorbis also use PKG-CONFIG, so we should also install it:

Go to the website:
http://www.gimp.org/~tml/gimp/win32/downloads.html

Download:
glib-2.14.2.zip
glib-dev-2.14.2.zip
pkg-config-0.20.zip
libiconv-1.9.1.bin.woe32.zip
gettext-0.14.5.zip

decompress to C:\msys\mingw


Install Texi2Html

In case you need some documentation, i like it sometimes it helps :)

Download:
http://download.savannah.gnu.org/releas ... .76.tar.gz
configure --prefix=/usr
make install

some libs need pod2man to generate man documentation, download it from:
http://search.cpan.org/src/RGARCIA/perl ... pod2man.PL

edit the perl path to /bin/perl and save at /bin/mod2man

other utils:

unzip and wget

http://gnuwin32.sourceforge.net/packages/unzip.htm
http://pages.interlog.com/%7Etcharron/wgetwin.html

Download the binary zip files and add then to msys/bin

astyle (sometimes is a mess to read code) and artistic style formats it like a charm:

Download from astyle.sf.net
Download: astyle_1.21__windows.zip
unzip to C:\msys


Integrate with Visual studio

on the msys root add 2 scripts:

vs-make.bat:

@c:\msys\bin\sh -c 'export VS_PATH=`pwd`; /bin/sh --login -c "/vs-make.sh %1 %2 %3 %4 %5"'

vs-make.sh:

#!/bin/bash
cd $VS_PATH
make 2>&1 $@ | sed -e 's/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/'

Done! at this moment you have everything ready to build gnu applications on windows with almost no effort.


Raydium dependencies

Raydium still has some dependencies to build, so lest grab the latest stable and build them:

glew 1.4

Download:
https://sourceforge.net/project/downloa ... .0-src.tgz

edit Makefile

GLEW_DEST = /usr/local
make
make install

OpenAL 1.1
Download from www.openal.org the latest binaries
copy C:\Program Files\OpenAL 1.1 SDK\include to c:\msys\local\include\AL
copy C:\Program Files\OpenAL 1.1 SDK\libs\Win32 to c:\msys\local\lib
copy C:\WINDOWS\system32\openAL.dll to c:\msys\local\bin

ALUT 1.1 src
Download from www.openal.org the sources:
freealut-1.1.0-src.zip
Build this is tricky, first unzip it and run the following scripts:
./autogen.sh
./configure --prefix=/usr/local LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include CFLAGS=-I/usr/local/include

edit include/alut.h change line 23 to:
#define ALUT_API

basically remove the dllimport stuff. this is because we always linking with gcc and assume that if not shared mode then we are statically linking.

make
make install

make will fail on building hello world, this is because alut scripts are not tunned to read the openal headers and libs from /usr/local, don't worry at this time the library is already built
make install will correctly copy the headers and lib to the proper destination but will fail again on the hello world (again, don't worry).


ogg vorbis

download:
http://downloads.xiph.org/releases/ogg/ ... 1.3.tar.gz
http://downloads.xiph.org/releases/vorb ... 2.0.tar.gz

libogg
./configure --prefix=/usr/local --enable-static --disable-shared
make
make install

libvorbis
./configure --prefix=/usr/local --enable-static --disable-shared
make
make install

libjpeg
Download libjpeg 6b from:
http://www.ijg.org/

libjpeg builds out of the box but later on we face problems because it declares INT16 and INT32 types that are already part of the stdlib. We need to patch jmorecfg.h:

on the top after the comment about the basic data types add:

#if defined(__MINGW32__) && defined(_RPCNDR_H) && !defined(HAVE_BOOLEAN)
#define HAVE_BOOLEAN
#endif

and replace the INT16 and INT32 declarations to:

/* X11/xmd.h and win32api already define INT16 */
#if !defined(XMD_H) && !defined(_BASETSD_H)
typedef short INT16;
#endif

/* INT32 must hold at least signed 32-bit values. */

/* X11/xmd.h and win32api already define INT32 */
#if !defined(XMD_H) && !defined(_BASETSD_H)
typedef long INT32;
#endif

./configure --prefix=/usr/local --enable-static --disable-shared
make
mkdir -p /usr/local/man/man1
make install
make install-lib

ode
Download:
http://downloads.sourceforge.net/opende ... g_mirror=0
./configure --prefix=/usr/local --enable-release --enable-static --disable-shared

edit config.h where is it (because it will colide with libjpeg):
#define HAVE_STDLIB_H 1

replace with:
#ifndef HAVE_STDLIB_H
#define HAVE_STDLIB_H 1
#endif

make
make install

php (right now i copy them from ouille sdk)


Optional

I'm trying to make some lua bindings for Raydium so maybe these options are only for me:

lua 5.1.2
Download from www.lua.org
make generic
make install

All dependencies are ready now i can build raydium.


Build Raydium

at the moment i've a heavy modified raydium code base, i'll port back my changes and the visual studio projects and post them later on, but from here you don't need to use the shell window anymore, it is all on visual studio :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 08, 2007 8:57 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

What a long post :D

Quote:
Ouille i think you got it wrong, i use gcc to build everything because i believe it is easier to keep the same code to run on almost every platform.


In fact no, i quite make the same things but using CodeBlock as ide. I realy hope you make every thing compiled with Vc++.

1) Msys ok

I don't use core util nor bash interpreter.

2) Ok for gcc
And msys configuration.

3) Haven't see perl dependency :(

4) Autotools is used to build other dependency, i just include binaries in the sdk.

Anyway thank's for the great list.

I think xfennec propose php bindings in place of lua (perhaps i'm wrong).

I'd like to propose a binarie version of this sdk (lot's of user can't handle all this step easily).
This sdk can be for vc++ and code blocks.

I'll be back on this thread for structure of the sdk.

Thank's for all of this detail, it help me a lot.

Have a nice day.

Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 08, 2007 9:25 am 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
One more thing, i make some new makefiles and i build both static and dynamic libraries of raydium which can later be linked against the end user game.

For example the demo6.c compiles shared to a exe win 580kb and static to a exe with 1.3Mb

checking the dependencies:

test6-shared.exe
+-kernel32.dll
+-msvcrt.dll
+-opengl32.dll
+-user32.dll
+-raydium.dll

in means it has 3 dependencies: raydium.dll which depends on glew32.dll and php5ts.dll

test6-static.exe
+-glew32.dll
+-php5ts.dll
+-openal32.dll
+-advapi32.dll
+-gdi32.dll
+-glu32.dll
+-kernel32.dll
+-msvcrt.dll
+-opengl32.dll
+-user32.dll
+-avicap32.dll
+-msvfw32.dll
+-winmm.dll
+-ws_32.dll

in means it has 2 dependencies: glew32.dll and php5ts.dll

because all the other ones are part of the OS.

Finally for 100% Visual Studio users, if the just get the raydium.dll i build and the header files it is possible to compile and link only with the microsoft compiler. I'll work on a another huge post on this in the comming couple of days...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 11, 2007 11:28 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Wow, impressive posts ;)

To make a long story short: we need maintainer(s) for windows. We must provide to windows Raydium users a simple (as possible) way to use the engine, like the DLL you're talking about in the end of your post. It would be great to allow linking with VC++ and GNU world (Mingw for instance). And more than anything else, we need people to maintain all this ! (releasing new builds quiet often, working with Linux devs for portability problems and so on).

I also like the idea of a "ready to use" pack, like the current "simple compiler", but it's another story.

The current state of the offical "windows version" of Raydium is catastrophic. ( Huge thanks to ouille for his work so far to make things way better !)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 13, 2007 8:50 am 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
good news, bad news...

Good news is that i managed to build the DLL under mingw and then create a simple Visual Studio C++ Express project and use the binary DLL and compile with VC++ my test against it.

This means that it is possible to build the DLL from the sources under mingw and then make binary releases that allow you to use whatever compiler (for now either GCC or VC++) you want.

The bad news is that this means huge changes on the header files. If i link the DLL at runtime it works fine but i need to prototype all the exported functions from the DLL, but if i try to use the headers they have so many dependencies included and use almost only GNU headers that on VS it is a real mess.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 13, 2007 8:57 am 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
another thing while investigating the headers and DLLs, there are about 350 global variables, wow that is quite impressive! but do they really need to be exported too? i mean:

#define __global extern

or

#define __global __cdecl(dllexport)

aren't they too many? maybe some can be global only on the engine context so once compiled are hidden from the game developer...

just run the command on your raydium/raydium directory:

grep __global *

and you'll see what i'm writting about...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 13, 2007 1:40 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
About "GNU headers" vs. "MS headers", we can perhaps try a few things. Have you some examples of these ? Perhaps can we create "fake" GNU headers, that will include VC ones or things like this ...

About globals, the thing is that Raydium used to be managed with globals in its first versions. Since a few years now, we try to provide "accessors" for globals, but this "global-style" is still quiet visible in some places of the code. And some old application code depends on globals.

IMHO, to use 100% of the engine, you probably still need to have access to globals.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 14, 2007 8:25 am 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
still on the globals and the sdk... for now i was thinking that it would be possible to make a SDK like this, all core development stays under GCC which is good because the same code will compile on linux, mac, windows, etc..., on windows we run mingw and build a DLL and pack it with the def file, the lib file and the engine header files as the sdk. Then the user only creates a simple VS project includes the headers and links against the DLL.

build a dll on mingw and link on visual studio is trivial and has no down sides, however i'm trying to do the second step make a vs project and link which is ok but i clash on the globals.

__global is defined as simple __declspec(dllexport) and like this the globals are not exported on the DLL. to export them it needs to be something like __declspec(dllexport) extern but then i get linking errors on GCC.

These errors are right because adding extern to the global will only declare it but not allocate it.

this will introduce more changes... damn it! :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 14, 2007 2:45 pm 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
ignore my previous post, i'm a bit noob on C with the microsoft compiler :)

But finally i managed to compile both static and dynamic libraries (that actually work) for raydium under windows. The static one is cool for developing under gcc or mingw to be more precise. The DLL is build and generated the .def and .lib as required to link under visual studio.

for now i'll try to make the VS2005 sdk. I'll use the dll from GCC and link against it, because this is the less intrusive way, i think. My next step is to work out the header files in order to allow me to use them on VS...


Top
 Profile  
 
 Post subject: White smoke!!!
PostPosted: Wed Nov 14, 2007 3:06 pm 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
paulo@FUNSTATION /devel/raydium/raydium
$ make clean

paulo@FUNSTATION /devel/raydium/raydium
$ make shared
gcc -W -g -c myglut.c log.c atexit.c signal.c trigo.c random.c timecall.c profile.c parser.c fog.c window.c capture.c clear.c background.c light.c key.c mouse.c joy.c texture.c shadow.c render.c particle2.c sound.c callback.c normal.c vertex.c osd.c hdr.c shader.c register.c php.c rayphp.c console.c gui.c land.c sky.c internal.c file.c path.c file_tri.c camera.c object.c cli.c network.c init.c ode.c live.c video.c web.c reg_api.c -I"/usr/local/include" -I"/usr/local/include/php-5.1.2" -I"/usr/local/include/php-5.1.2/main" -I"/usr/local/include/php-5.1.2/Zend" -I"/usr/local/include/php-5.1.2/TSRM" -DRAYDIUM_BUILD_SHARED_LIBRARY -fexpensive-optimizations -O3
light.c: In function 'raydium_light_texture':
light.c:84: warning: comparison between signed and unsigned
mouse.c: In function 'raydium_mouse_move':
mouse.c:17: warning: comparison between signed and unsigned
mouse.c:17: warning: comparison between signed and unsigned
texture.c: In function 'raydium_texture_size_is_correct':
texture.c:21: warning: comparison between signed and unsigned
texture.c: In function 'raydium_texture_load_internal':
texture.c:30: warning: 'bpp' may be used uninitialized in this function
texture.c:30: warning: 'ty' may be used uninitialized in this function
texture.c:30: warning: 'tx' may be used uninitialized in this function
texture.c:29: warning: 'data' may be used uninitialized in this function
texture.c:27: warning: 'file' may be used uninitialized in this function
shadow.c: In function 'raydium_shadow_enable':
shadow.c:68: warning: comparison between signed and unsigned
sound.c: In function 'raydium_sound_music_callback':
sound.c:806: warning: comparison between signed and unsigned
hdr.c: In function 'raydium_hdr_texture':
hdr.c:362: warning: comparison between signed and unsigned
shader.c: In function 'raydium_shader_attach_texture':
shader.c:369: warning: comparison between signed and unsigned
register.c: In function 'raydium_register_name_isvalid':
register.c:25: warning: comparison between signed and unsigned
php.c:95: warning: missing initializer
php.c:95: warning: (near initialization for 'raydium_sapi_module.unblock_interruptions')
console.c: In function 'raydium_console_complete':
console.c:460: warning: comparison between signed and unsigned
gui.c: In function 'raydium_gui_combo_draw':
gui.c:1132: warning: comparison between signed and unsigned
gui.c:1143: warning: comparison between signed and unsigned
gui.c: In function 'raydium_gui_zone_draw':
gui.c:425: warning: 'col' may be used uninitialized in this function
gui.c: In function 'raydium_gui_track_draw':
gui.c:519: warning: 'cuv' may be used uninitialized in this function
gui.c: In function 'raydium_gui_button_draw':
gui.c:314: warning: 'suv' may be used uninitialized in this function
land.c: In function 'raydium_land_surface':
land.c:103: warning: 'dy' is used uninitialized in this function
land.c:103: warning: 'dx' is used uninitialized in this function
land.c:103: warning: 'n' is used uninitialized in this function
file.c: In function 'raydium_file_basename':
file.c:45: warning: comparison between signed and unsigned
file_tri.c: In function 'read_vertex_from':
file_tri.c:271: warning: comparison between signed and unsigned
object.c: In function 'raydium_object_find':
object.c:12: warning: comparison between signed and unsigned
object.c: In function 'raydium_object_isvalid':
object.c:20: warning: comparison between signed and unsigned
object.c: In function 'raydium_object_anim_generate_internal':
object.c:477: warning: comparison between signed and unsigned
object.c: In function 'raydium_object_callback':
object.c:593: warning: comparison between signed and unsigned
network.c: In function 'raydium_network_propag_add':
network.c:101: warning: comparison between signed and unsigned
network.c: In function 'raydium_network_socket_is_readable':
network.c:442: warning: comparison between signed and unsigned
network.c: In function 'raydium_network_read':
network.c:694: warning: comparison between signed and unsigned
network.c: In function 'raydium_network_read_flushed':
network.c:859: warning: 'save_type' may be used uninitialized in this function
network.c:858: warning: 'save_id' may be used uninitialized in this function
init.c: In function 'raydium_init_load':
init.c:301: warning: 'tmp_near' may be used uninitialized in this function
init.c:301: warning: 'tmp_far' may be used uninitialized in this function
init.c:301: warning: 'tmp_fov' may be used uninitialized in this function
init.c:300: warning: 'tmp_lighting' may be used uninitialized in this function
init.c:300: warning: 'tmp_fog' may be used uninitialized in this function
init.c:300: warning: 'tmp_filter' may be used uninitialized in this function
init.c:300: warning: 'tmp_windowtype' may be used uninitialized in this function
init.c:300: warning: 'tmp_height' may be used uninitialized in this function
init.c:300: warning: 'tmp_width' may be used uninitialized in this function
ode.c: In function 'raydium_ode_ground_set_name':
ode.c:367: warning: comparison between signed and unsigned
ode.c: In function 'raydium_ode_capture_seek':
ode.c:4920: warning: comparison between signed and unsigned
ode.c:4923: warning: comparison of unsigned expression < 0 is always false
ode.c: In function 'raydium_ode_capture_play_internal_index_build':
ode.c:4674: warning: 'last_event.fpos' may be used uninitialized in this function
ode.c:4674: warning: 'last_event.index' may be used uninitialized in this function
ode.c: In function 'dNearPickback':
ode.c:4484: warning: 'e2' is used uninitialized in this function
ode.c: In function 'raydium_ode_draw_all':
ode.c:3348: warning: 'col' may be used uninitialized in this function
ode.c:3343: warning: 'f2' may be used uninitialized in this function
ode.c:3342: warning: 'f1' may be used uninitialized in this function
ode.c: In function 'raydium_ode_motor_update_joints_data_internal':
ode.c:2170: warning: 'fmax' may be used uninitialized in this function
ode.c:2169: warning: 'vel' may be used uninitialized in this function
ode.c: In function 'raydium_ode_joint_suspension':
ode.c:1731: warning: 'f' may be used uninitialized in this function
live.c: In function 'Frame_CallBack':
live.c:151: warning: comparison between signed and unsigned
live.c:154: warning: comparison between signed and unsigned
live.c: In function 'raydium_live_texture_create':
live.c:875: warning: comparison between signed and unsigned
web.c: In function 'raydium_web_client_get':
web.c:365: warning: 'fp' may be used uninitialized in this function
gcc -shared myglut.o log.o atexit.o signal.o trigo.o random.o timecall.o profile.o parser.o fog.o window.o capture.o clear.o background.o light.o key.o mouse.o joy.o texture.o shadow.o render.o particle2.o sound.o callback.o normal.o vertex.o osd.o hdr.o shader.o register.o php.o rayphp.o console.o gui.o land.o sky.o nternal.o file.o path.o file_tri.o camera.o object.o cli.o network.o init.o ode.o live.o video.o web.o reg_api.o -L"/usr/local/bin" -L"/usr/local/lib" -Wl,--out-implib,libraydiumdll.a,--output-def,raydium.def,--export-all-symbols -lphp5ts -lode -lopengl32 -lglu32 -lgdi32 -ljpeg -lwinmm -lglew32 -lm -lopenal32 -lws2_32 -lalut -lvorbisfile -lvorbis -logg -lvfw32 -lstdc++ -o raydium.dll
Creating library file: libraydiumdll.a
Microsoft (R) Library Manager Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

Creating library raydium.lib and object raydium.exp
Shared build complete!

paulo@FUNSTATION /devel/raydium/raydium
$ cl vs-test.c raydium.lib
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

vs-test.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

/out:vs-test.exe
vs-test.obj
raydium.lib

paulo@FUNSTATION /devel/raydium/raydium
$ vs-test.exe
Raydium: Raydium 3D Game Engine
Raydium: version 0.706
Raydium: command line args: OK
Raydium: chdir to 'C:\msys\devel\raydium\raydium\': OK
Raydium: using 'C:\Document and Settings\Paulo\.raydium' as home dir


So it is possible then :) now my code (vs-test.c) is:

// fake DLL imports (need to work on the original headers)
extern __declspec(dllimport) int raydium_mouse_button[3];
__declspec(dllimport) void raydium_init_args(int argc, char **argv);

int main (int argc, char **argv)
{
raydium_init_args(argc, argv);
return (0);
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 15, 2007 1:00 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Wow, you like massive posts :)

Let's sum up things a little bit: You were able to
- create a Raydium DLL using GCC (any modified code / headers for that ?)
- link this DLL with VC++ and the native MS compiler (but without "official" headers yet)

Am I right ?

PS: What a lot of warnings ! I've nothing like that with GCC 4.0.1 ... I'll try to fix that ASAP. What is your GCC version here ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 15, 2007 2:28 pm 
Offline

Joined: Wed Nov 07, 2007 7:31 pm
Posts: 26
Location: Amsterdam
I've all these warnings because i rewrote all my makefiles. my gcc version is 4.2.1. I compile with the -W flag which issue all these cool warnings :)

I've synchronized with svn on the 13th. My changes are here: http://www.scratchydreams.com/projects/raydium.zip THIS IS ONLY the source code.

I sync code by downloading a night svn snapshot from the download section, i copy over my Makefile and run the task format. Then i use a merge tool to see the differences between my current code and the latest code.

If you use my dev environment as described on the 1st post you only need to run the default tasks, to build a demo use the makefile under demo as a start. This is a GCC build.

To use the Microsoft compiler first compile the library as shared and install and then use the project under win32. Again this is a rough test case because i still need to work on the header files to make it work...

Once i managed to achieve this i'll post another mega post with installation instructions for Visual Studio C++ Express 2005 and build the test6.c example. But that is still far away i need time and i'm still learning too :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 15, 2007 5:19 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

I don't have lot's of free time now. But i follow this thread with interest.

I'll try to find some time to build an official windows sdk with Paulo's help and informations.

Just one question:

When i began to work with raydium, i try to compile under vs++, because i already use this ide.

An advice about free ide like code blocks make things really easiers.

Why do you want to use Vs++, for the ide or for compiler performances ?


Anyway having an sdk that can work on both mingw and vs is the bes solution.

have a nice day
Ouille


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group