IrrlichtRenderer problem

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

communism
Just popping in
Just popping in
Posts: 9
Joined: Tue Aug 28, 2012 19:16

IrrlichtRenderer problem

Postby communism » Tue Aug 28, 2012 19:23

I keep getting this error when I try to construct a CEGUIIrrlichtRenderer...

error C2664: 'CEGUI::IrrlichtRenderer::IrrlichtRenderer(irr::IrrlichtDevice &)' : cannot convert parameter 1 from 'irr::IrrlichtDevice *' to 'irr::IrrlichtDevice &'

I'm using Visual Studio 9 (2008)

And the code that matters...

Code: Select all

//Receiver is my Event Receiver for Irrlicht...
IrrlichtDevice * device = createDevice(video::EDT_OPENGL, dimension2d<u32>(640, 480), 16, false, false, false, &receiver);
CEGUI::IrrlichtRenderer * rend = new CEGUI::IrrlichtRenderer(device);

DEvil HUnter
Just popping in
Just popping in
Posts: 7
Joined: Thu Sep 09, 2010 13:37

Re: IrrlichtRenderer problem

Postby DEvil HUnter » Tue Aug 28, 2012 19:46

i would recommend buying and reading a book about c or c++. there you should read the chapter about pointers and references.

take a look at each byte in the following code:

Code: Select all

IrrlichtDevice & device = createDevice(video::EDT_OPENGL, dimension2d<u32>(640, 480), 16, false, false, false, &receiver);


hint: -> * -> & this time

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: IrrlichtRenderer problem

Postby Kulik » Tue Aug 28, 2012 20:43

Actually

Code: Select all

IrrlichtDevice & device = *createDevice(video::EDT_OPENGL, dimension2d<u32>(640, 480), 16, false, false, false, &receiver);


the * before createDevice is important.

communism
Just popping in
Just popping in
Posts: 9
Joined: Tue Aug 28, 2012 19:16

Re: IrrlichtRenderer problem

Postby communism » Wed Aug 29, 2012 15:43

Unfortunately the code;

Code: Select all

IrrlichtDevice * device = createDevice(video::EDT_OPENGL, dimension2d<u32>(640, 480), 16, false, false, false, &receiver);

Is necessary, all other references to the "device" only work if it is a pointer.
I attempted the following code...

Code: Select all

CEGUI::IrrlichtRenderer * rend = new CEGUI::IrrlichtRenderer(*device)

But I get the following error;
cannot access protected member declared in class 'CEGUI::IrrlichtRenderer'

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: IrrlichtRenderer problem

Postby Kulik » Wed Aug 29, 2012 18:05

http://www.cegui.org.uk/docs/current/re ... orial.html

You can't construct the renderer like this. If anything it would be the IR::create static method.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests