Wednesday 2 December 2015

SDL - Bug or Problem with SDL_RenderFillRect

Got one of those annoying debugging problems going on, I'm not sure whether the problem is with the presentation buffer, or the data I'm drawing.


This code, draws a cross within a rectangle I've defined, and then it draws a hollow rectangle around them... Annoyingly, the calculation I've used for adding the width & height to the location makes sense, but it appears the rectangle is one pixel less in width... So the SDL call calculates or 
uses the rectangle to draw.


But, that's not the problem, below the code drawing this, I've asked it to actually fill in the whole rectangle...


However, the result does not fill in the rectangle...


I've tried this in both Visual Studio and Code::Blocks, neither seem to want to fill in.  I'm using the same colour, blend and settings, as you can see in the final code listing, just the call to the render fill rect function does not render a filled in rectangle.

Any ideas?

No comments:

Post a Comment