mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Fix viewport set for texture buffer in OGL_DrawRect().
This commit is contained in:
parent
cfc85d2c92
commit
70417de37c
13
OpenGL.cpp
13
OpenGL.cpp
|
@ -940,13 +940,14 @@ void OGL_DrawRect( int ulx, int uly, int lrx, int lry, float *color )
|
|||
glDisable( GL_CULL_FACE );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
u32 width = VI.width, height = VI.height;
|
||||
if (frameBuffer.top != NULL && frameBuffer.drawBuffer != GL_BACK) {
|
||||
width = frameBuffer.top->width;
|
||||
height = frameBuffer.top->height;
|
||||
if (frameBuffer.drawBuffer != GL_DRAW_FRAMEBUFFER) {
|
||||
glOrtho( 0, VI.width, VI.height, 0, 1.0f, -1.0f );
|
||||
glViewport( 0, (frameBuffer.drawBuffer == GL_BACK ? OGL.heightOffset : 0), OGL.width, OGL.height );
|
||||
} else {
|
||||
glOrtho( 0, frameBuffer.top->width, frameBuffer.top->height, 0, 1.0f, -1.0f );
|
||||
glViewport( 0, 0, frameBuffer.top->width*frameBuffer.top->scaleX, frameBuffer.top->height*frameBuffer.top->scaleY );
|
||||
}
|
||||
glOrtho( 0, VI.width, VI.height, 0, 1.0f, -1.0f );
|
||||
glViewport( 0, (frameBuffer.drawBuffer == GL_BACK ? OGL.heightOffset : 0), OGL.width, OGL.height );
|
||||
|
||||
glDepthRange( 0.0f, 1.0f );
|
||||
|
||||
glColor4f( color[0], color[1], color[2], color[3] );
|
||||
|
|
Loading…
Reference in New Issue
Block a user