• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language CMake
  • License
    zlib License
  • Created over 4 years ago
  • Updated 6 months ago

Reviews

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

Repository Details

A minimal project template for raylib using CMake that works well in CLion & Visual Studio.

Simple and portable CMake template for raylib

This is a basic project template for raylib using CMake and has been tested with Visual Studio, Visual Studio Code and CLion.

The master branch of the raylib source code is downloaded using CMake FetchContent from github and compiled from source as it is much easier than including prebuilt binaries for every platform and configuration.

Building from the cmake file will build both raylib and src/main.c which includes a basic example of a raylib program.

Asset handling

The example in src/main.c uses an example image located in the assets folder. To load it we use ASSETS_PATH, which is a string macro with the absolute path "assets" directory. This macro is defined in the CMakeLists.txt file on line 23.

If you plan on releasing or sharing your game consider manually setting the value of the ASSETS_PATH macro.

In C you can concatenate string literals by putting them next to each other, eg: "A" "B" is "AB". So ASSETS_PATH "test.png" becomes "/path/to/your/assets/test.png"

If you wanna share your game with others you should set ASSETS_PATH to be a relative path like "./assets/". You can do this in the CMakeLists.txt file.

More Repositories

1

rayfork

C99 Game Library. XNA-like. Platform Independent. Allocator Aware.
C
328
star
2

libco

Single header C99 coroutines library. Forked from libco and flb_libco.
C
71
star
3

glfw-single-header

A script that generates a single-header & single-header+single-source version of GLFW
C
44
star
4

raylib-cpp-cmake-template

A simple and portable raylib cmake template using C++
C
27
star
5

zig-nanoid

A tiny, secure, URL-friendly, unique string ID generator. Now available in pure Zig.
Zig
25
star
6

rayfork-sokol-template

A simple rayfork project template with sokol-app and CMake
C
13
star
7

rayfork-tests

A collection of examples written in rayfork that also serve as tests.
C
7
star
8

RemoveTwitterViewCount

JavaScript
6
star
9

GLFWCMakeTemplate

A simple template for a C application using GLFW with GLAD and CMake.
C
5
star
10

MyResume

My resume. Done in Adobe Illustrator because I can just place text wherever I want and make it look good, best tool for the job in my case.
3
star
11

UKSheltersAndFoodBanksAPI

The first API for gathering data about UK Shelters and Food Banks
Python
2
star
12

space-shooter

C
2
star
13

ls-cparser

A library for parsing C language code.
C++
2
star
14

hot-code-reload

C
2
star
15

GalaciucView

Our project for the Open Hackathon at InfoEducatie 2017 Utility section
Java
2
star
16

zigen

Zig
1
star
17

bananya-vs-color-scheme

1
star
18

GraphTheory

Project I made back in high school to demonstrate graph theory. Made in Java using LibGDX.
Java
1
star
19

EmotiView

Team's Casting the void* project for the 2018 Sky Hackathon.
Kotlin
1
star
20

dino-game

A dino game
C
1
star
21

data_desk

A data description format parser with introspection and custom code capabilities.
C
1
star
22

utf8

Lightweight C++ utf8 library with simple implementation. Uses utf8proc for case conversion.
C++
1
star