Last Thursday night was a night from hell! I had to rebuild all of the libraries (GLTools, FREEGLUT, and MathEngine) from their sources, modifying their their projects' properties so that they compile and link without errors and warnings. Adding them to the Graphics engine project and get that to compile and link without errors or warnings was a whole other issue. I spent the whole night wrestling with Visual Studio. At 7 AM next day I finished the process successfully, but too tired to go ahead to write any code.
With the project all setup and ready for actual coding, the fun part started. Before taking SE456 - Architecture of Computer Games - last quarter, I thought I knew how to write software, but after I took that class, I discovered that I knew nothing about that before. Since then I fell in love with software architecture and anything related to that topic, including API design, OOP principles, and design patterns. When I apply these principles I learned, I really feel that I'm actually an ENGINEER as opposed to someone who just knows how to write code that runs.
I really didn't like the structure of the GLTools at all, or how the project was initially setup. So I played around a bit, using the baby steps approach. Wrapping all of what was originally there, transforming the project from a single file that had all the code in it to a project with multiple files and multiple classes. The main method now has only 5 lines of code. all the rest is handled by other classes.
It's far from being complete, but it's the very first step into a huge refactoring operation. This very first step is shown in the below UML. Very excited to continue the refactoring, hopefully transforming this into a strong graphics engine.
Sunday, February 24, 2013
Tuesday, February 12, 2013
The Math Engine: More About C++ Than It Is About Math
Just Like Professor Keenan said, the math engine taught me a lot about C++ than it did about math. I list some of the things I learned about C++ below:
Wonderful class so far! :)
- Optional Function/Method Parameters:
- Those are the parameters that have default values, and are always put at the end of the parameters list. What I learned was not to define a default parameter twice (in the declaration and in the implementation), as it will not compile.
- Subscripting: Overloading the [] Operator:
- Overload it twice:
- Once with a return value of a reference type, which causes it be an I-value, allowing subscripted expressions on either side of the assignment operators:
- Vect& Vect::operator[](x_enum);
- To be used as either:
- V[x] = 5.0f;
- Or V[x] = V[y];
- The second version of it is intended to be used by a constant object of the class it is overloaded for:
- const Vect Vect::operator[](x_enum) const;
- Overloading Unary Operators ( +, -, ++, -- ):
- Can be overloaded by a global function made as a friend for the class:
- Vect operator+(Vect& v);
- Or as instance method, like below:
- Vect Vect::operator+();
- Nameless Unions: to reduce typing.
Wonderful class so far! :)
Saturday, February 2, 2013
Lagging Behind
With all of the bad stuff that has been going on in my country for more than a week now, and with my priority last week was given to studying and reading for the other Graphics class, I'm really lagging behind. I haven't written a single line of code in PA3 or PA4 so far. All what I have done was just some experimentation I wrote using Qt Creator for the file system.
For this, I have decided that this whole weekend is dedicated to prof. Ed Keenan's assignments. Period.
For this, I have decided that this whole weekend is dedicated to prof. Ed Keenan's assignments. Period.
Subscribe to:
Posts (Atom)
