• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    C
  • License
    zlib License
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sleek multiplatform C++ 2D and 3D game creation!

ZillaLib Game SDK

Welcome to ZillaLib

ZillaLib is a 2D and 3D game creation framework that runs on pretty much every open platform out there. Windows, Linux, macOS, Android, iOS and on the web.

It's a sleek C++ library that compiles to all platforms with zero change in the game code. Truly write once, run everywhere. Of course it is still possible to deviate parts easily where needed. For instance for touchscreen inputs.

The library itself compiles quickly, has zero external dependencies, and links statically adding only around 250kb to the binary size of the game. Still it comes with plenty of features.

Games using ZillaLib

See Games.md for a list. These can be played directly in the web browser or downloaded, and come with full source code under the same license as ZillaLib.

Sample Code

See the ZillaLibSamples repository for short and easy to understand sample code for almost all features.

Tutorials

See the tutorials listing on the ZillaLib website.

ZillaLib Features

Here's a list of features provided by the ZillaLib.

Code

  • Game code implementation is 100% C/C++
  • All platforms get compiled to natively, linked statically
  • No touching of Java, Objective-C, Javascript, C# or anything required
  • Exact same code that debugs on PC runs everywhere else
  • Easy to set up, no dependencies

Platforms

Rendering

  • Drawing of simple 2D geometry (lines, circles, polygons, etc)
  • Surface texture loading (PNG/JPEG)
  • Drawing of surfaces scaled/rotated
  • Buffered batch rendering
  • Repeated texture rendering
  • Tiled textures for tile maps or animations
  • Font rendering
  • Bitmap fonts and TTF fonts
  • Text alignment vertical/horizontal/baseline, automatic line breaks
  • Particle system
  • Custom vertex/fragment shader support

Audio

  • Audio sample loading and playing (OGG)
  • Music streaming and looping
  • Hooks for custom processing
  • Built in chip tune like synthesizer
  • Samples with arbitrary playback speed

Animation

  • Tiled textures for animation
  • Particle system
  • Transition manager for timer/event based animation
  • Bone based physics for 2D ragdoll animations

Math

  • 2D Math library (Vectors, Rects, Rotating Bounding Boxes, etc.)
  • Collision test functions for common interactions (Circle/Line/Boxes tests and sweeps)
  • Easing functions
  • Random Number Generators

Networking

  • UDP based server/client system (based on ENET)
  • Super light weight NAT punch (easily P2P connect, even from mobile to PC)
  • HTTP requests for all platforms including POST data
  • HTTP responses can be loaded as regular files (including textures/audio)

Game

  • Scene manager for splitting game parts
  • Built in transition system for animating scene switch
  • Event system for input, resizing
  • Multitouch input support where available
  • Mobile device motion sensors and joystick support

System

  • Key/Value configuration storage for all platforms
  • Thread support
  • Open URL in default system browser
  • Base64 encoding/decoding
  • Data compression and checksum functions
  • Custom easy to use XML and JSON handling

3D Rendering

  • Scene management with camera and light objects
  • Material (shader) management system
  • Many options for predefined materials but extendable with custom shader code
  • Mesh file loaders (OBJ/PLY/Multi OBJ animation)
  • Mesh generators (plane, box, sphere, ...)
  • Shadow mapping
  • 3D particle system
  • Skeletal mesh with IK

License

ZillaLib is available under the zlib license.

Setting Up a Project

First download this project from GitHub with the 'Download ZIP' button or by cloning the repository.

The library itself compiles automatically with the first project being built, so lets start right away!

By far the easiest way to get started is to use the interactive ZillaLib Project Generator tool which is available online or offline. Just enter a project name and select the target project files to generate.
If you have placed ZillaLib in a directory named dfferent than "ZillaLib" or if you want to place your game project in a directory that is not next to ZillaLib's, you have to specify the relative path in the field 'Path to ZillaLib'. For instance, if you have ZillaLib in "D:\dev\libs\ZillaLib-master" and you plan to put your game project in "D:\dev\proj\MySuperGame", then specify "../../libs/ZillaLib-master" as the path to ZillaLib. Always specify the relative path. It makes it easy to build various platforms and even from different virtual machines in the same place.

When finished, click "Generate and Save Project Archive (ZIP)" and everything will automagically be prepared for you. Extract the project files in the planned location. There's even some sample code included to start up right away. Check the specific platform from the list below on how to set it up and how to actually get your project up and running.

Platforms and Setup

Windows (32 and 64 bit)

Compiling and debugging is done with Visual Studio. All versions are supported (VC6 until VS2019). If you don't have it installed yet, you can download Visual Studio Community Edition here. Make sure "Visual C++" is selected during the installation. Optionally you can also install "Windows XP Support for C++" under the features/packages list.

Once installed, open your GameProject-vs.sln solution file. On your first start-up, it should have your game project selected as the start up project in the Solution Explorer (project name is bold). It should also default to the build configuration "Debug" and the build platform "Win32" on the top of the Visual Studio window. This is fine for now, you can just build and run the sample code with the menu function "Debug / Start Without Debugging".

Windows XP Support

XP support is enabled for VS2013 and older as it does not require any optional packages to be installed. If you use VS2015 or newer and want your output executable files to run on Windows XP, you need to activate the correct toolset by copying 'ZillaLib-vs.props.sample' to 'ZillaLib-vs.props', edit the file and remove the comment tags around <UseXPToolset>1</UseXPToolset>.

Android

See README.md under Android for how to setup and build for Android.

iOS (iPhone/iPad/iPod)

See README.md under ZillaLib-iOS.xcodeproj for how to setup and build for iOS.

WebAssembly

