Relo Template for Irrlicht.

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Relo Template for Irrlicht.

Post by cmoibenlepro »

Hi guys, I wanted to give my little contribution to the Irrlicht Community.

I recently started to use Visual C++ toolkit and Relo IDE and I found it great! :D
If you didn't know if was possible look this thread and download Afecelis's great tutorial:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3188

The problem with his tutorial it that you needed to copy the Irrlicht library in your working directory and to set the extra include folders for each project your create.
I wanted to speed up a bit the process of starting a project with Relo.

Finally, I created a template to create Irrlicht projects with Relo and VC++ Toolkit :D

You can download it here
(please read the readme to know how to use it...)

Hope it helps! Give me comments!
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

whoa! thanks for the comments. I had a lotta fun writing it and specially seeing it worked! I've gotten a lot of feedback from people who have started using Relo+vc toolkit with excellent comments, specially cause they get to use DirectX.

I'm glad the community is taking it further.

Thanks for your template Cmoibelenpro! I guess it's time to write v2.0 of my tutorial and include your stuff as well (if you don't mind).

great job!
Image
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

thanks for the comment.
I'm glad it works! :D
Thanks for your template Cmoibelenpro! I guess it's time to write v2.0 of my tutorial and include your stuff as well (if you don't mind).
Of course I don't mind :D
I'm very happy you think it's good.

I want to to ask you something... Could you include my template with your tutorial (or at least upload it to your website) ?
because I don't know if my webspace will always be available (I don't have a lot of bandwidth...) thanks :wink:
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

of course man, NP!

I also put examples 1-9 from Irrlicht using your wizard (It's great!): Get the Irrlicht examples here:
http://www.danielpatton.com/afecelis/fi ... amples.zip

get Cmoibelenpro's C++ template and project wizard here:
http://www.danielpatton.com/afecelis/fi ... mplate.zip

I mirrored the Relo tutorial as well. It will be about a week while I write the new stuff including Cmoibelenpro's template:
http://www.danielpatton.com/afecelis/fr ... piling.pdf


Cmoibelenpro, I'm not really sure if that /O2 is necesary in irrlicht_set.ini. I modified it this way (included the lib paths as well), let me know if it's ok and if you approve I'll replace the one in your zip file:

Code: Select all

[Template]
Type=Project Settings
Name=Irrlicht Project Settings

[Options]
Libraries=irrlicht.lib
WindowsApp=no
ForceCppCompile=no
ExcludeCppLib=no
ExtraCompileSwitches=/I"C:\DXSDK\Include" /I"C:\Program Files\Microsoft Visual C++ Toolkit 2003\include" /I"C:\irrlicht\include"
ExtraLinkSwitches=/L"C:\DXSDK\lib" /L"C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib" /L"C:\irrlicht\lib\VisualStudio"
again, congrats for the good work, even the icon is beautiful, ha ha hah a :wink:
Last edited by afecelis on Wed Aug 04, 2004 2:35 am, edited 1 time in total.
Image
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

Thanks for hosting my template. It's very nice. :wink:
Cmoibelenpro, I'm not really sure if that /O2 is necesary in irrlicht_set.ini.
It's not obligatory , but it gives better results...
For example, I tried to compile the lmts loader made by jox:
without /02 the size of the compiled executable is 92k
with /O2 it's 88k
...
I know VC++ toolkit do always optimizations, but /O2 do better optimizations I think...

anyway, you can remove if you want. I don't care.
(included the lib paths as well)
ok great! I didn't know how to do it... thanks. :D
But it was also working without it.
again, congrats for the good work, even the icon is beautiful, ha ha hah a
Thanks again for your good comments. :)
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

What is that /O2 option, anyway?
And you're right, it seems like the extra libs are not necesary. I get the following messages after compiling:

LINK : warning LNK4044: unrecognized option '/LC:\DXSDK\lib'; ignored
LINK : warning LNK4044: unrecognized option '/LC:\Archivos de programa\Microsoft Visual C++ Toolkit 2003\lib'; ignored
LINK : warning LNK4044: unrecognized option '/LC:\irrlicht\lib\VisualStudio'; ignored

so I think it ignores them anyway. Unless a project requires a specific lib, I guess. I was getting the same warnings about ignoring the /O2 , so that's why I decided to put it back in.

I'll re-try it your way to see if file size gets smaller.

many thanks for everything. The last thing we need from this Killer combo (relo+vc toolkit) is dll compiling!!!! I wonder if it's possible to compile dlls with the VC 2003 toolkit.

cheers!
Image
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

size of the hello world tutorial without /O2: 29.5k
with /O2: 29.0k
There is not a lot of difference, but it is there...
It could maybe make bigger difference with bigger projects... :?:
What is that /O2 option, anyway?
open the command line window, go to your VC++ toolkit folder
open the bin folder
type cl /help

it will give you the list of all the command line options of the toolkit. :wink:
/O2 means "maximize speed"
there is also /O1 ("minimize space") and /Og ("global optimization")
but I tested them and they give all the same result...

VC++ toolkit have optimization power so why not use it? :wink:
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

you're right! I'm getting those warnings because of the extra linker options I added. There's no need for my lines; without them evrything compiles with no warnings, sweet! and the 02 option does seem to make the exe smaller.

the way you got it is perfect!

cheers
Image
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

nice.

Now, I will try to make that dll compile. :wink:

I will give you more news if it works.

(then code hints for irrlicht would be great, but making them would be a long job...)
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

to get relo to compile dlls, msvc.ini located in config/compilers must be modified to do so. More than modified, the dll options must be added since it's got none.

Msvc.ini also has the info regarding to the vc6 compiler. It would be cool to get a VCtoolkit version. I tried to mod it a bit:

Code: Select all

