Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m_frameDestRect = { 0, 0, 480, 320 };
- m_frameSrcRect = { 0, 0, 480, 320 };
- m_pTexSprite = IMG_LoadTexture(pRenderer, "image.png");
- SDL_RenderCopy(m_pRenderer, m_pTexSprite, &m_frameSrcRect, &m_frameDestRect);
- uint32_t frameX = (m_frame + 1) % 5;
- uint32_t col = (m_frame + 1) / 5;
- m_frameSrcRect = { frameX * 480, col * 320, 480, 320 };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement