diff options
| author | Andre Weissflog <floooh@gmail.com> | 2020-11-04 18:35:50 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2020-11-04 18:35:50 +0100 |
| commit | 330cb511d685f7225986b3bba67883a5ca3f0b58 (patch) | |
| tree | 47919c7297029d804e467b7300bfdb119501308f | |
| parent | 6285f4f4f843abf6732b9f590ee1e938d4691cdb (diff) | |
| parent | b545e7fd0d843dc523619d5a5cb5e0a0fbd6f2be (diff) | |
Merge branch 'gl_texture_target' of https://github.com/oviano/sokol into oviano-gl_texture_target
| -rw-r--r-- | sokol_gfx.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h index e65553a8..3735f67c 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -1598,6 +1598,10 @@ typedef struct sg_image_content { .mtl_textures[SG_NUM_INFLIGHT_FRAMES] .d3d11_texture + For GL, you can also specify the texture target or leave it empty + to use the default texture target for the image type (GL_TEXTURE_2D + for SG_IMAGETYPE_2D etc) + The same rules apply as for injecting native buffers (see sg_buffer_desc documentation for more details). */ @@ -1628,6 +1632,7 @@ typedef struct sg_image_desc { const char* label; /* GL specific */ uint32_t gl_textures[SG_NUM_INFLIGHT_FRAMES]; + int gl_texture_target; /* Metal specific */ const void* mtl_textures[SG_NUM_INFLIGHT_FRAMES]; /* D3D11 specific */ @@ -5732,6 +5737,9 @@ _SOKOL_PRIVATE sg_resource_state _sg_gl_create_image(_sg_image_t* img, const sg_ SOKOL_ASSERT(desc->gl_textures[slot]); img->gl.tex[slot] = desc->gl_textures[slot]; } + if (desc->gl_texture_target) { + img->gl.target = (GLenum)desc->gl_texture_target; + } } else { /* create our own GL texture(s) */ |