All Projects → andrewrk → Zig Sdl

andrewrk / Zig Sdl

Licence: other
self-contained SDL2 package for Zig

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Zig Sdl

Nanogui Sdl
Minimalistic port of NanoGUI claim works with SDL API w/o external dependencies.
Stars: ✭ 328 (+1161.54%)
Mutual labels:  sdl
Lambdahack
Haskell game engine library for roguelike dungeon crawlers; please offer feedback, e.g., after trying out the sample game with the web frontend at
Stars: ✭ 439 (+1588.46%)
Mutual labels:  sdl
Falltergeist
Opensource crossplatform Fallout 2™ game engine writen in C++ and SDL.
Stars: ✭ 668 (+2469.23%)
Mutual labels:  sdl
Magnum
Lightweight and modular C++11 graphics middleware for games and data visualization
Stars: ✭ 3,728 (+14238.46%)
Mutual labels:  sdl
Fiber2d
Cross-platform 2D Game Engine in pure Swift
Stars: ✭ 415 (+1496.15%)
Mutual labels:  sdl
Zep
Zep - An embeddable editor, with optional support for using vim keystrokes.
Stars: ✭ 477 (+1734.62%)
Mutual labels:  sdl
Pygame
pygame (the library) is a Free and Open Source python programming language library for making multimedia applications like games built on top of the excellent SDL library. C, Python, Native, OpenGL.
Stars: ✭ 4,164 (+15915.38%)
Mutual labels:  sdl
Fortran Sdl2
Fortran 2008 interface bindings to SDL 2.0
Stars: ✭ 18 (-30.77%)
Mutual labels:  sdl
Taisei
A free and open-source Touhou Project fangame
Stars: ✭ 428 (+1546.15%)
Mutual labels:  sdl
Dlangui
Cross Platform GUI for D programming language
Stars: ✭ 642 (+2369.23%)
Mutual labels:  sdl
Railt
⚡️ A PHP GraphQL Framework
Stars: ✭ 353 (+1257.69%)
Mutual labels:  sdl
Libsdl2pp
C++11 bindings/wrapper for SDL2
Stars: ✭ 385 (+1380.77%)
Mutual labels:  sdl
Guislice
GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
Stars: ✭ 534 (+1953.85%)
Mutual labels:  sdl
Drawio Threatmodeling
Draw.io libraries for threat modeling diagrams
Stars: ✭ 327 (+1157.69%)
Mutual labels:  sdl
Tartiflette
GraphQL Engine built with Python 3.6+ / asyncio
Stars: ✭ 719 (+2665.38%)
Mutual labels:  sdl
Anese
Another NES Emulator - written for fun & learning - first implementation of wideNES
Stars: ✭ 323 (+1142.31%)
Mutual labels:  sdl
Wasmwinforms
C# Winforms for Webassembly
Stars: ✭ 444 (+1607.69%)
Mutual labels:  sdl
Blipkit
C library for creating the beautiful sound of old sound chips
Stars: ✭ 23 (-11.54%)
Mutual labels:  sdl
Nya
[WIP] Game Engine written in Crystal
Stars: ✭ 16 (-38.46%)
Mutual labels:  sdl
Devskim
DevSkim is a set of IDE plugins and rules that provide security "linting" capabilities.
Stars: ✭ 576 (+2115.38%)
Mutual labels:  sdl

zig-sdl

Self-contained SDL2 package for Zig.

Current Status

On Linux, I was able to build libSDL2.a and then link an application against it, but there would be no video support:

$ zig build run
INFO: Unable to initialize SDL: No available video device

So then I tried enabling X11, and running into this:

/home/andy/dev/zig-sdl/src/sensor/../events/../video/./khronos/vulkan/./vk_platform.h:113:10: fatal error: 
      'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.

Which means that I need to create an X11 package that this one will depend on. Recursive package dependencies is starting to get into territory where we need Zig package manager to continue.

How to Use this Package

I'm still experimenting. Don't try to use it yet.

Updating to a Newer SDL Version

First, download the new tarball and overwrite all the source files with the new versions. Look at the git diff and make sure that everything that has been overwritten is SDL stuff, not stuff from this package, which is these files:

  • README.md
  • build.zig
  • zig-prebuilt/
  • example/

Next, you'll need access to each supported OS. The current list is:

  • Linux
  • Windows

Linux

TODO docs for configuring

Windows

On a Windows machine, install Microsoft Visual Studio and CMake. Run x64 Native Tools Command Prompt for VS 2019 and execute these commands:

mkdir build-debug
cd build-debug
cmake .. -Thost=x64 -A x64 -DCMAKE_BUILD_TYPE=Debug -DSDL_SHARED=OFF
cd ..
mkdir build-release
cd build-release
cmake .. -Thost=x64 -A x64 -DCMAKE_BUILD_TYPE=Release -DSDL_SHARED=OFF

Next, diff build-debug/include/SDL_config.h and build-release/include/SDL_config.h. When I did this, there were no differences. So, the directories are the same. Delete one of them and use the other one.

Ensure the appropriate subdirectory exists within zig-prebuilt. For example, on 64-bit Windows, it is x86_64-windows-msvc. Copy build-release/include/SDL_config.h to the appropriate subdirectory within zig-prebuilt.

Next, look at a git diff and use your critical thinking skills to determine if anything not mentioned in this README needs to be done.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].