From c52ba520cec3c9d3fdf7cb1f70da95e9396c59a9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 28 Aug 2015 14:14:29 +0200 Subject: Small tweaks --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rlgl.c') diff --git a/src/rlgl.c b/src/rlgl.c index 163fa35a..6dea10c0 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -858,7 +858,7 @@ void rlglInit(void) // NOTE: We don't need that much data on screen... right now... #if defined(GRAPHICS_API_OPENGL_11) - TraceLog(INFO, "OpenGL 1.1 profile initialized"); + //TraceLog(INFO, "OpenGL 1.1 (or driver default) profile initialized"); #endif #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -- cgit v1.2.3 From 5cfd59258ae4c308aab1055430f10955e5188736 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 29 Aug 2015 17:01:36 +0200 Subject: Detected issue --- src/rlgl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/rlgl.c') diff --git a/src/rlgl.c b/src/rlgl.c index 6dea10c0..12eb7a9e 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1938,15 +1938,17 @@ Model rlglLoadModel(VertexData mesh) } // Read screen pixel data (color buffer) +// ISSUE: Non pre-multiplied alpha when reading from backbuffer! +// TODO: Multiply alpha unsigned char *rlglReadScreenPixels(int width, int height) { - unsigned char *screenData = (unsigned char *)malloc(width * height * sizeof(unsigned char) * 4); + unsigned char *screenData = (unsigned char *)malloc(width*height*sizeof(unsigned char)*4); // NOTE: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData); // Flip image vertically! - unsigned char *imgData = (unsigned char *)malloc(width * height * sizeof(unsigned char) * 4); + unsigned char *imgData = (unsigned char *)malloc(width*height*sizeof(unsigned char)*4); for (int y = height-1; y >= 0; y--) { -- cgit v1.2.3 From 055d8927cccbc2b7b4dd5d6f6928159ba3fff2e6 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 29 Aug 2015 20:20:28 +0200 Subject: Small code tweaks --- src/rlgl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/rlgl.c') diff --git a/src/rlgl.c b/src/rlgl.c index 12eb7a9e..7fa50af6 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -4,8 +4,8 @@ * * raylib now uses OpenGL 1.1 style functions (rlVertex) that are mapped to selected OpenGL version: * OpenGL 1.1 - Direct map rl* -> gl* -* OpenGL 3.3+ - Vertex data is stored in VAOs, call rlglDraw() to render -* OpenGL ES 2 - Same behaviour as OpenGL 3.3+ +* OpenGL 3.3 - Vertex data is stored in VAOs, call rlglDraw() to render +* OpenGL ES 2 - Vertex data is stored in VBOs or VAOs (when available), call rlglDraw() to render * * Copyright (c) 2014 Ramon Santamaria (@raysan5) * @@ -3061,8 +3061,6 @@ static pixel *GenNextMipmap(pixel *srcData, int srcWidth, int srcHeight) #if defined(RLGL_STANDALONE) -typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; - // Output a trace log message // NOTE: Expected msgType: (0)Info, (1)Error, (2)Warning static void TraceLog(int msgType, const char *text, ...) -- cgit v1.2.3 From aa982f80f58ae0f18ed8431be8353c9f997610b5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 30 Aug 2015 17:44:47 +0200 Subject: Reviewed some comments --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rlgl.c') diff --git a/src/rlgl.c b/src/rlgl.c index 7fa50af6..8806b429 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2077,7 +2077,7 @@ Shader LoadShader(char *vsFileName, char *fsFileName) return shader; } -// Load a custom shader and return program id +// Load custom shader strings and return program id unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) { unsigned int program = 0; -- cgit v1.2.3