raul.salas Posted March 1, 2019 Share Posted March 1, 2019 (edited) Hi, I'm working on an app that requires resize the window on the fly. In docs is specified that you need to set a flag to allow the window resize when you use setWidth and setHeight functions. I know that using the function "setVideoMode" from app class i can specify the flag required (APP_INDEPENDENT_SIZE_WINDOW) , but this method restarts the window and creates another one with the new configuration. I need to avoid this restart so, researching the library i found that engine uses this function to create the first main window. Is there any way to specify the flag before the engine inits? Something like an entry parameter or a way to specify. I'm working on 2.7.3 version. Edit: The function setVideoMode only can be used in c++, in doc specifies that the function exists in UnigineScript but the interpreter not include it and can't be called. Thanks! Edited March 1, 2019 by raul.salas Link to comment
silent Posted March 1, 2019 Share Posted March 1, 2019 Hi Raul, Have you tried to pass -video_resizable 1 command line option on engine startup? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
raul.salas Posted March 1, 2019 Author Share Posted March 1, 2019 Hi silent, Yes, i pass the next video command line options: -video_app auto -video_vsync 0 -video_refresh 0 -video_mode 1 -video_resizable 1 -video_fullscreen 0 -video_debug 0 -video_gamma 1.0 Thanks! Link to comment
silent Posted March 1, 2019 Share Posted March 1, 2019 Hi Raul, Could you please provide a small test app sources where resize is not working? Right now it's not completely clear what is going on. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
raul.salas Posted March 4, 2019 Author Share Posted March 4, 2019 Hi silent, Just create a new project and add this worldExpression node with a simple input test to change the resolution with the arrows. By default the project has the same parameters i post (video_resizable 1). Here is the node. data.7z Link to comment
silent Posted March 4, 2019 Share Posted March 4, 2019 Hi Raul, It seems that there is a bug inside engine that always passes App::INDEPENDENT_SIZE_WINDOW flag causing window to stay at the initial width and height. engine.app.setVideoMode is not available in UnigineScript (that's another docs bug). To workaround this issue you need to modify C++ part of the default application and call setVideoMode once in system logic that clears all the window flags: // AppSystemLogic.cpp #include "UnigineApp.h" int AppSystemLogic::init() { Unigine::App::get()->setVideoMode(200, 200, 0); // workaround to reset flags return 1; } That will make code in your attachment to start work. However, resize window manually with a mouse will be impossible. We will fix all of these issues in the upcoming SDK update. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
silent Posted March 4, 2019 Share Posted March 4, 2019 You can also try to patch engine sources in source/engine/framework/AppWindow.cpp. Find all strings (4 matches): if ((app->window_flags & ~INDEPENDENT_SIZE_WINDOW) == 0) and replace them with: if ((app->window_flags & INDEPENDENT_SIZE_WINDOW) == 0) In that case no workaround in system logic should be required. Thanks! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
raul.salas Posted March 4, 2019 Author Share Posted March 4, 2019 Hi silent, I tried to patch the engine and it works. Thanks for your help! Link to comment
Recommended Posts