|
|
@@ -161,7 +161,15 @@ open_buffer() {
|
|
|
}
|
|
|
|
|
|
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");
|
|
|
close_buffer();
|
|
|
return false;
|