How can I create a texture containing a geometric figure using SDL2?
I saw there is a way to convert Surface to Texture, and I also saw that there is a way to draw directly to the screen using DrawRect()
/ FillRect()
functions... I'm not sure if the geometry has something similar. Ultimately I want to have a texture to render.
The way I'm making my engine draw is to read game objects' texture and copy it to the render using render.Copy(texture, rect1, rect2)
.
This makes me wonder if there's a way for my game object to hold a texture containing a rect, circle, or triangle texture. I couldn't find in the SDL wiki or tutorials online.