SDL_RenderCopy Memory Leak?

Hi,

1
2
3
4
5
6
7
8
9
10
11
12
void SDLToolBox::render(Coordinate myCoord, SDL_Rect* myRect, SDL_Texture* myTexture, bool flip)
{	
		renderQ = { (myCoord.xCoord - camera->getViewPortX()) / camera->getZoom(), 
					(myCoord.yCoord - camera->getViewPortY()) / camera->getZoom(),
					(myRect->w) / camera->getZoom(), (myRect->h) / camera->getZoom() };
		if (flip)
			SDL_RenderCopyEx(gRender, myTexture, myRect, &renderQ, 0, NULL, SDL_FLIP_HORIZONTAL);
		else
			SDL_RenderCopy(gRender, myTexture, myRect, &renderQ);
	
	
}


Every time SDL_RenderCopy(gRender, myTexture, myRect, &renderQ); executes I see a spike in memory usage, about 1.3M per execution or 12.09M/s (average of 30 seconds in which time this statement executes 1-3 times more per iteration)

1. Has anybody else had this problem with SDL_RenderCopy?
2. If it is my doing what can I do to fix it?
3: I am willing to show more code but I'm not sure what would be relevant. Everything on the call stack?

1: Are you sure it's this statement?
Yes, when I comment out the general render all objects it maintains it's original size of 9.04M

Thanks for any input
Last edited on
Topic archived. No new replies allowed.