Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C and Raylib
#1
Raylib is a simple library for creating games. I've tried it with Go, first, but using it with C is also extremely easy:

Code:
#include "raylib.h"

int main() {
   const int szerokosc = 900;
   const int wysokosc = 600;
   InitWindow(szerokosc, wysokosc, "C and Raylib example");
   SetTargetFPS(60);
   while (!WindowShouldClose()) {
       BeginDrawing();
            ClearBackground(WHITE);
            DrawText("As easy as BASIC!", 300, 40, 30, DARKGRAY);
            DrawLine(50, 90, 850, 90, BLACK);
            DrawCircle(450, 350, 10, DARKBLUE);
            DrawCircleGradient(450, 350, 150, YELLOW, DARKGREEN);
            DrawCircleLines(450, 350, 200, BLACK);
            DrawRectangleLines(10, 10, 880, 580, RED);
            DrawRectangleGradientH(50, 100, 50, 50, MAROON, GOLD);
            DrawRectangle(50, 500, 50, 50, BROWN);
            DrawRectangle(800, 100, 50, 50, DARKGRAY);
            DrawRectangleGradientH(800, 500, 50, 50, PURPLE, DARKBLUE);
       EndDrawing();
   }
   CloseWindow();
   return 0;
}

Website: https://www.raylib.com/
Pre-compiled binaries: https://github.com/raysan5/raylib
Reply
#2
nice find tomek  Wink
it looks like very simple openGL wrapper.
I think that i would try it with o2 compiler...
also when i looking into supported languages i stop on ODIN ?
hmm interesting one...
Reply
#3
There is also Euraylib for OpenEuphoria (it's been just released). You can use it with the interpreter or the translator. The only dependency needed is a single raylib.dll/raylib.so file. I can't understand how did we manage to miss it on retrogamecoding.org - this is a perfect solution for retro stuff.



Here is an example in Euphoria


Code:
include std/machine.e
include std/convert.e
include Euraylib.ew

InitWindow(256, 256,"Basic Drawings")
SetTargetFPS(1)

while not WindowShouldClose()  do    
    BeginDrawing()    
       ClearBackground(bytes_to_int({0, 0, 0, 255}))
       for x = 0 to 255 do
           for y = 0 to 255 do
               DrawPixel(x, y, bytes_to_int({255 - x, x,y, 255}))
           end for
       end for
    
    EndDrawing()
end while

CloseWindow()


I think Cybermonkey should have a look at it, so he could stop "fighting" with Allegro and SDL and jumping from one to another. It should be easy to use Raylib with the interpreter he's using now. Let him know. I'm not a member there anymore.
Reply
#4
Look
I am not in games and i am not messenger
and i really doubt that he is interested for this one because he like is own way .
this euphoria lib..hmm mm
i am not sure about that ...
currently i am in something else very different..so i will see...
Reply
#5
Is it possible to use RayLib  with NaaLaa?
Reply
#6
I really don't know..
I will try it tonight with Oxygen basic
so i will see what is that..

hey rick
i download whole zip from github
but there is no any compiled binary in dll form
then i look into source , i tried to compile but compiler complain about C99
compatibility mode ..ohh gee such a crap.
i don't know you can try
Reply
#7
(07-13-2019, 02:18 PM)Aurel Wrote: I really don't know..
I will try it tonight with Oxygen basic
so i will see what is that..

hey rick
i download whole zip from github
but there is no any compiled binary in dll form
then i look into source , i tried to compile but compiler complain about C99
compatibility mode ..ohh gee such a crap.
i don't know you can try

 I found raylib.dll when I downloaded Euraylib from GitHub.
 Maybe that will help.


Attached Files
.zip   raylib.zip (Size: 328.67 KB / Downloads: 1)
Reply
#8
https://github.com/raysan5/raylib/releases - pre-compiled binaries for Windows and Linux. I don't think you can use it with NaaLaa.

Aurel, one minute you seem to be interested, the next one you say you don't give a shit about it. At least I know why - you haven't been able to compile it from source or find pre-compiled libraries (really?). And no - you don't have to tell Cybermonkey anything. Don't take everything literally.
Reply
#9
tomek
In a ziped file i download there is no raylib.dll
second i tried to compile from source to create that freakin dll but comiler complain
about C99 thing so i give up .
thanks Rick for dll ,,i will try this openGL wrapper.... Big Grin 
and what a heck is with all this care about Cyb ,,,ask someone else
Reply
#10
Aurel, really? Instead of the source code, download the package with pre-compiled libraries included. Just for curiosity - what compiler did you use? On Linux, GCC compiles it without problems.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)