Changeset a23fc08 in opengl-game
- Timestamp:
- May 24, 2019, 8:52:32 PM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 6abfd07
- Parents:
- 98f06d9
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (05/24/19 20:22:31)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (05/24/19 20:52:32)
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TODO.txt
r98f06d9 ra23fc08 6 6 -Update the IMGUI code in a generic way to support this as well 7 7 -Check the book's "Printing Parameters from the GL Context" to output a bunch of OpenGL context params 8 -Move some common functions into a Utils class9 8 10 9 DONE … … 17 16 - What I really need to do is completely refactor the logger class to return an ofstream to the logger file 18 17 and use streaming to send output to it. The log file can be closed in the destructor. 18 -Move some common functions into a Utils class 19 19 20 20 NEW TODO -
makefile
r98f06d9 ra23fc08 15 15 # as this well prevent regenerating .o files for unchanged .cpp files 16 16 17 newgame: new-game.cpp logger.cpp stb_image.cpp imgui_impl_glfw_gl3.cpp CrashLogger.cpp $(IMGUI_FILES)17 newgame: new-game.cpp logger.cpp utils.cpp CrashLogger.cpp stb_image.cpp imgui_impl_glfw_gl3.cpp $(IMGUI_FILES) 18 18 $(CC) $^ $(DEP) $(CFLAGS) -o $@ 19 19 -
new-game.cpp
r98f06d9 ra23fc08 198 198 unsigned char* loadImage(string file_name, int* x, int* y); 199 199 200 void printVec3(string label, const vec3& v);201 void printVec4(string label, const vec4& v);202 void printMat4(string label, const mat4& m);203 204 200 void initObject(SceneObject* obj); 205 201 void addObjectToScene(SceneObject* obj, … … 255 251 void initGuiValueLists(map<string, vector<UIValue>> valueLists); 256 252 void renderGuiValueList(vector<UIValue>& values); 257 258 float getRandomNum(float low, float high);259 253 260 254 #define NUM_KEYS (512) … … 1348 1342 } 1349 1343 1350 void printVec3(string label, const vec3& v) {1351 cout << label << " -> (" << v.x << "," << v.y << "," << v.z << ")" << endl;1352 }1353 1354 void printVec4(string label, const vec4& v) {1355 cout << label << " -> (" << v.x << "," << v.y << "," << v.z << "," << v.w << ")" << endl;1356 }1357 1358 void printMat4(string label, const mat4& m) {1359 cout << label << ": " << endl;1360 cout << "[ " << m[0][0] << " " << m[1][0] << " " << m[2][0] << " " << m[3][0] << " ]" << endl;1361 cout << "[ " << m[0][1] << " " << m[1][1] << " " << m[2][1] << " " << m[3][1] << " ]" << endl;1362 cout << "[ " << m[0][2] << " " << m[1][2] << " " << m[2][2] << " " << m[3][2] << " ]" << endl;1363 cout << "[ " << m[0][3] << " " << m[1][3] << " " << m[2][3] << " " << m[3][3] << " ]" << endl;1364 }1365 1366 1344 // TODO: Pass a reference, not a pointer 1367 1345 void initObject(SceneObject* obj) { … … 2736 2714 return obj; 2737 2715 } 2738 2739 float getRandomNum(float low, float high) {2740 return low + ((float)rand() / RAND_MAX) * (high-low);2741 } -
utils.h
r98f06d9 ra23fc08 1 #ifndef __UTILS_H__ 2 #define __UTILS_H__ 3 4 #include <string> 5 6 #include <glm/mat4x4.hpp> 7 8 using namespace std; 9 using namespace glm; 10 11 float getRandomNum(float low, float high); 12 13 void printVec3(string label, const vec3& v); 14 void printVec4(string label, const vec4& v); 15 void printMat4(string label, const mat4& m); 16 1 17 // Code for offset_of function from https://gist.github.com/graphitemaster/494f21190bb2c63c5516 2 18 … … 16 32 return offset_of_impl<T1, T2>::offset(member); 17 33 } 34 35 #endif
Note:
See TracChangeset
for help on using the changeset viewer.