Rizz 微小的C11游戏开发框架(rizzoli and isles)

网友投稿 1266 2022-10-10 19:21:10

Rizz 微小的C11游戏开发框架(rizzoli and isles)

Rizz

@septag

Rizz (ریز) is a tiny, multi-platform, and minimal game/app development framework, Written in C language. It's currently a work in progress, features and improvements will be added constantly to different platforms.

Design and Basic usage

For more detailed information about design principles, architecture and basic usage of the framework, please read the document rizz Architecture and Basic usage

Note

This is not a game engine, it's a relatively low-level framework for programmers to build their own engine/renderer/physics on top of it. The core of rizz does not and will not implement any rendering techniques/physics or impose any specific entity system to the user. It just provides the basic building blocks for game developers. Other features will be implemented as plugins.

Features and Changes

see CHANGELOG for latest changes, new features and bug fixes.

Core

Portable C code: C11 (gcc/clang), C99 (msvc) compatible code, designed with data-oriented mindset.Plugin system: Engine has a small core. Many functionalities are implemented through plugins.Minimal Dependencies: No external/large dependencies. Only a handful of small dependencies included in the source.Hot-reloading of C/C++ code: Plugins/Game code are all hot-reloadable with some restrictions and rules.Fiber based job system: Simple to use fiber-based job system.Reflection: Provides simple reflection system for structs, enums and functions.Async Asset Manager: Flexible reference counting asset manager. New asset types can be added by third-party code to the manager.Hot-reloading of assets and shaders: All in-game resources and shaders can be hot-reloaded.Virtual file system: Async read/write. Directories or archives can be mounted as virtual directories.Support for coroutines: Coroutines can be suspended for N frames or N milliseconds.

Graphics

Multiple graphics API support: Metal (iOS, MacOS). OpenGL-ES 2/3 (Android). Direct3D11 (Windows), OpenGL 3.3 (Linux)Portable shaders: Write shaders once in GLSL, toolset will automatically translate the shader to other APIs.Multi-threaded GPU command-buffer: Draw commands can be submitted by multiple threads with staged API.Compute shader support (Experimental): Experimental compute-shader support, currently only under Direct3D, more backends will be added.basis_universal texture format support

Plugins

Many of the engine features are implemented in the plugins:

imgui: Dear-imgui plugin with some utility API2dtools: 2D rendering tools: sprite, sprite animation, font drawing with TTF supportsound: Simple sound system. Audio mixer and 2d-sounds.input: Input system with gamepad and touch support3dtools: 3D rendering tools: support for GLTF 3d models, basic debug primitive creation and drawing

Debugging and Profiling

Remote Profiler: Integrated Remotery for remote debugger/command console and log viewer.Graphics API introspection: Debug application level graphic calls and objects.Memory Debugger: Debug and monitor memory allocations for all subsystems.

Supported platforms

WindowsLinuxMacOSAndroidRaspberryPIiOS

Build

rizz is designed to run on all major mobile (iOS, android), PC (Windows, Linux, MacOS) and web (WebASM) platforms. But as the engine is in it's early age, the current platforms are built and tested:

Windows: Tested on Windows10 with visual studio 14 2015 update 3 (Win64).Linux: Tested on ubuntu 16 with clang (6.0.0) and gcc (7.3.0). Package requirements: libx11-devlibxrandr-devlibxi-devlibasound2-dev (if you are planning to build sound plugin) MacOS: Tested on MacOS High Sierra - AppleClang 9.1.0Android: For android, there is a python script android.py which takes care of preparing android project structure, building the code and packaging the final APK. please read the begining of android.py.RaspberryPI: Tested on RPi1 ModelB Ubuntu-jessie (gcc Raspbian 4.9.2). Package requirements: libasound2-dev (if you are planning to build sound plugin) iOS: For iOS, there is a python script ios.py which takes care of initializing iOS project

CMake options

BUNDLE (default=0, android/ios=1):BUNDLE=0 indicates that rizz is built as an executable host which runs the game by rizz --run game.dll (on linux it's rizz --run ./game.so). Recommended for development, where you need reduced binary sizes and live-reloading of game code and plugins.BUNDLE=1 Builds rizz as static library. To link and bundle rizz and other plugins with a single stand-alone executable, so there will be only one executable and bundles rizz and all the plugins you specify. to build the bundle properly, you should set these cmake arguments on configure: BUNDLE_TARGET: target name of the executable you are trying to build (first example: -DBUNDLE_TARGET=01-hello)BUNDLE_TARGET_NAME: if the cmake target and the actual name of your application differs, use argument to address that. (first example: -DBUNDLE_TARGET_NAME=hello)BUNDLE_PLUGINS: list the plugins that is required by your application, separated by semicolon. (first example: -DBUNDLE_PLUGINS=imgui) ENABLE_HOT_LOADING (default=1, android/ios=0) Enables hot reloading of assets and monitoring the assets directories. Doesn't work on mobile OSes. ENABLE_PROFILER (default=0/debug, default=1/release) BUILD_EXAMPLES (default=1, android/ios=0) Build example projects in /examples directory. MSVC_STATIC_RUNTIME (default=0): MSVC specific. Compiles the RELEASE config with '/MT' flag instead of '/MD' MSVC_MULTITHREADED_COMPILE (default=1): MSVC specific. Turns on multi-threaded compilation (turns it off with Ninja) CLANG_ENABLE_PROFILER (default=0): Clang specific. Turns on -ftime-trace flag. Only supported in clang-9 and higher

Examples

Examples Basic examples are included with this repo, in examples directory:

Space invaders clone - link to github project

Open-Source libraries used

Primarily developed for rizz

sx: Portable base libraryglslcc: GLSL cross-compiler (external binary tool)dds-ktx: Single header KTX/DDS readercj5: Very minimal single header JSON5 parser in C99, derived from jsmnatlasc: Command-line tool that builds atlas texture from a bunch of input images. (External binary tool)dmon: Single header C99 portable library for monitoring directory changes.

3rdparties

sokol: minimal cross-platform standalone C headerscr: Simple C Hot Reload Header-only Librarycimgui: C-API for imgui (used in imgui plugin)imgui: Dear ImGui: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies (used in imgui plugin)Remotery: Single C file, Realtime CPU/GPU Profiler with Remote Web Viewerlz4: Extremely Fast Compression algorithmhttp: Basic HTTP protocol implementation over socketsstb: stb single-file public domain libraries for C/C++sort: Sorting routine implementations in "template" CImGuizmo: 3D gizmo for imgui (used in imgui plugin)gainput: Input library for games (used in input plugin)basis_universal: Basis Universal GPU Texture Codecfontstash: Light-weight online font texture atlas builder (used in 2dtools plugin)cgltf: Single-file glTF 2.0 loader and writer written in C99 (used in 3dtools plugin)

License (BSD 2-clause)

Copyright 2019 Sepehr Taghdisian. All rights reserved.https://github.com/septag/rizzRedistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NOEVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCEOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IFADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:实战分布式医疗挂号系统之整合Swagger2到通用模块
下一篇:我给pyecharts绘制的“时间轮播图”,加上了好玩儿的“图形标志”!
相关文章