diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 9a0eac7b5..0ea12a793 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -124,6 +124,8 @@ static boolean GLFramebuffer_IsFuncAvailible(void); GLuint FramebufferObject, FramebufferTexture, RenderbufferObject; GLboolean FrameBufferEnabled = GL_FALSE, RenderToFramebuffer = GL_FALSE; + +boolean supportFBO = false; #endif // Sryder: NextTexAvail is broken for these because palette changes or changes to the texture filter or antialiasing @@ -764,9 +766,15 @@ void SetupGLFunc4(void) #ifdef USE_FBO_OGL static boolean GLFramebuffer_IsFuncAvailible(void) { + //this stuff needs atleast OGL 3.0 + if (majorGL < 3) + return false; + return((isExtAvailable("GL_ARB_framebuffer_no_attachments",gl_extensions)) && (isExtAvailable("GL_ARB_framebuffer_object",gl_extensions)) && (isExtAvailable("GL_ARB_framebuffer_sRGB",gl_extensions))); + + return false; } #endif @@ -2319,9 +2327,13 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value) #ifdef USE_FBO_OGL case HWD_SET_FRAMEBUFFER: FrameBufferEnabled = Value ? GL_TRUE : GL_FALSE; - - if (!GLFramebuffer_IsFuncAvailible()) + supportFBO = GLFramebuffer_IsFuncAvailible(); + + if (!supportFBO) + { FrameBufferEnabled = GL_FALSE; + CV_Set(&cv_grframebuffer, "Off"); + } break; #endif case HWD_SET_TEXTUREFILTERMODE: diff --git a/src/hardware/r_opengl/r_opengl.h b/src/hardware/r_opengl/r_opengl.h index a4d8819e3..255969d5a 100644 --- a/src/hardware/r_opengl/r_opengl.h +++ b/src/hardware/r_opengl/r_opengl.h @@ -116,6 +116,7 @@ void GLFramebuffer_Disable(void); extern GLuint FramebufferObject, FramebufferTexture, RenderbufferObject; extern GLboolean FrameBufferEnabled, RenderToFramebuffer; +extern boolean supportFBO; #endif // ========================================================================== diff --git a/src/m_menu.c b/src/m_menu.c index dfdd26b2d..5c25b209d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -58,6 +58,7 @@ #ifdef HWRENDER #include "hardware/hw_main.h" +#include "hardware/r_opengl/r_opengl.h" #endif #include "d_net.h" @@ -4491,6 +4492,10 @@ void M_Init(void) { OP_ExpOptionsMenu[op_exp_ffclip].status = IT_DISABLED; OP_ExpOptionsMenu[op_exp_sprclip].status = IT_DISABLED; +#ifdef USE_FBO_OGL + if (!supportFBO) + OP_ExpOptionsMenu[op_exp_fbo].status = IT_GRAYEDOUT; +#endif } #endif diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index edc9cdb6b..5bb6b7347 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -151,6 +151,10 @@ boolean OglSdlSurface(INT32 w, INT32 h) "- GPU drivers are missing or broken. You may need to update your drivers."); } + SetupGLInfo(); + + SetupGLFunc4(); + if (majorGL == 1 && minorGL <= 3) // GL_GENERATE_MIPMAP is unavailible for OGL 1.3 and below supportMipMap = false; else @@ -161,10 +165,6 @@ boolean OglSdlSurface(INT32 w, INT32 h) else maximumAnisotropy = 1; - SetupGLInfo(); - - SetupGLFunc4(); - granisotropicmode_cons_t[1].value = maximumAnisotropy; #ifdef USE_FBO_OGL I_DownSample();