mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge remote-tracking branch 'origin/master' into Android-trash
This commit is contained in:
@ -19,11 +19,12 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "../../Plugin_VideoOGL/Src/GLUtil.h"
|
||||
#include "../../Plugin_VideoOGL/Src/RasterFont.h"
|
||||
#include "../../Plugin_VideoOGL/Src/ProgramShaderCache.h"
|
||||
#include "RasterFont.h"
|
||||
#include "SWRenderer.h"
|
||||
#include "SWStatistics.h"
|
||||
|
||||
#include "OnScreenDisplay.h"
|
||||
|
||||
static GLuint s_RenderTarget = 0;
|
||||
|
||||
static GLint attr_pos = -1, attr_tex = -1;
|
||||
@ -33,7 +34,7 @@ static GLuint program;
|
||||
// Rasterfont isn't compatible with GLES
|
||||
// degasus: I think it does, but I can't test it
|
||||
#ifndef USE_GLES
|
||||
OGL::RasterFont* s_pfont = NULL;
|
||||
RasterFont* s_pfont = NULL;
|
||||
#endif
|
||||
|
||||
void SWRenderer::Init()
|
||||
@ -47,7 +48,6 @@ void SWRenderer::Shutdown()
|
||||
#ifndef USE_GLES
|
||||
delete s_pfont;
|
||||
s_pfont = 0;
|
||||
OGL::ProgramShaderCache::Shutdown();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -90,9 +90,7 @@ void SWRenderer::Prepare()
|
||||
CreateShaders();
|
||||
// TODO: Enable for GLES once RasterFont supports GLES
|
||||
#ifndef USE_GLES
|
||||
// ogl rasterfont depends on ogl programshadercache
|
||||
OGL::ProgramShaderCache::Init();
|
||||
s_pfont = new OGL::RasterFont();
|
||||
s_pfont = new RasterFont();
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
#endif
|
||||
GL_REPORT_ERRORD();
|
||||
@ -103,14 +101,12 @@ void SWRenderer::RenderText(const char* pstr, int left, int top, u32 color)
|
||||
#ifndef USE_GLES
|
||||
int nBackbufferWidth = (int)GLInterface->GetBackBufferWidth();
|
||||
int nBackbufferHeight = (int)GLInterface->GetBackBufferHeight();
|
||||
|
||||
glColor4f(((color>>16) & 0xff)/255.0f, ((color>> 8) & 0xff)/255.0f,
|
||||
((color>> 0) & 0xff)/255.0f, ((color>>24) & 0xFF)/255.0f);
|
||||
s_pfont->printMultilineText(pstr,
|
||||
left * 2.0f / (float)nBackbufferWidth - 1,
|
||||
1 - top * 2.0f / (float)nBackbufferHeight,
|
||||
0, nBackbufferWidth, nBackbufferHeight, color);
|
||||
|
||||
glBindVertexArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
left * 2.0f / (float)nBackbufferWidth - 1,
|
||||
1 - top * 2.0f / (float)nBackbufferHeight,
|
||||
0, nBackbufferWidth, nBackbufferHeight);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -123,7 +119,7 @@ void SWRenderer::DrawDebugText()
|
||||
if (g_SWVideoConfig.bShowStats)
|
||||
{
|
||||
p+=sprintf(p,"Objects: %i\n",swstats.thisFrame.numDrawnObjects);
|
||||
p+=sprintf(p,"Primatives: %i\n",swstats.thisFrame.numPrimatives);
|
||||
p+=sprintf(p,"Primitives: %i\n",swstats.thisFrame.numPrimatives);
|
||||
p+=sprintf(p,"Vertices Loaded: %i\n",swstats.thisFrame.numVerticesLoaded);
|
||||
|
||||
p+=sprintf(p,"Triangles Input: %i\n",swstats.thisFrame.numTrianglesIn);
|
||||
@ -228,6 +224,9 @@ void SWRenderer::DrawTexture(u8 *texture, int width, int height)
|
||||
|
||||
void SWRenderer::SwapBuffer()
|
||||
{
|
||||
// Do our OSD callbacks
|
||||
OSD::DoCallbacks(OSD::OSD_ONFRAME);
|
||||
|
||||
DrawDebugText();
|
||||
|
||||
glFlush();
|
||||
|
Reference in New Issue
Block a user