Massive framerate loss when drawing.
Posted: September 30th, 2017, 6:25 pm
Hi there.
I have been following the beginner series ( also some of the intermediate) to learn some c++, and a few days ago i finally decided to create my own project.
It's a simple arkanoid clone, using the basic concepts from lesson 1-8 + arrays and classes/objects.
My problem is now, that when i draw the breakable blocks my frame rate tanks, going from 120 to 37. I feel like this shouldn't be happening since it's not a complicated game by any means, but i also don't know what causes it or how to avoid it.
The only cause i can think of at this point is that the putPixel command isn't intended to be used so much?
Right now i call it approx. 218916 times each frame, which is a lot.
I've included my code, if that helps.
I hope you can help me out here
I have been following the beginner series ( also some of the intermediate) to learn some c++, and a few days ago i finally decided to create my own project.
It's a simple arkanoid clone, using the basic concepts from lesson 1-8 + arrays and classes/objects.
My problem is now, that when i draw the breakable blocks my frame rate tanks, going from 120 to 37. I feel like this shouldn't be happening since it's not a complicated game by any means, but i also don't know what causes it or how to avoid it.
The only cause i can think of at this point is that the putPixel command isn't intended to be used so much?
Right now i call it approx. 218916 times each frame, which is a lot.
I've included my code, if that helps.
I hope you can help me out here