From 3efceb3723733a4766abb97fed479b3b4931ae1b Mon Sep 17 00:00:00 2001 From: outfrost Date: Tue, 6 Nov 2018 14:56:59 +0100 Subject: [PATCH] Start refactoring naming convention --- debugutil.c | 32 ++++++++++++++++---------------- debugutil.h | 6 +++--- main.c | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/debugutil.c b/debugutil.c index cd911b9..191bb4b 100644 --- a/debugutil.c +++ b/debugutil.c @@ -4,27 +4,27 @@ #include #include -char * get_gl_info() { - const char * gl_version = (const char *) glGetString(GL_VERSION); - const char * gl_sl_version = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION); - const char * gl_renderer = (const char *) glGetString(GL_RENDERER); +char* getGlInfoString() { + const char* glVersion = (const char*) glGetString(GL_VERSION); + const char* glslVersion = (const char*) glGetString(GL_SHADING_LANGUAGE_VERSION); + const char* glRenderer = (const char*) glGetString(GL_RENDERER); - size_t gl_info_length = strlen("OpenGL - GLSL - ") - + strlen(gl_version) - + strlen(gl_sl_version) - + strlen(gl_renderer); + size_t glInfoLength = strlen("OpenGL - GLSL - ") + + strlen(glVersion) + + strlen(glslVersion) + + strlen(glRenderer); - char * gl_info = malloc(gl_info_length + sizeof(char)); - sprintf(gl_info, + char* glInfoString = malloc(glInfoLength + sizeof(char)); + sprintf(glInfoString, "OpenGL %s - GLSL %s - %s", - gl_version, - gl_sl_version, - gl_renderer); + glVersion, + glslVersion, + glRenderer); - return gl_info; + return glInfoString; } -void print_struct_aiScene(FILE* stream, const struct aiScene* scene) { +void dumpScene(FILE* stream, const struct aiScene* scene) { if (scene == NULL) { fprintf(stream, "NULL"); return; @@ -44,7 +44,7 @@ void print_struct_aiScene(FILE* stream, const struct aiScene* scene) { (void*) (*scene).mLights); } -void print_struct_aiNode(FILE* stream, const struct aiNode* node) { +void dumpNode(FILE* stream, const struct aiNode* node) { if (node == NULL) { fprintf(stream, "NULL"); return; diff --git a/debugutil.h b/debugutil.h index 2d7793b..7099d68 100644 --- a/debugutil.h +++ b/debugutil.h @@ -4,8 +4,8 @@ #include #include -char * get_gl_info(); -void print_struct_aiScene(FILE* stream, const struct aiScene* scene); -void print_struct_aiNode(FILE* stream, const struct aiNode* node); +char* getGlInfoString(); +void dumpScene(FILE* stream, const struct aiScene* scene); +void dumpNode(FILE* stream, const struct aiNode* node); #endif diff --git a/main.c b/main.c index 7040978..9f239c6 100644 --- a/main.c +++ b/main.c @@ -13,7 +13,7 @@ int main(int argc, char** argv) { glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA | GLUT_DEPTH); glutCreateWindow(NULL); - glutSetWindowTitle(get_gl_info()); + glutSetWindowTitle(getGlInfoString()); glutDisplayFunc(render_scene); glutReshapeFunc(resize_stage); -- 2.44.0