mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
This commit adds more+better support for OpenGL ES:
* Support for many OES extensions * Support for OpenGL ES 2.x * Compile fixes for OpenGL ES 1.x * Support for FBO's in both versions
This commit is contained in:
parent
7bb2991ccb
commit
cbe036c849
@ -37,7 +37,7 @@ CLP(GeomContext)::
|
|||||||
bool CLP(GeomContext)::
|
bool CLP(GeomContext)::
|
||||||
get_display_list(GLuint &index, const CLP(GeomMunger) *munger,
|
get_display_list(GLuint &index, const CLP(GeomMunger) *munger,
|
||||||
UpdateSeq modified) {
|
UpdateSeq modified) {
|
||||||
#ifdef OPENGLES_1
|
#ifdef OPENGLES
|
||||||
// Display lists not supported by OpenGL ES.
|
// Display lists not supported by OpenGL ES.
|
||||||
nassertr(false, false);
|
nassertr(false, false);
|
||||||
return false;
|
return false;
|
||||||
@ -56,7 +56,7 @@ get_display_list(GLuint &index, const CLP(GeomMunger) *munger,
|
|||||||
index = dl._index;
|
index = dl._index;
|
||||||
dl._modified = modified;
|
dl._modified = modified;
|
||||||
return list_current;
|
return list_current;
|
||||||
#endif // OPENGLES_1
|
#endif // OPENGLES
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -68,7 +68,7 @@ get_display_list(GLuint &index, const CLP(GeomMunger) *munger,
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void CLP(GeomContext)::
|
void CLP(GeomContext)::
|
||||||
release_display_lists() {
|
release_display_lists() {
|
||||||
#ifdef OPENGLES_1
|
#ifdef OPENGLES
|
||||||
// Display lists not supported by OpenGL ES.
|
// Display lists not supported by OpenGL ES.
|
||||||
nassertv(_display_lists.empty());
|
nassertv(_display_lists.empty());
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ release_display_lists() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_display_lists.clear();
|
_display_lists.clear();
|
||||||
#endif // OPENGLES_1
|
#endif // OPENGLES
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -10,9 +10,33 @@
|
|||||||
// license. You should have received a copy of this license along
|
// license. You should have received a copy of this license along
|
||||||
// with this source code in a file named "LICENSE."
|
// with this source code in a file named "LICENSE."
|
||||||
//
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TypeHandle CLP(GraphicsBuffer)::_type_handle;
|
TypeHandle CLP(GraphicsBuffer)::_type_handle;
|
||||||
|
|
||||||
|
// This helps to keep the source clean of hundreds of #ifdefs.
|
||||||
|
#ifdef OPENGLES_2
|
||||||
|
#define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER
|
||||||
|
#define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER
|
||||||
|
#else
|
||||||
|
#ifdef OPENGLES_1
|
||||||
|
#define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||||
|
#define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||||
|
#define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||||
|
#define GL_RENDERBUFFER GL_RENDERBUFFER_OES
|
||||||
|
#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
|
||||||
|
#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES
|
||||||
|
#define GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_OES
|
||||||
|
#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
|
||||||
|
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES
|
||||||
|
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES
|
||||||
|
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES
|
||||||
|
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES
|
||||||
|
#define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_OES
|
||||||
|
#define GL_DEPTH_STENCIL GL_DEPTH_STENCIL_OES
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: glGraphicsBuffer::Constructor
|
// Function: glGraphicsBuffer::Constructor
|
||||||
// Access: Public
|
// Access: Public
|
||||||
@ -173,26 +197,28 @@ check_fbo() {
|
|||||||
CLP(GraphicsStateGuardian) *glgsg;
|
CLP(GraphicsStateGuardian) *glgsg;
|
||||||
DCAST_INTO_R(glgsg, _gsg, false);
|
DCAST_INTO_R(glgsg, _gsg, false);
|
||||||
|
|
||||||
GLenum status = glgsg->_glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
|
GLenum status = glgsg->_glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
if (status != GL_FRAMEBUFFER_COMPLETE) {
|
||||||
GLCAT.error() << "EXT_framebuffer_object reports non-framebuffer-completeness.\n";
|
GLCAT.error() << "EXT_framebuffer_object reports non-framebuffer-completeness.\n";
|
||||||
switch(status) {
|
switch(status) {
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
|
||||||
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\n"; break;
|
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_ATTACHMENT\n"; break;
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
|
||||||
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT\n"; break;
|
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\n"; break;
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
|
||||||
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\n"; break;
|
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_DIMENSIONS\n"; break;
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
|
||||||
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_FORMATS_EXT\n"; break;
|
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_FORMATS\n"; break;
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
|
case GL_FRAMEBUFFER_UNSUPPORTED:
|
||||||
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT\n"; break;
|
GLCAT.error() << "FRAMEBUFFER_UNSUPPORTED\n"; break;
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
|
#ifndef OPENGLES
|
||||||
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT\n"; break;
|
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
|
||||||
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
|
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER\n"; break;
|
||||||
GLCAT.error() << "FRAMEBUFFER_UNSUPPORTED_EXT\n"; break;
|
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:
|
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_READ_BUFFER\n"; break;
|
||||||
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT\n"; break;
|
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
|
||||||
|
GLCAT.error() << "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE\n"; break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
GLCAT.error() << "OTHER PROBLEM\n"; break;
|
GLCAT.error() << "OTHER PROBLEM\n"; break;
|
||||||
}
|
}
|
||||||
@ -307,10 +333,11 @@ rebuild_bitplanes() {
|
|||||||
|
|
||||||
// For all slots, update the slot.
|
// For all slots, update the slot.
|
||||||
|
|
||||||
// bind_slot(rb_resize, attach, RTP_depth_stencil, GL_DEPTH_ATTACHMENT_EXT);
|
// bind_slot(rb_resize, attach, RTP_depth_stencil, GL_DEPTH_ATTACHMENT);
|
||||||
bind_slot(rb_resize, attach, RTP_depth, GL_DEPTH_ATTACHMENT_EXT);
|
bind_slot(rb_resize, attach, RTP_depth, GL_DEPTH_ATTACHMENT);
|
||||||
bind_slot(rb_resize, attach, RTP_color, GL_COLOR_ATTACHMENT0_EXT);
|
bind_slot(rb_resize, attach, RTP_color, GL_COLOR_ATTACHMENT0);
|
||||||
int next = GL_COLOR_ATTACHMENT1_EXT;
|
#ifndef OPENGLES
|
||||||
|
int next = GL_COLOR_ATTACHMENT1;
|
||||||
for (int i=0; i<_fb_properties.get_aux_rgba(); i++) {
|
for (int i=0; i<_fb_properties.get_aux_rgba(); i++) {
|
||||||
bind_slot(rb_resize, attach, (RenderTexturePlane)(RTP_aux_rgba_0+i), next);
|
bind_slot(rb_resize, attach, (RenderTexturePlane)(RTP_aux_rgba_0+i), next);
|
||||||
next += 1;
|
next += 1;
|
||||||
@ -323,15 +350,17 @@ rebuild_bitplanes() {
|
|||||||
bind_slot(rb_resize, attach, (RenderTexturePlane)(RTP_aux_float_0+i), next);
|
bind_slot(rb_resize, attach, (RenderTexturePlane)(RTP_aux_float_0+i), next);
|
||||||
next += 1;
|
next += 1;
|
||||||
}
|
}
|
||||||
|
#endif // OPENGLES_2
|
||||||
// Setup any required multisample buffers.
|
// Setup any required multisample buffers.
|
||||||
if (_requested_multisamples) {
|
if (_requested_multisamples) {
|
||||||
if (_fbo_multisample == 0) {
|
if (_fbo_multisample == 0) {
|
||||||
glgsg->_glGenFramebuffers(1, &_fbo_multisample);
|
glgsg->_glGenFramebuffers(1, &_fbo_multisample);
|
||||||
}
|
}
|
||||||
glgsg->bind_fbo(_fbo_multisample);
|
glgsg->bind_fbo(_fbo_multisample);
|
||||||
bind_slot(rb_resize, attach, RTP_depth, GL_DEPTH_ATTACHMENT_EXT);
|
bind_slot(rb_resize, attach, RTP_depth, GL_DEPTH_ATTACHMENT);
|
||||||
bind_slot_multisample(rb_resize, attach, RTP_color, GL_COLOR_ATTACHMENT0_EXT);
|
bind_slot_multisample(rb_resize, attach, RTP_color, GL_COLOR_ATTACHMENT0);
|
||||||
int next = GL_COLOR_ATTACHMENT1_EXT;
|
#ifndef OPENGLES
|
||||||
|
int next = GL_COLOR_ATTACHMENT1;
|
||||||
for (int i=0; i<_fb_properties.get_aux_rgba(); i++) {
|
for (int i=0; i<_fb_properties.get_aux_rgba(); i++) {
|
||||||
bind_slot_multisample(rb_resize, attach, (RenderTexturePlane)(RTP_aux_rgba_0+i), next);
|
bind_slot_multisample(rb_resize, attach, (RenderTexturePlane)(RTP_aux_rgba_0+i), next);
|
||||||
next += 1;
|
next += 1;
|
||||||
@ -344,10 +373,10 @@ rebuild_bitplanes() {
|
|||||||
bind_slot_multisample(rb_resize, attach, (RenderTexturePlane)(RTP_aux_float_0+i), next);
|
bind_slot_multisample(rb_resize, attach, (RenderTexturePlane)(RTP_aux_float_0+i), next);
|
||||||
next += 1;
|
next += 1;
|
||||||
}
|
}
|
||||||
glEnable(GL_MULTISAMPLE_ARB);
|
glEnable(GL_MULTISAMPLE);
|
||||||
}
|
} else {
|
||||||
else {
|
glDisable(GL_MULTISAMPLE);
|
||||||
glDisable(GL_MULTISAMPLE_ARB);
|
#endif // OPENGLES_2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -367,7 +396,7 @@ rebuild_bitplanes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (update) {
|
if (update) {
|
||||||
int color_attachment = GL_COLOR_ATTACHMENT0_EXT;
|
int color_attachment = GL_COLOR_ATTACHMENT0;
|
||||||
|
|
||||||
for (int i=0; i<count_textures(); i++) {
|
for (int i=0; i<count_textures(); i++) {
|
||||||
// Do we really need the following lines?
|
// Do we really need the following lines?
|
||||||
@ -391,8 +420,8 @@ rebuild_bitplanes() {
|
|||||||
// also case RTP_depth_stencil
|
// also case RTP_depth_stencil
|
||||||
for (int f = 0; f < 6; f++) {
|
for (int f = 0; f < 6; f++) {
|
||||||
glgsg -> bind_fbo(_cubemap_fbo [f]);
|
glgsg -> bind_fbo(_cubemap_fbo [f]);
|
||||||
glgsg -> _glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
glgsg -> _glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + f,
|
GL_TEXTURE_CUBE_MAP_POSITIVE_X + f,
|
||||||
gtc->_index, 0);
|
gtc->_index, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -412,8 +441,8 @@ rebuild_bitplanes() {
|
|||||||
case RTP_aux_float_3:
|
case RTP_aux_float_3:
|
||||||
for (int f = 0; f < 6; f++) {
|
for (int f = 0; f < 6; f++) {
|
||||||
glgsg -> bind_fbo(_cubemap_fbo [f]);
|
glgsg -> bind_fbo(_cubemap_fbo [f]);
|
||||||
glgsg -> _glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, color_attachment,
|
glgsg -> _glFramebufferTexture2D(GL_FRAMEBUFFER, color_attachment,
|
||||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + f,
|
GL_TEXTURE_CUBE_MAP_POSITIVE_X + f,
|
||||||
gtc->_index, 0);
|
gtc->_index, 0);
|
||||||
}
|
}
|
||||||
color_attachment++;
|
color_attachment++;
|
||||||
@ -428,15 +457,17 @@ rebuild_bitplanes() {
|
|||||||
glgsg -> bind_fbo(_cubemap_fbo [0]);
|
glgsg -> bind_fbo(_cubemap_fbo [0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENGLES
|
||||||
if ( (_fb_properties.get_rgb_color() > 0) ||
|
if ( (_fb_properties.get_rgb_color() > 0) ||
|
||||||
(_fb_properties.get_aux_hrgba() > 0) ) {
|
(_fb_properties.get_aux_hrgba() > 0) ) {
|
||||||
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||||
glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
glDrawBuffer(GL_NONE);
|
glDrawBuffer(GL_NONE);
|
||||||
glReadBuffer(GL_NONE);
|
glReadBuffer(GL_NONE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
_cube_face_active = 0;
|
_cube_face_active = 0;
|
||||||
report_my_gl_errors();
|
report_my_gl_errors();
|
||||||
@ -461,12 +492,14 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
|
|||||||
case RTP_aux_rgba_3:
|
case RTP_aux_rgba_3:
|
||||||
glFormat = GL_RGBA;
|
glFormat = GL_RGBA;
|
||||||
break;
|
break;
|
||||||
|
#ifndef OPENGLES_2
|
||||||
case RTP_aux_hrgba_0:
|
case RTP_aux_hrgba_0:
|
||||||
case RTP_aux_hrgba_1:
|
case RTP_aux_hrgba_1:
|
||||||
case RTP_aux_hrgba_2:
|
case RTP_aux_hrgba_2:
|
||||||
case RTP_aux_hrgba_3:
|
case RTP_aux_hrgba_3:
|
||||||
glFormat = GL_RGBA16F_ARB;
|
glFormat = GL_RGBA16F_ARB;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -486,7 +519,7 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
|
|||||||
tex->set_y_size(_rb_size_y);
|
tex->set_y_size(_rb_size_y);
|
||||||
tex->set_pad_size(_rb_size_x - _x_size, _rb_size_y - _y_size);
|
tex->set_pad_size(_rb_size_x - _x_size, _rb_size_y - _y_size);
|
||||||
_use_depth_stencil = false;
|
_use_depth_stencil = false;
|
||||||
if (attachpoint == GL_DEPTH_ATTACHMENT_EXT) {
|
if (attachpoint == GL_DEPTH_ATTACHMENT) {
|
||||||
if ( _gsg->get_supports_depth_stencil() && tex->get_format() == Texture::F_depth_stencil ) {
|
if ( _gsg->get_supports_depth_stencil() && tex->get_format() == Texture::F_depth_stencil ) {
|
||||||
tex->set_component_type(Texture::T_unsigned_int_24_8);
|
tex->set_component_type(Texture::T_unsigned_int_24_8);
|
||||||
_use_depth_stencil = true;
|
_use_depth_stencil = true;
|
||||||
@ -496,39 +529,44 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
|
|||||||
CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
|
CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
|
||||||
glgsg->update_texture(tc, true);
|
glgsg->update_texture(tc, true);
|
||||||
if (tex->get_texture_type() == Texture::TT_2d_texture) {
|
if (tex->get_texture_type() == Texture::TT_2d_texture) {
|
||||||
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||||
GL_TEXTURE_2D, gtc->_index, 0);
|
GL_TEXTURE_2D, gtc->_index, 0);
|
||||||
} else {
|
} else {
|
||||||
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
|
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
|
||||||
gtc->_index, 0);
|
gtc->_index, 0);
|
||||||
}
|
}
|
||||||
if (_use_depth_stencil) {
|
if (_use_depth_stencil) {
|
||||||
if (tex->get_texture_type() == Texture::TT_2d_texture) {
|
if (tex->get_texture_type() == Texture::TT_2d_texture) {
|
||||||
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
|
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
|
||||||
GL_TEXTURE_2D, gtc->_index, 0);
|
GL_TEXTURE_2D, gtc->_index, 0);
|
||||||
} else {
|
} else {
|
||||||
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
|
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
|
||||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
|
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
|
||||||
gtc->_index, 0);
|
gtc->_index, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (glFormat == GL_RGBA16F_ARB)
|
#ifdef OPENGLES_2
|
||||||
|
tex->set_format(Texture::F_rgba);
|
||||||
|
#else
|
||||||
|
if (glFormat == GL_RGBA16F_ARB) {
|
||||||
tex->set_format(Texture::F_rgba16);
|
tex->set_format(Texture::F_rgba16);
|
||||||
else
|
} else {
|
||||||
tex->set_format(Texture::F_rgba);
|
tex->set_format(Texture::F_rgba);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
|
TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
|
||||||
nassertv(tc != (TextureContext *)NULL);
|
nassertv(tc != (TextureContext *)NULL);
|
||||||
CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
|
CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
|
||||||
glgsg->update_texture(tc, true);
|
glgsg->update_texture(tc, true);
|
||||||
if (tex->get_texture_type() == Texture::TT_2d_texture) {
|
if (tex->get_texture_type() == Texture::TT_2d_texture) {
|
||||||
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, attachpoint,
|
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER, attachpoint,
|
||||||
GL_TEXTURE_2D, gtc->_index, 0);
|
GL_TEXTURE_2D, gtc->_index, 0);
|
||||||
} else {
|
} else {
|
||||||
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, attachpoint,
|
glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER, attachpoint,
|
||||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
|
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
|
||||||
gtc->_index, 0);
|
gtc->_index, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -556,12 +594,13 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allocate and bind the renderbuffer.
|
// Allocate and bind the renderbuffer.
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, _rb[slot]);
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, _rb[slot]);
|
||||||
if (attachpoint == GL_DEPTH_ATTACHMENT_EXT) {
|
if (attachpoint == GL_DEPTH_ATTACHMENT) {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
if (_gsg->get_supports_depth_stencil() && slot == RTP_depth_stencil) {
|
if (_gsg->get_supports_depth_stencil() && slot == RTP_depth_stencil) {
|
||||||
glgsg->_glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_EXT,
|
glgsg->_glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL,
|
||||||
_rb_size_x, _rb_size_y);
|
_rb_size_x, _rb_size_y);
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, 0);
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
|
|
||||||
GLuint rb;
|
GLuint rb;
|
||||||
|
|
||||||
@ -570,15 +609,16 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
|
|||||||
rb = _shared_depth_buffer -> _rb[slot];
|
rb = _shared_depth_buffer -> _rb[slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||||
GL_RENDERBUFFER_EXT, rb);
|
GL_RENDERBUFFER, rb);
|
||||||
|
|
||||||
glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
|
glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
|
||||||
GL_RENDERBUFFER_EXT, rb);
|
GL_RENDERBUFFER, rb);
|
||||||
} else {
|
} else {
|
||||||
glgsg->_glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
|
#endif
|
||||||
|
glgsg->_glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT,
|
||||||
_rb_size_x, _rb_size_y);
|
_rb_size_x, _rb_size_y);
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, 0);
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
|
|
||||||
GLuint rb;
|
GLuint rb;
|
||||||
|
|
||||||
@ -587,15 +627,17 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
|
|||||||
rb = _shared_depth_buffer -> _rb[slot];
|
rb = _shared_depth_buffer -> _rb[slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||||
GL_RENDERBUFFER_EXT, rb);
|
GL_RENDERBUFFER, rb);
|
||||||
|
#ifndef OPENGLES_2
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
glgsg->_glRenderbufferStorage(GL_RENDERBUFFER_EXT, glFormat,
|
glgsg->_glRenderbufferStorage(GL_RENDERBUFFER, glFormat,
|
||||||
_rb_size_x, _rb_size_y);
|
_rb_size_x, _rb_size_y);
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, 0);
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, attachpoint,
|
glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER, attachpoint,
|
||||||
GL_RENDERBUFFER_EXT, _rb[slot]);
|
GL_RENDERBUFFER, _rb[slot]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toss any texture that was connected to the slot.
|
// Toss any texture that was connected to the slot.
|
||||||
@ -613,95 +655,115 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void CLP(GraphicsBuffer)::
|
void CLP(GraphicsBuffer)::
|
||||||
bind_slot_multisample(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum attachpoint) {
|
bind_slot_multisample(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum attachpoint) {
|
||||||
CLP(GraphicsStateGuardian) *glgsg;
|
CLP(GraphicsStateGuardian) *glgsg;
|
||||||
DCAST_INTO_V(glgsg, _gsg);
|
DCAST_INTO_V(glgsg, _gsg);
|
||||||
|
|
||||||
if ((_rbm[slot] != 0)&&(!rb_resize)) {
|
if ((_rbm[slot] != 0)&&(!rb_resize)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_rbm[slot] != 0) {
|
if (_rbm[slot] != 0) {
|
||||||
glgsg->_glDeleteRenderbuffers(1, &(_rbm[slot]));
|
glgsg->_glDeleteRenderbuffers(1, &(_rbm[slot]));
|
||||||
_rbm[slot] = 0;
|
_rbm[slot] = 0;
|
||||||
}
|
}
|
||||||
glgsg->_glBindFramebuffer(GL_FRAMEBUFFER_EXT, _fbo_multisample);
|
glgsg->_glBindFramebuffer(GL_FRAMEBUFFER, _fbo_multisample);
|
||||||
glgsg->_glGenRenderbuffers(1, &(_rbm[slot]));
|
glgsg->_glGenRenderbuffers(1, &(_rbm[slot]));
|
||||||
// Allocate and bind the renderbuffer.
|
// Allocate and bind the renderbuffer.
|
||||||
Texture *tex = attach[slot];// if there is a texture map, use it's format as needed.
|
Texture *tex = attach[slot];// if there is a texture map, use it's format as needed.
|
||||||
|
|
||||||
if (attachpoint == GL_DEPTH_ATTACHMENT_EXT) {
|
if (attachpoint == GL_DEPTH_ATTACHMENT) {
|
||||||
if ( _gsg->get_supports_depth_stencil() && _use_depth_stencil ) {
|
#ifndef OPENGLES_2
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, _rbm[slot]);
|
if (_gsg->get_supports_depth_stencil() && _use_depth_stencil) {
|
||||||
if (_requested_coverage_samples)
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, _rbm[slot]);
|
||||||
glgsg->_glRenderbufferStorageMultisampleCoverage(GL_RENDERBUFFER_EXT, _requested_coverage_samples,
|
if (_requested_coverage_samples)
|
||||||
_requested_multisamples, GL_DEPTH_STENCIL_EXT,
|
glgsg->_glRenderbufferStorageMultisampleCoverage(GL_RENDERBUFFER, _requested_coverage_samples,
|
||||||
_rb_size_x, _rb_size_y);
|
_requested_multisamples, GL_DEPTH_STENCIL,
|
||||||
else
|
_rb_size_x, _rb_size_y);
|
||||||
glgsg->_glRenderbufferStorageMultisample(GL_RENDERBUFFER_EXT, _requested_multisamples, GL_DEPTH_STENCIL_EXT,
|
else
|
||||||
_rb_size_x, _rb_size_y);
|
glgsg->_glRenderbufferStorageMultisample(GL_RENDERBUFFER, _requested_multisamples, GL_DEPTH_STENCIL,
|
||||||
GLint givenSamples = -1;
|
_rb_size_x, _rb_size_y);
|
||||||
glgsg->_glGetRenderbufferParameteriv( GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_SAMPLES_EXT, &givenSamples);
|
GLint givenSamples = -1;
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, 0);
|
#ifndef OPENGLES
|
||||||
glgsg->_glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
glgsg->_glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &givenSamples);
|
||||||
GL_RENDERBUFFER_EXT, _rbm[slot]);
|
#endif // OPENGLES
|
||||||
glgsg->_glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
GL_RENDERBUFFER_EXT, _rbm[slot]);
|
glgsg->_glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||||
} else {
|
GL_RENDERBUFFER, _rbm[slot]);
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, _rbm[slot]);
|
glgsg->_glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
|
||||||
GLuint format = GL_DEPTH_COMPONENT;
|
GL_RENDERBUFFER, _rbm[slot]);
|
||||||
if (tex)
|
} else {
|
||||||
{
|
#endif // OPENGLES_2
|
||||||
if (tex->get_format() == Texture::F_depth_component16)
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, _rbm[slot]);
|
||||||
format = GL_DEPTH_COMPONENT16;
|
GLuint format = GL_DEPTH_COMPONENT;
|
||||||
if (tex->get_format() == Texture::F_depth_component24)
|
if (tex) {
|
||||||
format = GL_DEPTH_COMPONENT24;
|
if (tex->get_format() == Texture::F_depth_component16)
|
||||||
if (tex->get_format() == Texture::F_depth_component32)
|
#ifdef OPENGLES_1
|
||||||
format = GL_DEPTH_COMPONENT32;
|
format = GL_DEPTH_COMPONENT16_OES;
|
||||||
}
|
#else // OPENGLES_1
|
||||||
if (_requested_coverage_samples)
|
format = GL_DEPTH_COMPONENT16;
|
||||||
glgsg->_glRenderbufferStorageMultisampleCoverage(GL_RENDERBUFFER_EXT, _requested_coverage_samples,
|
#endif
|
||||||
_requested_multisamples, format,
|
if (tex->get_format() == Texture::F_depth_component24)
|
||||||
_rb_size_x, _rb_size_y);
|
#ifdef OPENGLES
|
||||||
else
|
format = GL_DEPTH_COMPONENT24_OES;
|
||||||
glgsg->_glRenderbufferStorageMultisample(GL_RENDERBUFFER_EXT, _requested_multisamples, format,
|
if (tex->get_format() == Texture::F_depth_component32)
|
||||||
_rb_size_x, _rb_size_y);
|
format = GL_DEPTH_COMPONENT32_OES;
|
||||||
GLint givenSamples = -1;
|
#else
|
||||||
glgsg->_glGetRenderbufferParameteriv( GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_SAMPLES_EXT, &givenSamples);
|
format = GL_DEPTH_COMPONENT24;
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, 0);
|
if (tex->get_format() == Texture::F_depth_component32)
|
||||||
glgsg->_glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
format = GL_DEPTH_COMPONENT32;
|
||||||
GL_RENDERBUFFER_EXT, _rbm[slot]);
|
#endif // OPENGLES
|
||||||
|
#ifndef OPENGLES_2
|
||||||
}
|
}
|
||||||
|
#endif // OPENGLES_2
|
||||||
|
if (_requested_coverage_samples)
|
||||||
|
glgsg->_glRenderbufferStorageMultisampleCoverage(GL_RENDERBUFFER, _requested_coverage_samples,
|
||||||
|
_requested_multisamples, format,
|
||||||
|
_rb_size_x, _rb_size_y);
|
||||||
|
else
|
||||||
|
glgsg->_glRenderbufferStorageMultisample(GL_RENDERBUFFER, _requested_multisamples, format,
|
||||||
|
_rb_size_x, _rb_size_y);
|
||||||
|
GLint givenSamples = -1;
|
||||||
|
#ifndef OPENGLES
|
||||||
|
glgsg->_glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &givenSamples);
|
||||||
|
#endif
|
||||||
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
|
glgsg->_glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||||
|
GL_RENDERBUFFER, _rbm[slot]);
|
||||||
}
|
}
|
||||||
else {
|
} else {
|
||||||
Texture *Tex = attach[slot];
|
Texture *Tex = attach[slot];
|
||||||
GLuint glFormat = GL_RGBA;
|
GLuint glFormat = GL_RGBA;
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case RTP_aux_rgba_0:
|
case RTP_aux_rgba_0:
|
||||||
case RTP_aux_rgba_1:
|
case RTP_aux_rgba_1:
|
||||||
case RTP_aux_rgba_2:
|
case RTP_aux_rgba_2:
|
||||||
case RTP_aux_rgba_3:
|
case RTP_aux_rgba_3:
|
||||||
glFormat = GL_RGBA;
|
glFormat = GL_RGBA;
|
||||||
break;
|
break;
|
||||||
case RTP_aux_hrgba_0:
|
#ifndef OPENGLES_2
|
||||||
case RTP_aux_hrgba_1:
|
case RTP_aux_hrgba_0:
|
||||||
case RTP_aux_hrgba_2:
|
case RTP_aux_hrgba_1:
|
||||||
case RTP_aux_hrgba_3:
|
case RTP_aux_hrgba_2:
|
||||||
glFormat = GL_RGBA16F_ARB;
|
case RTP_aux_hrgba_3:
|
||||||
break;
|
glFormat = GL_RGBA16F_ARB;
|
||||||
};
|
break;
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, _rbm[slot]);
|
#endif
|
||||||
if (_requested_coverage_samples)
|
};
|
||||||
glgsg->_glRenderbufferStorageMultisampleCoverage(GL_RENDERBUFFER_EXT, _requested_coverage_samples,
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, _rbm[slot]);
|
||||||
_requested_multisamples, glFormat, _rb_size_x, _rb_size_y);
|
if (_requested_coverage_samples)
|
||||||
else
|
glgsg->_glRenderbufferStorageMultisampleCoverage(GL_RENDERBUFFER, _requested_coverage_samples,
|
||||||
glgsg->_glRenderbufferStorageMultisample(GL_RENDERBUFFER_EXT, _requested_multisamples, glFormat,
|
_requested_multisamples, glFormat, _rb_size_x, _rb_size_y);
|
||||||
_rb_size_x, _rb_size_y);
|
else
|
||||||
GLint givenSamples = -1;
|
glgsg->_glRenderbufferStorageMultisample(GL_RENDERBUFFER, _requested_multisamples, glFormat,
|
||||||
glgsg->_glGetRenderbufferParameteriv( GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_SAMPLES_EXT, &givenSamples);
|
_rb_size_x, _rb_size_y);
|
||||||
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, 0);
|
GLint givenSamples = -1;
|
||||||
glgsg->_glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER_EXT, attachpoint,
|
#ifndef OPENGLES
|
||||||
GL_RENDERBUFFER_EXT, _rbm[slot]);
|
glgsg->_glGetRenderbufferParameteriv( GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &givenSamples);
|
||||||
}
|
#endif
|
||||||
glgsg->report_my_gl_errors();
|
glgsg->_glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
|
glgsg->_glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, attachpoint,
|
||||||
|
GL_RENDERBUFFER, _rbm[slot]);
|
||||||
|
}
|
||||||
|
glgsg->report_my_gl_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -742,8 +804,7 @@ generate_mipmaps() {
|
|||||||
// after rendering is completed for a given frame. It
|
// after rendering is completed for a given frame. It
|
||||||
// should do whatever finalization is required.
|
// should do whatever finalization is required.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void CLP(GraphicsBuffer)::
|
void CLP(GraphicsBuffer)::end_frame(FrameMode mode, Thread *current_thread) {
|
||||||
end_frame(FrameMode mode, Thread *current_thread) {
|
|
||||||
end_frame_spam(mode);
|
end_frame_spam(mode);
|
||||||
nassertv(_gsg != (GraphicsStateGuardian *)NULL);
|
nassertv(_gsg != (GraphicsStateGuardian *)NULL);
|
||||||
|
|
||||||
@ -758,8 +819,8 @@ void CLP(GraphicsBuffer)::
|
|||||||
// Resolve Multisample rendering if using it.
|
// Resolve Multisample rendering if using it.
|
||||||
if (_requested_multisamples && _fbo_multisample) {
|
if (_requested_multisamples && _fbo_multisample) {
|
||||||
glgsg->report_my_gl_errors();
|
glgsg->report_my_gl_errors();
|
||||||
glgsg->_glBindFramebuffer( GL_DRAW_FRAMEBUFFER_EXT, _fbo );
|
glgsg->_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _fbo);
|
||||||
glgsg->_glBindFramebuffer( GL_READ_FRAMEBUFFER_EXT, _fbo_multisample );
|
glgsg->_glBindFramebuffer(GL_READ_FRAMEBUFFER, _fbo_multisample);
|
||||||
|
|
||||||
// If the depth buffer is shared, resolve it only on the last to render FBO.
|
// If the depth buffer is shared, resolve it only on the last to render FBO.
|
||||||
int do_depth_blit = 0;
|
int do_depth_blit = 0;
|
||||||
@ -774,18 +835,20 @@ void CLP(GraphicsBuffer)::
|
|||||||
graphics_buffer_iterator++) {
|
graphics_buffer_iterator++) {
|
||||||
graphics_buffer = (*graphics_buffer_iterator);
|
graphics_buffer = (*graphics_buffer_iterator);
|
||||||
if (graphics_buffer) {
|
if (graphics_buffer) {
|
||||||
// this call removes the entry from the list
|
// This call removes the entry from the list
|
||||||
if ( graphics_buffer->get_sort() >= max_sort_order ) {
|
if (graphics_buffer->get_sort() >= max_sort_order) {
|
||||||
max_sort_order = graphics_buffer->get_sort();
|
max_sort_order = graphics_buffer->get_sort();
|
||||||
highest_sort_graphics_buffer = graphics_buffer;
|
highest_sort_graphics_buffer = graphics_buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( max_sort_order == this->get_sort() )
|
if (max_sort_order == this->get_sort()) {
|
||||||
do_depth_blit = 1;
|
do_depth_blit = 1;
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
do_depth_blit = 1;
|
do_depth_blit = 1;
|
||||||
|
}
|
||||||
|
#ifndef OPENGLES
|
||||||
if (do_depth_blit)
|
if (do_depth_blit)
|
||||||
glgsg->_glBlitFramebuffer(0, 0, _rb_size_x, _rb_size_y, 0, 0, _rb_size_x, _rb_size_y,
|
glgsg->_glBlitFramebuffer(0, 0, _rb_size_x, _rb_size_y, 0, 0, _rb_size_x, _rb_size_y,
|
||||||
GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,
|
GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,
|
||||||
@ -795,30 +858,31 @@ void CLP(GraphicsBuffer)::
|
|||||||
GL_COLOR_BUFFER_BIT,
|
GL_COLOR_BUFFER_BIT,
|
||||||
GL_NEAREST);
|
GL_NEAREST);
|
||||||
// Now handle the other color buffers.
|
// Now handle the other color buffers.
|
||||||
int next = GL_COLOR_ATTACHMENT1_EXT;
|
int next = GL_COLOR_ATTACHMENT1;
|
||||||
for (int i=0; i<_fb_properties.get_aux_rgba(); i++) {
|
for (int i=0; i<_fb_properties.get_aux_rgba(); i++) {
|
||||||
glReadBuffer( next );
|
glReadBuffer(next);
|
||||||
glDrawBuffer( next );
|
glDrawBuffer(next);
|
||||||
glgsg->_glBlitFramebuffer(0, 0, _rb_size_x, _rb_size_y, 0, 0, _rb_size_x, _rb_size_y,
|
glgsg->_glBlitFramebuffer(0, 0, _rb_size_x, _rb_size_y, 0, 0, _rb_size_x, _rb_size_y,
|
||||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
next += 1;
|
next += 1;
|
||||||
}
|
}
|
||||||
for (int i=0; i<_fb_properties.get_aux_hrgba(); i++) {
|
for (int i=0; i<_fb_properties.get_aux_hrgba(); i++) {
|
||||||
glReadBuffer( next );
|
glReadBuffer(next);
|
||||||
glDrawBuffer( next );
|
glDrawBuffer(next);
|
||||||
glgsg->_glBlitFramebuffer(0, 0, _rb_size_x, _rb_size_y, 0, 0, _rb_size_x, _rb_size_y,
|
glgsg->_glBlitFramebuffer(0, 0, _rb_size_x, _rb_size_y, 0, 0, _rb_size_x, _rb_size_y,
|
||||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
next += 1;
|
next += 1;
|
||||||
}
|
}
|
||||||
for (int i=0; i<_fb_properties.get_aux_float(); i++) {
|
for (int i=0; i<_fb_properties.get_aux_float(); i++) {
|
||||||
glReadBuffer( next );
|
glReadBuffer(next);
|
||||||
glDrawBuffer( next );
|
glDrawBuffer(next);
|
||||||
glgsg->_glBlitFramebuffer(0, 0, _rb_size_x, _rb_size_y, 0, 0, _rb_size_x, _rb_size_y,
|
glgsg->_glBlitFramebuffer(0, 0, _rb_size_x, _rb_size_y, 0, 0, _rb_size_x, _rb_size_y,
|
||||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
next += 1;
|
next += 1;
|
||||||
}
|
}
|
||||||
glReadBuffer( GL_COLOR_ATTACHMENT0_EXT );
|
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||||
glDrawBuffer( GL_COLOR_ATTACHMENT0_EXT );
|
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||||
|
#endif
|
||||||
glgsg->report_my_gl_errors();
|
glgsg->report_my_gl_errors();
|
||||||
}
|
}
|
||||||
glgsg->bind_fbo(0);
|
glgsg->bind_fbo(0);
|
||||||
|
@ -181,6 +181,7 @@ is_at_least_gles_version(int major_version, int minor_version) const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CLP(GraphicsStateGuardian)::
|
INLINE void CLP(GraphicsStateGuardian)::
|
||||||
enable_multisample_antialias(bool val) {
|
enable_multisample_antialias(bool val) {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
if (_supports_multisample) {
|
if (_supports_multisample) {
|
||||||
if ((_multisample_mode & MM_antialias) != 0 && !val) {
|
if ((_multisample_mode & MM_antialias) != 0 && !val) {
|
||||||
// Turn off antialias multisample.
|
// Turn off antialias multisample.
|
||||||
@ -196,6 +197,7 @@ enable_multisample_antialias(bool val) {
|
|||||||
_multisample_mode |= MM_antialias;
|
_multisample_mode |= MM_antialias;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -207,6 +209,7 @@ enable_multisample_antialias(bool val) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CLP(GraphicsStateGuardian)::
|
INLINE void CLP(GraphicsStateGuardian)::
|
||||||
enable_multisample_alpha_one(bool val) {
|
enable_multisample_alpha_one(bool val) {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
if (_supports_multisample) {
|
if (_supports_multisample) {
|
||||||
if ((_multisample_mode & MM_alpha_one) != 0 && !val) {
|
if ((_multisample_mode & MM_alpha_one) != 0 && !val) {
|
||||||
// Turn off sample_alpha_to_one multisample.
|
// Turn off sample_alpha_to_one multisample.
|
||||||
@ -224,6 +227,7 @@ enable_multisample_alpha_one(bool val) {
|
|||||||
_multisample_mode |= MM_alpha_one;
|
_multisample_mode |= MM_alpha_one;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -235,6 +239,7 @@ enable_multisample_alpha_one(bool val) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CLP(GraphicsStateGuardian)::
|
INLINE void CLP(GraphicsStateGuardian)::
|
||||||
enable_multisample_alpha_mask(bool val) {
|
enable_multisample_alpha_mask(bool val) {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
if (_supports_multisample) {
|
if (_supports_multisample) {
|
||||||
if ((_multisample_mode & MM_alpha_mask) != 0 && !val) {
|
if ((_multisample_mode & MM_alpha_mask) != 0 && !val) {
|
||||||
// Turn off sample_alpha_to_mask multisample.
|
// Turn off sample_alpha_to_mask multisample.
|
||||||
@ -252,6 +257,7 @@ enable_multisample_alpha_mask(bool val) {
|
|||||||
_multisample_mode |= MM_alpha_mask;
|
_multisample_mode |= MM_alpha_mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -261,6 +267,7 @@ enable_multisample_alpha_mask(bool val) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CLP(GraphicsStateGuardian)::
|
INLINE void CLP(GraphicsStateGuardian)::
|
||||||
enable_line_smooth(bool val) {
|
enable_line_smooth(bool val) {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
if (_line_smooth_enabled != val) {
|
if (_line_smooth_enabled != val) {
|
||||||
_state_mask.clear_bit(TransparencyAttrib::get_class_slot());
|
_state_mask.clear_bit(TransparencyAttrib::get_class_slot());
|
||||||
_line_smooth_enabled = val;
|
_line_smooth_enabled = val;
|
||||||
@ -270,6 +277,7 @@ enable_line_smooth(bool val) {
|
|||||||
GLP(Disable)(GL_LINE_SMOOTH);
|
GLP(Disable)(GL_LINE_SMOOTH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -279,6 +287,7 @@ enable_line_smooth(bool val) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CLP(GraphicsStateGuardian)::
|
INLINE void CLP(GraphicsStateGuardian)::
|
||||||
enable_point_smooth(bool val) {
|
enable_point_smooth(bool val) {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
if (_point_smooth_enabled != val) {
|
if (_point_smooth_enabled != val) {
|
||||||
_state_mask.clear_bit(TransparencyAttrib::get_class_slot());
|
_state_mask.clear_bit(TransparencyAttrib::get_class_slot());
|
||||||
_point_smooth_enabled = val;
|
_point_smooth_enabled = val;
|
||||||
@ -288,6 +297,7 @@ enable_point_smooth(bool val) {
|
|||||||
GLP(Disable)(GL_POINT_SMOOTH);
|
GLP(Disable)(GL_POINT_SMOOTH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -297,7 +307,7 @@ enable_point_smooth(bool val) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CLP(GraphicsStateGuardian)::
|
INLINE void CLP(GraphicsStateGuardian)::
|
||||||
enable_polygon_smooth(bool val) {
|
enable_polygon_smooth(bool val) {
|
||||||
#ifndef OPENGLES_1 // GL_POLYGON_SMOOTH not supported in OpenGL ES.
|
#ifndef OPENGLES // GL_POLYGON_SMOOTH not supported in OpenGL ES.
|
||||||
if (_polygon_smooth_enabled != val) {
|
if (_polygon_smooth_enabled != val) {
|
||||||
_polygon_smooth_enabled = val;
|
_polygon_smooth_enabled = val;
|
||||||
if (val) {
|
if (val) {
|
||||||
@ -306,7 +316,7 @@ enable_polygon_smooth(bool val) {
|
|||||||
GLP(Disable)(GL_POLYGON_SMOOTH);
|
GLP(Disable)(GL_POLYGON_SMOOTH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // OPENGLES_1
|
#endif // OPENGLES
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -462,6 +472,7 @@ enable_depth_test(bool val) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CLP(GraphicsStateGuardian)::
|
INLINE void CLP(GraphicsStateGuardian)::
|
||||||
enable_fog(bool val) {
|
enable_fog(bool val) {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
if (_fog_enabled != val) {
|
if (_fog_enabled != val) {
|
||||||
_fog_enabled = val;
|
_fog_enabled = val;
|
||||||
if (val) {
|
if (val) {
|
||||||
@ -478,6 +489,7 @@ enable_fog(bool val) {
|
|||||||
GLP(Disable)(GL_FOG);
|
GLP(Disable)(GL_FOG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -487,6 +499,7 @@ enable_fog(bool val) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CLP(GraphicsStateGuardian)::
|
INLINE void CLP(GraphicsStateGuardian)::
|
||||||
enable_alpha_test(bool val) {
|
enable_alpha_test(bool val) {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
if (_alpha_test_enabled != val) {
|
if (_alpha_test_enabled != val) {
|
||||||
_alpha_test_enabled = val;
|
_alpha_test_enabled = val;
|
||||||
if (val) {
|
if (val) {
|
||||||
@ -503,6 +516,7 @@ enable_alpha_test(bool val) {
|
|||||||
GLP(Disable)(GL_ALPHA_TEST);
|
GLP(Disable)(GL_ALPHA_TEST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // OPENGLES_2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -541,7 +555,9 @@ enable_polygon_offset(bool val) {
|
|||||||
// Description: Convert index to gl light id
|
// Description: Convert index to gl light id
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE GLenum CLP(GraphicsStateGuardian)::get_light_id(int index) const {
|
INLINE GLenum CLP(GraphicsStateGuardian)::get_light_id(int index) const {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
return GL_LIGHT0 + index;
|
return GL_LIGHT0 + index;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -551,7 +567,9 @@ INLINE GLenum CLP(GraphicsStateGuardian)::get_light_id(int index) const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE GLenum CLP(GraphicsStateGuardian)::
|
INLINE GLenum CLP(GraphicsStateGuardian)::
|
||||||
get_clip_plane_id(int index) const {
|
get_clip_plane_id(int index) const {
|
||||||
|
#ifndef OPENGLES_2
|
||||||
return GL_CLIP_PLANE0 + index;
|
return GL_CLIP_PLANE0 + index;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -94,7 +94,11 @@ typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebu
|
|||||||
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
|
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
|
||||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||||
|
#ifdef OPENGLES_2
|
||||||
|
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||||
|
#else
|
||||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||||
|
#endif
|
||||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||||
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||||
typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
|
typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
|
||||||
@ -104,6 +108,10 @@ typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type
|
|||||||
typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
|
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||||
|
typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex);
|
||||||
|
typedef void (APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void);
|
||||||
|
typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||||
|
typedef void (APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||||
#endif // __EDG__
|
#endif // __EDG__
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -448,9 +456,14 @@ public:
|
|||||||
PFNGLWEIGHTFVARBPROC _glWeightfvARB;
|
PFNGLWEIGHTFVARBPROC _glWeightfvARB;
|
||||||
|
|
||||||
bool _supports_matrix_palette;
|
bool _supports_matrix_palette;
|
||||||
PFNGLCURRENTPALETTEMATRIXARBPROC _glCurrentPaletteMatrixARB;
|
#ifdef OPENGLES
|
||||||
PFNGLMATRIXINDEXPOINTERARBPROC _glMatrixIndexPointerARB;
|
PFNGLCURRENTPALETTEMATRIXOESPROC _glCurrentPaletteMatrix;
|
||||||
PFNGLMATRIXINDEXUIVARBPROC _glMatrixIndexuivARB;
|
PFNGLMATRIXINDEXPOINTEROESPROC _glMatrixIndexPointer;
|
||||||
|
#else
|
||||||
|
PFNGLCURRENTPALETTEMATRIXARBPROC _glCurrentPaletteMatrix;
|
||||||
|
PFNGLMATRIXINDEXPOINTERARBPROC _glMatrixIndexPointer;
|
||||||
|
PFNGLMATRIXINDEXUIVARBPROC _glMatrixIndexuiv;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool _supports_draw_range_elements;
|
bool _supports_draw_range_elements;
|
||||||
PFNGLDRAWRANGEELEMENTSPROC _glDrawRangeElements;
|
PFNGLDRAWRANGEELEMENTSPROC _glDrawRangeElements;
|
||||||
@ -502,7 +515,11 @@ public:
|
|||||||
PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC _glCheckFramebufferStatus;
|
PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC _glCheckFramebufferStatus;
|
||||||
PFNGLFRAMEBUFFERTEXTURE1DEXTPROC _glFramebufferTexture1D;
|
PFNGLFRAMEBUFFERTEXTURE1DEXTPROC _glFramebufferTexture1D;
|
||||||
PFNGLFRAMEBUFFERTEXTURE2DEXTPROC _glFramebufferTexture2D;
|
PFNGLFRAMEBUFFERTEXTURE2DEXTPROC _glFramebufferTexture2D;
|
||||||
|
#ifdef OPENGLES_2
|
||||||
|
PFNGLFRAMEBUFFERTEXTURE3DOES _glFramebufferTexture3D;
|
||||||
|
#else
|
||||||
PFNGLFRAMEBUFFERTEXTURE3DEXTPROC _glFramebufferTexture3D;
|
PFNGLFRAMEBUFFERTEXTURE3DEXTPROC _glFramebufferTexture3D;
|
||||||
|
#endif
|
||||||
PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC _glFramebufferRenderbuffer;
|
PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC _glFramebufferRenderbuffer;
|
||||||
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC _glGetFramebufferAttachmentParameteriv;
|
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC _glGetFramebufferAttachmentParameteriv;
|
||||||
PFNGLGENERATEMIPMAPEXTPROC _glGenerateMipmap;
|
PFNGLGENERATEMIPMAPEXTPROC _glGenerateMipmap;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "lightMutexHolder.h"
|
#include "lightMutexHolder.h"
|
||||||
#include "pStatTimer.h"
|
#include "pStatTimer.h"
|
||||||
|
|
||||||
#ifndef OPENGLES_1 // Occlusion queries not supported by OpenGL ES.
|
#ifndef OPENGLES // Occlusion queries not supported by OpenGL ES.
|
||||||
|
|
||||||
TypeHandle CLP(OcclusionQueryContext)::_type_handle;
|
TypeHandle CLP(OcclusionQueryContext)::_type_handle;
|
||||||
|
|
||||||
@ -114,4 +114,4 @@ get_num_fragments() const {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // OPENGLES_1
|
#endif // OPENGLES
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
class GraphicsStateGuardian;
|
class GraphicsStateGuardian;
|
||||||
|
|
||||||
#ifndef OPENGLES_1 // Occlusion queries not supported by OpenGL ES.
|
#ifndef OPENGLES // Occlusion queries not supported by OpenGL ES.
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Class : GLOcclusionQueryContext
|
// Class : GLOcclusionQueryContext
|
||||||
@ -57,5 +57,5 @@ private:
|
|||||||
|
|
||||||
#include "glOcclusionQueryContext_src.I"
|
#include "glOcclusionQueryContext_src.I"
|
||||||
|
|
||||||
#endif // OPENGLES_1
|
#endif // OPENGLES
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ void CLP(init_classes)() {
|
|||||||
CLP(VertexBufferContext)::init_type();
|
CLP(VertexBufferContext)::init_type();
|
||||||
CLP(GraphicsBuffer)::init_type();
|
CLP(GraphicsBuffer)::init_type();
|
||||||
|
|
||||||
#ifndef OPENGLES_1
|
#ifndef OPENGLES
|
||||||
CLP(OcclusionQueryContext)::init_type();
|
CLP(OcclusionQueryContext)::init_type();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user