#include <irrlicht.h>
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
int main () {
IrrlichtDevice *dev = createDevice (EDT_DIRECTX8, core::dimension2d<s32> (800, 600),
32, false, false, false, 0);
IVideoDriver *drv = dev->getVideoDriver ();
ISceneManager *smgr = dev->getSceneManager ();
IGUIEnvironment* guienv = device->getGUIEnvironment();
dev->setWindowCaption (L"test");
guienv->addStaticText (L"Hello World! This is the Irrlicht Software engine!", rect<int>(10,10,200,22), true);
dev->drop ();
return 0;
}
When i try to compile it says:
g:\irrlicht-1.2\include\irrtypes.h(66) : fatal error C1083: Cannot open include file: 'wchar.h': No such file or directory
Error executing cl.exe.
How do i fix it?
Code error
Thanks.
I already fixed it, i forgot to include dev c++ Libraries.
But i got another error
"node->setMaterialTexture(0, driver->getTexture("G:/irrlicht-1.2/media/sydney.bmp"));"
The compiler says: 'driver' undeclared (first use this fuction)
(each underclared identifier reported only once foe each fuction it appears in.)
Looks like i had to write "using namespace ---" before the code, but i dont know wats it.
Im doing hello world tutorial, first i got "device errors", so i wrote "*dev = create device" instead (it was *device = create device in the tutorial), but i dont kno how to fix the drive thing.
I wrote Using namespaces at the being of the code.
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
#pragma comment(lib, "Irrlicht.lib")
I already fixed it, i forgot to include dev c++ Libraries.
But i got another error
"node->setMaterialTexture(0, driver->getTexture("G:/irrlicht-1.2/media/sydney.bmp"));"
The compiler says: 'driver' undeclared (first use this fuction)
(each underclared identifier reported only once foe each fuction it appears in.)
Looks like i had to write "using namespace ---" before the code, but i dont know wats it.
Im doing hello world tutorial, first i got "device errors", so i wrote "*dev = create device" instead (it was *device = create device in the tutorial), but i dont kno how to fix the drive thing.
I wrote Using namespaces at the being of the code.
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
#pragma comment(lib, "Irrlicht.lib")
driver is supposed to be the pointer you got bach from your GetVideoDriver() call. in the above code you called it "drv", so you should call it that in your getmesh call too.
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Oh, okay.
Thanks
I done compiling, n i got this error:
[Linker error] undefined reference to `irr::createDevice(irr::video::E_DRIVER_TYPE, irr::core::dimension2d<int> const&, unsigned int, bool, bool, bool, irr::IEventReceiver*, char const*)'
ld returned 1 exit status
it should be somethin wrong with "IrrlichtDevice *dev = createDevice (EDT_OPENGL, core::dimension2d<s32> (800, 600),
32, false, false, false, 0); "
But it looks okay to me, Wats wrong with this?
Thanks
I done compiling, n i got this error:
[Linker error] undefined reference to `irr::createDevice(irr::video::E_DRIVER_TYPE, irr::core::dimension2d<int> const&, unsigned int, bool, bool, bool, irr::IEventReceiver*, char const*)'
ld returned 1 exit status
it should be somethin wrong with "IrrlichtDevice *dev = createDevice (EDT_OPENGL, core::dimension2d<s32> (800, 600),
32, false, false, false, 0); "
But it looks okay to me, Wats wrong with this?
Ok thanks guys for helping me, everything works =)
So i made my first hello world thingie, now i understand how the engine works a bit.
Thanks again.
Ill try to do the next tutorial and see if i can do it alone =P
I made other two demos (both workin ^^), but i checked the CPU, and it was 98%, is there a way for make it less?
the FPS was 700
So i made my first hello world thingie, now i understand how the engine works a bit.
Thanks again.
Ill try to do the next tutorial and see if i can do it alone =P
I made other two demos (both workin ^^), but i checked the CPU, and it was 98%, is there a way for make it less?
the FPS was 700
The render loop runs as fast as it possibly can, and this will consume all of the cpu time that it is given. All modern desktop operating systems use preemptive scheduling, so this isn't really a problem...
Each process is given a priority. If there is one program that wants to burn cpu cycles, it will be allowed to do so as long as a process with a priority of greater or equal value does not want some cpu time. If you have two processes of the same priority that want 100% of the cpu, the scheduler will give each of them as much time as it can, which comes out to about 50% each. If there are 3, then they get 33%. In other words, your system performance should not be significantly impacted when a default priority process runs at 100% cpu.
If you really think it is important to not consume CPU time, you can periodically suspend your program with a call to Sleep() on windows or usleep() on *nix environments. I believe that a change was added to the driver to allow sleeping, but I haven't looked at it.
Travis
Each process is given a priority. If there is one program that wants to burn cpu cycles, it will be allowed to do so as long as a process with a priority of greater or equal value does not want some cpu time. If you have two processes of the same priority that want 100% of the cpu, the scheduler will give each of them as much time as it can, which comes out to about 50% each. If there are 3, then they get 33%. In other words, your system performance should not be significantly impacted when a default priority process runs at 100% cpu.
If you really think it is important to not consume CPU time, you can periodically suspend your program with a call to Sleep() on windows or usleep() on *nix environments. I believe that a change was added to the driver to allow sleeping, but I haven't looked at it.
Travis