Written by
NrdyBhu1
on
on
Setting up raylib with freeBASIC
Installing freeBASIC compiler
Installing freeBASIC compiler comes first. You can just grab the lastest version of freeBASIC compiler from Sourceforge. For Linux users you can follow the lines of code below:
$ tar -xvf FreeBASIC-1.08.1-ubuntu-20.04-x86_64.tar.gz # I use ubuntu 20.04 (it might be different for you)
$ cd FreeBASIC-1.08.1-ubuntu-20.04-x86_64
$ sudo ./install.sh -i
That should do it.
Installing raylib
Installing raylib comes next. Make sure you have build-essentials
(gcc, etc) along with cmake
installed.
Follow the instruction from the raylib wiki and install on your specific platform.
Static library build is preffered if possible and install it to the root.
Fin
Finally only thing left is for final use, You can use the following code as base template.
#include "raylib.bi"
const SCREEN_WIDTH = 800
const SCREEN_HEIGHT = 450
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "raylib [core] example - basic window")
while not WindowShouldClose()
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
EndDrawing()
wend
CloseWindow()