|
|
@@ -2523,6 +2523,20 @@ reset() {
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
+#if defined(OPENGLES) && !defined(OPENGLES_1)
|
|
|
+ if (is_at_least_gles_version(3, 0)) {
|
|
|
+ _glReadBuffer = (PFNGLREADBUFFERPROC)
|
|
|
+ get_extension_func("glReadBuffer");
|
|
|
+
|
|
|
+ } else if (has_extension("GL_NV_read_buffer")) {
|
|
|
+ _glReadBuffer = (PFNGLREADBUFFERPROC)
|
|
|
+ get_extension_func("glReadBufferNV");
|
|
|
+
|
|
|
+ } else {
|
|
|
+ _glReadBuffer = nullptr;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
#ifndef OPENGLES_1
|
|
|
_max_color_targets = 1;
|
|
|
if (_glDrawBuffers != nullptr) {
|
|
|
@@ -8868,7 +8882,7 @@ set_draw_buffer(int rbtype) {
|
|
|
*/
|
|
|
void CLP(GraphicsStateGuardian)::
|
|
|
set_read_buffer(int rbtype) {
|
|
|
-#ifndef OPENGLES // Draw buffers not supported by OpenGL ES. (TODO!)
|
|
|
+#ifndef OPENGLES_1 // Draw buffers not supported by OpenGL ES 1.
|
|
|
if (rbtype & (RenderBuffer::T_depth | RenderBuffer::T_stencil)) {
|
|
|
// Special case: don't have to call ReadBuffer for these.
|
|
|
return;
|
|
|
@@ -8901,10 +8915,14 @@ set_read_buffer(int rbtype) {
|
|
|
}
|
|
|
++index;
|
|
|
}
|
|
|
+#ifdef OPENGLES
|
|
|
+ _glReadBuffer(buffer);
|
|
|
+#else
|
|
|
glReadBuffer(buffer);
|
|
|
+#endif
|
|
|
|
|
|
} else {
|
|
|
-
|
|
|
+#ifndef OPENGLES
|
|
|
switch (rbtype & RenderBuffer::T_color) {
|
|
|
case RenderBuffer::T_front:
|
|
|
glReadBuffer(GL_FRONT);
|
|
|
@@ -8941,10 +8959,11 @@ set_read_buffer(int rbtype) {
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+#endif // OPENGLES
|
|
|
}
|
|
|
|
|
|
report_my_gl_errors();
|
|
|
-#endif // OPENGLES
|
|
|
+#endif // OPENGLES_1
|
|
|
}
|
|
|
|
|
|
/**
|