See README.md under WebAssembly for how to setup and build for WebAssembly.

Emscripten

This platform is deprecated, WebAssembly should be used instead.
See README.md under Emscripten for how to setup and build for Emscripten.

Chrome Portable Native Client

This platform is deprecated, WebAssembly should be used instead.
See README.md under NACL for how to setup and build for Native Client.

Linux

See README.md under Linux for how to setup and build for Linux.

macOS

See README.md under ZillaLib-OSX.xcodeproj for how to setup and build for macOS.

Asset File Handling

ZillaLib has various modes of packaging asset files with the game depending mainly on the target platform, but also on build configuration (debug or release) and on the project settings.

How files are loaded

Files are loaded through the ZL_File class. ZL_File can reference actual files on the file system, data in memory, or files inside containers. Containers themselves are a ZL_File, too. When loading files, paths are given relative from the game project directory and are written with forward slashes.

There is a global file container ZL_File::DefaultReadFileContainer which will be used automatically for reading files. Depending on the platform and build configuration, this default container will be automatically set on startup. Generally similar platform types have similar asset handling.

Desktop (Windows, Linux, macOS)

Debug builds always load asset files directly. It is recommended to call the LoadReleaseDesktopDataBundle method at the beginning of Load of your ZL_Application subclass. LoadReleaseDesktopDataBundle takes an optional file name as parameter. It should name a zip-file (does not need a .zip ending) which will be used as the default read file container in release builds.
Alternatively, if your project was set-up with the 'Embed Assets in Binary' option, the optional parameter can be left empty. In that case, the executable binary of the game itself will be loaded as default container. A project with that option enabled will automatically package all assets during the release build process into the output binary just for that.
LoadReleaseDesktopDataBundle does nothing on debug builds as well as non-desktop builds, so it does not need a platform check with if or #if.

Mobile (Android, iOS)

Mobile app packages have a fixed way of packaging and loading files. Therefore all build configurations behave the same and no separate actions are required. On Android, the applications APK package is being loaded as the default read file container on startup. On iOS applications are installed and extracted by the operating system so files can be loaded with no file container.

Web (NACL, Emscripten)

The build process for web targets packages all assets into a single file for distribution. A ZIP file named GAME_Files.dat on NACL and a GAME_Files.js named file for Emscripten.
If your project was set-up with the 'Embed Assets in Binary' option, the asset file will be merged into the main game executable file so distribution becomes a single file.
Because there is no traditional file access on the web, the entire asset file will be loaded into memory on startup and ZL_File instances then read from that memory.

More Repositories

1

dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
C++
765
star
2

TinySoundFont

SoundFont2 synthesizer library in a single C/C++ file
C
631
star
3

wajic

WebAssembly JavaScript Interface Creator
JavaScript
193
star
4

ClangWasm

WebAssembly without Emscripten
JavaScript
120
star
5

DLLFromMemory-net

C# library to load a native DLL from memory without the need to allow unsafe code
C#
87
star
6

WiiBalanceScale

Use the Wii Balance Board as a pretty accurate weight scale
C#
82
star
7

GamepadPhoenix

A tool for Windows to play any game (old or new) with any gamepad (old or new)
C++
70
star
8

PseudoVive

Simulate device names for any SteamVR driver to increase compatiblity
C++
62
star
9

LoveWebBuilder

Package, build and run LΓ–VE games for the web - https://schellingb.github.io/LoveWebBuilder/
JavaScript
37
star
10

RDBEd

DAT & RDB Editor for RetroArch/Libretro
C#
31
star
11

c-data-structures

Simple and convenient data structure single-file public domain libraries for C/C++
C
30
star
12

xmp-wavis

Plugin for XMPlay to use Winamp visualizations
C++
13
star
13

sizer-net

Tool that shows the size of things in a .NET assembly
C#
12
star
14

xmp-coverart

Plugin for XMPlay that displays album art of the playing song
C
10
star
15

ZillaLibSamples

Code samples for ZillaLib (https://github.com/schellingb/ZillaLib)
C++
9
star
16

CozyGit

CozyGit is a Git GUI client for Windows aiming for simplicity and ease of use
C#
8
star
17

MediaFileDateFixer

Copy date/time from meta data (Exif, etc) of photos and videos to file modification date
C#
8
star
18

SWFAutomation

Flash Automation in a Browser with JavaScript, C++, Python or AutoHotkey
C++
7
star
19

MCLANRelay

Relay/proxy a Minecraft LAN game over the internet - server and client side
C++
3
star
20

MinimalSystray

Minimal code for a Windows systray icon
C++
3
star
21

WrathOfGod

C++
2
star
22

Hexzilla

C++
2
star
23

OpenVRTouchPadTest

Simple tool for testing touch pad events from OpenVR
C++
2
star
24

EmbedFileInC

Generate code to easily embed files into C/C++ source
HTML
2
star
25

Talkies

A game about a small world
C++
2
star
26

LazerMaze

You are trapped in the Lazer Maze, can you find the way to the goal?
C++
1
star
27

StealthMan

C++
1
star
28

UE4AssetGrep

Easily confirm occurrences of names in UE4 Blueprint files while inside Visual Studio
C++
1
star
29

Shootzilla

Defat the hordes of evil! Can you delay the inevitable?
C++
1
star
30

MercReckoning

C++
1
star
31

ZIPValidateCRC

A simple tool for decompressing files and validating stored CRC numbers. Serves as an example on how to load ZIP files in C++.
C++
1
star
32

SuperMonkeyCall

A game about flinging monkeys!
C++
1
star
33

Tinyzilla

Ludum Dare 56 Submission
C++
1
star