CS 330 Lecture 28 – Parametric Polymorphism
Agenda what ?s program this the cost of subtype polymorphism a Set class in C++ a Set class in Java C++ templates vs. Java generics Learning Intentions I understand that some methods of making code reusable lead to costs in performance and error detection. I can use templates to achieve parametric polymorphism in C++. I […]
CS 330 Lecture 27 – Polymorphism
Agenda what ?s defining polymorphism theorize this what does this do? TODO 1/4 sheet: Read http://www.insomniacgames.com/tech/articles/0308/three_big_lies.php. (This page rendered improperly for me; I had to highlight the text to read it.) Read http://hacksoflife.blogspot.com/2008/04/what-is-oop-good-for.html. What do you think? Intentions I can define polymorphism and identify the benefits it confers upon developers like me. I can comprehend how dynamic dispatch […]
CS 455 Lecture 17 – Heightmaps
Agenda what ?s heightmap exercise TODO Heightmaps are grayscale images used to generate terrain. For example, to get a landscape with rolling hills, we can use a noisy but smooth image: To produce a plateau (white) with a sudden chasm (black), we can use this image of starker contrast: The are two significant advantages of […]
CS 330 Lecture 26 – C++ I/O, Overloading, References
Agenda what ?s the philosophy of Stroustrup C++ I/O builtin operators references const next up: polymorphism TODO 1/4 sheet: Scour the results of the 2015 Stack Overflow Developer Survey. What’s interesting? Surprising? Devastating? Encouraging? Where do you deviate? Where do you conform? Code Image.h Image.cpp main.cpp Haiku
CS 330 Lecture 25 – Concrete Classes in C++
Agenda what ?s classes in C++ namespaces RAII references overloading builtin operators I/O of custom types Code Image.h Image.cpp main.cpp Haiku
CS 330 Timbre Homework – due before April 15
See the PDF.
schuhaj – late magnets
My thought process was: copy and paste CJ’s code and then try to get rid of the obvious errors. That was an easy first step. Next it was figuring out what was missing. I didn’t realize until after getting the magnets on the screen that although my code didn’t have errors, it didn’t work. Hours […]
CS 330 Lecture 24 – Memory, Polymorphism, and Higher-order Functions
Agenda what ?s program this polymorphism in C function pointers callbacks with GLUT TODO 1/4 sheet: read A Malloc Tutorial. Program This Write a preprocessor macro named EZMALLOC that shortens the code needed to allocate a block of memory. Programmers will invoke it with something like: Code multireturn.c poly.c torus.c Haiku
CS 455 Lecture 16 – Specular Lighting
Agenda what ?s diffuse lighting in eye space positional lighting vs. directional lighting specular reflection TODO As a lab exercise, implement specular lighting in the specular project. Send me a screenshot of your scene with highlights. Haiku
CS 330 Lecture 23 – Cisms Cont’d
Agenda what ?s enums and type safety the C preprocessor macro danger dynamic memory allocation memory allocation When do I dynamically allocate memory? When you don’t know how much memory you’ll need at compile time. You don’t know if the size depends on a function parameter. When you allocate memory within a function but need the […]