Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sprites = new SpriteSheet(L"./Sprites/index.png", gfx ,64 ,64);
- void SpriteSheet::Draw(int index, int x, int y , float mag)
- {
- D2D1_RECT_F src = D2D1::RectF(
- (float)((index % spriteAcross) * spriteWidth),
- (float)((index % spriteAcross) * spriteHeight),
- (float)(((index % spriteAcross) * spriteWidth) + spriteWidth),
- (float)(((index % spriteAcross) * spriteHeight) + spriteHeight)
- );
- D2D1_RECT_F dest = D2D1::RectF(
- x, y,
- x + spriteWidth,
- y + spriteHeight
- );
- gfx->GetRenderTarget()->DrawBitmap( bmp.Get(), dest, 1.0f , D2D1_BITMAP_INTERPOLATION_MODE_LINEAR , src);
- }
- sprites->Draw((frame/20)%4 , 100, 100 , 2.0);
Add Comment
Please, Sign In to add comment