[Compiler Config]
Name=Visual C++ 7
Disabled=false          # true = won't appear in compiler list

[Options]
Interpreter=none        # none, mingw, or borland
LibFormat=$LIBFILE.lib

IncludePathFormat=/I"$PATH"
LibPathFormat=/L"$PATH"

ObjFileFormat=$FILE.obj
ResFileFormat=$FILE.res
ExeFileFormat=$FILE.exe

ForceC++Compile.ON=/TP
ForceC++Compile.OFF=

TurnOffWarnings.ON=/w
TurnOffWarnings.OFF=

[Windows App Commands]
CompileCmd=cl "$IN" /c /Fo"$OUT" /I"$PATH\..\include" $CFLAGS /nologo
ResCompileCmd=..\..\Microsoft Visual C++ Toolkit 2003\bin\cl /i"$PATH\..\include" /i"$PATH\..\Microsoft SDK\src\mfc" -fo"$OUT" "$IN"
LinkCmd=link /SUBSYSTEM:WINDOWS /NOLOGO /LIBPATH:"$PATH\..\lib" /MACHINE:IX86 $LFLAGS $INRES $IN user32.lib kernel32.lib "/OUT:$OUT"

[Console App Commands]
CompileCmd=cl "$IN" /c /Fo"$OUT" /I"$PATH\..\include" $CFLAGS /nologo
LinkCmd=link /SUBSYSTEM:CONSOLE /NOLOGO /LIBPATH:"$PATH\..\lib" $LFLAGS $IN "/OUT:$OUT"

[DLL Commands]
CompileCmd=
LinkCmd=

[Static Lib Commands]
CompileCmd=
LinkCmd=
so far it's working and I changed the default vc6 name for vc7. But the dll part beats me.

It would also be cool to get icon resources to compile, huh? Am I asking too much?

cheers!!!

It's been a ton of fun!
ps. I sent Niko the new examples using the template and the template. He wants to include some of this stuff in the next release but he had some problems. Let's hope your template simplifies things even more (which I think it does).

cheers!
Image
cmoibenlepro (not log in)

Post by cmoibenlepro (not log in) »

I read the MSDN reference and I think it would be:

[DLL Commands]
CompileCmd=cl "$IN" /c /MD /Fo"$OUT" /I"$PATH\..\include" $CFLAGS /nologo
LinkCmd=link /DLL /NOLOGO /LIBPATH:"$PATH\..\lib" $LFLAGS $IN "/OUT:$OUT"

But I'm not sure...
I added opengl libs to vc++ lib folder
and added opengl include to vc++/include/GL

I opened in Relo the msvc project irrlicht.dsp, added directx include folder and irrlicht source/include folder to the "extra include folders" .

I finally chose "windows dll" in the project options.

I tried to build it... it started to compile.
It worked for 32 cpp files... :)

then it failed because it say that it can't find "glx.h"

I googled for glx.h but I only found one for linux. It call x11 includes so it can't be compiled with vc++... :cry:
I didn't find nowhere a windows version of glx.h.
I checked in my MinGW include folder and there is not glx.h ... But I was able to compile the Irrlicht dll without glx.h with mingw.
so maybe glx.h is only used for linux version of irrlicht?
So it is only for linux, why is it called by vc++ toolkit or relo??
I wasn't able to fix it...

anyway, I will try to find the solution this evening or tomorrow because now I need to go to work... :(
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

those are great news Cmoibelenpro!

I found a glx.h in my system that is used by g3d (opengl engine). It's located in g3d's include folder, so I'm using it in the directories to include in VC7.

I guess this one'll do the job!!!!

grab it here:
http://www.danielpatton.com/afecelis/files/glx.zip

let me know how things went!!!!
Image
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

just updated the link to Irrlicht examples above:

http://www.danielpatton.com/afecelis/fi ... amples.zip
Image
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

time for some news :wink:

it still don't work completly (But I didn't work a lot on this yet...) but I solved the glx.h problem.

The glx file that you post is the same as the one I had...
I made some research on google and I'm pretty sure that glx is only for linux (this is why it is not included with vc++ or mingw)

If you look the first lines of glx.h (after the big comment) you can see:
#include <X11/Xlib.h>
#include <X11/Xutil.h>

of course this can't be used in windows (X11 is like the windows api but for linux)

So I checked why glx was called during the compilation of Irrlicht dll.
I found that the compilation failed when compiling COpenGLTexture.cpp
The following lines are the cause of this problem:

#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#else
#include <GL/glx.h>
#include <GL/gl.h>
#endif


of course this mean that glx.h is included only if WIN32 is NOT defined (so you are compiling on linux...) .
I don't know why, but WIN32 is not defined by default by VC++ toolkit so it tried to include glx.h instead of glu.h and windows.h
That's why it failed :wink:

The solution? I added to the Extra Compiler Switches (in the project options) this: /D WIN32
So now that WIN32 is defined manually, the compiler don't try to open glx.h :D

So that's for the good news...
Now there is a new problem.
The compilation still fail because of this fatal error:
irrlicht\source\COpenGLTexture.h(16) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
I don't have windows.h :!:
I checked in VC++ toolkit folder and it's not in the include folder...
strange...

I will try to find a solution and I will give you more news... stay tuned. :)
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

I downloaded windows platform sdk so mybe it will work :D

(A tip: go to the platform skd page, click on install this SDK at right,
click on continue, choose accept for the EULA, then instead of choosing "install now" click "cancel".
It will return you to a page where you can install only the components you want. :wink:
I unchecked "build environment for intel 64bit", "documentation" and "samples and source code" because I don't need them.
So instead of downloading more than 175MB, I only downloaded 40MB. :lol: )

I will try to make it works, I give you news. :wink:
Post Reply