From aee23413b69f37b6bf9cf7a7ed9a0ca475809417 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Mon, 25 Aug 2014 01:52:34 +0200 Subject: [PATCH] =?UTF-8?q?Draw:=20Limpiar=20correctamente=20la=20pantalla?= =?UTF-8?q?=20cuando=20se=20usa=20OpenGLES.=20Realmente=20dibuja=20un=20po?= =?UTF-8?q?l=C3=ADgono=20blanco=20sobre=20toda=20la=20pantalla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GameLib/Draw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GameLib/Draw.c b/GameLib/Draw.c index 4e72078..53b398e 100644 --- a/GameLib/Draw.c +++ b/GameLib/Draw.c @@ -68,6 +68,8 @@ float _color[4]; #if USE_OpenGLES +GLuint _whiteTex; + GLuint Draw_CompileShader(GLenum type, const char *source){ GLuint shader = glCreateShader(type); if (shader == 0) { @@ -132,6 +134,8 @@ GLuint vertexObject; #endif +GLuint Draw_UploadGLTexture(int w, int h, unsigned char *pixels); + ///////////////////////////// // Draw_Init // @@ -303,6 +307,9 @@ int Draw_Init(int width,int height,char *title,int pfps,int fps){ glUniformMatrix4fv(projectionMatrixLoc, 1, GL_FALSE, projectionMatrix); + unsigned char whiteTexData[4]={255,255,255,255}; + _whiteTex=Draw_UploadGLTexture(1, 1, whiteTexData); + #endif // Enable Alpha blending @@ -429,6 +436,7 @@ void Draw_Clean( 0.0, 0.0, // TexCoord 0 fr, fg, fb, 1.0, // Color }; + glBindTexture(GL_TEXTURE_2D, _whiteTex); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vVertices), vVertices); glDrawArrays(GL_TRIANGLES, 0, 6); #endif