In Procress

master
Allen Webster 2019-07-21 11:31:17 -07:00
parent 55d064cf61
commit 3ddd3fc2fa
1 changed files with 8 additions and 1 deletions

View File

@ -31,7 +31,7 @@ gl__texture_initialize(GLint tex_width, GLint tex_height, u32 *pixels){
internal u32
gl__get_gpu_texture(Vec3_i32 dim, Texture_Kind texture_kind){
u32 tex;
u32 tex = 0;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@ -43,6 +43,13 @@ gl__get_gpu_texture(Vec3_i32 dim, Texture_Kind texture_kind){
return(tex);
}
internal b32
gl__fill_gpu_texture(Texture_Kind texture_kind, u32 gpu_texture, Vec3_i32 p, Vec3_i32 dim, void *data){
b32 result = false;
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, p.x, p.y, p.z, dim.x, dim.y, dim.z, GL_RED, GL_UNSIGNED_INT, data);
return(result);
}
internal void
gl__draw_bind_texture(Render_Target *t, i32 texid){
if (t->bound_texture != texid){