2 * Base class for graphics/sound
4 * Copyright (C) 2009 Mathias Gottschlag
6 * This file is part of OpenStranded
8 * OpenStranded is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * OpenStranded is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with OpenStranded. If not, see <http://www.gnu.org/licenses/>.
22 #include "eal/engine.hh"
24 #include <irrlicht/irrlicht.h>
53 irrlicht
= irr::createDevice (irr::video::EDT_OPENGL
,
54 irr::core::dimension2d
<irr::s32
>(1024, 768), 32);
56 irr::scene::ISceneManager
* smgr
= irrlicht
->getSceneManager();
58 //irr::scene::ICameraSceneNode *camera = smgr->addCameraSceneNode ();
59 irr::scene::ICameraSceneNode
*camera
= smgr
->addCameraSceneNodeFPS();
60 camera
->setPosition(irr::core::vector3df(0, 30, 0));
61 camera
->setTarget(irr::core::vector3df(0, 0, 0));
62 this->camera
.create(camera
);
79 Engine::getEnvironment ()
84 bool Engine::update ()
86 if (!irrlicht
->run ())
89 irr::video::IVideoDriver
*driver
= irrlicht
->getVideoDriver();
90 if (driver
->getFPS () != lastfps
)
92 lastfps
= driver
->getFPS ();
94 swprintf (caption
, 256, L
"OpenStranded - FPS: %d", lastfps
);
95 irrlicht
->setWindowCaption (caption
);
97 irr::scene::ISceneManager
* smgr
= irrlicht
->getSceneManager();
99 driver
->beginScene (true, true, irr::video::SColor (255, 100, 101, 140) );
105 irr::scene::ISceneManager
*
106 Engine::getSceneManager()
108 if (!irrlicht
) return 0;
109 return irrlicht
->getSceneManager();