Struggling to clear the framebuffer
Im writing a software renderer in C++ using glm and raylib, and i recently tried to draw a spinning triangle. The problem is that when i launched it the triangle leaves a trail of previously drawn triangles.
I tried to fix it by rasterizing to a framebuffer and then drawing that framebuffer instead of drawing the pixels directly and using ClearBackground to refresh the screen, but doing it that way has still the same problem. ¿Why im having this problem even though im clearing the framebuffer?
EDIT: Now im using textures to draw the pixels to the screen instead of drawing them using DrawRectangle, but it still doesnt work.
This is the code for the rasterizer (sorry for sharing it like this, i havent uploaded this to github yet):
The header file: