zaterdag 8 september 2012

New project

I'm switching from a 2.5D/isometric to an 3D program. So this is why I started playing around with openGL and Irrlicht. I chose openGL because I want to run the program cross OS. So here is a little tutorial on how I made an Irrlicht project template with Code::blocks because I didn't want to re-enter my settings every time. I first wanted to use Netbeans but I still cant figure out how to make them compatible...
So I unpacked the irrlicht library in my home/Development folder. No make or configure needed ad far as I remember.
So start up Code::blocks and make a new console project. I named it IrrlichtTemplate but you can use whatever you want. There is an irrlicht project but it gives error on build so I haven't used it.
You don't have to edit anything yet just click next.
After that I right-click on the project and choose build options.
The I choose the Linker Settings tab and add the following libraries:
Irrlicht
GL
Xxf86vm
Xext
X11

After that I go to the tab Search directories and the smaller tab Compiler. Browse to where I unpacked the irrlicht folder. I go into the folder and open the include folder. Then click Open. I don't keep it as a relative path but that is personal preference.
In the Linker tab I add the /usr/X11R6/lib$(LIBSELECT).
I also add the linux library by browsing to the irrlicht folder then lib/Linux.
Then you should be able to compile.

It is basically this tutorial.
Just a remainder about Code::blocks, if you have your main.cpp open and press ctrl-s it just saves your main.cpp, not your project settings. Make sure you save them to or else you have to redo this tutorial....

I also edited my main.cpp so I don't have to enter all the namespaces and libraries.This is my main.cpp

#include 
#include 


using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif

int main()
{

    return 0;
}


Make sure you have your irrlicht project open.
After I saved my project settings I chose file->save project as template...
Then just click next.

 So now you can make a new project and under user templates should be your new Irrlicht template.
So if I figure more stuff out about Irrlicht or openGL I'll post it :).
If you have any errors or questions after flowing this guide please ask.

Geen opmerkingen:

Een reactie plaatsen