Autogenerated Beef bindings for raylib
Find a file
Braedon Vale f1bc1c30ac
Merge pull request #17 from Adrian-Samoticha/main
Add OpenGL 4.3 Support
2025-08-12 10:42:37 -04:00
.idea/.idea.raylib-beef/.idea Remove todo 2023-04-13 08:28:40 -04:00
generator Some wasm fixes 2025-03-10 20:46:48 -04:00
img Create raylib-beef-logo.png 2023-03-19 14:42:02 -04:00
raylib-api@9903826e3e Upgrade to 5.5 (#13) 2024-11-18 20:12:26 -05:00
raylib-beef remove static library configurations and associated static library for OpenGL 4.3 support 2025-08-12 14:34:58 +02:00
.gitattributes Initial commit 2023-03-19 12:57:34 -04:00
.gitignore Remove recovery folder 2023-03-19 13:59:17 -04:00
.gitmodules Add raylib-api as submodule 2023-03-19 14:05:29 -04:00
LICENSE Create LICENSE 2023-03-19 14:49:39 -04:00
raylib-beef.sln Initial commit 2023-03-19 12:57:34 -04:00
README.md add note to rebuild project after updating binaries for OpenGL 4.3 support 2025-08-12 14:48:06 +02:00

raylib-beef

logo

BeefLang bindings for Raylib 5.5.

Example

using System;
using RaylibBeef;
using static RaylibBeef.Raylib;

namespace example;

class Program
{
	public static int Main(String[] args)
	{
		InitWindow(800, 600, scope $"Raylib Beef {RAYLIB_VERSION_MAJOR}.{RAYLIB_VERSION_MINOR}.{RAYLIB_VERSION_PATCH}");
		InitAudioDevice();

		let beefMain = Color(165, 47, 78, 255);
		let beefOutline = Color(243, 157, 157, 255);

		while (!WindowShouldClose())
		{
			BeginDrawing();
			
			ClearBackground(RAYWHITE);

			DrawRectangle(GetScreenWidth() / 2 - 128, GetScreenHeight() / 2 - 128, 256, 256, beefOutline);
			DrawRectangle(GetScreenWidth() / 2 - 112, GetScreenHeight() / 2 - 112, 224, 224, beefMain);

			DrawText("raylib", GetScreenWidth() / 2 - 44, GetScreenHeight() / 2, 50, beefOutline);
			DrawText("beef", GetScreenWidth() / 2 - 62, GetScreenHeight() / 2 + 46, 50, beefOutline);

			DrawRectangle(GetScreenWidth() / 2 + 54, GetScreenHeight() / 2 + 54, 42, 42, beefOutline);
			DrawRectangle(GetScreenWidth() / 2 + 62, GetScreenHeight() / 2 + 62, 26, 26, RAYWHITE);

			DrawCircle(GetMouseX(), GetMouseY(), 20, beefOutline);
			DrawCircle(GetMouseX(), GetMouseY(), 8, beefMain);

			DrawFPS(20, 20);

			EndDrawing();
		}

		CloseAudioDevice();
		CloseWindow();

		return 0;
	}
}

Quick Start (using Beef IDE)

  1. Clone this repository to wherever you want
  2. Right-click on your workspace and select Add Existing Project and select the folder where the BeefProj.toml file is.

image

  1. Add raylib-beef as a dependency of your project

image

Static Linking

On Windows, default linking is set to dynamically link to raylib. This is because of some weird linking problems with MSVC. You can change that by selecting a different project configuration for raylib-beef in the Workspace settings. You can select from StaticDebug and StaticRelease.

image

How to Enable OpenGL 4.3 Support

To make use of modern OpenGL features such as compute shaders and Shader Storage Buffer Objects, raylib needs to be compiled with the RAYLIB_OPENGL_43 flag enabled. By default, this flag is disabled and any attempt to use OpenGL 4.3 features will result in runtime errors that look like this:

WARNING: SHADER: Compute shaders not enabled. Define GRAPHICS_API_OPENGL_43
WARNING: SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43

raylib-beef provides binaries that have been compiled with the RAYLIB_OPENGL_43 flag enabled. To use these binaries, head to your Workspace properties and choose any of the *_GL43 build configurations under Targeted > Projects > raylib-beef:

image

Note that OpenGL 4.3 support is currently only available for Win64 and only supports dynamic linking.

Note: You may need to delete the dist directory of your project and rebuild it to ensure the new binaries are used.

Contribution

I'll be happy to resolve any issues or pull requests.