raylib game framework
- StarBootics
- Addict
- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: raylib game framework
Hello everyone,
@Danilo : When do you think your Module will be ready for download ?
Best regards
StarBootics
@Danilo : When do you think your Module will be ready for download ?
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: raylib game framework


Re: raylib game framework
It's still the same problem and round about 230 wrapper functions are needed for the ByVal structures.Cyllceaux wrote:"long time ago" I started to port it by myself. I stopped it cause of ByVal Structures. (Pure Basic did not support it)
I wrote with ray about this and he said, I have to write my own wrapper in C.
Now he support pointers vor structures... which is great
I coded the first 3 by hand and then decided to use C for the job.

Code: Select all
Procedure rlBeginMode3D(*camera.rlCamera3D)
!MOV qword RAX, [p.p_camera]
!PUSH qword [RAX + 40]
!PUSH qword [RAX + 32]
!PUSH qword [RAX + 24]
!PUSH qword [RAX + 16]
!PUSH qword [RAX + 08]
!PUSH qword [RAX + 00]
!CALL _BeginMode3D
!ADD RSP, 48
EndProcedure
Procedure rlDrawCube(*position.rlVector3, width.rl_float, height.rl_float, length.rl_float, color.rlColor)
!MOV qword RAX, [p.p_position]
!MOVQ XMM0, QWORD [RAX]
!MOVSS XMM1, DWORD [RAX+8]
!MOVSS XMM2, DWORD [p.v_width]
!MOVSS XMM3, DWORD [p.v_height]
!MOVSS XMM4, DWORD [p.v_length]
!MOV EDI, DWORD [p.v_color]
!CALL _DrawCube
EndProcedure
Procedure rlDrawCubeWires(*position.rlVector3, width.rl_float, height.rl_float, length.rl_float, color.rlColor)
!MOV qword RAX, [p.p_position]
!MOVQ XMM0, QWORD [RAX]
!MOVSS XMM1, DWORD [RAX+8]
!MOVSS XMM2, DWORD [p.v_width]
!MOVSS XMM3, DWORD [p.v_height]
!MOVSS XMM4, DWORD [p.v_length]
!MOV EDI, DWORD [p.v_color]
!CALL _DrawCubeWires
EndProcedure
Structures: 100%StarBootics wrote:@Danilo : When do you think your Module will be ready for download ?
Enumerations: 100%
Procedure Imports: 73%
109 wrapper .c files are done and another round about 120 are waiting.
Should be ready in 2 days, and we have a working import on macOS.
After that comes testing on Linux (should run out-of-the-box I hope), and
I need to use a Windows virtual machine and VC++ for testing there.
MSVC++ is always a bit different, so I don't know what will come on this platform.
When the import is done and useable, it is required to translate some of the 100+ raylib examples (Online) to PB.
So I think macOS is 2 days away. All OS hopefully still in May 2020.

The good thing is, raylib comes without any docs. No translation required!

Re: raylib game framework
Done. And Linux works. 
Only Windows missing...


Only Windows missing...

Re: raylib game framework
That's cool stuff !
Re: raylib game framework
I suffer every time I encounter, think, or read about this.Danilo wrote:Now I import raylib‘s CloseWindow() as rl_CloseWindow(), with
modules I would need to write rl::rl_CloseWindow() ( Double-Whopper),
because rl::CloseWindow() is not possible with PB.
BTW: nice job Danilo

"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
- StarBootics
- Addict
- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: raylib game framework
Indeed !Fred wrote:That's cool stuff !
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: raylib game framework
On macOS and Linux it works with a static import, so we get stand-alone executables.
Windows makes problems, as always, so it looks like I need to use the DLL import currently. That works.
Windows makes problems, as always, so it looks like I need to use the DLL import currently. That works.
Re: raylib game framework
The follow-up thread is there: https://www.purebasic.fr/english/viewtopic.php?f=27&t=75276
Re: raylib game framework
Can you explain what not working during the static lib creation on windows?Danilo wrote:On macOS and Linux it works with a static import, so we get stand-alone executables.
Windows makes problems, as always, so it looks like I need to use the DLL import currently. That works.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Re: raylib game framework
I will look into that later. The static lib that comes with raylib is compiled as C++,IceSoft wrote:Can you explain what not working during the static lib creation on windows?
so it can‘t be used as a C import (name mangling).
I tried several Compilers on Windows. The older VC++ compilers couldn‘t compile it,
and the newer (2015+) compilers use a new C runtime library (libucrt.lib / vcruntime.lib).
There came up several issues with missing runtime lib imports etc.
I have an idea how to get it working, but I can‘t do everything at the same time.
Currently I want to translate some of the raylib examples to PureBasic.
Re: raylib game framework
Yes thats more important.Danilo wrote: Currently I want to translate some of the raylib examples to PureBasic.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Re: raylib game framework
On windows if you can't use the same VS version PB is built with and you're using a recent VS, you'll need to add the crt libs as dependencies to the static lib and hope that there's no conflicts.Danilo wrote:I will look into that later. The static lib that comes with raylib is compiled as C++,IceSoft wrote:Can you explain what not working during the static lib creation on windows?
so it can‘t be used as a C import (name mangling).
I tried several Compilers on Windows. The older VC++ compilers couldn‘t compile it,
and the newer (2015+) compilers use a new C runtime library (libucrt.lib / vcruntime.lib).
There came up several issues with missing runtime lib imports etc.
I have an idea how to get it working, but I can‘t do everything at the same time.
Currently I want to translate some of the raylib examples to PureBasic.
Windows 11, Manjaro, Raspberry Pi OS

