1 / 10

Object Oriented Design

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.

Télécharger la présentation

Object Oriented Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object Oriented Design

  2. 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

  3. 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 • E.g., ATI Radeon, GeForce • Results in complex but efficient rendering • Already these cards can draw a multi thousands 3D polygon object with light sources, etc. faster than a 32 x 32 pixel desktop icon.

  4. OpenGL Architecture http://developer.apple.com/techpubs/macosx/Carbon/graphics/OpenGL/OpenGL/chap2/index.html

  5. Anti Patterns: OpenGL the Mega Blob • “a class with 60 or more attributes and operations usually indicates the presence of the Blob” • OpenGL >= 300 http://gl4java.sourceforge.net/docs/html/ • What can we do make this enormous functionality more accessible through OOD?

  6. Let’s make a Game Engine • Refactoring • Bottom up: to make OpenGL functionality available • Top down: to capture needs by a variety of games • We use some ideas from our 2D editor design Game 1 Game 2 Game n Game Engine Chris Schenk & Luke Swanson OpenGL Hardware

  7. Examples • Create a subclass of the OpenGLWindow class and extend the display, reshape, idle and init methods. • OpenGL for MCL • Triangles, cubes, sprites, textures • OpenGL for Java

  8. Trade offs • This is not an OpenGL course • Keep OpenGL specific lectures to a minimum • Read the books for more depth • Game Engine will have to be very simple stressing simplicity over depth and performance

  9. OpenGL Resources • The OpenGL Red Book • The must have Programming Guide • http://fly.cc.fer.hr/~unreal/theredbook/ • The OpenGL Blue Book • The Reference Manual • http://www.eecs.tulane.edu/www/graphics/doc/OpenGL-Man-Pages/opengl_index_spec.html • Real-Time Rendering • A truly wonderful book covering a lot of ground on how to make efficient 3D • http://www.amazon.com/exec/obidos/ASIN/1568811012 • http://www.opengl.org/

  10. Homework • Download and install GL4Java • http://www.jausoft.com/gl4java.html • After installation run the demos • Due: October 31 • Read OpenGL Red book chapter 1 and 2 • http://fly.cc.fer.hr/~unreal/theredbook/ • Due: November 5

More Related