Re: raylibshim - A shim library for Euphoria and Raylib
- Posted by Icy_Viking Jul 21, 2019
- 1159 views
Well, I got it to work, somewhat. It doesen't show the image, but it does show a bunch of garbled random characters.
public constant xDrawTexture = define_c_proc(ray,"+DrawTexture",{C_UINT,C_INT,C_INT,C_INT,C_INT,C_INT,C_INT,C_UINT}) public procedure DrawTexture(sequence seg,atom x,atom y,atom tint) c_proc(xDrawTexture,{seg[1],seg[2],seg[3],seg[4],seg[5],x,y,tint}) end procedure
without warning include std/machine.e include std/convert.e include Euraylib.ew --include raylibshim.e constant width = 800 constant height = 450 atom black = bytes_to_int({0,0,0,0}) atom white = bytes_to_int({255,255,255,255}) atom yello = bytes_to_int({255,255,0,255}) InitWindow(width,height,"Simple Texture") while not WindowShouldClose() do BeginDrawing() ClearBackground(black) DrawText("This is Texture",1,1,20,yello) gLoadTextureFromImage("raylib_logo.png") sequence texture_info = {2,150,150,1,0} DrawTexture(texture_info,width / 2, height / 2,white) EndDrawing() end while CloseWindow()