Make renderblended expect a 0-terminated string
This commit is contained in:
parent
657e42cead
commit
b46b744d71
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ pub const Font = struct {
|
|||
c.TTF_CloseFont(self.font);
|
||||
}
|
||||
|
||||
pub fn renderBlended(self: Font, text: []const u8, color: sdl.Color) !sdl.Surface {
|
||||
pub fn renderBlended(self: Font, text: [:0]const u8, color: sdl.Color) !sdl.Surface {
|
||||
var cText = @ptrCast([*c]const u8, text);
|
||||
if (c.TTF_RenderUTF8_Blended(self.font, cText, @bitCast(c.SDL_Color, color))) |surface| {
|
||||
return sdl.Surface{ .surface = @ptrCast(*sdl.c.SDL_Surface, surface) };
|
||||
|
|
Loading…
Reference in a new issue