Search the Community
Showing results for tags 'display'.
-
Normal look On my 2nd screen. Normal on 3rd one tho. Also UI mouse input works like if no offset happen #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> world; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; shared_ptr<Widget> btn2; static bool EventCallback(const Event& e, shared_ptr<Object> extra) { Print("Callback"); return true; } void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.2f, 0.1f, 0.1f, 1.0f); uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); btn = CreateButton("Btn", 20, 20, 100, 100, ui->root); btn2 = CreateButton("Btn", 20, 150, 100, 100, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 300, 300, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world world = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0, 0, 0); initGui(); ListenEvent(EVENT_DATA, NULL, EventCallback, btn); auto color = Vec4(0.5, 0, 1, 0.5f); btn->SetColor(color); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); ui->ProcessEvent(ev); } world->Update(); world->Render(framebuffer); } return 0; }
-
-
Hi, yesterday i was testing ultraengine again. I worked on my laptop + a second monitor/screen. As long as i had the ultraengine window on my laptop screen everything worked as usual. The moment i was moving the ultraengine window to my second screen, the editor started to act weird. Some icons (see attached screenshots) disappeared, which i think this happens because the second screen is bigger, but with a lower screen-resolution. So far it can be explained to a certain level... What i can not explain myself is, everytime when i was trying to download a new material during i used the second screen, the ultraengine shuts down. The only explanation that comes to my mind for this: Normally when the download is finished, the window in ultra engine jumps from "Asset Library" to the "Project" view. Maybe this function is somehow related/connected to the main-screen of the laptop and ends in an error/crash ?