{"id":18847832,"url":"https://github.com/interkosmos/sdl77","last_synced_at":"2025-04-14T08:10:52.956Z","repository":{"id":58094614,"uuid":"529947692","full_name":"interkosmos/sdl77","owner":"interkosmos","description":"SDL 1.2 abstraction library for FORTRAN 77","archived":false,"fork":false,"pushed_at":"2024-01-05T00:02:48.000Z","size":343,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T21:46:47.483Z","etag":null,"topics":["fortran","fortran-77","fortran77","game-dev","sdl","sdl-image","sdl-mixer"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interkosmos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-08-28T18:35:59.000Z","updated_at":"2025-01-13T21:39:30.000Z","dependencies_parsed_at":"2023-02-08T13:31:48.831Z","dependency_job_id":"99584200-1df7-4049-8f62-b3aa384884ef","html_url":"https://github.com/interkosmos/sdl77","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"a0f5ac6f7bc433f88fba5a39cf7cb0c7bcd42373"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Fsdl77","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Fsdl77/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Fsdl77/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Fsdl77/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interkosmos","download_url":"https://codeload.github.com/interkosmos/sdl77/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248843867,"owners_count":21170492,"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":["fortran","fortran-77","fortran77","game-dev","sdl","sdl-image","sdl-mixer"],"created_at":"2024-11-08T03:09:50.125Z","updated_at":"2025-04-14T08:10:52.927Z","avatar_url":"https://github.com/interkosmos.png","language":"C","funding_links":[],"categories":["Codes"],"sub_categories":["Graphics, Plotting, User Interfaces"],"readme":"# SDL 77\n\nSDL 77 is a C library for game development in FORTRAN 77 that provides\nsome glue code to access the software renderer of SDL 1.2. Common\n[FORTRAN/C calling conventions](https://www.math.utah.edu/software/c-with-fortran.html)\nare used for mixed-language programming (compatible to f77, f2c, g77,\nGNU Fortran, Digital/Compaq, Portland Group, SGI, Sun, …). For modern\nFortran 2008 interface bindings to SDL 2.0, see\n[fortran-sdl2](https://github.com/interkosmos/fortran-sdl2).\n\nThe library has the following dependencies:\n\n* SDL 1.2\n* SDL_image\n* SDL_mixer\n\nYou may have to install additional development headers. See the\n[documentation](API.md) for the API description.\n\n## Build Instructions\n\nFirst, install the dependencies. On FreeBSD, run:\n\n```\n# pkg install audio/sdl_mixer devel/sdl12 graphics/sdl_image\n```\n\nThen, build `libSDL77.a` with GCC by executing the provided Makefile:\n\n```\n$ make\n```\n\nYou may want to compile the library without the SDL_image dependency\n(restricting the supported image formats to BMP only):\n\n```\n$ make noimage\n```\n\nTo build without SDL_mixer, run:\n\n```\n$ make nomixer\n```\n\nAnd only bare SDL 1.2, without SDL_image and SDL_mixer:\n\n```\n$ make nolibs\n```\n\nLink your FORTRAN 77 program against `libSDL77.a -lSDL -lSDL_image -lSDL_mixer`.\nAlternatively, you can simply link with object file `SDL77.o` instead of\n`libSDL77.a`.\n\n## Example\n\nThe following example program `demo.f` in ANSI FORTRAN 77 opens an SDL\n1.2 window and fills a green rectangle.\n\n```fortran\nC     ******************************************************************\nC\nC     SDL 77 DEMO PROGRAM IN FORTRAN 77.\nC\nC     ******************************************************************\n      PROGRAM DEMO\nC\nC     EXTERNAL PROCEDURES.\nC\n      EXTERNAL GCLOSE, GOPEN\n      EXTERNAL GCOLOR, GDELAY, GEVENT, GFILLR, GFLUSH, GLAYER\n      INTEGER  GKEY\nC\nC     PARAMETERS.\nC\n      INTEGER EQUIT, IDELAY, IW, IH, KESC\n      PARAMETER (EQUIT=12, IDELAY=50, IW=640, IH=480, KESC=27)\nC\nC     VARIABLES.\nC\n      INTEGER IEVENT, ISTAT\n      LOGICAL DONE\n      DATA DONE /.FALSE./\nC\nC     OPEN SDL 1.2 WINDOW.\nC\n      CALL GOPEN(IW, IH, 'FORTRAN' // ACHAR(0), ISTAT)\n      IF (ISTAT .NE. 0) STOP\nC\nC     MAIN LOOP: POLLS EVENTS, FILLS RECTANGLE, FLIPS BUFFER TO SCREEN.\nC\n   10 CONTINUE\nC\nC     PROCESS EVENTS.\nC\n   20 CONTINUE\n      CALL GEVENT(IEVENT, ISTAT)\n      IF (IEVENT .EQ. EQUIT) DONE = .TRUE.\n      IF (ISTAT .EQ. 1) GOTO 20\nC\nC     PROCESS KEYBOARD INPUT.\nC\n      IF (GKEY(KESC) .EQ. 1) DONE = .TRUE.\nC\nC     FILL RECTANGLE.\nC\n      CALL GLAYER(0)\n      CALL GCOLOR(0, 255, 0)\n      CALL GFILLR(50, 50, 150, 150)\nC\nC     FLIP TO SCREEN.\nC\n      CALL GFLUSH()\n      CALL GDELAY(IDELAY)\n      IF (.NOT. DONE) GOTO 10\nC\nC     QUIT.\nC\n      CALL GCLOSE()\n      END\n```\n\nLink the demo program against SDL 77, SDL, SDL_image, and SDL_mixer:\n\n```\n$ gfortran -o demo demo.f libSDL77.a -lSDL -lSDL_image -lSDL_mixer\n$ ./demo\n```\n\nTo compile without SDL_image and SDL_mixer, run:\n\n```\n$ make nolibs\n$ gfortran -o demo demo.f libSDL77.a -lSDL\n$ ./demo\n```\n\nThe code is compatible to f2c as well:\n\n```\n$ f2c demo.f\ndemo.f:\n   MAIN demo:\n$ gcc -o demo demo.c libSDL77.a -lSDL -lSDL_image -lSDL_mixer -lf2c -lm\n$ ./demo\n```\n\n## Further Examples\n\nSome example programs can be found in directory `examples/`:\n\n* **archi** draws the Archimedean spiral.\n* **bship** draws the burning ship fractal.\n* **engine** renders a 2.5-D environment through ray-casting.\n* **fern** draws a Barnsley fern fractal.\n* **fire** renders the DOOM fire effect.\n* **fizzle** demonstrates a fizzle-fade effect based on Fisher-Yates shuffle.\n* **flower** draws a sunflower fractal.\n* **font** prints text with a bitmap font.\n* **mode7** shows affine transformation for perspective correction.\n* **plasma** renders animated [plasma effect](https://en.wikipedia.org/wiki/Plasma_effect).\n* **root3** is another fractal demo.\n* **shuttle** renders the wireframe model of a space shuttle.\n* **smoke** renders a 3-D chaotic attractor.\n* **sphere** draws a shaded sphere.\n* **track** plays audio track in OGG format and optionally WAV sound effect.\n\nBuild the examples with:\n\n```\n$ make examples\n```\n\n## Licence\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterkosmos%2Fsdl77","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterkosmos%2Fsdl77","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterkosmos%2Fsdl77/lists"}