Week 1 Day 2 - A Little Advanced C++...
The Voroni assignment was due today, but some of the students had technical issues completing it, so I went over some features of C and C++ that they hadn't seen before. (This is one of the reasons why I recommend my CSCI students take game development - they continue to level up in programming.)
We talked about:
1) static inline class variables - variables that are attached to a class, not an object of that class. So all objects of that class share the same variable.
2) The use of #if and #ifdef and related preprocessor directives to do things like cause compiler errors if the version of C++ used wasn't high enough, or to have different function calls on different operating systems.
3) Using a reference to get a variable out of a vector without actually copying it out as normal. This can be risky as if a vector ever reallocated all pointers, references, and iterators pointing at it are invalidated.
4) Use of typedefs (or using "using" in C++) to alias type names to a smaller size.
5) Globals are always initialized to 0
6) Using emplace_back instead of push_back. I don't mention why in the video - we do this to avoid creating a temporary variable and then copying the variable into the vector.
I start the lecture talking about one of the most unconscionable employment agreements I've ever seen from Amazon, and I finish the lecture talking about the UCs, discrete math, and some other stuff you can skip.
Other Videos By Bill Kerney
2021-07-20 | Week 3 Day 1 - Tracelines in UE4 |
2021-07-16 | Week 2 Day 5 - Blueprints |
2021-07-16 | Week 2 Day 4 - Game Development Terminology, Intro to Blueprints |
2021-07-16 | Week 2 Day 4 - Rasterization |
2021-07-14 | Week 2 Day 3 - Collision Detection, Traceline, BVHs |
2021-07-14 | Week 2 Day 3 - Landscape Layers, Automatic Grass, Fog |
2021-07-13 | Week 2 Lecture 2 - Lloyd's Algorithm and Collision Detection |
2021-07-13 | Week 2 Lecture 2 - Landscaping |
2021-07-12 | Week 2 Lecture 1 - More C++ |
2021-07-12 | Week 2 Day 1 - Advanced Materials |
2021-07-09 | Week 1 Day 2 - A Little Advanced C++... |
2021-07-09 | Week 1 Lecture 4 - Materials in UE4 |
2021-07-09 | Week 1 Day 3 - Lighting |
2021-07-07 | Week 1 Day 1 - Voroni Diagrams |
2021-07-07 | Week 1 Lecture 2 - Intro to Unreal Engine |
2021-07-07 | Week 1 Day 1 - Welcome to IS50A |
2021-05-15 | Week 18 - Bounding Volume Hierarchies |
2021-05-14 | Week 18 Day 3 - Use Cases |
2021-05-13 | Week 18 Day 2 - Final Presentations |
2021-05-13 | Week 18 Day 2 - Hyperthreading |
2021-05-12 | Week 18 Day 2 - Graph Adjacency Lists |