Added b3Printf, b3Warning and b3Error that can be re-routed to custom handlers.

See in src/Bullet3Common/b3Logging.h for details
This commit is contained in:
erwin coumans
2013-06-03 13:10:27 -07:00
parent 70b4ead641
commit 76b0d7697a
21 changed files with 321 additions and 175 deletions

View File

@@ -39,6 +39,8 @@
"../OpenGLTrueTypeFont/opengl_fontstashcallbacks.h",
"../../src/Bullet3Geometry/b3ConvexHullComputer.cpp",
"../../src/Bullet3Geometry/b3ConvexHullComputer.h",
"../../src/Bullet3Common/b3Logging.h",
"../../src/Bullet3Common/b3Logging.cpp",
"../../src/Bullet3Common/b3AlignedAllocator.cpp",
"../../src/Bullet3Common/b3Quickprof.cpp",
"../../src/Bullet3Common/b3Quickprof.h",

View File

@@ -180,7 +180,7 @@ struct InternalDataRenderer : public GLInstanceRendererInternalData
}
void keyboardCallback(unsigned char key, int x, int y)
{
printf("world\n");
// printf("world\n");
}
};
@@ -637,7 +637,7 @@ void GLInstancingRenderer::writeTransforms()
}
} else
{
printf("ERROR glMapBuffer failed\n");
b3Error("ERROR glMapBuffer failed\n");
}
glUnmapBuffer( GL_ARRAY_BUFFER);
//if this glFinish is removed, the animation is not always working/blocks

View File

@@ -3,6 +3,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "Bullet3Common/b3Logging.h"
// Load the shader from the source text
void gltLoadShaderSrc(const char *szShaderSrc, GLuint shader)
@@ -89,8 +90,8 @@ GLuint gltLoadShaderPair(const char *szVertexProg, const char *szFragmentProg)
&actualLen,
infoLog);
printf("Warning/Error in GLSL shader:\n");
printf("%s\n",infoLog);
b3Error("Warning/Error in GLSL shader:\n");
b3Error("%s\n",infoLog);
glDeleteProgram(hReturn);
return (GLuint)NULL;
}

View File

@@ -25,7 +25,7 @@ subject to the following restrictions:
static void printGLString(const char *name, GLenum s) {
const char *v = (const char *) glGetString(s);
printf("GL %s = %s\n", name, v);
b3Printf("GL %s = %s\n", name, v);
}