Example #1
0
void OpenGLFrameBuffer::Update()
{
	if (!CanUpdate()) 
	{
		GLRenderer->Flush();
		return;
	}

	Begin2D(false);

	DrawRateStuff();
	GLRenderer->Flush();

	if (GetTrueHeight() != GetHeight())
	{
		if (GLRenderer != NULL) 
			GLRenderer->ClearBorders();

		Begin2D(false);
	}
	if (gl_draw_sync || !swapped)
	{
		Swap();
	}
	swapped = false;
	Unlock();
	CheckBench();
}
Void D3D11TextureCube::Update( const D3D11SubResourceIndex * pIndex, D3D11TextureCubeFace iFace, const D3D11Rectangle * pRect, const Void * pSrcData, D3D11DeferredContext * pContext ) const
{
    DebugAssert( IsCreated() );
    DebugAssert( CanUpdate() );
    DebugAssert( !m_bLocked );

    UInt iSubResource = _GetSubResourceIndex( pIndex, iFace, m_hTextureDesc.MipLevels, m_hTextureDesc.ArraySize );
    DebugAssert( pRect->iLeft >= 0 && pRect->iLeft < pRect->iRight && pRect->iRight <= (signed)_GetBound(m_hTextureDesc.Width,pIndex->iMipSlice) );
    DebugAssert( pRect->iTop >= 0 && pRect->iTop < pRect->iBottom && pRect->iBottom <= (signed)_GetBound(m_hTextureDesc.Height,pIndex->iMipSlice) );

    D3D11_BOX hBox;
    hBox.left = pRect->iLeft;
    hBox.right = pRect->iRight;
    hBox.top = pRect->iTop;
    hBox.bottom = pRect->iBottom;
    hBox.front = 0;
    hBox.back = 1;

    UInt iStride = _GetStride( m_hTextureDesc.Format );
    UInt iPitch = iStride * _GetBound( m_hTextureDesc.Width, pIndex->iMipSlice );
    UInt iSlice = iPitch * _GetBound( m_hTextureDesc.Height, pIndex->iMipSlice );

    ID3D11DeviceContext * pDeviceContext = m_pRenderer->m_pImmediateContext;
    if ( pContext != NULL && pContext->IsCreated() )
        pDeviceContext = pContext->m_pDeferredContext;

    pDeviceContext->UpdateSubresource( m_pTexture, iSubResource, &hBox, pSrcData, iPitch, iSlice );
}
Void D3D11Texture3D::Update( const D3D11SubResourceIndex * pIndex, const D3D11Box * pBox, const Void * pSrcData, D3D11DeferredContext * pContext ) const
{
    DebugAssert( IsCreated() );
    DebugAssert( CanUpdate() );
    DebugAssert( !m_bLocked );

    UInt iSubResource = _GetSubResourceIndex( pIndex, m_hTextureDesc.MipLevels, 1 );
    DebugAssert( pBox->iLeft < pBox->iRight && pBox->iRight <= _GetBound(m_hTextureDesc.Width,pIndex->iMipSlice) );
    DebugAssert( pBox->iTop < pBox->iBottom && pBox->iBottom <= _GetBound(m_hTextureDesc.Height,pIndex->iMipSlice) );
    DebugAssert( pBox->iFront < pBox->iBack && pBox->iBack <= _GetBound(m_hTextureDesc.Depth,pIndex->iMipSlice) );

    D3D11_BOX hBox;
    hBox.left = pBox->iLeft;
    hBox.right = pBox->iRight;
    hBox.top = pBox->iTop;
    hBox.bottom = pBox->iBottom;
    hBox.front = pBox->iFront;
    hBox.back = pBox->iBack;

    UInt iStride = _GetStride( m_hTextureDesc.Format );
    UInt iPitch = iStride * _GetBound( m_hTextureDesc.Width, pIndex->iMipSlice );
    UInt iSlice = iPitch * _GetBound( m_hTextureDesc.Height, pIndex->iMipSlice );

    ID3D11DeviceContext * pDeviceContext = m_pRenderer->m_pImmediateContext;
    if ( pContext != NULL && pContext->IsCreated() )
        pDeviceContext = pContext->m_pDeferredContext;

    pDeviceContext->UpdateSubresource( m_pTexture, iSubResource, &hBox, pSrcData, iPitch, iSlice );
}
Void D3D11Texture1D::Update( const D3D11SubResourceIndex * pIndex, UInt iX, UInt iWidth, const Void * pSrcData, D3D11DeferredContext * pContext ) const
{
    DebugAssert( IsCreated() );
    DebugAssert( CanUpdate() );
    DebugAssert( !m_bLocked );

    UInt iSubResource = _GetSubResourceIndex( pIndex, m_hTextureDesc.MipLevels, m_hTextureDesc.ArraySize );
    DebugAssert( iX + iWidth <= _GetBound(m_hTextureDesc.Width, pIndex->iMipSlice) );

    D3D11_BOX hBox;
    hBox.left = iX;
    hBox.right = iX + iWidth;
    hBox.top = 0;
    hBox.bottom = 1;
    hBox.front = 0;
    hBox.back = 1;

    UInt iStride = _GetStride( m_hTextureDesc.Format );
    UInt iPitch = iStride * _GetBound( m_hTextureDesc.Width, pIndex->iMipSlice );
    
    ID3D11DeviceContext * pDeviceContext = m_pRenderer->m_pImmediateContext;
    if ( pContext != NULL && pContext->IsCreated() )
        pDeviceContext = pContext->m_pDeferredContext;

    pDeviceContext->UpdateSubresource( m_pTexture, iSubResource, &hBox, pSrcData, iPitch, 0 );
}
Example #5
0
void LoginServer::SendAccountUpdate(ServerPacket* pack) {
	ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer;
	if(CanUpdate()) {
		Log.Out(Logs::Detail, Logs::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort);
		strn0cpy(s->worldaccount, LoginAccount, 30);
		strn0cpy(s->worldpassword, LoginPassword, 30);
		SendPacket(pack);
	}
}
Example #6
0
void CSourceODBC::TestFile(void)
{
    {
        SetPosition(0);
        SDBField *colmn = m_database.GetColomn( _T("FILE") );
        CByteArray *p = &colmn->binValue;
        int rew = 432;
    }

    SetPosition(0);
    Edit();
    SDBField *colmn = m_database.GetColomn( _T("FILE") );

    CByteArray *ba = &m_database.GetColomn( _T("FILE") )->binValue;
    ba->RemoveAt(0, ba->GetSize());
    ba->Add(111);

    Set(_T("Comment"), _T("wqe"));
    while(!CanUpdate()) {
        Sleep(10);
    }

    Update();
}