1 #include <irrlicht/irrlicht.h>
11 scm_primitive_load(scm_from_locale_string("plugins/default/main.scm"));
13 IrrlichtDevice* device =
14 createDevice(EDT_OPENGL,
15 dimension2d<u32>(640, 480), 16,
16 false, false, false, 0);
20 IVideoDriver* driver = device->getVideoDriver();
28 u32 then = device->getTimer()->getTime();
30 const f32 fadeRate = 0.1f;
34 const u32 now = device->getTimer()->getTime();
35 const f32 frameDeltaTime = (f32)(now - then);
38 if (bg_r <= 0.0f) fadeOut = false;
39 else if (bg_r >= 255.0f) fadeOut = true;
43 bg_r -= fadeRate * frameDeltaTime;
44 bg_g -= fadeRate * frameDeltaTime;
45 bg_b -= fadeRate * frameDeltaTime;
49 bg_r += fadeRate * frameDeltaTime;
50 bg_g += fadeRate * frameDeltaTime;
51 bg_b += fadeRate * frameDeltaTime;
55 bg_r = bg_b = bg_g = 0.0f;
56 else if (bg_r >= 255.0f)
57 bg_r = bg_b = bg_g = 255.0f;
59 driver->beginScene(true, true, SColor(255, (u32)bg_r,
60 (u32)bg_g, (u32)bg_b));