mirror of
https://github.com/nicbarker/clay.git
synced 2025-09-18 12:36:17 +00:00
update to newest sokol
This commit is contained in:
parent
9c4ebcba49
commit
bca9f1a8ec
|
@ -95,7 +95,7 @@
|
||||||
sclay_image to the CLAY macro, like this:
|
sclay_image to the CLAY macro, like this:
|
||||||
CLAY({
|
CLAY({
|
||||||
...
|
...
|
||||||
.image = { .imageData = &(sclay_image){ .image = img, .sampler = 0 } },
|
.image = { .imageData = &(sclay_image){ .view = view, .sampler = 0 } },
|
||||||
})
|
})
|
||||||
Using 0 as a sampler uses the sokol default sampler with linear interpolation.
|
Using 0 as a sampler uses the sokol default sampler with linear interpolation.
|
||||||
The image should be created using sg_make_image from sokol_gfx.
|
The image should be created using sg_make_image from sokol_gfx.
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
typedef int sclay_font_t;
|
typedef int sclay_font_t;
|
||||||
|
|
||||||
typedef struct sclay_image {
|
typedef struct sclay_image {
|
||||||
sg_image image;
|
sg_view view;
|
||||||
sg_sampler sampler;
|
sg_sampler sampler;
|
||||||
struct {
|
struct {
|
||||||
float u0, v0, u1, v1;
|
float u0, v0, u1, v1;
|
||||||
|
@ -459,7 +459,7 @@ void sclay_render(Clay_RenderCommandArray renderCommands, sclay_font_t *fonts) {
|
||||||
Clay_CornerRadius r = config->cornerRadius;
|
Clay_CornerRadius r = config->cornerRadius;
|
||||||
|
|
||||||
sgl_enable_texture();
|
sgl_enable_texture();
|
||||||
sgl_texture(img->image, img->sampler);
|
sgl_texture(img->view, img->sampler);
|
||||||
|
|
||||||
sgl_begin_triangle_strip();
|
sgl_begin_triangle_strip();
|
||||||
if(r.topLeft > 0 || r.topRight > 0){
|
if(r.topLeft > 0 || r.topRight > 0){
|
||||||
|
|
Loading…
Reference in a new issue