{"id":17190274,"url":"https://github.com/sezero/sdl_gfx","last_synced_at":"2025-06-16T08:33:57.584Z","repository":{"id":73376053,"uuid":"436631005","full_name":"sezero/SDL_gfx","owner":"sezero","description":"SDL_gfx -- fork from the sourceforge svn repo","archived":false,"fork":false,"pushed_at":"2024-04-06T10:57:12.000Z","size":2982,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T16:34:39.569Z","etag":null,"topics":["sdl","sdl-gfx"],"latest_commit_sha":null,"homepage":"https://sourceforge.net/projects/sdlgfx/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sezero.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-09T13:40:41.000Z","updated_at":"2025-04-18T20:15:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"54e4c284-b873-4361-97e5-f79df03cc740","html_url":"https://github.com/sezero/SDL_gfx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sezero/SDL_gfx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sezero%2FSDL_gfx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sezero%2FSDL_gfx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sezero%2FSDL_gfx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sezero%2FSDL_gfx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sezero","download_url":"https://codeload.github.com/sezero/SDL_gfx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sezero%2FSDL_gfx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260126642,"owners_count":22962668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sdl","sdl-gfx"],"created_at":"2024-10-15T01:13:51.942Z","updated_at":"2025-06-16T08:33:57.547Z","avatar_url":"https://github.com/sezero.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"/*!\n\n\n\\mainpage SDL_gfx - SDL-1.2 graphics drawing primitives, rotozoom and other supporting functions\n\n\n\\section contact_sec Contact and License\n\nEmail aschiffler at ferzkopp dot net to contact the author or better check\nauthor's homepage at http://www.ferzkopp.net for the most up-to-date\ncontact information.\n\nThis library is licenced under the zlib License, see the file LICENSE for details. \n\n\n\\section intro_sec Introduction\n\nThe SDL_gfx library evolved out of the SDL_gfxPrimitives code which\nprovided basic drawing routines such as lines, circles or polygons for \nSDL Surfaces and adding a couple other useful functions for zooming \nimages for example and doing basic image processing on byte arrays.\n\nNote that SDL_gfx is compatible with SDL version 1.2 (not SDL2).\nA contributed patch to enable compilation of SDL_gfx against SDL2 \nwith CMake is provided in the \"Other Builds\" folder.\n\nThe current components of the SDL_gfx library are:\n- Graphic Primitives (SDL_gfxPrimitives.h, SDL_gfxPrimitives.c)\n- Rotozoomer (SDL_rotozoom.h, SDL_rotozoom.c)\n- Framerate control (SDL_framerate.h, SDL_framerate.c)\n- MMX image filters (SDL_imageFilter.h, SDL_imageFilter.c)\n- Custom Blit functions (SDL_gfxBlitFunc.h, SDL_gfxBlitFunc.c)\n- Build-in 8x8 Font (SDL_gfxPrimitives_font.h)\n\n\n\n\\subsection notes_gfx Notes on Graphics Primitives\n\nCare has been taken so that all routines are fully alpha-aware and can \nblend any primitive onto the target surface if ALPHA\u003c255. Surface depths \nsupported are 1,2,3 and 4 bytes per pixel. Surface locking is implemented\nin each routine and the library should work well with hardware \naccelerated surfaces. \n\n\\htmlonly\n\u003ca href=\"../Screenshots/SDL_gfxPrimitives.jpg\" target=\"_blank\" title=\"SDL_gfxPrimitives Screenshot\"\u003e\u003cimg src=\"../Screenshots/SDL_gfxPrimitives-thumb.jpg\" border=\"0\" hspace=\"5\"\u003e\u003c/a\u003e\u003cbr /\u003e\n\\endhtmlonly\n\nCurrently, The following Anti-Aliased drawing primitives are available:\n- AA-line\n- AA-polygon\n- AA-circle\n- AA-ellipse\n\nNote: All ___Color routines expect the color to be in the format 0xRRGGBBAA.\n\n\\subsection notes_roto Notes on Rotozoomer\n\nThe rotozoom code is not ASM-speed quality, but it should be fast enough \neven for some realtime effects if the CPU is good or bitmaps small.\nWith interpolation the routines are typically used for pre-rendering stuff \nin higher quality (i.e. smoothing) - that's also the reason why the API differs \nfrom SDL_BlitRect() - as they create a new target surface each time rotozoom \nis called. The final rendering speed is dependent on the target surface\nsize as it is beeing xy-scanned when rendering the new surface.\n\n\\htmlonly\n\u003ca href=\"../Screenshots/SDL_rotozoom.jpg\" target=\"_blank\" title=\"SDL_rotozoom Screenshot\"\u003e\u003cimg src=\"../Screenshots/SDL_rotozoom-thumb.jpg\" border=\"0\" hspace=\"5\"\u003e\u003c/a\u003e\u003cbr /\u003e\n\\endhtmlonly\n\nNote also that the smoothing toggle is dependent on the input surface bit \ndepth. 8bit surfaces will \\b never be smoothed - only 32bit surfaces will.\n\nNote that surfaces of other bit depth then 8 and 32 will be converted \non the fly to a 32bit surface using a blit into a temporary surface. This \nimpacts performance somewhat.\n\nSmoothing (interpolation) flags work only on 32bit surfaces:\n\\verbatim\n #define SMOOTHING_OFF\t\t0\n #define SMOOTHING_ON\t\t1\n\\endverbatim\n \n\\subsection notes_rate Notes on Framerate Manager\n\nThe framerate functions are used to insert delays into the graphics loop\nto maintain a constant framerate.\n\nThe implementation is more sophisticated that the usual\n\\verbatim\n\tSDL_Delay(1000/FPS); \n\\endverbatim\ncall since these functions keep track of the desired game time per frame \nfor a linearly interpolated sequence of future timing points of each frame. \nThis is done to avoid rounding errors from the inherent instability in the \ndelay generation and application.\n\n\\htmlonly\n\u003ca href=\"../framerate.png\" target=\"_blank\" title=\"Framerate Diagram\"\u003e\u003cimg src=\"../framerate-thumb.png\" border=\"0\"\u003e\u003c/a\u003e\u003cbr /\u003e\n\\endhtmlonly\n\ni.e. the 100th frame of a game running at 50Hz will be accurately\n2.00sec after the 1st frame (if the machine can keep up with the drawing).\n\nThe functions return 0 or 'value' for sucess and -1 for error. All functions\nuse a pointer to a framerate-manager variable to operate.\n\n\n\\subsection notes_filter Notes on ImageFilters\n\nThe imagefilter functions are a collection of MMX optimized routines that\noperate on continuous buffers of bytes - typically greyscale images from \nframegrabbers and such - performing functions such as image addition and \nbinarization. All functions (almost ... not the the convolution routines) \nhave a C implementation that is automatically used on systems without MMX \ncapabilities.\n\nThe compiler flag -DUSE_MMX toggles the conditional compile of MMX assembly.\nAn assembler must be installed (i.e. \"nasm\").\n\n\n\\subsection notes_blitters Notes on Custom Blitters\n\nThe custom blitter functions provide (limited) support for surface\ncompositing - that is surfaces can be blitted together, and then\nstill blitted to the screen with transparency intact.\n\n\\subsection platforms Supported Platforms\n\n\\subsubsection platformlinux Unix/Linux\n\nThe library compiles and is tested for a Linux target (gcc compiler) via the\nthe usual configure;make;make install sequence.\n\n\\subsubsection platformwindows Windows\n\nA Win32 target is available (VisualC, mingw32, xmingw32 cross-compiler).\n\nVS2022\n\n- Download SDL sources from https://github.com/libsdl-org/SDL-1.2\n- Place files into directory along the SDL_gfx source folder as \"SDL-1.2\" folder\n- Recompile SDL using VS2022 (note SDL's README for instructions of config file)\n- Open SDL_gfx.sln in VS2022 and recompile all\n- Manually copy the SDL.sll into the target folder of Test programs\n\nSee \"Other Builds\" for additional makefiles (likely out of date, since not maintained).\n\nWhen using the cross-compiler (available on the author's homepage, very\nout of date), the build process generates .DLLs. You can use the command \nline 'LIB.EXE' tool to generate VC6 compatible .LIB files for linking \npurposes. \n\n\\subsubsection platformosx Mac OSX \n\nThe usual autotools build chain should be used. MacPorts or fink may \nbe required (that's what the author uses).\n\nXcode is supported via templates. See \"Other Builds\" folder Xcode3+.zip -\nthis template only supports SDL_gfx and not the tests. For this template, the\nDeployment Target (the lowest version to run on) is set to 10.5 and expects\nthe SDL.framework preinstalled in some default location\n(either /Library/Frameworks, or ~/Library/Frameworks). \n\nOlder targets are also reported to work (10.3+ native and Project Builder). \n\n\\subsubsection platformqnx QNX\n\nQNX was reported to build (see .diff in \"Other Builds\").\n\n\\subsubsection platformzune Zune\n\nZuneHD (WinCE 6 ARM) is reported to build (see OpenZDK in \"Other Builds\").\nNote that between rendering on the Zune's ARM CPU and constantly uploading\ntextures to the GPU, SDL_gfx is going to be slow. Also, the libc math \nfunctions all use software FP emulation even when VFP floating point\nsupport is turned on in the compiler, so there's extra overhead due to that\nas well.\n\n\\subsubsection platformothers Others\n\nOther platforms might work but have not been tested by the author.\nPlease check the file \"INSTALL\" as well as the folder \"Other Builds\".\n\nSee also section \"Installation\" below for more build instructions.\n\n\\section install_sec Installation\n\n\\subsection unix Unix/Linux\n\nTo compile the library your need the SDL 1.2 installed from source or \ninstalled with the 'devel' RPM package. For example on Mandriva, run:\n\\verbatim\n\turpmi  libSDL1.2-devel\n\\endverbatim\n\nThen run\n\\verbatim\n\t./autogen.sh\t# (optional, recommended)\n\t./configure\n\tmake\n\tmake install\n\tldconfig\n\\endverbatim\n\nto compile and install the library. The default location for the \ninstallation is /usr/local/lib and /usr/local/include. The libary \npath might need to be added to the file:\n\t/etc/ld.so.conf\n\nRun the shell script 'nodebug.sh' before make, to patch the makefile \nfor optimized compilation:\n\\verbatim\n\t./autogen.sh\t# (optional, recommended)\n\t./configure\n\t./nodebug.sh\n\tmake\n\tmake install\n\tldconfig\n\\endverbatim\n\nCheck the folder \"Other Builds\" for alternative makefiles.\n\n\\subsection prep Build Prep\n\nRun autogen.sh or manually:\n\\verbatim\n\taclocal --force\n\tlibtoolize --force --copy\n\tautoreconf -fvi\n\\endverbatim\n\n\\subsection nommx No-MMX\n\nTo build without MMX code enabled (i.e. PPC or for AMD64 architecture\nwhich is missing pusha/popa):\n\\verbatim\n\t./configure --disable-mmx\n\tmake\n\tmake install\n\\endverbatim\ni.e. to build on MacOSX 10.3+ use:\n\\verbatim\n\t./configure --disable-mmx \u0026\u0026 make\n\\endverbatim\n\n\\subsection vs9 Windows (VC9, VS2010)\n\nOpen SDL_gfx_VS2010.sln solution file and review README.\n\n\\subsection vs8 Windows (VC8, VS2008)\n\nOpen SDL_gfx_VS2008.sln solution file and review README.\n\n\n\\subsection vc6 Windows (VC6/7)\n\nSee folder Other Builds.\n\nTo create a Windows DLL using VisualC6:\n\\verbatim\n\tunzip -a VisualC6.zip\n\tvcvars32.bat\n\tcopy VisualC/makefile\n\tnmake\n\\endverbatim\nor\n\\verbatim\n\tunzip -a VisualC7.zip\n\\endverbatim\nand open the project file.\n\n\n\\subsection wince WindowsCE\n\nSee folder Other Builds.\n\nMay need workaround for missing lrint.\n\n\n\\subsection cross Cross-Compilation\n\nTo build using mingw32 on Win32, check the makefile contained in mingw.zip\n\nTo create a Windows DLL using the xmingw32 cross-compiler:\n\\verbatim\n\tcross-configure\n\tcross-make\n\tcross-make install\n\\endverbatim\n\nSpecify the path to your cross-compiled 'sdl-config', and invoke\n'./configure' with the '--host' and '--build' arguments. For example,\nto cross-compile a .DLL from GNU/Linux:\n\\verbatim\n\tSDL_CONFIG=/usr/local/cross-tools/i386-mingw32msvc/bin/sdl-config \\\n\t\t./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu\n\tmake\n\tmake install\n\\endverbatim\n\n\\subsection qnx QNX\n\nTo build on QNX6, patch first using:\n\\verbatim\n\tpatch -p0 \u003cQNX.diff\n\\endverbatim\n\n\\subsection osx OSX\n\nUse standard unix build sequence.\n\nTo build on MacOS X with Project Builder, follow these steps:\n- Update your developer tools to the lastest version.\n- Install the SDL Developers framework for Mac OS X.\n- Download the latest SDL_gfx source distribution and extract the\n\tarchive in a convenient location.\n- Extract the included OSX-PB.tgz archive into the\n\ttop directory of the SDL_gfx distribution (from step 3). This will create a\n\tPB that contains the project files.\n- The project has targets for the SDL_gfx framework and the four test\n\tprograms. All can be built using the 'deployment' or 'development' build\n\tstyles. \n\nA newer version for MaxOS X is included in the OSX-PB-XCode.zip archive. The \nupdated version uses relative pathnames where appropriate, and pointers to \nthe standard  installation location of SDL. However, it may require XCode in \norder to be used.\n\n\\section interfaces_sec Language Interfaces\n\nSDL_gfx has been integrated with the following language interfaces:\n- Pascal: http://www.freepascal-meets-sdl.net\n- Perl: http://sdl.perl.org\n- Python: http://www.pygame.org\n- C#: http://cs-sdl.sourceforge.net\n- Lua: http://www.egsl.retrogamecoding.org/\n- Oberon: http://sourceforge.net/projects/sdl-for-oberon/\n\n\\section test_sec Test Programs\n\nChange to the ./Test directory and run\n\\verbatim\n\t./autogen.sh\n\t./configure\n\tmake\n\\endverbatim\nto create several test programs for the libraries functions. This requires\nthe library to be previously compiled and installed.\n\n\nSee the source code .c files for some sample code and implementation hints.\n\n\n\\section contrib_sec Contributors\n\n- Fix for filledbox by Ingo van Lil, inguin at gmx.de - thanks Ingo.\n\n- Non-alpha line drawing code adapted from routine \n  by Pete Shinners, pete at shinners.org - thanks Pete.\n\n- More fixes by Karl Bartel, karlb at gmx.net - thanks Karl.\n\n- Much testing and suggestions for fixes from Danny van Bruggen,\n  danny at froukepc.dhs.org - thanks Danny.\n\n- Original AA-circle/-ellipse code idea from Stephane Magnenat, \n  nct at wg0.ysagoon.com - thanks Stephane.\n\n- Faster blending routines contributed by Anders Lindstroem,\n  cal at swipnet.se - thanks Anders.\n\n- New AA-circle/-ellipse code based on ideas from Anders Lindstroem - \n  thanks Anders.\n\n- VisualC makefile contributed by Danny van Bruggen, \n  danny at froukepc.dhs.org - thanks Danny.\n\n- VisualC7 project file contributed by James Turk, \n  jturk at conceptofzero.com - thanks James.\n\n- Project Builder package contributed by Thomas Tongue, \n  TTongue at imagiware.com - Thanks Thomas.\n\n- Fix for filledPolygon contributed by Kentaro Fukuchi \n  fukuchi at is.titech.ac.jp - Thanks Kentaro.\n\n- QNX6 patch contributed by Mike Gorchak,\n  mike at malva.ua - Thanks Mike.\n\n- Pie idea contributed by Eike Lange,\n  eike.lange at uni-essen.de - Thanks Eike.\n\n- Dynamic font setup by Todor Prokopov,\n  koprok at dir.bg - Thanks Todor.\n\n- Horizontal/Vertical flipping code by Victor (Haypo) \n  Stinner, victor.stinner at haypocalc.com - Thanks Victor.\n\n- OSX build fixes by Michael Wybrow, \n  mjwybrow at cs.mu.oz.au - Thanks Michael.\n\n- gcc3.4 build fixes by Dries Verachtert, \n  dries at ulyssis.org - Thanks Dries.\n\n- Updated OSX build by Brian Rice,\n  water451 at gmail.com - Thanks Brian.\n\n- aaellipse issues pointed out by Marco Wertz,\n  marco.wertz at gmx.de - Thanks Marco.\n\n- texturedPolygon idea and code by Kees Jongenburger,\n  kees.jongenburger at gmail.com - Thanks Kees.\n \n- Several bugfixes contributed by Sigborn Skjaeret, \n  cisc at broadpark.no - Thanks CISC.\n\n- Syntax error for C++ found by Olivier Boudeville,\n  olivier.boudeville at online.fr - Thanks Olivier.\n\n- hline/vline clipping fixes found by Daniel Roggen,\n  droggen at gmail.com and Mikael Thieme, \n  mikael.thieme at his.se - Thanks Daniel+Mikael.\n\n- rotozoom fix for big-endian machines (i.e. PPC)\n  by Julian Mayer, julianmayer at mac.com - Thanks\n  Julian.\n\n- Cross-compilation notes contributed by Sylvain\n  Beucler, beuc at beuc.net - Thanks Sylvain.\n\n- Fix duplicate pixel renders in circleColor contributed\n  by David Raber, lotharstar at gmail.com - Thanks David.\n\n- New arcColor (and arcRGBA) routine contributed\n  by David Raber, lotharstar at gmail.com - Thanks David.\n\n- Idea for polygonColorMT and texturePolygonMT routines for\n  multithreaded operation contributed by \"unknown\" -\n  Thank you.\n\n- Multiple patches applied and repackaged version 2.0.18\n  by Paul, sweetlilmre at gmail.com - Thanks Paul and\n  other contributors of patches.\n\n- Change to avoid gcc4 compiler warnings contributed by Thien-Thi\n  nguyen, ttn at gnuvola.org - thanks Thi. \n\n- hline 1bpp off-by-one patch contributed by Manuel Lausch\n  mail at manuellausch.de - Thanks Manuel.\n\n- pkg-config support contributed by Luca Bigliardi, shammash\n  at artha.org - thanks Luca.\n\n- Updated mingw Makefile contributed by Jan Leike, jan dot leike \n  at gmx dot net - thanks Jan.\n\n- Rotozoom debugging help by Jeff Wilges, heff at ifup dot us -\n  thanks Jeff.\n\n- Build updates provided by Barry deFreese, bdefreese at debian \n  dot org - thanks Barry.\n\n- Fix for 1-pixel postponement with 8bit scaling by Sylvain Beucler, \n  beuc at beuc dot net - thanks Sylvain.\n\n- Updates to headers and configure to allow for cross-compiling \n  to DLL (not just static .a) and fixes for compiling on Windows \n  using autotools by Sylvain Beucler, beuc at beuc dot net - thanks Sylvain.\n\n- Added Visual CE Project to Builds. Contributed by vrichomme at smartmobili\n  dot com - thanks.\n\n- Added Symbian and Windows 64bit fix with lrint function by Rene \n  Dudfield, renesd at gmail dot com - thanks Rene.\n\n- Fixes for Rotate90 0-degree case by Chris Allport, chris dot allport\n  at gmail dot com - thanks Chris.\n\n- Fixed for Win32 build support defines by tigerfishdaisy (SF) - thanks\n  Tiger Tiger.\n\n- Patch for OpenSDK contributed by itsnotabigtruck at ovi dot com - thanks\n  IsNotABigTruck.\n\n- OSX Xcode 3+ template ZIP contributed by marabus at meta dot ua - thanks\n  Vasyl.\n\n- Memory leak/error check patch for zoomSurface contributed by \n  RodolfoRG - thanks Rodolfo.\n\n- Zoom scaling factor rounding bugfix patch contributed by WanderWander\n  Lairson Costa - thanks Wander.\n\n- Suggestions for speed improvements contributed by inkyankes - thanks.\n\n- Pixel blend routine patches contributed by mitja at lxnav dot com -\n  thanks Mitja.\n\n- ImageFilter patches contributed by beuc at beuc dot net - thanks Sylvain.\n\n- Bug reports contributed by Yannick dot Guesnet at univ-rouen dot fr -\n- thanks Yannick.\n\n\\section changelog_sec Change Log\n\n\\verbinclude ChangeLog\n\n*/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsezero%2Fsdl_gfx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsezero%2Fsdl_gfx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsezero%2Fsdl_gfx/lists"}