mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
(R): Rewrite OGL_SwapBuffers() and use it for all platforms.
This commit is contained in:
parent
67b9a3dd1f
commit
3b06773f43
|
@ -460,11 +460,7 @@ void FrameBuffer_RenderBuffer( u32 address )
|
|||
}
|
||||
ogl_glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
ogl_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBuffer.top->fbo);
|
||||
#ifndef __LINUX__
|
||||
SwapBuffers( OGL.hDC );
|
||||
#else
|
||||
OGL_SwapBuffers();
|
||||
#endif
|
||||
OGL_SwapBuffers();
|
||||
}
|
||||
#else
|
||||
|
||||
|
|
|
@ -719,7 +719,7 @@ void GLSL_RenderDepth() {
|
|||
v1 = 1.0;
|
||||
|
||||
ogl_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
#ifndef __LINUX__
|
||||
#ifdef _WINDOWS
|
||||
glDrawBuffer( GL_FRONT );
|
||||
#else
|
||||
glDrawBuffer( GL_BACK );
|
||||
|
@ -737,7 +737,7 @@ void GLSL_RenderDepth() {
|
|||
glTexCoord2f( u1, 0.0f );
|
||||
glVertex2f( (GLfloat)OGL.width, 0.0f );
|
||||
glEnd();
|
||||
#ifndef __LINUX__
|
||||
#ifdef _WINDOWS
|
||||
glDrawBuffer( GL_BACK );
|
||||
#else
|
||||
OGL_SwapBuffers();
|
||||
|
|
17
OpenGL.cpp
17
OpenGL.cpp
|
@ -310,11 +310,7 @@ void OGL_InitStates()
|
|||
((i > (rand() >> 10)) << 0);
|
||||
}
|
||||
|
||||
#ifndef __LINUX__
|
||||
SwapBuffers( wglGetCurrentDC() );
|
||||
#else
|
||||
OGL_SwapBuffers();
|
||||
#endif
|
||||
}
|
||||
|
||||
void OGL_UpdateScale()
|
||||
|
@ -1154,10 +1150,14 @@ void OGL_ReadScreen( void **dest, long *width, long *height )
|
|||
glReadPixels( 0, OGL.heightOffset, OGL.width, OGL.height, GL_BGR_EXT, GL_UNSIGNED_BYTE, *dest );
|
||||
}
|
||||
|
||||
#ifdef __LINUX__
|
||||
void
|
||||
OGL_SwapBuffers()
|
||||
void OGL_SwapBuffers()
|
||||
{
|
||||
#ifdef _WINDOWS
|
||||
if (OGL.hDC == NULL)
|
||||
SwapBuffers( wglGetCurrentDC() );
|
||||
else
|
||||
SwapBuffers( OGL.hDC );
|
||||
#else
|
||||
static int frames[5] = { 0, 0, 0, 0, 0 };
|
||||
static int framesIndex = 0;
|
||||
static Uint32 lastTicks = 0;
|
||||
|
@ -1179,10 +1179,9 @@ OGL_SwapBuffers()
|
|||
}
|
||||
|
||||
SDL_GL_SwapBuffers();
|
||||
#endif // _WINDOWS
|
||||
}
|
||||
|
||||
#endif // __LINUX__
|
||||
|
||||
void ogl_glGenFramebuffers (GLsizei n, GLuint *framebuffers) {
|
||||
switch (OGL.framebuffer_mode) {
|
||||
case GLInfo::fbFBO:
|
||||
|
|
2
OpenGL.h
2
OpenGL.h
|
@ -187,9 +187,7 @@ void OGL_ClearDepthBuffer();
|
|||
void OGL_ClearColorBuffer( float *color );
|
||||
void OGL_ResizeWindow();
|
||||
void OGL_SaveScreenshot();
|
||||
#ifdef __LINUX__
|
||||
void OGL_SwapBuffers();
|
||||
#endif // __LINUX__
|
||||
void OGL_ReadScreen( void **dest, long *width, long *height );
|
||||
|
||||
void ogl_glGenFramebuffers (GLsizei n, GLuint *framebuffers);
|
||||
|
|
Loading…
Reference in New Issue
Block a user