design of a 2d graphics engine by joe hallahan. what is an engine? software engine: core of the...
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/1.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/2.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/3.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/4.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/5.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/6.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/7.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/8.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/9.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/10.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/11.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/12.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/13.jpg)
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,](https://reader036.vdocuments.us/reader036/viewer/2022082819/56649f345503460f94c5188d/html5/thumbnails/14.jpg)
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)