Skip to content

RudjiGames/rapp

Repository files navigation

Build status License

rapp is a library that provides cross-platform application entry point and additional functionality. rapp is heavily based on bgfx examples entry point code that can be found here. Graphics code is still bgfx based but..

...dependecy on bx and bgfx has been removed by aggressively copying code and by a special feature of build system that allows to have the same library in a 'solution' with different configurations.
To clarify, in the screenshot below first sample (command line) links against rapp and rbase while the second one (graphics) links against rapp_bgfx, rbase, bx, bimg and bgfx - this is all automated.

Thanks to multiple configurations per project feature of build, script taking care of this is very short and can be seen here, basically it just enables a library wide define.

Features

rapp currently has the following functionality:

  • Applications written as classes with init/shutdown/suspend/resume functionality
  • Command line (tools, unit tests, etc.) or graphics applications (games, etc.)
  • Custom commands
  • Input controllers (mouse, keyboard, gamepad, etc.) with input binding callbacks and debug visualizations
  • Ability to run code on main/message loop thread
  • Job scheduler with job stealing for fine grained parallelism
  • ImGui and NanoVG integration
  • Quake like console - ImGui based
  • Built-in rprof CPU profiler
  • Multiple applications in one binary
  • Window functions

rprof CPU profiler is an optional dependency and needs to be explicitly requested when generating project files, for example:

  GENie --with-rprof vs2022

Here's a screenshot of a bgfx sample showing input debugging, ImGui dialog and Quake like console as well as NanoVG shape (eyes):

Platform support

Input (KMG) Threading Console Graphics
Windows ✓✓✓
Xbox One ✓✓✓
PlayStation 4 ✓✓✓
Linux ✓✓X
Android XXX ?
OSX ✓✓X
Emscripten ✓✓✓ X

✓ - Working
X - Not yet implemented
? - Not supported

Platforms with partial implementations or not tested: iOS, UWP, FreeBSD
Input (KMG) stands for Keyboard, Mouse and Gamepad

Source Code

You can get the latest source code by cloning it from github:

  git clone https://github.com/RudjiGames/rapp.git 

Build and dependencies

There's quite a few dependencies and they can be fetched manually or using a batch file. For the list of dependencies please refer to the batch file.

Once dependencies are cloned, GENie project generator tool can be used to generate project files/solution. This batch file is an example of generating a solution and project files for VS2022.

License (BSD 2-clause)

Copyright 2023 Milos Tosic. All rights reserved.

https://github.com/RudjiGames/rapp

Redistribution and use in source and binary forms, with or without
modification, 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 OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT 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 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.