O'Reilly logo

Irrlicht 1.7 Realtime 3D Engine by Aung Sithu Kyaw, Johannes Stein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - creating the "game loop"

Let's create our game loop:

  1. The "game loop" is a simple while loop. We will have to redraw each frame as long as the device is running.
  2. Define the variable IVideoDriver* driver and allocate device->getVideoDriver().
  3. Now jump to the "game loop".
  4. Add driver->beginScene(true, true, SColor(255, 255, 255, 255)); at the beginning of the loop.
  5. Add driver->endScene(); at the end of the loop.
    #include <irrlicht.h> using namespace irr; using namespace core; using namespace video; #if defined(_MSC_VER) #pragma comment(lib, "Irrlicht.lib") #endif int main() { IrrlichtDevice* device = createDevice(EDT_OPENGL, dimension2d<u32>(640, 480), 16, false, false, false, 0); if (!device) return 1; IVideoDriver* driver = device->getVideoDriver(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required