Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Leadwerks.h"
- using namespace Leadwerks;
- Model* model = NULL;
- int main(int argc, const char *argv[])
- {
- Leadwerks::Window* window = Leadwerks::Window::Create();
- Context* context = Context::Create(window);
- World* world = World::Create();
- Camera* camera = Camera::Create();
- camera->Move(0,0,-3);
- Light* light = DirectionalLight::Create();
- light->SetRotation(35,35,0);
- auto gui = GUI::Create(context);
- auto base = gui->GetBase();
- model = Model::Box();
- model->SetColor(0.0,0.0,1.0);
- auto button = Widget::Button("Push", 200, 10, 76, 20, base);
- auto textfield = Widget::TextField("Enter some text here...",10, 10 ,180, 20, base);
- auto panel = Widget::Panel(10,200,300,150,base);
- panel->SetBool("border",true);
- auto pbtn = Widget::Button("Click", 10, 10, 76, 20, panel);
- auto plabel = Widget::Label("This is a label", 10,40,120,140,panel);
- auto tabs = Widget::Tabber(600,200,300,150,base);
- for(int i=0; i<4; i++) {
- tabs->AddItem("Item" + String(i));
- }
- auto pbtn1 = Widget::Button("Click", 10, 10, 76, 20, tabs);
- while (true)
- {
- if (window->Closed() || window->KeyDown(Key::Escape)) return false;
- model->Turn(0,Leadwerks::Time::GetSpeed(),0);
- while (EventQueue::Peek())
- {
- auto le = EventQueue::Wait();
- if (le.id == Event::WidgetAction) {
- System::Print("widget action");
- } else if (le.id == Event::WidgetSelect) {
- System::Print("widget select");
- }
- }
- Leadwerks::Time::Update();
- world->Update();
- world->Render();
- context->Sync(false);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment