1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
Larpon
2021-04-07 20:39:23 +02:00
committed by GitHub
parent 9541eb816b
commit 8caabf0e9e
29 changed files with 4825 additions and 2965 deletions

View File

@@ -10,7 +10,7 @@ module ttf
*
* Note:
*
* TODO:
* TODO:
**********************************************************************/
import math
import gg
@@ -131,9 +131,9 @@ pub fn (mut tf_skl TTF_render_Sokol) create_texture() {
d3d11_texture: 0
}
// comment for dynamic
img_desc.content.subimage[0][0] = C.sg_subimage_content{
img_desc.data.subimage[0][0] = C.sg_range{
ptr: tf_skl.bmp.buf
size: sz
size: size_t(sz)
}
simg := C.sg_make_image(&img_desc)
@@ -148,10 +148,10 @@ pub fn (tf_skl TTF_render_Sokol) destroy_texture() {
// Use only if usage: .dynamic
pub fn (mut tf_skl TTF_render_Sokol) update_text_texture() {
sz := tf_skl.bmp.width * tf_skl.bmp.height * tf_skl.bmp.bp
mut tmp_sbc := C.sg_image_content{}
tmp_sbc.subimage[0][0] = C.sg_subimage_content{
mut tmp_sbc := C.sg_image_data{}
tmp_sbc.subimage[0][0] = C.sg_range{
ptr: tf_skl.bmp.buf
size: sz
size: size_t(sz)
}
C.sg_update_image(tf_skl.sg_img, &tmp_sbc)
}