From 3ddd3fc2facb0ff6139fd354ececfb02f8eec348 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Sun, 21 Jul 2019 11:31:17 -0700 Subject: [PATCH] In Procress --- opengl/4ed_opengl_render.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/opengl/4ed_opengl_render.cpp b/opengl/4ed_opengl_render.cpp index 524d3a03..301be6d3 100644 --- a/opengl/4ed_opengl_render.cpp +++ b/opengl/4ed_opengl_render.cpp @@ -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){