Hello all,
I am currently working on a Raylib wrapper. However I can't get it to show a image on the screen. Every time I do, it crashes the program.
Color issue is figured out. Need to figure out how to load and draw image functions aren't working properly.
Full wrapper code: https://github.com/gAndy50/Qb64Wrappers/...aylib42.bi
Wrapper code
Program Code
I am currently working on a Raylib wrapper. However I can't get it to show a image on the screen. Every time I do, it crashes the program.
Color issue is figured out. Need to figure out how to load and draw image functions aren't working properly.
Full wrapper code: https://github.com/gAndy50/Qb64Wrappers/...aylib42.bi
Wrapper code
Code: (Select All)
TYPE fImage
xdata AS _OFFSET
xwidth AS INTEGER
height AS INTEGER
mipmaps AS INTEGER
format AS INTEGER
END TYPE
FUNCTION LoadTexture& (fName AS STRING)
SUB DrawTexture (BYVAL fTexture AS _OFFSET, BYVAL x AS INTEGER, BYVAL y AS INTEGER, BYVAL fColor AS _UNSIGNED LONG)
Program Code
Code: (Select All)
REM $include: 'raylib42.bi'
LET w = 800
LET h = 600
CALL InitWindow(w, h, "Hello")
DIM SHARED Col AS fColor
'R and G are backwards?
Col.r = 255 'this is blue?
Col.g = 0
Col.b = 0 'this is red? (if value is 255)
Col.a = 255
SetTargetFPS (60)
DIM SHARED tex AS fTexture
tex.id = 0
tex.xwidth = 50
tex.height = 50
tex.mipmaps = 0
tex.format = 0
tex& = LoadTexture("dw2.png")
DO
BeginDrawing
CALL ClearBackground(_RGBA32(Col.r, Col.g, Col.b, Col.a))
CALL DrawFPS(1, 1)
CALL DrawTexture(tex&, 10, 10, _RGBA32(255, 255, 255, 255))
'CALL DrawLine(10, 20, 50, 50, _RGBA32(0, 0, 255, 255))
EndDrawing
LOOP UNTIL WindowShouldClose