Git Product home page Git Product logo

guvacode / ray4laz Goto Github PK

View Code? Open in Web Editor NEW
93.0 7.0 18.0 137.05 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.33% C 85.67% Shell 0.15% Batchfile 0.02%
header-translation pascal-binding raylib lazarus lazarus-ide lazarus-package pascal enjoy-videogames-programming linux freepascal cross-platform pacal-langauge game-engine game-development game-dev windows macos

ray4laz's Issues

RayGuy 3.0

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

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.

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

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.

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; 

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?

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.

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

Some examples don't work for me

I'm testing Ray4Laz, on Linux (Debian12), with Lazarus 3.0 fixed. Most examples work correctly.

  • The 2 GUI-based examples do not work correctly. The 'controls-test-suite' does not show 3 'edit-boxes'. Of the rest of the controls that are displayed, none of those in the second column work. But the build is successful.

  • Most examples about 'shaders' are not displayed either, although the compilation is successful.

Should I compile with some special modifier? I have tested with different processors and graphics cards with the same results.

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.