Coder Social home page Coder Social logo

raylib-beef's Introduction

Raylib-Beef

raylib-beef is a Beef wrapper library for Raylib 3.7, a simple and easy-to-use library. In combination with the benefits of the Beef programming language, making games is pure satisfaction!

Attention! These bindings are still in development. Bugs may occur. You can download this library with binaries from the Release page!

OS Support is limited to Windows right now. I am only able test this library on Windows at the moment.




What is done

  • Bindings for:
    • raylib.h
    • raymath.h
    • rlgl.h (partly)
    • Easings.h

Important notes

  • there are no bindings for text manipulating methods
    • Beef already has custom methods for text manupulation
  • rlgl bindings are partly done

TODO:

  • Rewrite examples in Beef
  • finish rlgl.h bindings

Quick Start (using Beef IDE)

  1. Download raylib-beef and copy it to: C:\Program Files\BeefLang\BeefLibs
  2. Right-click on your workspace and select Add from Installed and choose raylib-beef

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

  1. Write some code:
using System;
using static raylib_beef.Raylib;

namespace YOUR_NAMESPACE_HERE
{
	class Program
	{
		public static int Main(String[] args)
		{
			let text = "Hello from Beef! Hope you have a good day!";

			SetConfigFlags(.FLAG_WINDOW_RESIZABLE);
			InitWindow(800, 600, "Hello world");
			SetTargetFPS(60);

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

				ClearBackground(.(52, 52, 52, 255));

				var x = (GetScreenWidth() / 2) - (MeasureText(text, 35) / 2);
				var y = GetScreenHeight() / 2;

				DrawText(text, x, y, 35, .LIGHTGRAY);

				EndDrawing();
			}

			CloseWindow();
			return 0;
		}
	}
}
  1. Profit!

Static linking

By default linking is set to dynamically link to Raylib. You can change that by selecting different raylib-beef project configuration in Workspace settings. You can select from DebugStatic and ReleaseStatic.

Then set your app project build properties to this:

Provided libraries are compiled with these flags

Commandline options:
-DSUPPORT_FILEFORMAT_JPG:BOOL="1" 
-DGLFW_USE_HYBRID_HPG:BOOL="1" 
-DSUPPORT_FILEFORMAT_FLAC:BOOL="1" 
-DCUSTOMIZE_BUILD:BOOL="1" 
-DBUILD_EXAMPLES:BOOL="0" 
-DSUPPORT_FILEFORMAT_GIF:BOOL="1" 
-DSUPPORT_FILEFORMAT_TGA:BOOL="1" 

Cache file:
SUPPORT_FILEFORMAT_JPG:BOOL=1
GLFW_USE_HYBRID_HPG:BOOL=1
SUPPORT_FILEFORMAT_FLAC:BOOL=1
CUSTOMIZE_BUILD:BOOL=1
BUILD_EXAMPLES:BOOL=0
SUPPORT_FILEFORMAT_GIF:BOOL=1
SUPPORT_FILEFORMAT_TGA:BOOL=1

More Info

Contribution

I'll be glad for any reported issues & pull requests

Notes

  • any contributions apart from bugfixes need to be placed in src/Extensions
    • this will separate additional helper functions from bindings
    • for example if you want to add some cool method for Vector3, you will create Vector3.bf in src/Extensions/Types and add that cool method to existing Vector3 type by using extensions statement

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.