Exemplo n.º 1
0
void ENGINEAPI EditorLevelInfo::UndoRedoRotation(Serializer &s, Serializer &sOut, BOOL bUndo)
{
    traceIn(EditorLevelInfo::UndoRedoRotation);

    DWORD numObjects;
    s << numObjects;

    sOut << numObjects;

    for(int i=0; i<numObjects; i++)
    {
        String name;
        Quat newRot;

        s << name;
        s << newRot;

        Entity *ent = Entity::FindByName(name);

        sOut << name;
        sOut << Quat(ent->GetLocalRot());

        SetWorldRot(ent, newRot);
        ent->UpdatePositionalData();
        //todo: manually set here
        //ent->Rot = ent->GetWorldRot() = newRot;
    }

    UpdateViewports();

    traceOut;
}
Exemplo n.º 2
0
	void D3DWrapper::WindowResized(unsigned int clientWidth, unsigned int clientHeight, unsigned int windowWidth, unsigned int windowHeight)
	{
		// Output debug information
		Utility::Logger::Instance().D("Resize: %u x %u\n", clientWidth, clientHeight);

		m_deviceContext->OMSetRenderTargets(0, NULL, NULL);

		// Release references to resources
		m_backBufferView = NULL;
		m_depthStencilView = NULL;
		m_depthStencilBuffer = NULL;

		// Resize the internal buffers
		HRESULT result = m_swapChain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH);
		if (FAILED(result))
			throw DirectXErrorM(result, "Failed to resize buffers");
		
		// Recreate view to internal back buffer.
		result = CreateBackBufferView();
		if (FAILED(result))
			throw DirectXErrorM(result, "Failed to recreate back buffer view");

		// Recreate depth/stencil buffer
		result = CreateDepthStencilBuffer(m_backBufferDescription.Width, m_backBufferDescription.Height);
		if (FAILED(result))
			throw DirectXErrorM(result, "Failed to recreate depth/stencil buffer");

		m_deviceContext->OMSetRenderTargets(1, &m_backBufferView.Resource(), m_depthStencilView.Resource()); 

		// Recreate the viewports
		UpdateViewports(m_viewports);
	}
Exemplo n.º 3
0
	void D3DWrapper::SetViewports(const std::vector<Viewport>& viewports)
	{
		m_viewports = viewports;
		UpdateViewports(m_viewports);
	}