Exemplo n.º 1
0
	bool D3D11RenderWindow::create(unsigned int width, unsigned int height, const StringStringMap *miscParams)
	{
		// Compute window rectangle dimensions based on requested client area dimensions.
		_processParams(miscParams);
		RenderWindow::create(width, height);
		DWORD dwStyle = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU);

		RECT R = { 0, 0, mWidth, mHeight };
		AdjustWindowRect(&R, dwStyle, false);
		int widthCalc = R.right - R.left;
		int heightCalc = R.bottom - R.top;

		std::wstring wName(mTitle.begin(), mTitle.end());
		mhMainWnd = CreateWindow(L"D3D11WndClassName", wName.c_str(),
			dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, widthCalc, heightCalc, 0, 0, mhAppInst, 0);

		if (!mhMainWnd)
		{
			return false;
		}

		_createSwapChain();
		//mForceRedraw = true;
		return true;
	}
Exemplo n.º 2
0
void Settings::_initializeCallbacks(){
    addCommandCallback( "setSettingsVisible", [=] (const QString & /*cmd*/,
                                            const QString & params, const QString & /*sessionId*/) -> QString {
               bool visible = false;
               bool validBool = _processParams( params, &visible );
               QString result;
               if ( validBool ){
                   setVisible( visible );
               }
               else {
                   result = "Setting visibility must be a bool : " + params;
               }
               Util::commandPostProcess( result );
               return result;
        });
}