… | |
… | |
164 | } |
164 | } |
165 | } |
165 | } |
166 | |
166 | |
167 | if ($render) { |
167 | if ($render) { |
168 | glViewport 0, 0, $tw, $th; |
168 | glViewport 0, 0, $tw, $th; |
|
|
169 | #glScissor 0, 0, $tw, $th; |
|
|
170 | #glEnable GL_SCISSOR_TEST; |
169 | glMatrixMode GL_PROJECTION; |
171 | glMatrixMode GL_PROJECTION; |
170 | glLoadIdentity; |
172 | glLoadIdentity; |
171 | glOrtho 0, $tw, 0, $th, -10000, 10000; |
173 | glOrtho 0, $tw, 0, $th, -10000, 10000; |
172 | glMatrixMode GL_MODELVIEW; |
174 | glMatrixMode GL_MODELVIEW; |
173 | glLoadIdentity; |
175 | glLoadIdentity; |
… | |
… | |
218 | 0, 0, |
220 | 0, 0, |
219 | $tw, $th, |
221 | $tw, $th, |
220 | 0; |
222 | 0; |
221 | gl_check "copying to texture %dx%d if=%x", |
223 | gl_check "copying to texture %dx%d if=%x", |
222 | $tw, $th, $self->{internalformat}; |
224 | $tw, $th, $self->{internalformat}; |
|
|
225 | |
|
|
226 | #glDisable GL_SCISSOR_TEST; |
223 | } else { |
227 | } else { |
224 | glTexImage2D GL_TEXTURE_2D, 0, |
228 | glTexImage2D GL_TEXTURE_2D, 0, |
225 | $self->{internalformat}, |
229 | $self->{internalformat}, |
226 | $dw, $dh, |
230 | $dw, $dh, |
227 | 0, |
231 | 0, |