EIDT_CONSOLE

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

EIDT_CONSOLE

Post by Adler1337 »

I am trying to use the new console device, but when i put it in createDevice() it says it can not convert device type to driver type.
Any ideas?
multum in parvo
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The first parameter to createDevice() is an enumeration of type E_DRIVER_TYPE, but you are passing an enumeration of type E_DEVICE_TYPE. Both types are unique and describe different things. There is no conversion between them, so you're obviously passing a parameter of the wrong type.

Perhaps you should look at the change log from the revision where the change was introduced. You might find some information on how to use it.

Travis
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Thanks for the reply, but i am still confused on how to use it. Could you post some code?
multum in parvo
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

No. I will not post some code. You should have no problem figuring it out from the description in changes.txt. After reading that, you should know what class you need to look at next...

Travis
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

I have been researching it, and this is what i got:

Code: Select all

irr::SIrrlichtCreationParameters* param;
    param.Bits = 16;
    param.DeviceType = EIDT_CONSOLE;
    param.DriverType = EDT_OPENGL;
    param.Fullscreen = false;
    param.Stencilbuffer = false;
    param.Vsync = false;
	device = createDeviceEx(param);
These are the errors i am getting:
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp||In function `int main(int, _TCHAR**)'
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|104|error: request for member `Bits' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|105|error: request for member `DeviceType' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|106|error: request for member `DriverType' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|107|error: request for member `Fullscreen' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|108|error: request for member `Stencilbuffer' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|109|error: request for member `Vsync' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|110|error: invalid initialization of reference of type 'const irr::SIrrlichtCreationParameters&' from expression of type 'irr::SIrrlichtCreationParameters*'|
..\..\irrlicht-1.6\irrlicht-1.6\include\irrlicht.h|351|error: in passing argument 1 of `irr::IrrlichtDevice* irr::createDeviceEx(const irr::SIrrlichtCreationParameters&)'|
||=== Build finished: 8 errors, 3 warnings ===|

I have been trying to research this and i am getting very confused. :( Can someone please tell me how to use this correctly?
multum in parvo
ericaus
Posts: 14
Joined: Sat Sep 19, 2009 10:53 am
Location: Australia

Post by ericaus »

Adler1337 wrote:I have been researching it, and this is what i got:

Code: Select all

irr::SIrrlichtCreationParameters* param;
    param.Bits = 16;
    param.DeviceType = EIDT_CONSOLE;
    param.DriverType = EDT_OPENGL;
    param.Fullscreen = false;
    param.Stencilbuffer = false;
    param.Vsync = false;
	device = createDeviceEx(param);
These are the errors i am getting:
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp||In function `int main(int, _TCHAR**)'
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|104|error: request for member `Bits' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|105|error: request for member `DeviceType' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|106|error: request for member `DriverType' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|107|error: request for member `Fullscreen' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|108|error: request for member `Stencilbuffer' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|109|error: request for member `Vsync' in `param', which is of non-class type `irr::SIrrlichtCreationParameters*'|
G:\CodeBlocksGame\MarsCodeBlocks\main.cpp|110|error: invalid initialization of reference of type 'const irr::SIrrlichtCreationParameters&' from expression of type 'irr::SIrrlichtCreationParameters*'|
..\..\irrlicht-1.6\irrlicht-1.6\include\irrlicht.h|351|error: in passing argument 1 of `irr::IrrlichtDevice* irr::createDeviceEx(const irr::SIrrlichtCreationParameters&)'|
||=== Build finished: 8 errors, 3 warnings ===|

I have been trying to research this and i am getting very confused. :( Can someone please tell me how to use this correctly?
you'll need to change

Code: Select all

irr::SIrrlichtCreationParameters* param;
into

Code: Select all

irr::SIrrlichtCreationParameters param;
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Thanks it compiles now :) , but when i use EIDT_CONSOLE and run i get an error that pops up and says something about memory could not be read. In the console window it says:
Irrlicht Engine 1.6
<-c<-[71
multum in parvo
Brkopac
Posts: 88
Joined: Fri Sep 19, 2008 2:36 am

Post by Brkopac »

Okay, I'll bite. Why are you trying to use the console device?
Last edited by Brkopac on Fri Oct 09, 2009 8:59 pm, edited 1 time in total.
Image - The glory days.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Tutorial 1 doesn't say anything about EIDT_CONSOLE.
multum in parvo
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

You'll have to give us more information. It works for me on Windows, OSX and Linux, though I've only tried Linux recently
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

@bitplane
I am using Code Blocks on Windows.
@Brkopac
You should really post new replies instead of editing your old ones.
You wrote:Okay, I'll bite. Why are you trying to use the console device?
I wrote:Tutorial 1 doesn't say anything about EIDT_CONSOLE.
You are making me sound like i am crazy :lol:
Okay, I'll bite. Why are you trying to use the console device?
:shock: because it looks freakin amazing
multum in parvo
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

This works for me, only tested in Wine though:

Code: Select all

#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

int main()
{
	SIrrlichtCreationParameters params;

	params.WindowSize.Width  = 79;
	params.WindowSize.Height = 23;
	params.DeviceType = EIDT_CONSOLE;

	IrrlichtDevice *device =
		createDeviceEx(params);

	if (!device)
		return 1;

	device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	IGUIEnvironment* guienv = device->getGUIEnvironment();

	guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!",
		rect<s32>(10,10,260,22), true);

	IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
	if (!mesh)
	{
		device->drop();
		return 1;
	}
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

	if (node)
	{
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setMD2Animation(scene::EMAT_STAND);
		node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
	}
	smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
	while(device->run())
	{
		driver->beginScene(true, true, SColor(255,100,101,140));
		smgr->drawAll();
		guienv->drawAll();
		driver->endScene();
	}
	device->drop();
	return 0;
}
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

I have exactly what you have and it still crashes. :(
multum in parvo
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

ok i think i found the problem. I got rid of device->getCursorControl()->setVisible(false); and it doesn't error anymore.
I am using a fps camera and i can't see my models. it just keeps printing <-[326;0H(326 counts up. Don't know what number it starts at.) Is this happening because EIDT_CONSOLE doesn't support fps camera(fps camera doesn't seem to move) or is because the camera is not looking at the models or something?
multum in parvo
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

The windows console device does support mouse, but it can't set the mouse position. What version of Windows are you using? Those control codes look like the ones for moving the caret.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply