Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 14th, 2012  |  syntax: C++  |  size: 0.61 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include "Rev3D/Engine.h"
  2. #include <cmath>
  3.  
  4. void R3D_main() {
  5.         float x = 0.0f;
  6.         R3D::WMgr->setTitle("Rev3D Test App");
  7.  
  8.         R3D::GL->setOrtho(Vec2D::Zero, R3D::WMgr->getScreenSize(), R3D::WMgr->getScreenSize());
  9.  
  10.         while(R3D::Engine->isRunning())
  11.         {
  12.                 x += 0.05f;
  13.  
  14.                 R3D::GL->beginFrame();
  15.                 R3D::GL->clearColor(R3D::BLUE * sin(x));
  16.  
  17.                 R3D::DB->pushTransform(Vec3D(320.0f, 240.0f, 0.0f), Vec3D::One, Vec3D(0.0f, 0.0f, x));
  18.                 R3D::DB->drawRect(Vec3D(-150.0f, -100.0f, 0.0f), 300.0f, 200.0f, R3D::YELLOW, 1.0f);
  19.                 R3D::DB->processQueue();
  20.  
  21.                 R3D::GL->endFrame();
  22.                 R3D::WMgr->update();
  23.                 cu_sleep(30);
  24.         }
  25. }