August 25, 2019, 09:13:58 AM

Author Topic: Raylib  (Read 726 times)

Offline Xaron

  • Sr. Member
  • ****
  • Posts: 252
Raylib
« on: July 25, 2018, 01:34:54 PM »
So anyone heard of this? I've stumbled across this a few weeks ago, currently v2.0 has been released and boy, it's pure fun. Remembers me at the good old BlitzBasic days. Uses OpenGL and it's cross platform!

http://www.raylib.com

Just take a look at the commands list:
http://www.raylib.com/cheatsheet/cheatsheet.html

Creating a basic window is just this:
Code: [Select]
/*******************************************************************************************
*
*   raylib [core] example - Basic window
*
*   Welcome to raylib!
*
*   This example has been created using raylib 1.0 (www.raylib.com)
*   raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
*   Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/

#include "raylib.h"

int main()
{
    // Initialization
    //--------------------------------------------------------------------------------------
    int screenWidth = 800;
    int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
   
    SetTargetFPS(60);
    //--------------------------------------------------------------------------------------

    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update
        //----------------------------------------------------------------------------------
        // TODO: Update your variables here
        //----------------------------------------------------------------------------------

        // Draw
        //----------------------------------------------------------------------------------
        BeginDrawing();

            ClearBackground(RAYWHITE);

            DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);

        EndDrawing();
        //----------------------------------------------------------------------------------
    }

    // De-Initialization
    //--------------------------------------------------------------------------------------   
    CloseWindow();        // Close window and OpenGL context
    //--------------------------------------------------------------------------------------

    return 0;
}

Offline Derron

  • Hero Member
  • *****
  • Posts: 2337
Re: Raylib
« Reply #1 on: July 25, 2018, 02:37:26 PM »
If people are not put off by the "C" code they need to write, that little thing indeed looks nice!

bye
Ron

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 1924
Re: Raylib
« Reply #2 on: July 25, 2018, 05:31:35 PM »
Quote
If people are not put off by the "C" code

C wouldn't have anything as long winded as

ClearBackground(RAYWHITE);  :)
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspbian Buster, pi4 4Gb RAM,1.5Ghz