|
|
@@ -374,16 +374,20 @@ gl_update_texture :: proc(th: Texture_Handle, data: []u8, rect: Rect) -> bool {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- //pf := gl_translate_pixel_format(tex.format)
|
|
|
-
|
|
|
-
|
|
|
gl.BindTexture(gl.TEXTURE_2D, tex.id)
|
|
|
gl.TexSubImage2D(gl.TEXTURE_2D, 0, i32(rect.x), i32(rect.y), i32(rect.w), i32(rect.h), gl.RGBA, gl.UNSIGNED_BYTE, raw_data(data))
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
gl_destroy_texture :: proc(th: Texture_Handle) {
|
|
|
+ tex := hm.get(&s.textures, th)
|
|
|
+
|
|
|
+ if tex == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
+ gl.DeleteTextures(1, &tex.id)
|
|
|
+ hm.remove(&s.textures, th)
|
|
|
}
|
|
|
|
|
|
Shader_Compile_Result_OK :: struct {}
|