Commit 154fe135956d455668cd94862a4b1276ffad64e6
1 parent
372b5963
fixed some bad code that cause a problem for other modules
Showing
1 changed file
with
9 additions
and
9 deletions
Show diff stats
gl/gl_texture.h
... | ... | @@ -141,15 +141,17 @@ class gl_texture : public virtual image_stack<T> |
141 | 141 | void |
142 | 142 | createTexture() |
143 | 143 | { |
144 | + glPixelStorei(GL_UNPACK_ALIGNMENT,1); | |
145 | + glGenTextures(1, &texID); | |
146 | + glBindTexture(texture_type, texID); | |
147 | + glTexParameteri(texture_type, | |
148 | + GL_TEXTURE_MIN_FILTER, | |
149 | + GL_LINEAR); | |
150 | + glTexParameteri(texture_type, | |
151 | + GL_TEXTURE_MAG_FILTER, | |
152 | + GL_LINEAR); | |
144 | 153 | switch(texture_type) |
145 | 154 | { |
146 | - glPixelStorei(GL_UNPACK_ALIGNMENT,1); | |
147 | - glGenTextures(1, &texID); | |
148 | - glBindTexture(texture_type, texID); | |
149 | - glTexParameteri(texture_type, | |
150 | - GL_TEXTURE_MIN_FILTER, GL_NEAREST); | |
151 | - glTexParameteri(texture_type, | |
152 | - GL_TEXTURE_MAG_FILTER, GL_NEAREST); | |
153 | 155 | case GL_TEXTURE_3D: |
154 | 156 | glTexParameteri(texture_type, |
155 | 157 | GL_TEXTURE_WRAP_S, GL_REPEAT); |
... | ... | @@ -186,8 +188,6 @@ class gl_texture : public virtual image_stack<T> |
186 | 188 | GL_UNSIGNED_BYTE, |
187 | 189 | ptr); |
188 | 190 | break; |
189 | - default: | |
190 | - break; | |
191 | 191 | } |
192 | 192 | } |
193 | 193 | /* | ... | ... |