Page 1 of 1

2D graphics

Posted: Sun Nov 11, 2007 9:10 am
by thojoh370
Hey,
As some of you might already know, I am attempting to create an FPS. But the problem is (both on this and on another project), that the 2D image files that I load and place on the game screen doesn't show up! The code I use is the one from the tutorial:

Code: Select all

video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
gui::IGUIEnvironment* env = device->getGUIEnvironment();

driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);

// add irrlicht logo
env->addImage(driver->getTexture("../../media/irrlichtlogoalpha.tga"),
    core::position2d<s32>(10,10));
The FPS project loads a quake3 map, and the other project loads an .irr file, if that makes sense. And perhaps I've put this code in the wrong place?

Posted: Sun Nov 11, 2007 9:34 am
by arras
First make sure Irrlicht loaded image. Look in to console window, there should be something like "Loaded texture: irrlichtlogoalpha.tga".

Second check if you draw gui properly. guienv->drawAll(); should be called afther smgr->drawAll();.

No errors

Posted: Sun Nov 11, 2007 3:32 pm
by thojoh370
Irrlicht did succeed in loading the image. No problems there.
(In fact, I borrowed the code from one of the tutorials (the terrain one), and yet it doesn't show up.)

EDIT: It doesnt show up in the console either. :?