Changeset db2d995 in opengl-game


Ignore:
Timestamp:
Apr 7, 2021, 2:51:53 PM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
5049354
Parents:
5081b9a
Message:

Make the printVec and printMat functions a bit easier to use and add a printVec for vec2

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • utils.cpp

    r5081b9a rdb2d995  
    2626}
    2727
    28 void printVec3(string label, const vec3& v) {
     28void printVec(string label, const vec2& v) {
     29   cout << label << " -> (" << v.x << "," << v.y << ")" << endl;
     30}
     31
     32void printVec(string label, const vec3& v) {
    2933   cout << label << " -> (" << v.x << "," << v.y << "," << v.z << ")" << endl;
    3034}
    3135
    32 void printVec4(string label, const vec4& v) {
     36void printVec(string label, const vec4& v) {
    3337   cout << label << " -> (" << v.x << "," << v.y << "," << v.z << "," << v.w << ")" << endl;
    3438}
    3539
    36 void printMat4(string label, const mat4& m) {
     40void printMat(string label, const mat4& m) {
    3741   cout << label << ": " << endl;
    3842   cout << "[ " << m[0][0] << " " << m[1][0] << " " << m[2][0] << " " << m[3][0] <<  " ]" << endl;
  • utils.hpp

    r5081b9a rdb2d995  
    1313float getRandomNum(float low, float high);
    1414
    15 void printVec3(string label, const vec3& v);
    16 void printVec4(string label, const vec4& v);
    17 void printMat4(string label, const mat4& m);
     15void printVec(string label, const vec2& v);
     16void printVec(string label, const vec3& v);
     17void printVec(string label, const vec4& v);
     18void printMat(string label, const mat4& m);
    1819
    1920// Code for offset_of function from https://gist.github.com/graphitemaster/494f21190bb2c63c5516
Note: See TracChangeset for help on using the changeset viewer.