Ver Fonte

Fix font usage error

Karl Zylinski há 4 meses atrás
pai
commit
6138909caa
2 ficheiros alterados com 3 adições e 1 exclusões
  1. 2 1
      karl2d.odin
  2. 1 0
      render_backend_d3d11.odin

+ 2 - 1
karl2d.odin

@@ -106,6 +106,7 @@ init :: proc(window_width: int, window_height: int, window_title: string,
 	append_nothing(&s.fonts)
 
 	s.default_font = load_font_from_bytes(DEFAULT_FONT_DATA)
+	set_font(s.default_font)
 
 	return s
 }
@@ -1314,7 +1315,7 @@ Font :: struct {
 Handle :: hm.Handle
 Texture_Handle :: distinct Handle
 Font_Handle :: distinct int
-FONT_NONE :: Font_Handle(0)
+FONT_NONE :: Font_Handle {}
 TEXTURE_NONE :: Texture_Handle {}
 
 

+ 1 - 0
render_backend_d3d11.odin

@@ -397,6 +397,7 @@ d3d11_update_texture :: proc(th: Texture_Handle, data: []u8, rect: Rect) -> bool
 	tex := hm.get(&s.textures, th)
 
 	if tex == nil || tex.tex == nil {
+		log.errorf("Trying to update texture %v with new data, but it is invalid.", th)
 		return false
 	}