[solved] setting an WIn32 application: rendering unmanaged exception

Problems building or running the engine, queries about how to use features etc.
Post Reply
Niubbo
Halfling
Posts: 79
Joined: Sat Jan 23, 2016 11:26 am
x 4

[solved] setting an WIn32 application: rendering unmanaged exception

Post by Niubbo »

Ogre Version: 1.12.6
Operating System: win10


I tried to setup an application WIn32 connecting the win32 windows to ogre. I think I have setup all correctly (the background color set on the viewport appears in the windows) but I have two main problems:


1 - The parameters passed are not applicated to the win32 original window, it seems only the externalWindowHandle is considered; at example the title is not changed, so the resolution.

Code: Select all

	HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);

.....
		m_AppRoot->initialise(false);
		
		//windows parameters
		Ogre::NameValuePairList params;
		params["externalWindowHandle"] =
			Ogre::StringConverter::toString((long)hWnd);
		params["vsync"] = "true";
		params["title"] = "TestApp";
		params["border"] = "none";


		m_RenderWindow = m_AppRoot->createRenderWindow("TestApp", 1024
			, 768, false, &params);
			
2 - when I try to add the rendering of a texture a exception umnanaged (no catch) is triggered in the code below. Is like the RenderWindow is not well created (perhaps is connected to the problem above), but I think to have followed all the correct steps (root, scenemanager, resources load and initialization, RTTS too)

Code: Select all

void D3D11RenderWindowBase::updateImpl()
	{
		D3D11RenderSystem* rsys = static_cast<D3D11RenderSystem*>(Root::getSingleton().getRenderSystem());
		rsys->validateDevice();

		RenderWindow::updateImpl();  -> here the exception is triggered
	}
In the log I found this message: the first line is my window, but I don't understanda the second line, it seems a different resolution (equal with the default win32 original size).

00:21:34: ***************************************
00:21:34: *** D3D11: Subsystem Initialized OK ***
00:21:34: ***************************************
00:21:34: D3D11RenderSystem::_createRenderWindow "TestApp", 1024x768 windowed miscParams: border=none externalWindowHandle=2756784 title=TestApp vsync=true
00:21:34: D3D11: Created D3D11 Rendering Window 'TestApp' : 1424x700, 32bpp

Any idea about what can be the problem? Thanks
Last edited by Niubbo on Sun Jun 07, 2020 4:20 pm, edited 1 time in total.

Niubbo
Halfling
Posts: 79
Joined: Sat Jan 23, 2016 11:26 am
x 4

Re: setting an WIn32 application: rendering unmanaged exception

Post by Niubbo »

about the first problem I checked the ogre code and in effect with the external win32 link, the directx plugin ignore the other parameters and use the values of original win32 window

Niubbo
Halfling
Posts: 79
Joined: Sat Jan 23, 2016 11:26 am
x 4

Re: setting an WIn32 application: rendering unmanaged exception

Post by Niubbo »

Problem solved; after have checked all the steps, I think the the problem was the missing initialization of internal and essential resources.

Post Reply