Questions tagged [raylib]

A simple to use library for making videogames, distributed under the zLib license.

raylib is a simple and easy-to-use library to enjoy videogames programming.

raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's specially well suited for prototyping, tooling, graphical applications, embedded systems and education.

NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no auto-debugging... just coding in the most pure spartan-programmers way.

Raylib.com

On Github

171 questions
0
votes
0 answers

Disable compiler warnings when using FetchContent with CMake

I'm trying to add a library to my CMake project, but I don't want the compiler to give me warning for this project so that I can enable -werror. For this I tried using the SYSTEM flag in FetchContent, with no success : FetchContent_Declare( …
TOOL
  • 70
  • 1
  • 10
0
votes
1 answer

is there a way to convert type char to structTexture in Raylib

I keep getting the error "func.h:23: error: cannot cast 'int' to 'struct Texture'" even though im inputting text as tile in renderTiles(). Am i just being dumb here? ¯_(ツ)_/¯ Im new to C so this might just be me. i copied and pasted the basic window…
justtab
  • 23
  • 4
0
votes
1 answer

Object pass itself to class constructor

I'm trying to code a simple game, where the main.cpp file instantiates the Game class, and the Game class instantiates the Player class. I want the Player class to have access to the Game class' variables, so I guess the best way to do that is to…
0
votes
0 answers

Running a C++ project with makefile but getting linking errors for source files in subdirectories

I've been trying to get a c++ project to build using this makefile: https://pastebin.com/vMEMwH4C The structure of my project is like this: For context, I'm using a library called Raylib and trying to run on a windows machine. This makefile was…
Joshua S.
  • 31
  • 6
0
votes
1 answer

Raylib fails to render perlin noise

so i was trying to implement perlin noise in c++ and render it with raylib. i successfully implemented it but can't render it. it just shows black screen even tho perlinNoise function returns some value. can anyone help? #include #include…
0
votes
0 answers

Raylib-rs error: method `resize` modifies its receiver in-place, what to do?

I'm trying to make a very simple game, using Raylib bindings for Rust. I'm new to Rust, but I've been learning it for a couple of months and already made several simple projects that work as intended. In this case I got to the point where I need to…
Yuriy S
  • 103
  • 6
0
votes
1 answer

Raylib for C++ DrawText() adds 0s to floats

In my program I have a float float integrity = 5.6; and I want to draw it on the screen. To do this, I use the DrawText function: DrawText(TextFormat("%f",integrity), 300, 160, 30, WHITE); But I get a bunch of zeros at the end that make everything…
0
votes
1 answer

Raylib Easing Functions Header Implementation

I'm a newbie coder and decided on using raylib to learn c / c#.. I saw an example with reasings.h header file and wanted to run that example on my local machine. I installed raylib via https://github.com/raylib-extras/game-premake Everything worked…
Ghoyos
  • 604
  • 2
  • 7
  • 18
0
votes
1 answer

how to compile C++ with Raylib program in Linux terminal

I created a very basic game with C++ using Raylib Package, i install Raylib from vcpkg but don't know how to compile it can you please help me out Error while Compiling the Main.cpp in which my game in written I try to compile My Main.cpp by…
0
votes
1 answer

Player not moving in Raylib

In Raylib I am trying to make a player character move however it is not moving I have tried using different functions like KeyPressed(). Here is the code(This is compiled in c++20): #include ; int main(){ int camX = 0; int camY =…
0
votes
0 answers

I can not figure out how to install Raylib-Lua on Debian

I am trying to install a lua binding of raylib, but I cannot install it. Nowhere online can I find instructions, hours of digging haven't helped. Wondering if anybody knows how to install on a fresh install of Debian 11 (Bullseye) Thank you!
TPGlitch
  • 1
  • 5
0
votes
1 answer

Animating the movement of a from one Vector to a Target vector

Alright so im using Raylib.h and got stuck in this code for a while now. I want to have a smooth animating movement of the velocity vector of the ball from one point to another. Basically The principle is to drag at any point on the screen and the…
0
votes
0 answers

Why mingw fails to find -lraylib?

so i tried to build my raylib code but it fails and givesme bunch of errors. can anyone help me to fix this issue? #include "C:\raylib\raylib\src\raylib.h" int main(void) { const int width = 1024; const int height = 512; InitWindow(width,…
0
votes
0 answers

Compilation of Raylib function fails on Visual Studio Code

I'm getting an error in the compilation of a C file that heavily uses Raylib function. Environment OS: Windows 10 IDE: Visual Studio Code Raylib version: 4.2.0 (win64, mingw) Sanity check of Raylib installation Following the discussions in How to…
Ogiad
  • 139
  • 1
  • 11
0
votes
0 answers

XCode 13, cannot add a search path for .h files

I'm having trouble adding raylib.h to my project in Xcode 13. The website gives the following instructions: Make sure Xcode finds raylib.h: Go to Build Settings > Search Paths and add raylib header folder (raylib-master/src) to Header Search…