ok dont use this at all then
This commit is contained in:
1 parent
4a1523da57
commit
9e104a8632
5 files changed
+1
-37
No files matched your search
@@ -287,9 +287,7 @@ typedef struct FSurfaceInfo FSurfaceInfo;
|
||||
|
||||
enum hwdsetspecialstate
|
||||
{
|
||||
#ifdef GL_VERSION_3_0
|
||||
HWD_SET_FRAMEBUFFER,
|
||||
#endif
|
||||
HWD_SET_SHADERS,
|
||||
|
||||
HWD_SET_TEXTUREFILTERMODE,
|
||||
|
||||
+1
-11
@@ -69,9 +69,7 @@ static boolean gr_palette_rendering_state = false;
|
||||
// Commands and console variables
|
||||
// ==========================================================================
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
static void CV_grframebuffer_OnChange(void);
|
||||
#endif
|
||||
static void CV_filtermode_ONChange(void);
|
||||
static void CV_anisotropic_ONChange(void);
|
||||
static void CV_screentextures_ONChange(void);
|
||||
@@ -99,9 +97,7 @@ consvar_t cv_grsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL,
|
||||
|
||||
consvar_t cv_grbatching = {"gr_batching", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
consvar_t cv_grframebuffer = {"gr_framebuffer", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, CV_grframebuffer_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
consvar_t cv_grfofcut = {"gr_fofcut", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -215,7 +211,6 @@ static void CV_grpalettedepth_OnChange(void)
|
||||
HWR_SetPalette(pLocalPalette);
|
||||
}
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
static void CV_grframebuffer_OnChange(void)
|
||||
{
|
||||
ONLY_IF_GL_LOADED
|
||||
@@ -223,7 +218,6 @@ static void CV_grframebuffer_OnChange(void)
|
||||
I_DownSample();
|
||||
RefreshSDLSurface();
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Sets the shader state.
|
||||
@@ -5953,9 +5947,7 @@ void HWR_TogglePaletteRendering(void)
|
||||
//added by Hurdler: console varibale that are saved
|
||||
void HWR_AddCommands(void)
|
||||
{
|
||||
#ifdef GL_VERSION_3_0
|
||||
CV_RegisterVar(&cv_grframebuffer);
|
||||
#endif
|
||||
CV_RegisterVar(&cv_grfiltermode);
|
||||
CV_RegisterVar(&cv_granisotropicmode);
|
||||
CV_RegisterVar(&cv_grsolvetjoin);
|
||||
@@ -6018,10 +6010,8 @@ void HWR_Startup(void)
|
||||
HWR_LoadAllCustomShaders();
|
||||
|
||||
HWR_TogglePaletteRendering();
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
|
||||
HWD.pfnSetSpecialState(HWD_SET_FRAMEBUFFER, cv_grframebuffer.value);
|
||||
#endif
|
||||
|
||||
if (msaa)
|
||||
{
|
||||
|
||||
@@ -152,9 +152,7 @@ void HWR_SetShaderState(void);
|
||||
|
||||
// Console variables
|
||||
extern consvar_t cv_grshaders;
|
||||
#ifdef GL_VERSION_3_0
|
||||
extern consvar_t cv_grframebuffer;
|
||||
#endif
|
||||
extern consvar_t cv_grfofcut;
|
||||
extern consvar_t cv_fofzfightfix;
|
||||
extern consvar_t cv_splitwallfix;
|
||||
|
||||
@@ -119,12 +119,10 @@ static GLfloat modelMatrix[16];
|
||||
GLfloat projMatrix[16];
|
||||
static GLint viewport[4];
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
static boolean GLFramebuffer_IsFuncAvailible(void);
|
||||
|
||||
GLuint FramebufferObject, FramebufferTexture, RenderbufferObject;
|
||||
GLboolean FrameBufferEnabled = GL_FALSE, RenderToFramebuffer = GL_FALSE;
|
||||
#endif
|
||||
|
||||
// Sryder: NextTexAvail is broken for these because palette changes or changes to the texture filter or antialiasing
|
||||
// flush all of the stored textures, leaving them unavailable at times such as between levels
|
||||
@@ -435,7 +433,6 @@ static PFNglCopyTexImage2D pglCopyTexImage2D;
|
||||
typedef void (APIENTRY * PFNglCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
static PFNglCopyTexSubImage2D pglCopyTexSubImage2D;
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
/* 3.0 functions for framebuffers and renderbuffers */
|
||||
typedef void (APIENTRY * PFNglGenFramebuffers) (GLsizei n, GLuint *ids);
|
||||
static PFNglGenFramebuffers pglGenFramebuffers;
|
||||
@@ -457,7 +454,6 @@ typedef void (APIENTRY * PFNglRenderbufferStorage) (GLenum target, GLenum intern
|
||||
static PFNglRenderbufferStorage pglRenderbufferStorage;
|
||||
typedef void (APIENTRY * PFNglFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLenum renderbuffer);
|
||||
static PFNglFramebufferRenderbuffer pglFramebufferRenderbuffer;
|
||||
#endif
|
||||
#endif //!STATIC_OPENGL
|
||||
|
||||
/* 1.2 functions for 3D textures */
|
||||
@@ -743,7 +739,6 @@ void SetupGLFunc4(void)
|
||||
pglUniform3fv = GetGLFunc("glUniform3fv");
|
||||
pglGetUniformLocation = GetGLFunc("glGetUniformLocation");
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
if (GLFramebuffer_IsFuncAvailible())
|
||||
{
|
||||
pglGenFramebuffers = GetGLFunc("glGenFramebuffers");
|
||||
@@ -757,17 +752,14 @@ void SetupGLFunc4(void)
|
||||
pglRenderbufferStorage = GetGLFunc("glRenderbufferStorage");
|
||||
pglFramebufferRenderbuffer = GetGLFunc("glFramebufferRenderbuffer");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
static boolean GLFramebuffer_IsFuncAvailible(void)
|
||||
{
|
||||
return((isExtAvailable("GL_ARB_framebuffer_no_attachments",gl_extensions)) &&
|
||||
(isExtAvailable("GL_ARB_framebuffer_object",gl_extensions)) &&
|
||||
(isExtAvailable("GL_ARB_framebuffer_sRGB",gl_extensions)));
|
||||
}
|
||||
#endif
|
||||
|
||||
EXPORT boolean HWRAPI(InitShaders) (void)
|
||||
{
|
||||
@@ -1028,7 +1020,6 @@ EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *pTexInfo)
|
||||
pTexInfo->downloaded = 0;
|
||||
}
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
void GLFramebuffer_Generate(void)
|
||||
{
|
||||
if (!GLFramebuffer_IsFuncAvailible())
|
||||
@@ -1138,7 +1129,6 @@ void GLFramebuffer_Disable(void)
|
||||
pglBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
pglBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// -----------------+
|
||||
// Flush : flush OpenGL textures
|
||||
@@ -2315,14 +2305,12 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
||||
case HWD_SET_SHADERS:
|
||||
gl_allowshaders = Value;
|
||||
break;
|
||||
#ifdef GL_VERSION_3_0
|
||||
case HWD_SET_FRAMEBUFFER:
|
||||
FrameBufferEnabled = Value ? GL_TRUE : GL_FALSE;
|
||||
|
||||
if (!GLFramebuffer_IsFuncAvailible())
|
||||
FrameBufferEnabled = GL_FALSE;
|
||||
break;
|
||||
#endif
|
||||
case HWD_SET_TEXTUREFILTERMODE:
|
||||
switch (Value)
|
||||
{
|
||||
|
||||
@@ -167,9 +167,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||
|
||||
granisotropicmode_cons_t[1].value = maximumAnisotropy;
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
I_DownSample();
|
||||
#endif
|
||||
}
|
||||
first_init = true;
|
||||
|
||||
@@ -179,9 +177,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||
if (screen_width != w || screen_height != h)
|
||||
{
|
||||
FlushScreenTextures();
|
||||
#ifdef GL_VERSION_3_0
|
||||
GLFramebuffer_DeleteAttachments();
|
||||
#endif
|
||||
}
|
||||
|
||||
screen_width = (GLint)w;
|
||||
@@ -191,13 +187,11 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||
SetStates();
|
||||
pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
RenderToFramebuffer = FrameBufferEnabled;
|
||||
GLFramebuffer_Disable();
|
||||
|
||||
if (RenderToFramebuffer && downsample)
|
||||
GLFramebuffer_Enable();
|
||||
#endif
|
||||
|
||||
HWR_Startup();
|
||||
textureformatGL = cbpp > 16 ? GL_RGBA : GL_RGB5_A1;
|
||||
@@ -225,17 +219,13 @@ void OglSdlFinishUpdate(boolean waitvbl)
|
||||
SDL_GetWindowSize(window, &sdlw, &sdlh);
|
||||
HWR_MakeScreenFinalTexture();
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
GLFramebuffer_Disable();
|
||||
RenderToFramebuffer = FrameBufferEnabled;
|
||||
#endif
|
||||
|
||||
HWR_DrawScreenFinalTexture(sdlw, sdlh);
|
||||
|
||||
#ifdef GL_VERSION_3_0
|
||||
if (RenderToFramebuffer && downsample)
|
||||
GLFramebuffer_Enable();
|
||||
#endif
|
||||
|
||||
SDL_GL_SwapWindow(window);
|
||||
|
||||
|
||||
Reference in new issue
Block a user