steve3d Posted April 24, 2012 Share Posted April 24, 2012 I want to embed Unigine into my own application, I've also looked the source of source\samples\App\, but I have a question, all these App are set to default using standard resolution, It seems there is no way to create a custom resolution. the App::setVideoMode is automatically called by engine with it's own standard resolution. Then only way to do this was using Unigine::Engine::init(UNIGINE_VERSION, app, argc, argv); and set video_mode to -1 then add width and height to argv. So I'm wondering if there is some other way to set the custom resolution without using argc and argv. Link to comment
frustum Posted April 24, 2012 Share Posted April 24, 2012 You can skip width and height arguments which you receive inside the App::setVideoMode() function. Engine uses App::getWidth() and App::getHeight() functions to get the real resolution. Link to comment
steve3d Posted April 25, 2012 Author Share Posted April 25, 2012 seems this won't work, my setVideoMode function: int WinApp::setVideoMode(int width,int height,int flags,int) { RECT win_rect; ::GetWindowRect(window, &win_rect); window_width = win_rect.right - win_rect.left; window_height = win_rect.bottom - win_rect.top; return create_context(); } And I already passed -video_mode -1 to argv, the actual render window are streched. Link to comment
manguste Posted April 28, 2012 Share Posted April 28, 2012 Very strange, cause it should work fine. And if RESIZABLE flag is passed? Link to comment
steve3d Posted May 2, 2012 Author Share Posted May 2, 2012 thanks, it seems the RESIZABLE flag must be set within setVideoMode function, there is the correct setVideoMode function in app. setVideoMode(int width,int height,int flags,int) { RECT win_rect; ::GetClientRect(window, &win_rect); window_width = win_rect.right - win_rect.left; window_height = win_rect.bottom - win_rect.top; window_flags = flags | Unigine::App::RESIZABLE; return create_context(); } Link to comment
Recommended Posts