Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2015-12-27 06:23:12 +0300
committerMike Erwin <significant.bit@gmail.com>2016-01-04 09:38:49 +0300
commitd2b4f9c627e6a9621797d7b9b8b3b83d3bfc2db5 (patch)
treead136cfdaf45d9554637ae777882a98e998e7f57 /source/blender/editors/screen
parented2daace76c0a101ce929031cfdbb7c3269df363 (diff)
OpenGL: image drawing tweaks
- no need to allocate client memory up front - delete unneeded GL calls - set default alpha test function on exit
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/glutil.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index cbb6b7685af..44ccf9a56bf 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -351,8 +351,6 @@ static int get_cached_work_texture(int *r_w, int *r_h)
static int tex_h = 256;
if (texid == -1) {
- unsigned char *tbuf;
-
glGenTextures(1, (GLuint *)&texid);
glBindTexture(GL_TEXTURE_2D, texid);
@@ -360,9 +358,7 @@ static int get_cached_work_texture(int *r_w, int *r_h)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- tbuf = MEM_callocN(tex_w * tex_h * 4, "tbuf");
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex_w, tex_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tbuf);
- MEM_freeN(tbuf);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex_w, tex_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glBindTexture(GL_TEXTURE_2D, 0);
}