How about an SDL_RenderFillQuad function? |
How about an SDL_RenderFillQuad function? |
Jonny D
|
It would probably be better to have a function for arbitrary geometry composed of triangles, like this one (SDL_RenderGeometry()):https://bugzilla.libsdl.org/show_bug.cgi?id=1734
But that feature has been waiting for over three years... Â and this related one is 5 years old: https://bugzilla.libsdl.org/show_bug.cgi?id=1138 Either of those would enable us to implement rotated quad rendering and keep the API lean. In the meantime, I've suggested SDL_gpu if you really need this now. Jonny D On Fri, Sep 30, 2016 at 8:37 AM, SeanOConnor wrote:
|
|||||||||||||
|
How about an SDL_RenderFillQuad function? |
Melker Narikka
Guest
|
If you're not too worried about performance, you could draw a
rectangle into an SDL_Texture and then draw it rotated with SDL_RenderCopyEx. Of course you'd have to do a bit more additional arithmetic yourself as the function takes an angle in degrees. -- Melker Narikka On Fri, Sep 30, 2016 at 3:37 PM, SeanOConnor wrote:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
SeanOConnor
|
For now I've done:
I just thought that adding a quad, triangle or arbitrary number of points function would be so easy (as rects are drawn with triangles anyway) it might as well be added, and I was surprised those functions weren't there already. I took a look at SDL_gpu but I'm wary of trying something without much documentation and potential future support. It does seem to use floating points for coordinates though which is another thing I don't get why SDL doesn't use. |
|||||||||||||
|
How about an SDL_RenderFillQuad function? |
Sanette
Guest
|
for lines, you can store a line in a texture (or, for that matter, you can simply store a pixel)
and then rotate and strech the texture with SDL_RenderCopyEx Le 30/09/2016 à 17:07, SeanOConnor a écrit :
|
|||||||||||||||
|
SeanOConnor
|
I also want the line to be any colour (set by what the player chooses) so I couldn't use a fixed PNG file for my texture. I suppose I could create the texture on the fly and fill it with an SDL_RenderFillRect and then rotate that, but it seems like a hell of a lot of work for something that ought to be trivial.
|
|||||||||||
|
Naith
|
If you want to let the user control the color of a texture you can load, for example, a PNG-image containg a white quad and when the texture is created, use SDL_SetTextureColorMod to set the color of the texture. |
|||||||||||||
|
rtrussell
|
Hear hear! I've tried SDL_gfx but that is very disappointing too. For example the routine which draws anti-aliased lines takes integer (pixel) coordinates for the end points, and the routines for drawing arcs and sectors take the start and end angles as integer degrees! Sorry, but this is fundamentally wrong. Richard. |
|||||||||||||
|
How about an SDL_RenderFillQuad function? |
Jonny D
|
Well, it's better than integer radians.
Jonny D On Fri, Sep 30, 2016 at 4:25 PM, rtrussell wrote:
|
|||||||||||||
|
How about an SDL_RenderFillQuad function? |
Sik
|
2016-09-30 12:07 GMT-03:00, SeanOConnor:
Because of the software renderer. That one is using dedicated algorithms instead of triangles. And honestly a good reason why we need triangle routines for it, because then at worst we can just build everything else on top of that. This is a problem that has been going on for a long while though. SDL supports multiple backends for the renderer (software, different OpenGL versions, different Direct3D versions), but they don't want to add a new function that doesn't work in all backends. And then what happens is somebody contributes a new function for one backend, but then nobody wants to bother implementing the function in the other backends, and the end result is that the function goes nowhere and gets forgotten. On top of the fact most people don't want to use the renderer anyway (they either use SDL_gpu or, more likely, they just go straight with their own OpenGL code). Actually heck, adding triangle functions would probably solve it for all backends. _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
How about an SDL_RenderFillQuad function? |
Travis McKinney
Guest
|
I've been messing around with AGG to draw quality lines.
http://www.antigrain.com/index.html There's a basic hello world integrating SDL2 and AGG at https://github.com/koopdi/draw On 30 September 2016 at 15:18, Sik the hedgehog wrote:
|
|||||||||||||||
|