The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
soft draw
Marcel Bakker
Guest

Hello,


I recently wrote a few functions that might help someone out there,
it's mostly about drawing polygons and ellipses.
Note that these functions run on top of SDL, no renderer specific code.


- source
 http://www.embenco.nl/wp-content/uploads/soft_draw.c
 http://www.embenco.nl/wp-content/uploads/soft_draw.h
- usage example
 http://www.embenco.nl/wp-content/uploads/main.c
soft draw
Marcel Bakker
Guest

Small update :


 Added a drawLine function that gives you control over drawing the start- and/or end-point.
 Added a drawLineThick function.
 


2015-11-26 19:46 GMT+01:00 Marcel Bakker:
Quote:
Hello,


I recently wrote a few functions that might help someone out there,
it's mostly about drawing polygons and ellipses.
Note that these functions run on top of SDL, no renderer specific code.


- source
 http://www.embenco.nl/wp-content/uploads/soft_draw.c
 http://www.embenco.nl/wp-content/uploads/soft_draw.h
- usage example
 http://www.embenco.nl/wp-content/uploads/main.c



soft draw
Marcel Bakker
Guest

Last update for now,
 Added a fill- and drawPie function.
 
A little blinking add here! for a set of basic draw primitives Smile


* all primitives support thickness
* all primitives support textured [RenderCopy like behavior, stretch/crop to destination]


Performance is searched and hopefully found by collecting and growing rectangles
, and only place calls to RenderFillRects with an array.
So depending on the size of the primitive
, it could very well fit inside 1 call to SDL.




2015-12-01 19:29 GMT+01:00 Marcel Bakker:
Quote:
Small update :


 Added a drawLine function that gives you control over drawing the start- and/or end-point.
 Added a drawLineThick function.
 


2015-11-26 19:46 GMT+01:00 Marcel Bakker:
Quote:
Hello,


I recently wrote a few functions that might help someone out there,
it's mostly about drawing polygons and ellipses.
Note that these functions run on top of SDL, no renderer specific code.


- source
 http://www.embenco.nl/wp-content/uploads/soft_draw.c
 http://www.embenco.nl/wp-content/uploads/soft_draw.h
- usage example
 http://www.embenco.nl/wp-content/uploads/main.c