Hello everyone, thanks to you Michael Del Solio for testing the program on your computer, which means the code is portable. Just to clarify... The following RayLib functions I have used in the various examples work fine without wrappers on both operating systems (Windows 11 and Debian 12), and also work fine on two different versions of RayLib (3.1 and 6.1): InitWindow SetTargetFPS WindowShouldClose CloseWindow IsKeyDown GetKeyPressed IsKeyPressed SetExitKey BeginDrawing EndDrawing TextFormat DrawText...
Hi everyone, I’ve prepared a new version of Space Invaders using the wrapper. The previous version works well, but I actually just bypassed the audio issue by using SDL libraries. The truth is that many RayLib functions return structures that are too complex (and I can't figure out if they can be handled in COBOL)—such as "LoadSound" or 3D functions like "DrawCube." I am trying to write a wrapper that works on both operating systems; in addition to the functions I was already using without a wrapper,...
Hi everyone, and thanks Eugenio Di Lorenzo. I managed to solve the audio problem without wrappers using SDL2 and SDL2_mixer on both operating systems (Windows and Linux). The power of GnuCOBOL allows us to combine multiple technologies (RayLib for video and SDL2 for audio), writing 100% GnuCOBOL code and without using any wrappers. I'm attaching the final package, which must be compiled in a single line as follows: 1) for Windows 11 (MSYS2): cobc -x -free space-invaders.cob -lraylib -lopengl32 -lgdi32...
Hi everyone, and thanks Lorenzo. I managed to solve the audio problem without wrappers using SDL2 and SDL2_mixer on both operating systems (Windows and Linux). The power of GnuCOBOL allows us to combine multiple technologies (RayLib for video and SDL2 for audio), writing 100% GnuCOBOL code and without using any wrappers. I'm attaching the final package, which must be compiled in a single line as follows: 1) for Windows 11 (MSYS2): cobc -x -free space-invaders.cob -lraylib -lopengl32 -lgdi32 -lwinmm...
Hello. I noticed that target-fps = 60 was passed "by content" to the call, and therefore was never used (even though no error was seen). By setting target-fps = 180, the game is perfectly synchronized and the speed is constant. Anyway, I fixed the error by changing "by content" to "by value", and I've also added some more comments to this latest version. Best regards, everyone.
Hello. I noticed that target-fps = 60 was passed "by content" to the call, and therefore was never used (even though no error was seen). By setting target-fps = 60, the game is perfectly synchronized and the speed is constant, albeit rather slow, on both Windows and Linux. But by setting target-fps = 180 (for example), on Windows the speed increases but after a while it slows down abruptly and then increases again, in fairly regular cycles, while on Linux the speed is higher and also remains perfectly...
Hi everyone, I finally managed to make a single version that works on both Windows 11 and Debian 12. The audio issue was solved with the wrapper. I was also able to add another sound (player_move.wav) that plays when the player is scrolled (right arrow / left arrow). This wasn't possible with "aplay" because, for example, if you held down the right (or left) arrow, "aplay" would be called hundreds, maybe thousands of times. The program still worked, but aplay would "discard" a lot of sounds, and...
With the addition of further comments for the Linux version...