Texture Not Showing
- Posted by Icy_Viking Jul 18, 2019
- 1542 views
Hello,
Working on my Raylib wrapper and I cannot get a texture to show.
C code
typedef struct Texture2D { unsigned int id; // OpenGL texture id int width; // Texture base width int height; // Texture base height int mipmaps; // Mipmap levels, 1 by default int format; // Data format (PixelFormat type) } Texture2D; void DrawTexture(Texture2D texture, int posX, int posY, Color tint)
Eu Wrapper code
--I have changed the wrapper function to accept the struct as individual variables. ublic 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(atom id,atom w,atom h,atom mip,atom mat, atom x,atom y,atom tint) c_proc(xDrawTexture,{id,w,h,mip,mat,x,y,tint}) end proce
Eu Code (Load Texture Program)
without warning include std/machine.e include std/convert.e include Euraylib.ew 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") atom tex = LoadTexture("raylib_logo.png") while not WindowShouldClose() do BeginDrawing() ClearBackground(black) --Texture does not show DrawTexture(tex,256,256,1,1,width,height,yello) --Text does show DrawText("This is Texture",1,1,20,yello) EndDrawing() end while UnloadTexture(tex) CloseWindow()