Skip to content

Instantly share code, notes, and snippets.

@patgarner
Created March 18, 2025 09:57
Show Gist options
  • Save patgarner/b5801859b9db031015d33eb1e4355ddf to your computer and use it in GitHub Desktop.
Save patgarner/b5801859b9db031015d33eb1e4355ddf to your computer and use it in GitHub Desktop.
RayLib "Hello, Word!" in C
/*
** 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