add ogl version check + grey out in menu + turn it off when not avilible
This commit is contained in:
1 parent
eaeb2575f7
commit
3c8c273e51
4 files changed
+24
-6
No files matched your search
@@ -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:
|
||||
|
||||
@@ -116,6 +116,7 @@ void GLFramebuffer_Disable(void);
|
||||
|
||||
extern GLuint FramebufferObject, FramebufferTexture, RenderbufferObject;
|
||||
extern GLboolean FrameBufferEnabled, RenderToFramebuffer;
|
||||
extern boolean supportFBO;
|
||||
#endif
|
||||
|
||||
// ==========================================================================
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+4
-4
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user