Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "App.h"
- using namespace Leadwerks;
- App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {}
- App::~App() { delete world; delete window; }
- Vec2 pos;
- bool App::Start()
- {
- window = Window::Create("test", 50, 50, 1280, 720, Leadwerks::Window::Titlebar);
- context = Context::Create(window);
- world = World::Create();
- pos = Vec2(0, 0);
- return true;
- }
- bool App::Loop()
- {
- if (window->Closed()) return false;
- pos.x += 1 * Time::GetSpeed();
- context->SetColor(120, 120, 0, 0);
- context->DrawRect(0, 0, 100, 60);
- context->SetColor(255, 0, 0, 0);
- context->SetBlendMode(Blend::Alpha);
- context->DrawText("Testing shit", pos.x, 500);
- context->SetBlendMode(Blend::Solid);
- context->SetColor(0, 0, 0, 0);
- context->Sync();
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement