Utilities and common code for use with raylib

Overview

Raylib Extras

Utilities and shared components for use with raylib (https://www.raylib.com/)

Libraries

Raylib Extras is made up of two main libraries,

rlExtrasC

This is a pure C library that can be build static or dynamic (DLL). It contains the following components.

FPCamera

A first person view camera system

TPOrbitCamera

A third person view camera system that orbits a target point based on mouse input

Frustum

Frustum extraction with functions for testing point, sphere, and Axis Alligned Bounding Box against it. Useful for view culling.

RLGeoTools (C)

Geometry Extensions for raylib, including functions to create dynamic meshes.

RLSprites

Sprite Management system

rlExtrasCPP

This is a C++ library that can be build static. It contains the following components.

FPCamera

A first person view camera system with support for user settable near and far clipping planes.

RLSprites

Sprite Management system

RLAssets

A simple asset management system

Building

Raylib Extras uses premake, a premake5.lua file is included in the repository. Simply use it to create the build files for your target system. See https://premake.github.io/ for more info. The repository also uses raylib as a submodule in the raylib folder so it can build the examples.

Examples will be included in the project files generated by premake.

build on windows with visual studio

  1. download premake5.exe from https://premake.github.io/
  2. copy it into the raylib extras folder
  3. run premake.bat

Premake will then generate all the visual studio projects needed. You can open them with the RaylibExtras.sln that will be created in the root folder of the repository.

Other platforms will work in a similar way.

Extra Extras

Premake

Premake scripts for raylib alone and a sample game project.

RLTiles_CPP

Exprimental tiled reading and rendering for raylib.

All compoents are licensed under the MIT license.

Issues
  • Some errors and compiler warning when compiling FPCamera.c with gcc (not g++)

    Some errors and compiler warning when compiling FPCamera.c with gcc (not g++)

    Compiling FPCamera.c with gcc produces the following output (with -wall):

    src/utils/FPCamera.c: In function 'InitFPCamera': src/utils/FPCamera.c:37:16: error: 'NULL' undeclared (first use in this function) if (camera == NULL) ^~~~ src/utils/FPCamera.c:37:16: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'? src/utils/FPCamera.c:33:1: +#include <stddef.h> #include <math.h> src/utils/FPCamera.c:37:16: if (camera == NULL) ^~~~ src/utils/FPCamera.c:37:16: note: each undeclared identifier is reported only once for each function it appears in src/utils/FPCamera.c:53:22: error: expected expression before '{' token camera->MoveSpeed = { 1,1,1 }; ^ src/utils/FPCamera.c:54:22: error: expected expression before '{' token camera->TurnSpeed = { 90,90 }; ^ src/utils/FPCamera.c:72:23: error: expected expression before '{' token camera->ViewAngles = { 0,0 }; ^ src/utils/FPCamera.c:79:70: error: expected expression before 'Vector3' camera->ViewCamera.target = Vector3Add(camera->ViewCamera.position, Vector3{ 0, 0, camera->TargetDistance }); ^~~~~~~ src/utils/FPCamera.c:80:26: error: expected expression before '{' token camera->ViewCamera.up = { 0.0f, 1.0f, 0.0f }; ^ src/utils/FPCamera.c: In function 'ResizeFPCameraView': src/utils/FPCamera.c:103:16: error: 'NULL' undeclared (first use in this function) if (camera == NULL) ^~~~ src/utils/FPCamera.c:103:16: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'? src/utils/FPCamera.c: In function 'GetSpeedForAxis': src/utils/FPCamera.c:122:16: error: 'NULL' undeclared (first use in this function) if (camera == NULL) ^~~~ src/utils/FPCamera.c:122:16: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'? src/utils/FPCamera.c: In function 'UpdateFPCamera': src/utils/FPCamera.c:141:16: error: 'NULL' undeclared (first use in this function) if (camera == NULL) ^~~~ src/utils/FPCamera.c:141:16: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'? src/utils/FPCamera.c:180:15: error: expected '=', ',', ';', 'asm' or 'attribute' before '{' token Vector3 right{ forward.z * -1.0f, 0, forward.x }; ^ src/utils/FPCamera.c:180:34: warning: left-hand operand of comma expression has no effect [-Wunused-value] Vector3 right{ forward.z * -1.0f, 0, forward.x }; ^ src/utils/FPCamera.c:180:37: warning: left-hand operand of comma expression has no effect [-Wunused-value] Vector3 right{ forward.z * -1.0f, 0, forward.x }; ^ src/utils/FPCamera.c:180:37: warning: statement with no effect [-Wunused-value] src/utils/FPCamera.c:180:48: error: expected ';' before '}' token Vector3 right{ forward.z * -1.0f, 0, forward.x }; ^~ ; src/utils/FPCamera.c:185:75: error: 'right' undeclared (first use in this function); did you mean 'rint'? camera->CameraPosition = Vector3Add(camera->CameraPosition, Vector3Scale(right, direction[MOVE_RIGHT] - direction[MOVE_LEFT])); ^~~~~ rint src/utils/FPCamera.c:212:36: error: expected expression before 'Vector3' Matrix rotation = MatrixRotateXYZ(Vector3{ PI * 2 - camera->ViewAngles.y, PI * 2 - camera->ViewAngles.x, 0 }); ^~~~~~~ src/utils/FPCamera.c:225:3: error: 'constexpr' undeclared (first use in this function) constexpr float viewBobbleDampen = 8.0f; ^~~~~~~~~ src/utils/FPCamera.c:225:12: error: expected ';' before 'float' constexpr float viewBobbleDampen = 8.0f; ^~~~~~ ; src/utils/FPCamera.c:227:44: error: 'viewBobbleDampen' undeclared (first use in this function) eyeOfset -= sinf(camera->CurrentBobble / viewBobbleDampen) * camera->ViewBobbleMagnatude; ^~~~~~~~~~~~~~~~ src/utils/FPCamera.c:182:10: warning: unused variable 'oldPostion' [-Wunused-variable] Vector3 oldPostion = camera->CameraPosition; ^~~~~~~~~~ src/utils/FPCamera.c:161:8: warning: unused variable 'mouseWheelMove' [-Wunused-variable] float mouseWheelMove = GetMouseWheelMove(); ^~~~~~~~~~~~~~

    opened by zzador 4
  • rlImGui: added different mouse cursor support

    rlImGui: added different mouse cursor support

    I added mouse Cursor support

    its inspired/based by/on the win32 backend from Dear ImGui

    it implements all cursors (I think)

    Changes

    I changed the original part that hid and unhid the cursor and made it only change it if the cursor is changed (or ImGui draws the cursor itself)

    opened by Julianiolo 1
  • Premake scripts fixed

    Premake scripts fixed

    • root script had a typo for TPOrbitCameraCSample folder. No more missing raylib.h.
    • Premake/Game script had wrong file/ directories
    • Premake/raylib scripts had wrong file/ directories
    • Root premake creates a solution but has CloseWindow already defined ERROR.
    opened by nezvers 0
  • removed random scissorTest & duplicate ImguiIO get

    removed random scissorTest & duplicate ImguiIO get

    the scissorTest I removes seems to have no purpose, it also messes with everything that is done before its disabled again

    saw randomly that there was a IO ref created where one already is available, so I removed it

    opened by Julianiolo 0
  • rlImGui works on Linux, blank on Mac

    rlImGui works on Linux, blank on Mac

    I managed to get a hello world raylib+imgui program working on Linux.

    When I got to the Mac, it compiled without errors, but when running it failed to render the imgui part. Rendering with raylib works. And I know the imgui part is working, because I blindly clicked around where the button was supposed to be, and eventually it reacted (a print on stdout).

    I'm new to both imgui and raylib, can you help me debug this one?

    opened by bart9h 0
  • Failing to build with makefile [Mingw]

    Failing to build with makefile [Mingw]

    premake5 gmake2 builds successfully mingw32-make config=release_x64 fails from root folder

    "==== Building raylib (release_x64) ===="
    Creating ../bin/Release
    Linking raylib
    "==== Building rlExtrasC (release_x64) ===="
    Creating obj/x64/Release
    FPCamera.c
    process_begin: CreateProcess(NULL, cc -MMD -MP -DNDEBUG -I../raylib/src -I. -m64 -O2 -o obj/x64/Release/FPCamera.o -MF obj/x64/Release/FPCamera.d -c FPCamera.c, ...) failed.
    make (e=2): The system cannot find the file specified.
    mingw32-make[1]: *** [Makefile:168: obj/x64/Release/FPCamera.o] Error 2
    mingw32-make: *** [Makefile:86: rlExtrasC] Error 2
    

    and from premake/raylib

    "==== Building raylib (release_x64) ===="
    Creating bin/Release
    Linking raylib
    "==== Building core_basic_window (release_x64) ===="
    mingw32-make[1]: *** No rule to make target 'core_basic_window.c', needed by 'obj/x64/Release/core_basic_window/core_basic_window.o'.  Stop.
    mingw32-make: *** [Makefile:52: core_basic_window] Error 2
    
    opened by nezvers 0
Owner
Jeffery Myers
Software Developer at Blizzard Entertainment (personal account)
Jeffery Myers
Haxe bindings for raylib, a simple and easy-to-use library to learn videogame programming

Haxe bindings for raylib, a simple and easy-to-use library to learn videogame programming, Currently works only for windows but feel free the expand t

FSasquatch 27 Jul 8, 2022
autogen bindings to Raylib 4.0 and convenience wrappers on top. Requires use of `unsafe`

Raylib-CsLo Raylib-CsLo LowLevel autogen bindings to Raylib 4.0 and convenience wrappers on top. Requires use of unsafe A focus on performance. No run

NotNot 51 Jul 25, 2022
My collection of raylib code examples - For learning the C language with 2D and 3D games.

Raylib-Examples My collection of raylib examples. ( https://www.raylib.com/index.html ) For Raylib Version of 4 april 2020 ( Notepad++ windows install

Rudy Boudewijn van Etten 47 Jul 11, 2022
Utilities for use in a DPP based discord bot

DPPUtils NOTE: This repo is in development, use these utilities at your own risk Numerous utilities for use in your DPP bot. List of Utilities Youtube

Daniel Wykerd 5 Jul 9, 2022
MacFlim flim player source code and utilities

MacFlim Video player source code Please do not barf on code quality. It was not in releasable state, but people wanted to use it. You may even be one

Fred Stark 63 Jul 3, 2022
Integrate PhysFS with raylib, allowing to load images, audio and fonts from data archives.

raylib-physfs Integrate the virtual file system PhysicsFS with raylib, allowing to load images, audio, and fonts from data archives. Features Load the

Rob Loach 20 Jul 26, 2022
SWIG bindings for raylib (to Lua, and hopefully other languages)

swigraylib SWIG binding for raylib This repo generates raylib bindings to other languages (eg. Lua), by providing a raylib.i SWIG interface file. SWIG

null 6 Oct 28, 2021
The Ultimate Raylib gaming library wrapper for Nim

NimraylibNow! - The Ultimate Raylib wrapper for Nim The most idiomatic and up-to-date wrapper for Raylib gaming C library. Use this library if you wan

Dmitry Matveyev 118 Aug 4, 2022
Load Aseprite files for animated sprites in raylib.

raylib-aseprite Load Aseprite .aseprite files for animated sprites in raylib. Features Load Aseprite files directly for use in raylib Draw individual

Rob Loach 25 Jul 27, 2022
RayLib extern bindings for Haxe

raylib-haxe Haxe bindings for RayLib usage haxelib git raylib-haxe https://github.com/haxeui/raylib-haxe package; import RayLib.*; import RayLib.Cam

HaxeUI 20 Jul 6, 2022
A pong clone written in C++ with Raylib

How To Play Objective: first player to reach 10 points is the winner! PLAYER 1: W: up S: down PLAYER 2: ARROW UP or I: up ARROW DOWN or S: down Requir

Victor Sarkisov 1 Nov 8, 2021
Pong clone made in C++ with raylib

Raypong Pong clone made in C++ with raylib. Dependencies ...C++ and raylib lol Building To build, use these commands: mkdir build # Create a build dir

Mars 0 Feb 4, 2022
raylib Nuget package

raylib Nuget package This is a Nuget package for the popular raylib video game programming library. Resources used to create this package are as follo

Samuel Gomes 5 Apr 28, 2022
Minimalistic assertion library for raylib.

raylib-assert Minimalistic assertion library for raylib. Example #include "raylib.h" #include "raylib-assert.h" int main(void) { Assert(10 == 10)

Rob Loach 2 Jan 12, 2022
A top-down shooter made for the raylib 5K gamejam.

ANTISPELL Description A top-down shooter where you have to use your enemies' attacks to spell your spells! Features Absorb letters getting close to en

Francisco Javier Andrés Casas Barrientos 3 Apr 9, 2022
mpiFileUtils - File utilities designed for scalability and performance.

mpiFileUtils provides both a library called libmfu and a suite of MPI-based tools to manage large datasets, which may vary from large directory trees to large files.

High-Performance Computing 128 Jul 26, 2022
The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced.

libxo libxo - A Library for Generating Text, XML, JSON, and HTML Output The libxo library allows an application to generate text, XML, JSON, and HTML

Juniper Networks 242 Jul 19, 2022
Panda - is a set of utilities used to research how PsExec encrypts its traffic.

Panda Panda - is a set of utilities used to research how PsExec encrypts its traffic. Shared library used to inject into lsass.exe process to log NTLM

Pavel 11 Jul 17, 2022
Dead by Daylight utilities created while researching

DeadByDaylight Research material and PoC for bugs found during the reversal of the game Dead by Daylight. All information provided is for educational

Layle | Luca 13 Jul 27, 2022