Raylib Wrapper Help
#1
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
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
Reply


Messages In This Thread
Raylib Wrapper Help - by LeftyG - 08-27-2022, 07:44 PM
RE: Raylib Wrapper Help - by SMcNeill - 08-27-2022, 09:33 PM
RE: Raylib Wrapper Help - by LeftyG - 08-27-2022, 09:39 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-29-2022, 03:44 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-29-2022, 07:13 PM
RE: Raylib Wrapper Help - by LeftyG - 08-29-2022, 09:29 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 02:43 AM
RE: Raylib Wrapper Help - by LeftyG - 08-30-2022, 03:05 AM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 05:00 AM
RE: Raylib Wrapper Help - by LeftyG - 08-30-2022, 05:25 AM
RE: Raylib Wrapper Help - by TempodiBasic - 08-30-2022, 05:07 AM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 05:37 AM
RE: Raylib Wrapper Help - by LeftyG - 08-30-2022, 05:49 AM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 12:07 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 12:12 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 12:45 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 04:49 PM
RE: Raylib Wrapper Help - by LeftyG - 08-30-2022, 06:38 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 06:49 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 07:21 PM
RE: Raylib Wrapper Help - by SpriggsySpriggs - 08-30-2022, 07:43 PM
RE: Raylib Wrapper Help - by LeftyG - 08-30-2022, 08:55 PM



Users browsing this thread: 11 Guest(s)