Coder Social home page Coder Social logo

guvacode / ray4laz Goto Github PK

View Code? Open in Web Editor NEW
90.0 7.0 17.0 127.88 MB

A complete header translation (binding) of the raylib 5.0 to Pascal. Without any funky helper functions for memory alignment issues. Inspired and partially based on the drezgames/raylib-pascal binding, however a little cleaner and more recent, with FPC 3.2.0 and up support.

Home Page: https://www.raylib.com/

License: zlib License

Pascal 8.83% GLSL 5.51% C 85.65% Shell 0.01%
header-translation pascal-binding raylib lazarus lazarus-ide lazarus-package pascal enjoy-videogames-programming linux freepascal

ray4laz's Introduction

Ray4Laz is a header translation of the Raylib Game Development Library for the Lazarus project.


raylib is a simple and easy-to-use library to enjoy videogames programming.

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 auto-debugging... just coding in the most pure spartan-programmers way.*

features

  • NO external dependencies, all required libraries are bundled into raylib
  • Multiple platforms supported: Windows, Linux, MacOS, RPI, Android, HTML5... and more!
  • Written in plain C code (C99) using PascalCase/camelCase notation
  • Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3 or ES 2.0)
  • Unique OpenGL abstraction layer (usable as standalone module): rlgl
  • Multiple Fonts formats supported (TTF, Image fonts, AngelCode fonts)
  • Multiple texture formats supported, including compressed formats (DXT, ETC, ASTC)
  • Full 3D support, including 3D Shapes, Models, Billboards, Heightmaps and more!
  • Flexible Materials system, supporting classic maps and PBR maps
  • Animated 3D models supported (skeletal bones animation) (IQM)
  • Shaders support, including model and postprocessing shaders.
  • Powerful math module for Vector, Matrix and Quaternion operations: raymath
  • Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
  • VR stereo rendering support with configurable HMD device parameters
  • Huge examples collection with +120 code examples!
  • Bindings to +60 programming languages!
  • Free and open source.

supported headers

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

tested platforms

OS Supported
Mac ❓ no tested
Windows ✔️
Linux ✔️
Haiku ✔️
ReactOS ✔️

build and installation raylib

raylib binary releases for Windows, Linux and macOS are available at the Github Releases page.

building raylib on multiple platforms

raylib Wiki contains detailed instructions on building and usage on multiple platforms.

installation in lazarus ide.

select the package menu, open the network package manager.

select ray4laz package and install.

create a new project (Ray Simple Project).

enjoy !!!

manual installation and use without lazarus ide

clone this repository, then use 'fpc-wrapper.sh' as your compiler. this script automatically feeds fpc with the necessary arguments.

ray4laz's People

Contributors

glowiak avatar guvacode avatar shoozza 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  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  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  avatar  avatar  avatar  avatar  avatar

ray4laz's Issues

GuiTextBox partialy functioning

Hi Guya,

If the array of chars variable that is passed to GuiTextBox is attributed a value other than initializing it with '', outside the GuiTextBox, then this one will not allow editing the content of that variable. The following example works well, you can edit that variable as you like:

eText : array [0..60] of char = '';
iCategoryInput := GuiTextBox(rec_common, @eText, 60, true);

But if I touch the eText variable in any way, GuiTextBox will show its content but will not allow the editing;

These attributions:

eText := 'Spasiva!';`

or

eText := another_string_variable;

then eText is rendered non-editable in GuiTextBox, no matter if fpc is at 3.0.4 or 3.2.2 version.

I think (if is working the same also on your side) at least GuiTextBox must be rewritten in pascal.

I work at a visual demonstration program for qdbm database engine, in the way the example from fpc package is made for sqlite3 by ...pork... (can't remember his nickname), and I use raylib 4 with raygui from your translation.

raylib window context to OpenGLControl (initial code)

Still working on this, but the rendering happens in the TOpenGLControl on the form.

uses
OpenGLContext, raylib, glfw, Windows;
  TPortFrm = class(TForm)
    OpenGLControl1: TOpenGLControl;
    procedure FormCreate(Sender: TObject);
    procedure OpenGLControl1Paint(Sender: TObject);
  private
    WndContext: pGLFWwindow;
  public

  end;
procedure TPortFrm.FormCreate(Sender: TObject);
begin
  InitWindow(1600, 900, 'port');
  SetTargetFPS(60);
  WndContext:=glfwGetCurrentContext();
  OpenGLControl1.Handle:=HWND(WndContext);
end; 
procedure TPortFrm.OpenGLControl1Paint(Sender: TObject);
begin
  while not WindowShouldClose do begin
    BeginDrawing;
    ClearBackground(RED);
    OpenGLControl1.SwapBuffers;
    EndDrawing;
  end;
end; 

RayGuy 3.0

Any chance to have the header? We compile the C library ourselves. Thank you!

iqm animation/DrawModelEx spinning bug

When loading an animation and using DrawModelEx the model keeps pivoting around its root position. When I use DrawModel and DrawModelWiresEx the model stays where it should.

Thanks

Delphi support

Is it possible to add Delphi support in header files?
I looked code and i think, this solved by a small number of IFDEF'S.

Unable to Run

Windows 10 x64
Lazarus 2.2.0RC2 (built via fpcupdeluxe)
OPM: Installed Ray4Laz

Receiving "raylib.dll not found..." error. Rebuilding ray4laz_designtime v.4.0 removes this error. However, I still get the "Execution stopped with exit-code 1073741515" error. See screenshots for specific error messages.

Admittedly, this may be completely user error. Nonetheless, your work is invaluable and in the event someone else might get this fringe error it may be worth documenting.

ray1
ray2

How to run without Lazarus?

I am tired of Lazarus, and I would like to use just vim and fpc.

What flags do I need to link with Ray4Laz?

Nothing works

Installed through package manager. Load examples.
If there is not some error like:
models_animation.pas(31,40) Error: Call by var for arg no. 1 has to match exactly: Got "Pointer" expected "TMaterial"
ray_header.pas(1270,11) Hint: Found declaration: SetMaterialTexture(var TMaterial;LongInt;TTexture); CDecl;

Then the example compiles, runs, exits without anything ever showing up on screen.

Same with the program template from the file> new menu.

Move examples to a separate repo

When there are loads of examples (especially huge ones) in the repo, it significantly slows down the process of git-cloning it.

Would be good to move them to a separate repository and add a mention in the README about it.

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.