-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Working on Windows
The fastest way to get a game setup on windows with MinGW or Visual Studio is to use premake. See raylib-extras/game-premake for instructions
Or watch the video tutorial here
https://www.youtube.com/watch?v=--gI9083QnU
You can download and install raylib using the vcpkg dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg integrate install
vcpkg install raylib
The default triplet in vcpkg is set to "x86-windows". If you want to install x64 version instead, you should use following command:
vcpkg install raylib:x64-windows
The raylib port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
You can download and install raylib using the conan dependency manager:
https://docs.conan.io/en/latest/getting_started.html
The raylib recipe in conan is kept up to date by conan team members and community contributors. If the version is out of date, please create an issue or pull request on the conan-center-index repository.
Raylib already comes with ready-to-use makefiles and CMake build system to compile source code, examples and templates. You can download the raylib Windows Installer.
The raylib Windows Installer comes with all the required tools to develop with raylib, those tools are:
- C Compiler (TCC or MinGW) - To compile the code, it includes all required system libraries.
- Notepad++ (preconfigured) - To edit code, it includes ready-to-use scripts to compile code and examples.
- raylib library - Including, source, release, examples and templates.
If you want, you can use a different code editor (e.g. Visual Studio) or another compiler.
The instructions below are focused on compiling raylib using Notepad++ as the editor and TCC or MinGW as the compiler:
Just open raylib/src/raylib.h
source file on Notepad++ and execute (F6) the script raylib_source_compile
Using MinGW make tool, just navigate from command line to raylib/src/
folder and type:
mingw32-make PLATFORM=PLATFORM_DESKTOP
By default raylib is compiled for OpenGL 3.3 Core backend; to compile for OpenGL 1.1 just type:
mingw32-make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_11
Just open your example source file on Notepad++ and execute (F6) the script raylib_compile_execute
Using MinGW make tool, just navigate from command line to raylib/examples/
folder and type:
mingw32-make PLATFORM=PLATFORM_DESKTOP
Open w64devkit.exe
in C:\raylib\w64devkit
then cd to c:/raylib/raylib/examples/core
and type:
gcc core_basic_window.c -lraylib -lopengl32 -lgdi32 -lwinmm
This will output a.exe
to the current directory, where you can run it with ./a.exe
.
A tool has been created to ease this specific approach to building raylib: VCrayApp
VCrayApp
is a project-folder organization that is useful for creating Microsoft Windows programs using the raysan5/raylib library for graphical applications.
www.raylib.com | itch.io | GitHub | Discord | YouTube
- Architecture
- Syntax analysis
- Data structures
- Enumerated types
- External dependencies
- GLFW dependency
- libc dependency
- Platforms and graphics
- Input system
- Default shader
- Custom shaders
- Coding conventions
- Integration with other libs
- Working on Windows
- Working on macOS
- Working on GNU Linux
- Working on Chrome OS
- Working on FreeBSD
- Working on Raspberry Pi
- Working for Android
- Working for Web (HTML5)
- Working on exaequOS Web Computer
- Creating Discord Activities
- Working anywhere with CMake
- CMake Build Options
- raylib templates: Get started easily
- How To: Quick C/C++ Setup in Visual Studio 2022, GCC or MinGW
- How To: C# Visual Studio Setup
- How To: VSCode
- How To: Eclipse
- How To: Sublime Text
- How To: Code::Blocks