CD2DBitmap does not Draw

Hello all,

First off I am sorry if I placed this post in a wrong thread or the formatting is bad I ma new here and I still do not understand all the rules.

Now to my question I am trying to make a small @D memory game using MFC and Direct2D. I am having an issue with drawing the bitmap after it was successfully created and drawn.
To create the bitmap I am using the following function:
void CGameMaster::CreateTableTopBitmap()
{
if(!tableTopBitmap)
{

tableTopBitmap = new CD2DBitmap(windowToBeRanderedTo, iDTableTop, L"JPG", CD2DSizeU(0, 0), FALSE);
auto dWrd = GetLastError();


//USED FOR DEBUGING PURPOSES
HRESULT tempResault;

tempResault = tableTopBitmap->Create(windowToBeRanderedTo);
tempResault = tempResault;
}

}

all the functions pass with 0 or with S_OK, and for the drawing I am using:

void CGameMaster::DrawTable()
{
CD2DRectF destinationRectangle(0, 0, windowSize.width, windowSize.height);
windowToBeRanderedTo->DrawBitmap(tableTopBitmap, destinationRectangle);
auto dWrd = GetLastError();


}

the function passes with a 0 so no errors reported. My messages handle for OnDraw2D looks like this.

afx_msg LRESULT CChildView::OnDraw2D(WPARAM wParam, LPARAM lParam)
{
CHwndRenderTarget* renderingTarget = this->GetRenderTarget();
renderingTarget->SetTransform(D2D1::Matrix3x2F::Identity());
renderingTarget->Clear(D2D1::ColorF( D2D1::ColorF::White));

renderingTarget->BeginDraw();
//DEFINING RENDER TARGET FOR GAME MASTER
if (!gameMaster.GetWindowToBeRanderedTo() || !gameMaster.GetTableTopBitmap())
{
gameMaster.SetRenderingTarget(renderingTarget);
gameMaster.DrawTable();
}
renderingTarget->EndDraw();
this->RedrawWindow();



return 0;
}

Can someone help me understand why the bitmap does not draw?

Thank you in advance,
BR//
LittleTeaCup
Topic archived. No new replies allowed.