-
Posts
664 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Dreikblack
-
I changed CameraControls component to be tactical/isometric and noticed it's ignoring my new class member and in debug i found out it have vars that has been deleted and no my var there at all. My code Update() works fine tho except member issue. Tried to rebuild solution - nothing changes. Is there a proper way to recompile a component or maybe i should create new component instead of repurposing old one?
-
Exception thrown at 0x00007FF72DFF37B3 in Test Project_d.exe: 0xC0000005: Access violation reading location 0x0000000000000000. https://www.ultraengine.com/learn/CreateTerrain?lang=cpp Actually CreateTerrain() seems to return null and exception happens lower in code due that.
-
It happens after recreating window and UI on second screen, dragging app window and even if initially windows was created on 2nd display. Depending on window resolution it looks differently on second screen - invisible or partly visible. First screen: Second: #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; shared_ptr<Widget> btn2; bool fullscreen = false; int displayId = 0; void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, 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("Change display", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2, 200, 200, ui->root); btn->SetFontScale(2.0f); btn2 = CreateButton("Fullscreen", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2 + 250, 120, 30, ui->root, BUTTON_CHECKBOX); } void changeDisplay() { displayId = displayId == 0 ? 1 : 0; if (!fullscreen) { window = CreateWindow("Ultra Engine", 0, 0, 1000, 1000, GetDisplays()[displayId], WINDOW_DEFAULT); } else { window = CreateWindow("Ultra Engine", 0, 0, 1000, 1000, GetDisplays()[displayId], WINDOW_DEFAULT | WINDOW_FULLSCREEN); } framebuffer = CreateFramebuffer(window); initGui(); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1000, 1000, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(menuWold); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); //Create scenery auto box = CreateBox(menuWold); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); if (ev.source == btn && ev.id == EVENT_WIDGETACTION) { changeDisplay(); } if (ev.source == btn2 && ev.id == EVENT_WIDGETACTION) { fullscreen = !fullscreen; } ui->ProcessEvent(ev); } menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
-
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
Window becomes minimized if i create it fullscreen with resolution lesser than max screen size. Same example above shows it. -
Is there a new way to get it? Was using gui->GetLineHeight() and gui->MouseDown() in custom widgets
-
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
1. Change res button 2. You will see interface bug 3. Drag window to hit screen border - vulkan crash 4. Restart, click checkbox 5. Changer res button 6. Click this button agian with or without checkbox before it - vulkan crash (looks a bit differently depending what mode will be after first fullscreen) #include "UltraEngine.h" #include "../MainMenu.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; shared_ptr<Widget> btn2; bool fullscreen = false; void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, 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("change res", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2, 200, 200, ui->root); btn->SetFontScale(2.0f); btn2 = CreateButton("Checkbox", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2 + 250, 120, 30, ui->root, BUTTON_CHECKBOX); } void changeRes() { if (!fullscreen) { window = CreateWindow("Ultra Engine", 0, 0, 1920, 1080, window->display, WINDOW_DEFAULT); } else { window = CreateWindow("Ultra Engine", 0, 0, 1920, 1080, window->display, WINDOW_DEFAULT | WINDOW_FULLSCREEN); } framebuffer = CreateFramebuffer(window); initGui(); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1680, 1050, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(menuWold); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); //Create scenery auto box = CreateBox(menuWold); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); if (ev.source == btn && ev.id == EVENT_WIDGETACTION) { changeRes(); } if (ev.source == btn2 && ev.id == EVENT_WIDGETACTION) { fullscreen = !fullscreen; } ui->ProcessEvent(ev); } menuWold->Update(); menuWold->Render(framebuffer); } return 0; } -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
I will try later. You need to create only one extra class (MainMenu) in main.cpp folder for this example tho. -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
Should i make new thread with these new bugs from post above? -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
I made an example for UI bug (old frame stays in new window) and Vulcan crash that happens if you drag new window with mouse. Update: Also it crashes if you enter window mode after fullscreen mode. (have no idea to mark your checkbox btw xd) main: #include "UltraEngine.h" #include "../MainMenu.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto menu = MainMenu::create(); return 0; } MainMenu.h: #pragma once #include "UltraEngine.h" using namespace UltraEngine; class MainMenu : public Object { protected: MainMenu(); shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; shared_ptr<Widget> btn2; void init(); void initGui(); void changeRes(); bool fullscreen = false; public: static std::shared_ptr<MainMenu> create(); }; MainMenu.cpp: #include "UltraEngine.h" #include "MainMenu.h" MainMenu::MainMenu() { } std::shared_ptr<MainMenu> MainMenu::create() { struct Struct : public MainMenu {}; auto instance = std::make_shared<Struct>(); instance->init(); return instance; } void MainMenu::init() { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1680, 1050, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(menuWold); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); //Create scenery auto box = CreateBox(menuWold); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); if (ev.source == btn && ev.id == EVENT_WIDGETACTION) { changeRes(); } if (ev.source == btn2 && ev.id == EVENT_WIDGETACTION) { fullscreen = !fullscreen; } ui->ProcessEvent(ev); } menuWold->Update(); menuWold->Render(framebuffer); } } void MainMenu::initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, 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("change res", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2, 200, 200, ui->root); btn->SetFontScale(2.0f); btn2 = CreateButton("Checkbox", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2 + 250, 120, 30, ui->root, BUTTON_CHECKBOX); } void MainMenu::changeRes() { if (!fullscreen) { window = CreateWindow("Ultra Engine", 0, 0, 1920, 1080, window->display, WINDOW_DEFAULT); } else { window = CreateWindow("Ultra Engine", 0, 0, 1920, 1080, window->display, WINDOW_DEFAULT | WINDOW_FULLSCREEN); } framebuffer = CreateFramebuffer(window); initGui(); } -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
It's just a blank window for me if new framebuffer was not set instead of old one with & and idk how to make shared_point& as a class member (it has to be init as a const in class constuctor if i understand correctly) -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
#include "UltraEngine.h" using namespace UltraEngine; void changeRes(shared_ptr<Window>& window, shared_ptr<Framebuffer>& framebuffer) { shared_ptr<Framebuffer> newFramebuffer = framebuffer; window = CreateWindow("Ultra Engine", 0, 0, 1920, 1080, window->display, WINDOW_DEFAULT); //this works //framebuffer = CreateFramebuffer(window); //this one does not newFramebuffer = CreateFramebuffer(window); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_DEFAULT); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); ui_camera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); ui_camera->SetRenderLayers(2); ui_camera->SetClearMode(CLEAR_DEPTH); auto btn = CreateButton("change res", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2, 100, 30, ui->root); //Create scenery auto box = CreateBox(world); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); if (ev.id == EVENT_WIDGETACTION) { changeRes(window, framebuffer); } ui->ProcessEvent(ev); } world->Update(); world->Render(framebuffer); } return 0; } -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
Depends on case. I can workaround it. I just thought i was missing something. What about passing or calling framebuffer in another class though? I can make listener for settings widget in a class where framebuffer was created but maybe there is a proper way to get it for window recreate? -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
How to keep 3D UI (ui = CreateInterface() and Redraw() does not help) and how to get buffer in other class? I can pass it as shared_ptr<Framebuffer>& but can't use as member for recreating window. -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
Assert failed with this code (in Release mode too): #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_DEFAULT); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); //Create scenery auto box = CreateBox(world); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { window = CreateWindow("Ultra Engine", 0, 0, 1920, 1080, displays[0], WINDOW_DEFAULT); framebuffer = CreateFramebuffer(window); } world->Update(); world->Render(framebuffer); } return 0; } -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
Actually window now freezes in Release mode even without error. -
Vulkan crash after changing window resolution
Dreikblack replied to Dreikblack's topic in Bug Reports
Found out it happens only in debug mode. But i wonder now how to make existing window be fullscreen and vice verca. -
idk if there is another proper way to change a resolution of window. This way works in 2D UI. #include "UltraEngine.h" using namespace UltraEngine; bool EventCallback(const Event& ev, shared_ptr<Object> extra) { auto window = extra->As<Window>(); window->SetSize(1024, 768); return true; } int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); auto framebuffer = CreateFramebuffer(window); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); ui_camera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); ui_camera->SetRenderLayers(2); ui_camera->SetClearMode(CLEAR_DEPTH); auto btn = CreateButton("change res", 0, 0, 100, 30, ui->root); ListenEvent(EVENT_WIDGETACTION, btn, EventCallback, window); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { auto ev = WaitEvent(); ui->ProcessEvent(ev); } world->Update(); world->Render(framebuffer); } return 0; }
-
Different fonts for different blocks in widgets
Dreikblack replied to Dreikblack's topic in Suggestion Box
Font size? Yes, i know but not enough for me -
atm i don't even see ability to set font at all aside of creation new Interface (and if it's not 2D one). Own fonts for blocks would improve aesthetic look when one font is nice for titles but bad for usual text, digets etc.
-
Works fine in usual interface but throws an exception in case of UI in 3D rendering viewport. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 640, 480, displays[0]); // Create a world auto world = CreateWorld(); // Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create ui camera auto 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); //Load a font auto font = LoadFont("Fonts/arial.ttf"); //Create user interface auto ui = CreateInterface(world, font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); //Create widget auto sz = ui->root->ClientSize(); auto combobox = CreateComboBox((sz.x - 300) / 2, (sz.y - 30) / 2, 300, 30, ui->root); for (int n = 0; n < 20; ++n) { combobox->AddItem("Item " + String(n), n == 0); } while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WIDGETSELECT: Print("Item " + String(ev.data) + " selected"); break; case EVENT_WINDOWCLOSE: return 0; break; } } }
-
Compile Shaders.bat helped
-
Yes, i updated projects after last update. Actually have same error even without quake plugin with Samurai model example.
-
-
Quake model from pak is not visible in the engine. I can see model being loaded in debug (i.e. model var is not empty) but scene is empty. PAK0 is in app dir (because of shader issue, crash if pak in game folder atm). #include "UltraEngine.h" #include "Components/CameraControls.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); world->SetAmbientLight(0); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Load FreeImage plugin auto plg = LoadPlugin("Plugins/FITextureLoader"); auto quakeLoaderPlugin = LoadPlugin("Plugins/QuakeLoader"); //Load model WString path = AppDir(); auto pak = LoadPackage(path + "/PAK0.PAK"); ChangeDir(path); auto model = LoadModel(world, "progs/quaddama.mdl"); model->Turn(0, 180, 0, true); //Environment maps auto specmap = LoadTexture("https://github.com/UltraEngine/Assets/raw/main/Materials/Environment/footprint_court/specular.dds"); auto diffmap = LoadTexture("https://github.com/UltraEngine/Assets/raw/main/Materials/Environment/footprint_court/diffuse.dds"); world->SetEnvironmentMap(diffmap, ENVIRONMENTMAP_BACKGROUND); world->SetEnvironmentMap(specmap, ENVIRONMENTMAP_SPECULAR); world->SetEnvironmentMap(diffmap, ENVIRONMENTMAP_DIFFUSE); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 1.4, -1); camera->SetFov(70); camera->AddPostEffect(LoadPostEffect("Shaders/PostEffects/FXAA.json")); //Add camera controls camera->AddComponent<CameraControls>(); //Create light auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetArea(15, 15); light->SetRotation(45, 35, 0); light->SetColor(1.2); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
-
I guess this for using game models from legal game copy of player? Yea, it would much better than having their models in my game client since only Quake code is free to use but not content (even for uncomectial games i guess). I forgot about that tbh Thanks!