codeape Posted August 23, 2014 Share Posted August 23, 2014 bool App::Loop() { //Close the window to end the program if (window->Closed()) return false; //Press escape to end freelook mode if (window->KeyHit(Key::Escape)) { window->ShowMouse(); return false; } context->SetColor(1,0,0); context->DrawLine(0,0,200,200); context->SetColor(0,1,0); context->DrawRect(0,0,100,100); Leadwerks::Time::Update(); world->Update(); world->Render(); context->Sync(false); return true; } When I run this code (the default code) I only see the default map but no 2D Line or Rectangle: I have also tried adding Clear() from the Command reference examples (could not find any doc on Clear though, is it OpenGL context clear?): context->SetColor(0,0,0); context->Clear(); context->SetColor(1,0,0); context->DrawLine(0,0,200,200); context->SetColor(0,1,0); context->DrawRect(0,0,100,100); I run Ubuntu 14:04: lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 Codename: trusty Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 23, 2014 Share Posted August 23, 2014 use the 2D draw commands after you have rendered not before or you will just over write them Leadwerks::Time::Update(); world->Update(); world->Render(); context->SetColor(1,0,0); context->DrawLine(0,0,200,200); context->SetColor(0,1,0); context->DrawRect(0,0,100,100); context->Sync(false); 3 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
codeape Posted August 25, 2014 Author Share Posted August 25, 2014 Sorry for late answer. Thank you macklebee. That fixed it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.