Giter VIP home page Giter VIP logo

turboraylib's Introduction

TurboRaylib

TurboRaylib is a cool and clean Raylib bindings for Object Pascal (Delphi and FreePascal)

TurboRaylib sticks to the stable versions of RayLib, the current version is 4.5.0

Unlike other bindings, this version works stably in Win32 and Win64 in Delphi and Lazarus.
The raylib library has a lot of ABI problems when using DLLs, all known problems have been fixed in these bindings.
TurboRaylib has a lot of test coverage (see examples).

Foldes:

  • "raylib" - TurboRaylib bindings
  • "binaries" - Dynamic libraries suitable for TurboRaylib bindings
  • "examples" - Many examples for Delphi

You can download official DLL here: https://github.com/raysan5/raylib/releases/tag/4.5.0


TurboRaylib
(See: https://github.com/turborium/TurboRaylib/blob/main/examples/shapes/shapes_logo_raylib_anim/shapes_logo_raylib_anim.dpr)

raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's specially well suited for prototyping, tooling, graphical applications, embedded systems and education.

NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way. See: https://www.raylib.com/


Modules

Header Supported
raylib.h ✔️
raymath.h ✔️
rlgl.h ✔️

Platforms

Comiler Windows 32 Windows 64 OSX Linux
Delphi ❓ no tested ❓ no tested
FreePascal ❓ no tested

You can use TurboGen for generate new TurboRaylib project for Delphi/Lazarus and all OS

TurboRaylib

How to use?

Just add the "raylib" folder to your project, put the necessary dll next to the exe and get a fun!
Or use turbogen application.

Notes:

  • Some Raylib functions require the use of pointers, don't forget to enable {$POINTERMATH ON} option in your source code!
  • Text strings in Raylib uses UTF8 format, but Delphi uses WideSrtirng, because wrap your string in UTF8String(). Ex: UTF8String('My String').
  • The examples are mostly converted for testing purposes and are not examples of good Object Pascal code.

Заводим на Windows (Delphi/Lazarus)

  1. Скачиваем бинарь raylib для Windows. (https://github.com/raysan5/raylib/releases).
  2. Скопируйте dll из папки /lib в место где расположен exe-шник вашего приложения.
  3. ???
  4. PROFIT!

Заводим на OSX (Lazarus)

Меньше страданий

  1. Скачиваем бинарь raylib для osx. (https://github.com/raysan5/raylib/releases).
  2. Копируем ВСЕ файлы из /lib в место где будет расположен бинарь вашего приложения. (сюда и только сюда)
  3. Указываем линкеру что юзаем libraylib.dylib, а также говорим где искать бинарь либы:
    Пример для бинаря в папке /app:
    TurboRaylib
    (Если вам повезет то вы не получите ошибку линковки, если не повезло - забейте и запустите windows)

Больше страданий

Так или иначе ваше приложение бдует связяанно с конкретной версией raylib, для начала надо понять с каким "именем".

  1. скачиваем бинарный файл raylib для OSX.
  2. распаковываем архив и открываем "lib"
  3. запускаем "otool -L libraylib.dylib" из терминала (о да, каеф)
    TurboRaylib
    Мы получили "истинное имя библиотеки" - "libraylib.420.dylib", именно это и будет грузить наше приложение.
    Если мы не хотим таскать с собой сразу 3 файла,
    то надо переименовать "libraylib.4.2.0.dylib"(истинный бинарь) в "libraylib.420.dylib" и передавать линкуру его.
    Ex: "libraylib.420.dylib -rpath @executable_path/".

В целом "инфа" описана тут: http://clarkkromenaker.com/post/library-dynamic-loading-mac/. И тут: https://habr.com/ru/post/220961/. И да - нам еще повезло что либа raylib собрана с корректным @rpath(да в XUIN каждая либа указывает откуда ее запускать лол), иначе без "патчинга" вообще ипользовать невозможно было бы.
Почему истинный бинарь raylib обозван "libraylib.4.5.0.dylib", хотя внутри назван "libraylib.420.dylib" остаеться загадкой, возможно кто собирал - тоже не смог осознать "преимущества UNIX" и запутался.

Удачной долбежки!

Заводим на Linux (Lazarus)

Смотрите примеры, я завел и вы справитесь. Или нет, тогда поставьте Windows :)
TurboRaylib

turboraylib's People

Contributors

turborium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

turboraylib's Issues

Добавь лицензию

Если хочешь добавить в список биндингов то добавь лицензию иначе Санта марина к этому придередся.

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.