diff --git a/Source/Project64-video/Renderer/OGLESglitchmain.cpp b/Source/Project64-video/Renderer/OGLESglitchmain.cpp index 8d8ad34a9..119c02928 100644 --- a/Source/Project64-video/Renderer/OGLESglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLESglitchmain.cpp @@ -1114,52 +1114,6 @@ void updateTexture() } } -void gfxFramebufferCopyExt(int x, int y, int w, int h, int from, int to, int mode) -{ - if (mode == GR_FBCOPY_MODE_DEPTH) { - int tw = 1, th = 1; - if (npot_support) { - tw = g_width; th = g_height; - } - else { - while (tw < g_width) tw <<= 1; - while (th < g_height) th <<= 1; - } - - if (from == GR_FBCOPY_BUFFER_BACK && to == GR_FBCOPY_BUFFER_FRONT) { - //printf("save depth buffer %d\n", render_to_texture); - // save the depth image in a texture - //glReadBuffer(current_buffer); - glBindTexture(GL_TEXTURE_2D, depth_texture); - glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, - 0, g_viewport_offset, tw, th, 0); - glBindTexture(GL_TEXTURE_2D, default_texture); - return; - } - if (from == GR_FBCOPY_BUFFER_FRONT && to == GR_FBCOPY_BUFFER_BACK) { - //printf("writing to depth buffer %d\n", render_to_texture); - //glPushAttrib(GL_ALL_ATTRIB_BITS); - //glDisable(GL_ALPHA_TEST); - //glDrawBuffer(current_buffer); - glActiveTexture(texture_unit); - glBindTexture(GL_TEXTURE_2D, depth_texture); - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - set_depth_shader(); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_ALWAYS); - glDisable(GL_CULL_FACE); - render_rectangle(texture_unit, - 0, 0, - g_width, g_height, - tw, th, -1); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glBindTexture(GL_TEXTURE_2D, default_texture); - //glPopAttrib(); - return; - } - } -} - void gfxRenderBuffer(GrBuffer_t buffer) { #ifdef _WIN32 diff --git a/Source/Project64-video/Renderer/OGLglitchmain.cpp b/Source/Project64-video/Renderer/OGLglitchmain.cpp index cfb0eb90f..e7c203332 100644 --- a/Source/Project64-video/Renderer/OGLglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLglitchmain.cpp @@ -1405,54 +1405,6 @@ void updateTexture() grDisplayGLError("updateTexture"); } -void gfxFramebufferCopyExt(int x, int y, int w, int h, int from, int to, int mode) -{ - if (mode == GR_FBCOPY_MODE_DEPTH) { - int tw = 1, th = 1; - if (npot_support) { - tw = g_width; th = g_height; - } - else { - while (tw < g_width) tw <<= 1; - while (th < g_height) th <<= 1; - } - - if (from == GR_FBCOPY_BUFFER_BACK && to == GR_FBCOPY_BUFFER_FRONT) { - //printf("save depth buffer %d\n", render_to_texture); - // save the depth image in a texture - glReadBuffer(current_buffer); - glBindTexture(GL_TEXTURE_2D, depth_texture); - glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, - 0, g_viewport_offset, tw, th, 0); - glBindTexture(GL_TEXTURE_2D, default_texture); - grDisplayGLError("gfxFramebufferCopyExt :: A"); - return; - } - if (from == GR_FBCOPY_BUFFER_FRONT && to == GR_FBCOPY_BUFFER_BACK) { - //printf("writing to depth buffer %d\n", render_to_texture); - glPushAttrib(GL_ALL_ATTRIB_BITS); - glDisable(GL_ALPHA_TEST); - glDrawBuffer(current_buffer); - glActiveTextureARB(texture_unit); - glBindTexture(GL_TEXTURE_2D, depth_texture); - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - set_depth_shader(); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_ALWAYS); - glDisable(GL_CULL_FACE); - render_rectangle(texture_unit, - 0, 0, - g_width, g_height, - tw, th, -1); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glBindTexture(GL_TEXTURE_2D, default_texture); - glPopAttrib(); - grDisplayGLError("gfxFramebufferCopyExt :: B"); - return; - } - } -} - void gfxRenderBuffer(GrBuffer_t buffer) { #ifdef _WIN32 diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 68ca6dee3..6e090f5fa 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -54,7 +54,6 @@ void gfxDrawVertexArrayContiguous(uint32_t mode, uint32_t Count, void *pointers, bool gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers); void gfxAuxBufferExt(GrBuffer_t buffer); uint32_t gfxGet(uint32_t pname, uint32_t plength, FxI32 *params); -void gfxFramebufferCopyExt(int x, int y, int w, int h, int from, int to, int mode); void gfxRenderBuffer(GrBuffer_t buffer); void gfxBufferClear(gfxColor_t color, gfxAlpha_t alpha, uint32_t depth); void gfxBufferSwap(uint32_t swap_interval); diff --git a/Source/Project64-video/Renderer/glitchmain.h b/Source/Project64-video/Renderer/glitchmain.h index 947b2482d..fe93176b2 100644 --- a/Source/Project64-video/Renderer/glitchmain.h +++ b/Source/Project64-video/Renderer/glitchmain.h @@ -169,11 +169,4 @@ void set_copy_shader(); void disable_textureSizes(); void ExitFullScreen(); -// ZIGGY framebuffer copy extension -// allow to copy the depth or color buffer from back/front to front/back -#define GR_FBCOPY_MODE_DEPTH 0 -#define GR_FBCOPY_MODE_COLOR 1 -#define GR_FBCOPY_BUFFER_BACK 0 -#define GR_FBCOPY_BUFFER_FRONT 1 - void CHECK_FRAMEBUFFER_STATUS(void);