fixed font import
This commit is contained in:
parent
4387c059a4
commit
fef7b8e417
2 changed files with 11 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.zclay = .{
|
.zclay = .{
|
||||||
.url = "../../",
|
.url = "../../",
|
||||||
.hash = "12208b0815fead7e03bb771a07ab432ad6fea66228b46c1329443ce8f55998d0a0cd",
|
.hash = "1220d6ec9e404578dd1484fd60b767f1c91906c0cc19a86c4089a36c6366aa193fef",
|
||||||
},
|
},
|
||||||
.@"raylib-zig" = .{
|
.@"raylib-zig" = .{
|
||||||
.url = "https://github.com/Not-Nik/raylib-zig/archive/f26b2ab084be5e2840b7451818590cc512b7b972.tar.gz",
|
.url = "https://github.com/Not-Nik/raylib-zig/archive/f26b2ab084be5e2840b7451818590cc512b7b972.tar.gz",
|
||||||
|
|
|
@ -86,8 +86,14 @@ fn createLayout(profile_picture: *const rl.Texture2D) cl.ClayArray(cl.RenderComm
|
||||||
return cl.endLayout();
|
return cl.endLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn loadFont(file_data: ?[]const u8, fontId: u16, fontSize: i32) void {
|
// TODO: fix raylib bindings to allow this or replace raylib bindings
|
||||||
renderer.raylib_fonts[fontId] = rl.loadFontFromMemory(".ttf", file_data, fontSize * 2, null);
|
// fn loadFont(file_data: ?[]const u8, fontId: u16, fontSize: i32) void {
|
||||||
|
// renderer.raylib_fonts[fontId] = rl.loadFontFromMemory(".ttf", file_data, fontSize * 2, null);
|
||||||
|
// rl.setTextureFilter(renderer.raylib_fonts[fontId].?.texture, .texture_filter_trilinear);
|
||||||
|
// }
|
||||||
|
|
||||||
|
fn loadFont(fileName: [*:0]const u8, fontId: u16, fontSize: i32) void {
|
||||||
|
renderer.raylib_fonts[fontId] = rl.loadFontEx(fileName, fontSize, null);
|
||||||
rl.setTextureFilter(renderer.raylib_fonts[fontId].?.texture, .texture_filter_trilinear);
|
rl.setTextureFilter(renderer.raylib_fonts[fontId].?.texture, .texture_filter_trilinear);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +117,8 @@ pub fn main() anyerror!void {
|
||||||
rl.initWindow(1000, 1000, "Raylib Odin Example");
|
rl.initWindow(1000, 1000, "Raylib Odin Example");
|
||||||
rl.setTargetFPS(60);
|
rl.setTargetFPS(60);
|
||||||
|
|
||||||
loadFont(@embedFile("./resources/Roboto-Regular.ttf"), 0, 100);
|
// loadFont(@embedFile("./resources/Roboto-Regular.ttf"), 0, 100);
|
||||||
|
loadFont("./src/resources/Roboto-Regular.ttf", 0, 100);
|
||||||
const profile_picture = rl.loadTextureFromImage(rl.loadImageFromMemory(".png", @embedFile("./resources/profile-picture.png")));
|
const profile_picture = rl.loadTextureFromImage(rl.loadImageFromMemory(".png", @embedFile("./resources/profile-picture.png")));
|
||||||
|
|
||||||
var debug_mode_enabled = false;
|
var debug_mode_enabled = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue