UGDK/Tutorial/01
Jump to navigation
Jump to search
Criando uma cena. (Vou arrumar tudo. Só coloquei isso aqui pra deixar a página criada)
#include <ugdk/system/engine.h> #include <ugdk/action/scene.h> #include <ugdk/input/module.h> int main(int argc, char* argv[]) { //Initializes UGDK with default values ugdk::system::Initialize(); //Creates a new scene //A scene is where all elements are placed and game's logic occurs ugdk::action::Scene* scene = new ugdk::action::Scene(); //Adds a new task to the scene //A task is a routine that will be executed every frame scene->AddTask([scene](double dt) { //That ends it when Esc is pushed if(ugdk::input::manager()->KeyDown(ugdk::input::K_ESCAPE)) //Sets the finished_ flag //UGDK will delete the scene when possible scene->Finish(); }); //Pushes the scene into a queue ugdk::system::PushScene(scene); //Runs the main loop //The main loop is responsible to verify audio, input and scene's status. //It also manage time flow, tasks, scene's updates and drawings. ugdk::system::Run(); //Releases all resources ugdk::system::Release(); return 0; }