diff options
author | Nanley Chery <nanley.g.chery@intel.com> | 2015-07-23 10:41:41 -0700 |
---|---|---|
committer | Nanley Chery <nanley.g.chery@intel.com> | 2015-07-23 10:41:41 -0700 |
commit | 6556675e7244302a4db86e077d965046f561bca1 (patch) | |
tree | d8af12ab84a0e70f3d20be746e9400b3c8bc10aa | |
parent | 21ab5a30c8d769b01d08e0a5ff300010da0f7cb0 (diff) |
Fix the image buffer offset
-rw-r--r-- | gen_array.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gen_array.c b/gen_array.c index 81e3a7f..ba12dd2 100644 --- a/gen_array.c +++ b/gen_array.c @@ -146,12 +146,12 @@ main(int argc, char *argv[]) /* Create the texture array */ img_info[cur_lev].size = expt*imgs; - img_info[cur_lev].data = (char*) malloc(level_size); + img_info[cur_lev].data = (char*) malloc(expt*imgs); for (cur_img = 0; cur_img < imgs; ++cur_img) { glBindTexture(GL_TEXTURE_2D, tex[cur_img]); glGetTexImage(GL_TEXTURE_2D, cur_lev, tex_info.glFormat, tex_info.glType, - img_info[cur_lev].data); + img_info[cur_lev].data + cur_img*expt); } } |