Created
March 18, 2025 09:57
-
-
Save patgarner/b5801859b9db031015d33eb1e4355ddf to your computer and use it in GitHub Desktop.
RayLib "Hello, Word!" in C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** Install raylib | |
Windows: https://github.com/raysan5/raylib/wiki/Working-on-Windows | |
Mac: https://github.com/raysan5/raylib/wiki/Working-on-macOS | |
Linux: https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux | |
** Example of how to compile the code with raylib using GCC on Mac | |
gcc -o hellogame hellogame.c -lraylib -framework OpenGL -framework Cocoa -framework IOKit | |
*/ | |
#include <raylib.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char **arv) | |
{ | |
const int screenWidth = 800; | |
const int screenHeight = 450; | |
InitWindow(screenWidth, screenHeight, "Hello, Game!"); | |
SetTargetFPS(60); | |
while (!WindowShouldClose()) | |
{ | |
BeginDrawing(); | |
ClearBackground(RAYWHITE); | |
DrawText("Hello, World!", 10, 10, 20, DARKGRAY); | |
EndDrawing(); | |
} | |
CloseWindow(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment