diff --git a/neo/renderer/qgl_proc.h b/neo/renderer/qgl_proc.h index 54ef43d9..af0146d0 100644 --- a/neo/renderer/qgl_proc.h +++ b/neo/renderer/qgl_proc.h @@ -38,6 +38,7 @@ QGLPROC(glBegin, void, (GLenum mode)) QGLPROC(glBindTexture, void, (GLenum target, GLuint texture)) QGLPROC(glBitmap, void, (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)) QGLPROC(glBlendFunc, void, (GLenum sfactor, GLenum dfactor)) +QGLPROC(glBlendEquation, void, (GLenum mode)) QGLPROC(glCallList, void, (GLuint list)) QGLPROC(glCallLists, void, (GLsizei n, GLenum type, const GLvoid *lists)) QGLPROC(glClear, void, (GLbitfield mask)) diff --git a/neo/renderer/tr_backend.cpp b/neo/renderer/tr_backend.cpp index 18224a00..77ee7d8e 100644 --- a/neo/renderer/tr_backend.cpp +++ b/neo/renderer/tr_backend.cpp @@ -529,6 +529,31 @@ const void RB_SwapBuffers( const void *data ) { RB_ShowImages(); } +#if 01 // set alpha chan to 1.0: + bool blendEnabled = qglIsEnabled( GL_BLEND ); + //if ( !blendEnabled ) + qglEnable( GL_BLEND ); + qglBlendEquation( GL_FUNC_ADD ); + qglBlendFunc( GL_ONE, GL_ONE ); + + // draw screen-sized quad with color (0.0, 0.0, 0.0, 1.0) + int w = glConfig.vidWidth, h = glConfig.vidHeight; + int x = 0, y = 0; + qglColor4f( 0.5f, 0.0f, 0.0f, 1.0f ); + qglBegin( GL_QUADS ); + qglVertex2f( x, y ); + qglVertex2f( x + w, y ); + qglVertex2f( x + w, y + h ); + qglVertex2f( x, y + h ); + qglEnd(); + + // restore default or previous states + qglBlendEquation( GL_FUNC_ADD ); + if ( !blendEnabled ) + qglDisable( GL_BLEND ); + // TODO: theoretically I should restore the glColor value, but I'm sure it'll be set before it's needed anyway +#endif + // force a gl sync if requested if ( r_finish.GetBool() ) { qglFinish(); diff --git a/neo/sys/stub/stub_gl.cpp b/neo/sys/stub/stub_gl.cpp index 1296aeb0..af571081 100644 --- a/neo/sys/stub/stub_gl.cpp +++ b/neo/sys/stub/stub_gl.cpp @@ -44,6 +44,7 @@ void APIENTRY glBegin(GLenum mode){}; void APIENTRY glBindTexture(GLenum target, GLuint texture){}; void APIENTRY glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap){}; void APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor){}; +void APIENTRY glBlendEquation(GLenum mode){}; void APIENTRY glCallList(GLuint list){}; void APIENTRY glCallLists(GLsizei n, GLenum type, const GLvoid *lists){}; void APIENTRY glClear(GLbitfield mask){};