Hier mein Code:
Code: Alles auswählen
// Clear the render target 1st
this->mpD3DDevice->ClearRenderTargetView(this->mpTextureRenderTargetView,D3DXCOLOR(0.0f,0.0f,0.0f,0.0f));
// Set the Render Target
this->mpD3DDevice->OMSetRenderTargets(1,&(this->mpTextureRenderTargetView),NULL);
// draw the text now to the new render target
if(FAILED(this->mpSprite->Begin(D3DX10_SPRITE_SAVE_STATE | D3DX10_SPRITE_SORT_TEXTURE)))
return Core::Logging::LogError(L"Begin Sprite failed!");
// Check and calculate for full text height
if(this->mFullHeight <= this->mHeight)
this->RenderTopDown(); // methode zu Textrendern, benutzt DrawText
else
this->RenderBottomUp(); // methode zu Textrendern, benutzt DrawText
if(FAILED(this->mpSprite->End()))
return Core::Logging::LogError(L"End Sprite failed!");
if(!(this->mpDX2DTexture->SetTexture(this->mpTexture))) // wieterverwendung der Texture die ich als RenderTarget genutzt hatte
return Core::Logging::LogError(L"SetTexture failed!");
// reset to the old Render Target
ID3D10RenderTargetView* oldRenderTargetView = DXCore::RenderTargetView();
ID3D10DepthStencilView* oldDepthStencilView = DXCore::DepthStencilView();
this->mpD3DDevice->OMSetRenderTargets(1,&oldRenderTargetView,oldDepthStencilView);
Dank euch
Karl