Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CTexture::render(int x, int y, int w, int h, SDL_Rect* clip, double angle, SDL_Point* center, SDL_RendererFlip flip)
- {
- SDL_Rect renderQuad;
- //Set rendering space and render to screen
- //get width and Hieght for context
- if ((w == NULL) | (h == NULL))
- {
- renderQuad = { x, y, 100, 100 };
- }
- else
- {
- renderQuad = { x, y, w, h };
- }
- //clip may be used for animating
- //Set clip rendering dimensions
- if (clip != NULL)
- {
- renderQuad.w = clip->w;
- renderQuad.h = clip->h;
- }
- /*
- SDL_RenderCopyEx triggers break point
- SDL_RenderCopyEx(SDL_Renderer* renderer,
- SDL_Texture* texture,
- const SDL_Rect* srcrect,
- const SDL_Rect* dstrect,
- const double angle,
- const SDL_Point* center,
- const SDL_RendererFlip flip)
- ... Oh, I did not pass a proper value for the second rect
- */
- SDL_RenderCopyEx(GetRenderer(), GetTexture(), clip, &renderQuad, angle, center, flip); //exception thrown here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement