Object Oriented Design
Goals Using OpenGL as case study turning a blob anti pattern into an Object-Oriented Architecture A Quick Introduction to OpenGL Provide pointers to resources
Why OpenGL? Serves as great design case to explore a variety of OOD issues. Extremely useful to build 2D/3D games Provides access to sophisticated graphics supported by hardware acceleration u E.g., ATI Radeon, GeForce u Results in complex but efficient rendering u Already these cards can draw a multi thousands 3D polygon object with light sources, etc. faster than a 32 x 32 pixel desktop icon.
OpenGL Architecture
Anti Patterns: OpenGL the Mega Blob “a class with 60 or more attributes and operations usually indicates the presence of the Blob” u OpenGL >= What can we do make this enormous functionality more accessible through OOD?
Let’s make a Game Engine Refactoring u Bottom up: to make OpenGL functionality available u Top down: to capture needs by a variety of games We use some ideas from our 2D editor design Hardware OpenGL Game Engine Chris Schenk & Luke Swanson Game 1Game 2 Game n
Examples Create a subclass of the OpenGLWindow class and extend the display, reshape, idle and init methods. u OpenGL for MCL Triangles, cubes, sprites, textures u OpenGL for Java
Trade offs This is not an OpenGL course u Keep OpenGL specific lectures to a minimum u Read the books for more depth Game Engine will have to be very simple stressing simplicity over depth and performance
OpenGL Resources The OpenGL Red Book u The must have Programming Guide u The OpenGL Blue Book u The Reference Manual u GL-Man-Pages/opengl_index_spec.html GL-Man-Pages/opengl_index_spec.html Real-Time Rendering u A truly wonderful book covering a lot of ground on how to make efficient 3D u
Homework Download and install GL4Java u u After installation run the demos u Due: October 31 Read OpenGL Red book chapter 1 and 2 u u Due: November 5