Advertisement
Guest User

leadwerks

a guest
Nov 20th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include "App.h"
  2.  
  3. using namespace Leadwerks;
  4.  
  5. App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {}
  6.  
  7. App::~App() { delete world; delete window; }
  8.  
  9. Vec2 pos;
  10.  
  11. bool App::Start()
  12. {
  13.     window = Window::Create("test", 50, 50, 1280, 720, Leadwerks::Window::Titlebar);
  14.     context = Context::Create(window);
  15.     world = World::Create();
  16.  
  17.     pos = Vec2(0, 0);
  18.  
  19.     return true;
  20. }
  21.  
  22. bool App::Loop()
  23. {
  24.     if (window->Closed()) return false;
  25.  
  26.     pos.x += 1 * Time::GetSpeed();
  27.  
  28.     context->SetColor(120, 120, 0, 0);
  29.     context->DrawRect(0, 0, 100, 60);
  30.  
  31.     context->SetColor(255, 0, 0, 0);
  32.     context->SetBlendMode(Blend::Alpha);
  33.     context->DrawText("Testing shit", pos.x, 500);
  34.     context->SetBlendMode(Blend::Solid);
  35.  
  36.     context->SetColor(0, 0, 0, 0);
  37.     context->Sync();
  38.  
  39.     return true;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement