mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
texture-rectangle
This commit is contained in:
parent
ba30db6953
commit
89be2177c7
@ -161,7 +161,15 @@ open_buffer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_pbuffer == NULL) {
|
if (_pbuffer == NULL) {
|
||||||
if (!aglCreatePBuffer(_x_size, _y_size, GL_TEXTURE_2D, GL_RGBA, 0, &_pbuffer)) {
|
GLenum target = GL_TEXTURE_RECTANGLE_ARB;
|
||||||
|
if (_x_size == Texture::up_to_power_2(_x_size) &&
|
||||||
|
_y_size == Texture::up_to_power_2(_x_size)) {
|
||||||
|
// It's a power-of-two size, so we can use GL_TEXTURE_2D as the
|
||||||
|
// target. Dunno, but maybe this will be more likely to work on
|
||||||
|
// some hardware.
|
||||||
|
target = GL_TEXTURE_2D;
|
||||||
|
}
|
||||||
|
if (!aglCreatePBuffer(_x_size, _y_size, target, GL_RGBA, 0, &_pbuffer)) {
|
||||||
aglReportError("aglCreatePBuffer");
|
aglReportError("aglCreatePBuffer");
|
||||||
close_buffer();
|
close_buffer();
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user