Giter Club home page Giter Club logo

raylib-game-template's Introduction

Hi there! 👋

My name is Ray and I create things! In my GitHub you can find many of my open source projects! 😄

  • 🔭 I’m currently working on raylib and tools!
  • 🌱 I’m currently learning new things every day!
  • 👍 I’m looking to collaborate on any interesting project!
  • 🤔 I’m looking for help with raylib!
  • 💬 Ask me about raylib and games development!
  • 📫 How to reach me: [email protected]

If you like my work, consider sponsoring me! ♥️

raylib-game-template's People

Contributors

jdoleary avatar jeffm2501 avatar jupiterrider avatar lesleyrs avatar lpg2709 avatar m374lx avatar majanto avatar mrdaybird avatar orcmid avatar planetis-m avatar raysan5 avatar s-yablonskiy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raylib-game-template's Issues

How to add resources

I'm not a C developer, but I wanted to try to create some games with raylib. This will really be a stupid question, but how can I add resources to the solution? I'm using VS2022 and the provided solution file. I added the files from the Dr. Turtle and Mr. Gamera resources to the src/resources folder, but they are not found when running the game with this warning:

WARNING: FILEIO: [resources/sky.png] Failed to open file
WARNING: FILEIO: [resources/mountains.png] Failed to open file
WARNING: FILEIO: [resources/sea.png] Failed to open file
etc.

Do I have to add all files into a custom build step? What am I missing?

Note: If I just copy the resources folder to the output folder it works. I notice the CMAKE file have a COPY src/resources command, is it missing in the VS2022 solution? Or does it use another mechanism?

`make clean` not working on windows

sh: del: not found

I did some reading on the discord and you can use make clean SHELL=CMD in order to get it to work because w64devkit uses busybox shell.

Does that not mean that windows should use the linux commands by default, or is w64devkit not the intended way to use raylib on windows? I guess the installer only installs mingw itself, where do you get the single download from besides raylib?

Edit: I just noticed it works fine in raylib itself, can this be added to the makefile here as well? clean_shell_cmd: SHELL=cmd

Why do you have 2 CMakeLists.txt?

Hi, why do you have 2 CMakeLists.txt? Doesn't this cause a conflict when creating the project?

I would like the template to be more neutral, so that it can be used in any IDE or text editor, such as Kdevelop, Gnome builder, kate, Eclipse, VIM, geditor, and not just in visual studio.

saludos.

Convention for line-width?

I notice that there is no constraint on line width and even in markdown, lines can be very wide, although GitHub Markdown treats simple line breaks as just white space.

I like to have my code and other text formats confined to a line width that I can print and also view easily in any editor. I even set VS Code to break on a right margin and I clean them up usually. The only exception I can think of is URLs and Markdown links. I am known to put a ruler line at the top of a text file just for this purpose.

Put differently, if I continued to do that (my width magic number is 72) would it still be compatible with the raylib convention? I.e., in a pull request?

Is it wise to add working directory change for compiling/debugging

I think it is a good idea to expand the readme with information about changing the working directory into $(ProjectDir)......\src
Just so that the .exe that is being debugged can find the resrouces properly. I ended up figuring this out myself.. took me an hour.

`PLATFORM=PLATFORM_WEB make` don't work on MacOS

After brew install emscripten, brew install raylib, cloning this repo and running PLATFORM=PLATFORM_WEB make from the src/ dir gives this output:

% PLATFORM=PLATFORM_WEB make
/Applications/Xcode.app/Contents/Developer/usr/bin/make raylib_game
emcc -c raylib_game.c -o raylib_game.o -std=c99 -Wall -Wno-missing-braces -Wunused-result -D_DEFAULT_SOURCE -Os -I. -I../../raylib/src -I../../raylib/src/external -I../../raylib/src/extras -DPLATFORM_WEB
make[1]: emcc: No such file or directory
make[1]: *** [raylib_game.o] Error 1
make: *** [all] Error 2

which emcc finds it at /usr/local/bin, which is on the $PATH

make fails when converting to C++

All I did was change the compiler from gcc to g++ and change the flag -std=c99 to -std=c++17

alex@pop-os:~/Dropbox/dev/silver-palm-tree/src$ make make raylib_game make[1]: Entering directory '/home/alex/Dropbox/dev/silver-palm-tree/src' g++ -c raylib_game.c -o raylib_game.o -Wall -std=c++17 -D_DEFAULT_SOURCE -Wno-missing-braces -s -O1 -D_DEFAULT_SOURCE -I/usr/local/include -I. -I/home/alex/Dropbox/dev/silver-palm-tree/src -I/home/alex/Dropbox/dev/silver-palm-tree/src/external -DPLATFORM_DESKTOP raylib_game.c:25:28: error: invalid conversion from ‘int’ to ‘GameScreen’ [-fpermissive] 25 | GameScreen currentScreen = 0; | ^ | | | int raylib_game.c: In function ‘void ChangeToScreen(int)’: raylib_game.c:142:21: error: invalid conversion from ‘int’ to ‘GameScreen’ [-fpermissive] 142 | currentScreen = screen; | ^~~~~~ | | | int raylib_game.c: In function ‘void UpdateTransition()’: raylib_game.c:189:29: error: invalid conversion from ‘int’ to ‘GameScreen’ [-fpermissive] 189 | currentScreen = transToScreen; | ^~~~~~~~~~~~~ | | | int raylib_game.c: At global scope: raylib_game.c:120:13: warning: ‘void ChangeToScreen(int)’ defined but not used [-Wunused-function] 120 | static void ChangeToScreen(int screen) | ^~~~~~~~~~~~~~ make[1]: *** [Makefile:407: raylib_game.o] Error 1 make[1]: Leaving directory '/home/alex/Dropbox/dev/silver-palm-tree/src' make: *** [Makefile:398: all] Error 2

CONVENTIONS omits typedef conventions

The typedef cases seem to be for title case. It is not shown, although an already-defined type is used in an example.

I am unclear about the situation with all caps types that also happens in raylib.

The trick around using struct declarator names as defined types is also worthy of note. A mindmeld of the C Language type form :).

E.g.,

typedef struct Texture { ... } Texture

static CoreData CORE = { 0 )

Getting linker error with cmake

Getting the following linker error when building with cmake:
(pruned for readability)

...
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwGetTime
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwSwapBuffers
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwSetErrorCallback
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwInit
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwDefaultWindowHints
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwWindowHint
...

Adding the following after line 44 fixed the issue:

    target_link_options(${PROJECT_NAME} PUBLIC "-sUSE_GLFW=3")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.