a quick start

weijh
2024-02-21 17:52:32 +08:00
parent af4dc4b401
commit ce43e5b456

@ -1,3 +1,42 @@
## Quick start
1. Download `w64devkit-x.xx.x.zip` from https://github.com/skeeto/w64devkit
> Unzip to `c:\w64devkit`
2. Download `raylib-5.0_win64_mingw-w64.zip` from https://github.com/raysan5/raylib/releases
> Unzip `include` and `lib ` to `c:\w64devkit\x86_64-w64-mingw32`
> https://github.com/skeeto/w64devkit?tab=readme-ov-file#library-installation
3. Goto `c:\w64devkit` run `w64devkit.exe`which launches a console
4. Create `raylibhelloworld.c`
```
#include "raylib.h"
int main() {
const int screenWidth = 800;
const int screenHeight = 600;
InitWindow(screenWidth, screenHeight, "Raylib basic window");
SetTargetFPS(60);
while (!WindowShouldClose()) {
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("It works!", 20, 20, 20, BLACK);
EndDrawing();
}
CloseWindow();
return 0;
}
```
5. Compile with:
> `gcc -o raylibhelloworld.exe raylibhelloworld.c -lraylib -lopengl32 -lgdi32 -lwinmm`
6. Run
> `./raylibhelloworld.exe`
## Building raylib on Windows ## Building raylib on Windows
There are several ways to get setup on windows. This page will go through them from the easiest to the most difficult. There are several ways to get setup on windows. This page will go through them from the easiest to the most difficult.