X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fgpu-gles%2Fgpulib_if.c;h=ce32aada846257fc7fe6f0920685f1b1f42cd757;hp=a8daa5e9745fd1615a288182f2fd552d6d78cf22;hb=bb88ec28db0535102b70a7c18ef095cb904e3c6c;hpb=7890a708c71f94c549b3e87f7471647a014d4038 diff --git a/plugins/gpu-gles/gpulib_if.c b/plugins/gpu-gles/gpulib_if.c index a8daa5e9..ce32aada 100644 --- a/plugins/gpu-gles/gpulib_if.c +++ b/plugins/gpu-gles/gpulib_if.c @@ -19,6 +19,7 @@ #include "gpuDraw.c" #include "gpuTexture.c" #include "gpuPrim.c" +#include "hud.c" static const short dispWidths[8] = {256,320,512,640,368,384,512,640}; short g_m1,g_m2,g_m3; @@ -84,6 +85,8 @@ static void PaintBlackBorders(void) glEnable(GL_SCISSOR_TEST); glError(); } +static void fps_update(void); + void updateDisplay(void) { bFakeFrontBuffer=FALSE; @@ -120,8 +123,11 @@ void updateDisplay(void) } if(iDrawnSomething) + { + fps_update(); eglSwapBuffers(display, surface); - iDrawnSomething=0; + iDrawnSomething=0; + } if(lClearOnSwap) // clear buffer after swap? { @@ -620,9 +626,14 @@ void vout_update(void) } } +static struct rearmed_cbs *cbs; + long GPUopen(void **dpy) { - iResX = 800; iResY = 480; + int ret; + + iResX = cbs->screen_w; + iResY = cbs->screen_h; rRatioRect.left = rRatioRect.top=0; rRatioRect.right = iResX; rRatioRect.bottom = iResY; @@ -632,27 +643,27 @@ long GPUopen(void **dpy) CSTEXTURE = CSVERTEX = CSCOLOR = 0; InitializeTextureStore(); // init texture mem - is_opened = 1; - return GLinitialize(); + ret = GLinitialize(); + MakeDisplayLists(); + + is_opened = 1; + return ret; } long GPUclose(void) { is_opened = 0; + KillDisplayLists(); GLcleanup(); // close OGL return 0; } -//#include "../../frontend/plugin_lib.h" - -static const struct rearmed_cbs *cbs; - /* acting as both renderer and vout handler here .. */ void renderer_set_config(const struct rearmed_cbs *cbs_) { - cbs = cbs_; + cbs = (void *)cbs_; // ugh.. iOffscreenDrawing = 0; iZBufferDepth = 0; @@ -687,3 +698,20 @@ void SetAspectRatio(void) rRatioRect.right,rRatioRect.bottom); glError(); } + +static void fps_update(void) +{ + char buf[16]; + + cbs->flip_cnt++; + if(cbs->flips_per_sec != 0) + { + snprintf(buf,sizeof(buf),"%2d %4.1f",cbs->flips_per_sec,cbs->vsps_cur); + DisplayText(buf, 0); + } + if(cbs->cpu_usage != 0) + { + snprintf(buf,sizeof(buf),"%3d",cbs->cpu_usage); + DisplayText(buf, 1); + } +}