Make createTextureFromSurface print the error

This commit is contained in:
Sijmen 2020-05-22 22:41:17 +02:00
parent 1a8319b9c0
commit ecd398d685
Signed by: vijfhoek
GPG Key ID: DAF7821E067D9C48
1 changed files with 4 additions and 1 deletions

View File

@ -110,7 +110,10 @@ pub const Renderer = struct {
} }
pub fn createTextureFromSurface(self: Renderer, surface: Surface) !Texture { pub fn createTextureFromSurface(self: Renderer, surface: Surface) !Texture {
var texture = c.SDL_CreateTextureFromSurface(self.renderer, surface.surface) orelse return error.SdlError; var texture = c.SDL_CreateTextureFromSurface(self.renderer, surface.surface) orelse {
std.debug.warn("Renderer.createTextureFromSurface: {}\n", .{getError()});
return error.SdlError;
};
return Texture{ .texture = texture }; return Texture{ .texture = texture };
} }