🎮 SDL2 bindings for gawk
gawk-sdl2 provides a shared library extension for gawk to use the SDL2 library.
Note
This is an experimental project with a very limited number of available functions. Additionally, due to gawk storing all numbers as double-precision floating point numbers, it may not function properly on 64-bit systems.
- GNU awk (>= 4.2.1)
- SDL 2.0 headers and libraries
- SDL_mixer 2.0 headers and libraries
# Debian-based distributions
sudo apt install build-essential
sudo apt install libsdl2-dev libsdl2-mixer-dev
# Fedora-based distributions
sudo dnf groupinstall "Development Tools" "Development Libraries"
sudo dnf install SDL2-devel SDL2_mixer-devel
# Arch-based distributions
sudo pacman -S base-devel
sudo pacman -S sdl2 sdl2_mixergit clone https://github.com/mikkun/gawk-sdl2.gitcd gawk-sdl2
makecd examples
AWKLIBPATH=.. ./pong.awkSee examples/*.awk for usage.
🚧 Functions are being implemented as needed. The functions currently implemented are as follows:
SDL_AllocFormatSDL_AllocPaletteSDL_BlitSurfaceSDL_CreateRGBSurfaceSDL_CreateRGBSurfaceWithFormatSDL_CreateRendererSDL_CreateTextureSDL_CreateTextureFromSurfaceSDL_CreateWindowSDL_DelaySDL_DestroyRendererSDL_DestroyTextureSDL_DestroyWindowSDL_FillRectSDL_FreeFormatSDL_FreePaletteSDL_FreeSurfaceSDL_Gawk_AllocColorPaletteSDL_Gawk_AllocEventSDL_Gawk_AllocRectSDL_Gawk_GetEventTypeSDL_Gawk_GetKeyboardStateSDL_Gawk_GetPixelColorSDL_Gawk_PixelFormatEnumToArraySDL_Gawk_PixelFormatToArraySDL_Gawk_SetPixelColorSDL_Gawk_SurfaceToArraySDL_Gawk_UpdateColorPaletteSDL_Gawk_UpdateRectSDL_GetErrorSDL_GetPixelFormatNameSDL_GetTicksSDL_GetWindowPixelFormatSDL_GetWindowSurfaceSDL_HasIntersectionSDL_InitSDL_InitSubSystemSDL_MapRGBASDL_MasksToPixelFormatEnumSDL_PollEventSDL_QuitSDL_QuitSubSystemSDL_RenderClearSDL_RenderCopySDL_RenderDrawLineSDL_RenderDrawRectSDL_RenderFillRectSDL_RenderPresentSDL_SetPaletteColorsSDL_SetRenderDrawColorSDL_SetSurfacePaletteSDL_SetWindowTitleSDL_ShowSimpleMessageBoxSDL_UpdateTextureSDL_UpdateWindowSurfaceSDL_VERSIONNUM
Mix_AllocateChannelsMix_CloseAudioMix_FreeChunkMix_FreeMusicMix_Gawk_Linked_VersionMix_Gawk_QuerySpecMix_GetErrorMix_HaltChannelMix_HaltMusicMix_LoadMUSMix_LoadWAVMix_OpenAudioMix_PlayChannelMix_PlayChannelTimedMix_PlayMusicMix_PlayingMix_PlayingMusicMix_SetDistanceMix_SetMusicCMDMix_SetMusicPositionMix_SetPanningMix_SetPositionMix_SetReverseStereoMix_VolumeMusic
- Implement more functions.
