void Graphics::Rendering() { UpdateScreen(); // Draw moving tetromino float transX = mTetromino->GetTopLeft()->col; float transY = mTetromino->GetTopLeft()->row; for(int row=0; row<mTetromino->GetHeight(); row++) { for(int col=0; col<mTetromino->GetWidth(); col++) { if(mTetromino->GetShape()[row][col] != 0) { DrawSquare2D(col + transX, row + transY, mTetromino->GetShape()[row][col]); } } } // Draw landed tetrominos for(int row=0; row<mRow; row++) { for(int col=0; col<mCol; col++) { DrawSquare2D(col, row, mBoard->GetLanded()[row][col]); } } SwapFrameBuffer(); }
void iRenderer::End() { GetGlobalInstance()->GetDeviceInformation()->pDevice->EndScene(); GetGlobalInstance()->GetDeviceInformation()->pDevice->Present(NULL, NULL, NULL, NULL); // フレームバッファを交換する(ダブルバッファリングしてるため) SwapFrameBuffer(); }