From 53d87e765f441e4c9ec209b54bc662efe94d8c96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 10 Jun 2014 11:28:05 -0400 Subject: [PATCH] lib/opengles1: add color methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/mnit/opengles1.nit | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/mnit/opengles1.nit b/lib/mnit/opengles1.nit index a0233fa..dd5af2d 100644 --- a/lib/mnit/opengles1.nit +++ b/lib/mnit/opengles1.nit @@ -421,6 +421,14 @@ class Opengles1Display glClearColor( r, g, b, a ); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); `} + + # Set the current color applied to all drawing + # + # require: r, g, b, a in [0.0 .. 1.0] + fun color(r, g, b, a: Float) `{ glColor4f(r, g, b, a); `} + + # Reset the current color to opaque white + fun reset_color `{ glColor4f(1.0f, 1.0f, 1.0f, 1.0f); `} end extern class Opengles1Image in "C" `{struct mnit_opengles_Texture *`} -- 1.7.9.5