From 29ae06300325785543ae64ebe82f137a59859988 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 29 Jan 2016 02:55:12 +0100 Subject: [PATCH] (Libretro GL Test) Improve fixed function example --- cores/libretro-test-gl/libretro-test.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/cores/libretro-test-gl/libretro-test.c b/cores/libretro-test-gl/libretro-test.c index 75ebd54f42..628a6fd1cf 100644 --- a/cores/libretro-test-gl/libretro-test.c +++ b/cores/libretro-test-gl/libretro-test.c @@ -369,14 +369,14 @@ void retro_run(void) } #ifdef GL_FF - int width = BASE_WIDTH * 4; - int height = BASE_HEIGHT * 4; float ratio = width / (float)height; glBindFramebuffer(RARCH_GL_FRAMEBUFFER, hw_render.get_current_framebuffer()); + glClearColor(0.3, 0.4, 0.5, 1.0); glViewport(0, 0, width, height); glClear(GL_COLOR_BUFFER_BIT); + glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f); @@ -387,14 +387,17 @@ void retro_run(void) glLoadIdentity(); glBegin(GL_TRIANGLES); - glColor3f(1.f, 0.f, 0.f); - glVertex3f(-0.3f, -0.3f, 0.f); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glVertex2f(-0.5f, -0.5f); - glColor3f(0.f, 1.f, 0.f); - glVertex3f(0.3f, -0.3f, 0.f); + glColor4f(1.0f, 1.0f, 0.0f, 1.0f); + glVertex2f(0.5f, -0.5f); - glColor3f(0.f, 0.f, 1.f); - glVertex3f(0.0f, 0.3f, 0.f); + glColor4f(0.0f, 1.0f, 1.0f, 1.0f); + glVertex2f(-0.5f, 0.5f); + + glColor4f(1.0f, 0.0f, 1.0f, 1.0f); + glVertex2f(0.5f, 0.5f); glEnd(); #else