Page 1 of 1

Creating Irrlicht device from separate functions

Posted: Sat Dec 13, 2008 10:53 pm
by Def5
Hi! Is there any possibilities to create device from separate functions for example: SetVideoDriver(), SetWindowSize(), SetColorBits(), SetWindowId()... without rewriting some Irrlicht code and compiling him again. I tried to create something like that with creating class CConfigurator.
In functions of that class I used shared pointers (IS_DT, IS_WS...) of objects inside SIrrCreationParameters structure. When trying to compile CConfigurator file I´ve always get error "undeclared identifier". There is shared file I used:

Code: Select all

#ifndef IRR_SHARED_HPP
#define IRR_SHARED_HPP

#include "irrlicht.h"

using namespace irr;
using namespace video;
using namespace io;
using namespace scene;

SIrrlichtCreationParameters &param;

video::E_DRIVER_TYPE IS_DT = param.DriverType;
core::dimension2d<s32> IS_WS = param.WindowSize;
u32 IS_Bits = param.Bits;
bool IS_Fullscreen = param.Fullscreen;
bool IS_SB = param.Stencilbuffer;
bool IS_VSync = param.Vsync;
bool IS_AA = param.AntiAlias;
bool IS_HP_FPU = param.HighPrecisionFPU;
IEventReceiver* IS_ER = param.EventReceiver;
void* IS_W_ID = param.WindowId;

#endif // End of IRR_SHARED_HPP

Posted: Sat Dec 13, 2008 10:59 pm
by hybrid
I guess it's just a namespace problem, but you should give the full error message.

Posted: Sat Dec 13, 2008 11:10 pm
by Def5
I can´t currently provide full source code of that file (CConfigurator) or error message, because I erased it when I was mad but I know what you want me to say.

using namespace irr = BAD :(
namespace irr{<CODE>} = GOOD :D

I will write that class again and try this solution.