Author Topic: Raylib Wrapper Complete  (Read 2563 times)

0 Members and 1 Guest are viewing this topic.

Offline Lefty

  • Newbie
  • Posts: 9
Raylib Wrapper Complete
« on: August 16, 2019, 03:49:05 pm »
Hello all,

I have recently finished another wrapper for QB64. This time the source is included. It is a wrapper for Raylib. Raylib is a library for video game programming.

Raylib Wrapper: https://github.com/gAndy50/Qb64Wrappers

Feedback is appericated.

EDIT: Added Example on forum post.

Code: QB64: [Select]
  1. 'Raylib Basic Simple Window
  2. REM $include: 'raylib.bi'
  3.  
  4. LET w = 800
  5. LET h = 600
  6.  
  7. CALL InitWindow(w, h, "Simple")
  8.  
  9. SetTargetFPS (60)
  10.  
  11. DIM SHARED Col AS rColor
  12.  
  13. Col.r = 0
  14. Col.g = 255
  15. Col.b = 0
  16. Col.a = 255
  17.  
  18.  
  19.     BeginDrawing
  20.  
  21.     CALL ClearBackground(_RGBA32(Col.r, Col.g, Col.b, Col.a))
  22.  
  23.     CALL DrawText("Hello World" + CHR$(0), 10, 30, 20, _RGBA32(255, 0, 0, 255))
  24.  
  25.     IF IsKeyPressed(KEY_LEFT) THEN
  26.         CALL DrawText("Left" + CHR$(0), 10, 60, 20, _RGBA32(255, 0, 0, 255))
  27.     END IF
  28.  
  29.    CALL DrawFPS(10, 10)
  30.  
  31.     EndDrawing
  32.  
  33. LOOP UNTIL WindowShouldClose
  34.  
  35. CloseWindow
  36.  
« Last Edit: August 16, 2019, 09:54:14 pm by Lefty »