… | |
… | |
273 | gl_check "copying to texture %dx%d if=%x", |
273 | gl_check "copying to texture %dx%d if=%x", |
274 | $tw, $th, $self->{internalformat}; |
274 | $tw, $th, $self->{internalformat}; |
275 | |
275 | |
276 | #glDisable GL_SCISSOR_TEST; |
276 | #glDisable GL_SCISSOR_TEST; |
277 | } else { |
277 | } else { |
|
|
278 | my $if = $self->{internalformat}; |
|
|
279 | |
|
|
280 | if ($GL_COMPRESS && $::CFG->{texture_compression}) { |
|
|
281 | if ($if == GL_RGB) { |
|
|
282 | $if = GL_COMPRESSED_RGB_ARB; |
|
|
283 | } elsif ($if == GL_RGBA) { |
|
|
284 | $if = GL_COMPRESSED_RGBA_ARB; |
|
|
285 | } |
|
|
286 | } |
|
|
287 | |
278 | glTexImage2D GL_TEXTURE_2D, 0, |
288 | glTexImage2D GL_TEXTURE_2D, 0, |
279 | $self->{internalformat}, |
289 | $if, |
280 | $dw, $dh, |
290 | $dw, $dh, |
281 | 0, |
291 | 0, |
282 | $self->{format}, |
292 | $self->{format}, |
283 | $self->{type}, |
293 | $self->{type}, |
284 | $data; |
294 | $data; |