design of a 2d graphics engine by joe hallahan. what is an engine? software engine: core of the...

14
Design of a 2D Graphics Engine By Joe Hallahan

Upload: kristian-shields

Post on 05-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Design of a 2D Graphics Engine

By Joe Hallahan

Page 2: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

What is an Engine?

Software engine: core of the program Internal as opposed to visible

Others (physics, database) excel at one task only, “software engine” is more general

Emphasis on graphics

Page 3: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Benefits

Reusable, safe

Framework for program – everything else is specific/detail work

Page 4: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Purpose

To create an engine using C++, OpenGL, and SDL that can simplify the process required for creating a graphical application by rendering graphics automatically and providing support for other general functions

Page 5: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Design - Tools

C++ Fast, efficient

SDL Free Makes many functions easier Works well with OpenGL Cross-platform

Page 6: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Design - Tools

OpenGL 2D and 3D support Can be hard to learn/use Free, supported on most systems Really really fast

Page 7: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Design - Structure

Engine.h contains declarations of variables, functions, classes, also includes external libraries

Engine.cpp defines everything declared in Engine.h

A third program can be used to test the engine, all that is really necessary is the main() method

Page 8: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Problems to Overcome

Data structure– Array used– Holds Shapes– Only holds up to 100 objects

Page 9: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Testing

#include "Engine.h"

int main(int argc, char* argv[]){

Engine e;

e.run();

return 0;

}

Page 10: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Testing

Page 11: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Testing / Analysis

3 test programs Simple Test

Bare minimum – no external program, just a main method Pong

Game, familiar Simple, controls supported through SDL

Engine Demo Colors Collisions

Page 12: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Conclusion

Engine works correctly Performance mainly hardware dependent,

should be about as efficient as a normal program made without using engine

No performance loss

Page 13: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Expandability

3D support Sound More inputs More performance tweaks Better collision detection

Will hurt performance in most cases Specialization

Page 14: Design of a 2D Graphics Engine By Joe Hallahan. What is an Engine? Software engine: core of the program Internal as opposed to visible Others (physics,

Bibliography• -Development of a 3D Graphics Engine (Kassing)• -Modular Architecture for Computer Game

Design (McNeill)• -Multi-threaded Game Engine (Tulip, Bekkema,

Nesbitt)• -Interactive 3D Geometry in OpenGL (Welsh)• -FROG: The Fast \& Realistic OPENGL

Displayer• -Simple and rapid collision detection using

multiple viewing volumes (Fan, Wan, Gao)