{"id":67,"date":"2016-01-02T17:12:10","date_gmt":"2016-01-02T17:12:10","guid":{"rendered":"http:\/\/www.ferzkopp.org\/wordpress\/?p=67"},"modified":"2025-01-05T13:17:22","modified_gmt":"2025-01-05T21:17:22","slug":"sdl_gfx-sdl2_gfx","status":"publish","type":"post","link":"https:\/\/www.ferzkopp.net\/wordpress\/2016\/01\/02\/sdl_gfx-sdl2_gfx\/","title":{"rendered":"SDL_gfx \/ SDL2_gfx"},"content":{"rendered":"<p>Graphics drawing primitives and other support functions wrapped up in an add-on, C-based library for the Simple Direct Media (SDL) cross-platform API layer. SDL_gfx supports the original SDL1 library using software surfaces, and SDL2_gfx supports SDL2 using rendering functions.<\/p>\n<p><!--more--><\/p>\n<hr>\n<h3>SDL3_gfx Library<\/h3>\n<p>A port of this library to SDL3 has been created by S. Khabir: <a href=\"https:\/\/github.com\/sabdul-khabir\/SDL3_gfx\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/sabdul-khabir\/SDL3_gfx<\/a><\/p>\n<h3>SDL2_gfx Library<\/h3>\n<p><strong>SDL2<\/strong> graphics drawing primitives and other support functions<\/p>\n<p>Latest Version (Ver 1.0.4 &#8211; 11 Feb 2018)<\/p>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL2_gfx\/SDL2_gfx-1.0.4.tar.gz\">SDL2_gfx-1.0.4.tar.gz<\/a> (<a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL2_gfx\/SDL2_gfx-1.0.4.zip\">.zip<\/a>) (<a href=\"https:\/\/sourceforge.net\/projects\/sdl2gfx\/files\/SDL2_gfx-1.0.4.tar.gz.asc\/download\">.asc<\/a>)<\/p>\n<p>Sources and archives also on <a href=\"https:\/\/sourceforge.net\/projects\/sdl2gfx\/\">https:\/\/sourceforge.net\/projects\/sdl2gfx\/<\/a><\/p>\n<pre>Changes:\n - version rev to 1.0.4\n - fix int overflow in ellipseRGBA for large radii (thanks for reporting David)\n - fix aaline wrong direction hline bug (thanks Andre)\n - fix off-by-1 error in rotateSurface90Degrees (thanks Austin)<\/pre>\n<h5>Older versions<\/h5>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL2_gfx\/SDL2_gfx-1.0.3.tar.gz\">SDL2_gfx-1.0.3.tar.gz<\/a> (<a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL2_gfx\/SDL2_gfx-1.0.3.zip\">.zip<\/a>)<\/p>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL2_gfx\/SDL2_gfx-1.0.1.tar.gz\">SDL2_gfx-1.0.1.tar.gz<\/a> (<a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL2_gfx\/SDL2_gfx-1.0.1.zip\">.zip<\/a>)<\/p>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL2_gfx\/SDL2_gfx-1.0.0.tar.gz\">SDL2_gfx-1.0.0.tar.gz<\/a><\/p>\n<h5>Documentation<\/h5>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL2_gfx\/Docs\/html\/index.html\">Doxygen generated API documentation<\/a><\/p>\n<p>(C) A. Schiffler, aschiffler [at] ferzkopp.net 2012-2018, licensed under the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Zlib_License\">zlib license<\/a><\/p>\n<h5>Extensions \/ External Versions<\/h5>\n<p>The following external versions have been made of SDL2_gfx:<\/p>\n<ul>\n<li>Richard Russell&#8217;s <a href=\"https:\/\/github.com\/rtrussell\/BBCSDL\/blob\/master\/src\/SDL2_gfxPrimitives.c\">https:\/\/github.com\/rtrussell\/BBCSDL\/blob\/master\/src\/SDL2_gfxPrimitives.c<\/a> adds the following routines:\n<ul>\n<li>thickEllipseRGBA() &#8211; Draw thick outline ellipse with blending.<\/li>\n<li>thickArcRGBA() &#8211; Draw thick circular arc with blending.<\/li>\n<li>thickCircleRGBA() &#8211; Draw thick outline circle with blending.<\/li>\n<li>aaFilledEllipseRGBA() &#8211; Draw anti-aliased filled ellipse with blending.<\/li>\n<li>aaFilledPolygonRGBA() &#8211; Draw anti-aliased filled polygon with blending.<\/li>\n<li>aaFilledPieRGBA() &#8211; Draw anti-aliased filled pie or chord with blending.<\/li>\n<li>aaArcRGBA() &#8211; Draw anti-aliased elliptical arc with blending.<\/li>\n<li>aaBezierRGBA() &#8211; Draw anti-aliased B\u00e9zier curve with blending.<\/li>\n<li>aaFilledPolyBezierRGBA() &#8211; Fill a region bounded by cubic B\u00e9zier curves.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-447\" src=\"http:\/\/www.ferzkopp.net\/wordpress\/wp-content\/uploads\/2016\/01\/Russell-aaSDL2_gfx-demo.gif\" alt=\"\" width=\"400\" height=\"300\"><\/p>\n<hr>\n<h3>SDL_gfx Library<\/h3>\n<p><strong>SDL<\/strong> graphics drawing primitives and other support functions<\/p>\n<p>The SDL_gfx library evolved out of the <em>SDL_gfxPrimitives<\/em> code which provided basic drawing routines such as lines, circles or polygons and <em>SDL_rotozoom<\/em> which implemented a interpolating rotozoomer for SDL surfaces.<\/p>\n<p>The current components of the SDL_gfx library are:<\/p>\n<ul>\n<li>Graphic Primitives (SDL_gfxPrimitves.h)<\/li>\n<li>Rotozoomer (SDL_rotozoom.h)<\/li>\n<li>Framerate control (SDL_framerate.h)<\/li>\n<li>MMX image filters (SDL_imageFilter.h)<\/li>\n<li>Custom Blit functions (SDL_gfxBlitFunc.h)<\/li>\n<\/ul>\n<p>The library is backwards compatible to the above mentioned code. Its is written in plain C and can be used in C++ code.<\/p>\n<p>(C) A. Schiffler, aschiffler [at] ferzkopp.net 1999-2018, licensed under the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Zlib_License\">zlib license<\/a><\/p>\n<h5>Screenshots<\/h5>\n<div align=\"center\">\n<table border=\"0\" width=\"310\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"129\"><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/Screenshots\/SDL_gfxPrimitives.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 0px 18px;\" src=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/Screenshots\/SDL_gfxPrimitives-thumb.jpg\" alt=\"\" width=\"64\" height=\"48\"><\/a><br \/>\nSDL_gfxPrimitives<\/td>\n<td valign=\"top\" width=\"179\"><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/Screenshots\/SDL_rotozoom.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 0px 18px;\" src=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/Screenshots\/SDL_rotozoom-thumb.jpg\" alt=\"\" width=\"64\" height=\"48\"><\/a><br \/>\nSDL_rotozoom<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h5>Documentation<\/h5>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/Docs\/html\/index.html\">Overview and doxygen generated API documentation<\/a><\/p>\n<h5>Downloads<\/h5>\n<p>Latest Version (Ver 2.0.27 &#8211; Sun Dec 10 2023)<\/p>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/SDL_gfx-2.0.27.tar.gz\">SDL_gfx-2.0.27.tar.gz<\/a> (or on <a href=\"https:\/\/sourceforge.net\/projects\/sdlgfx\/files\/\">SourceForge<\/a>; see also <a href=\"https:\/\/sourceforge.net\/p\/sdlgfx\/code\/HEAD\/tree\/ChangeLog\" target=\"_blank\" rel=\"noopener\">ChangeLog<\/a>)<\/p>\n<p>Current Development Version via SVN<\/p>\n<p><em><a href=\"https:\/\/sourceforge.net\/projects\/sdlgfx\/\">https:\/\/sourceforge.net\/projects\/sdlgfx\/<\/a><\/em><\/p>\n<p>Older Releases<br \/>\n<a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/SDL_gfx-2.0.26.tar.gz\">SDL_gfx-2.0.26.tar.gz<\/a><\/p>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/SDL_gfx-2.0.25.tar.gz\">SDL_gfx-2.0.25.tar.gz<\/a><\/p>\n<p><a href=\"http:\/\/www.ferzkopp.net\/Software\/SDL_gfx-2.0\/SDL_gfx-2.0.24.tar.gz\">SDL_gfx-2.0.24.tar.gz<\/a><\/p>\n<h5>Supported Platforms<\/h5>\n<p>The library compiles and is tested for a Linux target (gcc compiler) and a Win32 target (VisualC, xmingw32 cross-compiler) as well as BeOS and MacOS X PowerBuilder See README for VC and PowerBuilder compile information. When using the cross-compiler (available on the author&#8217;s homepage), the build process generates .DLLs. You can use the command line &#8216;LIB.EXE&#8217; tool to generate VC6 compatible .LIB files for linking purposes.<\/p>\n<h5>Language Interfaces<\/h5>\n<p>SDL_gfx has been integrated with the following language interfaces:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.freepascal-meets-sdl.net\">Pascal<\/a>: http:\/\/www.freepascal-meets-sdl.net<\/li>\n<li><a href=\"http:\/\/sdl.perl.org\">Perl<\/a>: http:\/\/sdl.perl.org<\/li>\n<li><a href=\"http:\/\/www.pygame.org\">Python<\/a>: http:\/\/www.pygame.org<\/li>\n<li><a href=\"http:\/\/cs-sdl.sourceforge.net\">C#<\/a>: http:\/\/cs-sdl.sourceforge.net<\/li>\n<li><a href=\"http:\/\/www.egsl.retrogamecoding.org\/\">Lua<\/a>: http:\/\/www.egsl.retrogamecoding.org<\/li>\n<\/ul>\n<h5>Notes on Graphics Primitives<\/h5>\n<p>Care has been taken so that all routines are fully alpha-aware and can blend any primitive onto the target surface if ALPHA&lt;255. Surface depths supported are 1,2,3 and 4 bytes per pixel. Surface locking is implemented in each routine and the library should work well with hardware accelerated surfaces. Currently, The following Anti-Aliased drawing primitives are available:<\/p>\n<ul>\n<li>AA-line<\/li>\n<li>AA-circle<\/li>\n<li>AA-ellipse<\/li>\n<li>AA-polygon (not filled)<\/li>\n<\/ul>\n<h5>Interface<\/h5>\n<pre>Please check README in archive and .h files for up-to-date interface information.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Graphics drawing primitives and other support functions wrapped up in an add-on, C-based library for the Simple Direct Media (SDL) cross-platform API layer. SDL_gfx supports the original SDL1 library using software surfaces, and SDL2_gfx supports SDL2 using rendering functions.<\/p>\n","protected":false},"author":1,"featured_media":125,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[22],"tags":[36,37,39,38],"class_list":["post-67","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-c","tag-sdl","tag-sdl2_gfx","tag-sdl_gfx"],"_links":{"self":[{"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":25,"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":636,"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/posts\/67\/revisions\/636"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/media\/125"}],"wp:attachment":[{"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ferzkopp.net\/wordpress\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}