]> git.lizzy.rs Git - shadowclad.git/commitdiff
Start refactoring naming convention
authoroutfrost <kotlet.bahn@gmail.com>
Tue, 6 Nov 2018 13:56:59 +0000 (14:56 +0100)
committeroutfrost <kotlet.bahn@gmail.com>
Tue, 6 Nov 2018 13:56:59 +0000 (14:56 +0100)
debugutil.c
debugutil.h
main.c

index cd911b94e7bae26c28dcfe1644509c7091d0dff9..191bb4b19159012580eb33283072709dc68d4e49 100644 (file)
@@ -4,27 +4,27 @@
 #include <stdio.h>
 #include <assimp/scene.h>
 
-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;
index 2d7793b879a2c11b39c8b3c49ce88d3691f4c82a..7099d684b56b8f63580ee17cec5dd0bd1455ec02 100644 (file)
@@ -4,8 +4,8 @@
 #include <stdio.h>
 #include <assimp/scene.h>
 
-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 7040978d9a08765391cb03d87bb82ae3109f7682..9f239c67ae0161e7012a61aab9ecedb29231026b 100644 (file)
--- 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);