SDL2_gfx  1.0.2
GraphicsprimitivesandsurfacefunctionsforSDL2
SDL2_gfx - Graphics primitives and surface functions for SDL2

Contact and License

Email aschiffler at ferzkopp dot net to contact the author or better check author's homepage at http://www.ferzkopp.net for the most up-to-date contact information.

This library is licenced under the zlib License, see the file LICENSE for details.

Introduction

The SDL2_gfx library provides the basic drawing functions such as lines, circles or polygons provided by SDL_gfx on SDL2 against renderers of SDL2.

The current components of the SDL2_gfx library are:

Note that SDL2_gfx is compatible with SDL version 2.0 (not SDL 1.2).

Installation

Unix/Linux

Use the standard autoconf/automake sequence to compile and install the library.

        ./autogen.sh    # (optional, recommended)
        ./configure
        make
        make install

\subsubsection nommx Linker Configuration

The default location for the installation is /usr/local/lib and /usr/local/include. This libary path may need to be added to the file the linker configuration file:

        vi /etc/ld.so.conf
        ldconfig

\subsubsection nommx Non-MMX Platforms

To build without MMX code enabled (i.e. ARM, PPC, AMD64 architectures):

        ./configure --disable-mmx
        make
        make install

Windows (VS2015)

Open the SDL2_gfx.sln solution file, right click on the solution and choose 'Rebuild'.

The SDL2-2.0.5 folder must be placed in a directory alongside SDL2_gfx (or sdl2gfx-code) and build in the same configuration, i.e. Debug or Release, beforehand so the referenced SDL2.lib file can be found.

Mac OSX

The usual autotools build chain should be used. MacPorts or fink may be required.

Xcode is supported via templates. See Xcode.zip - this template only supports SDL2_gfx and not the tests. For this template, the Deployment Target (the lowest version to run on) is set to 10.11 and expects the SDL2.framework preinstalled in the default location: /Library/Frameworks.

Test Programs

Change to the ./test directory and run

        ./autogen.sh
        ./configure
        make

to create several test programs for the libraries functions. This requires the SDL2_gfx library to be previously compiled and installed.

See the source in the test/*.c files for some sample code and implementation hints.

Documentation

Please refer to the Doxygen-generated API documentation found in the Docs/html folder as well as the test programs in the test folder.

Change Log

SDL2_gfx ChangeLog

Mon, Feb 20, 2017  9:04:29 PM
- version rev to 1.0.3
- updates to VS solution
- update README for VS2015
- fix to rotozoomSurfaceSizeTrig (thanks hydren)
- fix for special case of roundedBoxRGBA (thanks LukeMS)

Thu, Dec 10, 2015  8:11:26 AM
- added XCode.zip (thanks Matthias for contributing)

Sun, Jul 13, 2014  9:21:00 AM
- added TestFramerate

Fri, Jul 11, 2014  7:33:12 PM
- rewrote thick line algorithm using polygon drawing (much less
  code and faster than original Murphy-Bresenham algorithm)
- update TestThickLine accuracy test in TestGfx
- update file headers

Fri, Jul 04, 2014  4:00:21 PM
- rewrote ellipse algorithm used by non-AA line/filled circle/ellipse functions:
  integer midpoint algorithm with 4x overscan for visual accuracy
- fix bugs in TestGfx
- add screenshot image

Sun, Jun 15, 2014  3:12:31 PM
- fixed roundedBox by rewriting algorithm and base it on filledCircle
- fixed textured polygon algorithm
- updated testgfx extensively (visual accuracy tests, updated tests for textured polygon)
- updated README

Mon, Jun 09, 2014  8:48:50 AM
- removed VS2010 solution files; updated VS2012 solution files for SDL2 updates

Mon, Jun 02, 2014  7:36:24 AM
- add patch for pkg-config support (thanks Sylvain)
- update tests to use SDLTest library
- fix commandline parsing in testgfx

Mon, May 12, 2014  7:29:24 AM
- fixed BoxRGBA size-off-by-1 error (thanks Stefan for reporting)

Sun, Feb 02, 2014 12:00:00 PM
- fixed and optimized rotateSurface90Degrees
- updated testrotozoom to allow specification of test range

Sun, Nov 03, 2013 10:11:16 AM
- updated testgfx program for benchmarking primitive rendering performance
- updated test programs based on VS warnings
- fixed VS2012 solution for Release build
 
Mon, Oct 28, 2013  8:00:05 AM
- bugfix to _aaline special cases
- added image filter functions
- added to documentation
- updated readme and changelog
- updated solutions for VS2010 and VS2012

Tue, Sep 04, 2012  8:27:44 AM
- initial release of development version (partially finished)