Skip to content

Recommended way to draw animations? #35

Answered by W2Wizard
MyNameIsTrez asked this question in Q&A
Discussion options

You must be logged in to vote

Truly the best way to draw many sprites in a grid like fashion is to make an image per sprite texture, then mlx_image_to_window the sprite you want to draw for your grid of sprites. You already have the texture in memory no need to create a new image for each sprite texture.

The short reason why there isn't a mlx_delete_instance function is because I haven't really implemented it yet, most of the time it's enough to just move the instance into the background or out of the sight of the player, sure a bit wasteful, but its even a common practice in the gaming industry itself and your GPU is not going to die drawing a little quad.

The long answer is because it's a lot of memory management in…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by W2Wizard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Question Further information is requested
2 participants