chapter 4: working with graphics apis
DESCRIPTION
Chapter 4: Working with Graphics APIs. We will …. Learn relationships between Graphics and GUI API Understand a Graphics API programming framework Use the framework and apply to Tutorial 3.1. Our Source Code. Graphics API. GUI API. Operating System. The APIs of Tutorial 3.1:. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/1.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Chapter 4: Working with Graphics APIs
![Page 2: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/2.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
We will …
Learn relationships between Graphics and GUI API
Understand a Graphics API programming framework
Use the framework and apply to Tutorial 3.1
![Page 3: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/3.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
The APIs of Tutorial 3.1:
Graphics API: Needs GUI for window to draw in
GUI API: Needs Operating system for events
Graphics APIGUI API
Our Source Code
Operating System
![Page 4: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/4.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Supports from the APIs Graphics API
Initialize drawing hardware GUI API
Create Window + GUI elements (Button) Create drawing area in Window
Graphics API draws to the drawing area created by GUI API
![Page 5: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/5.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Graphics API: Programming model
![Page 6: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/6.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Graphics API framework
Graphics Hardware Context (GHC) Hardware buffers (e.g., pixel frame buffer) Can be multiple buffers of different types
(e.g., pixel, z, stencil, etc.) Rendering Context (RC)
Attributes of how to turn geometry into pixels
e.g., transformation, color, lighting shading Can have multiple RC connecting to GHC
![Page 7: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/7.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Programming with Graphics API
![Page 8: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/8.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Programming with Graphics API
A: Initialize Hardware (GHC) B: Create RC C: Drawing
C1: Preparations: set Rendering state: transforms, colors, etc.
C2: Send drawing command GHC buffers are shown through
GUI drawing areas
![Page 9: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/9.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 3.1: OnPaint with D3D
![Page 10: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/10.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 3.2: OnPaint with OGL
![Page 11: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/11.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 3.1: OnCreate D3D Init
![Page 12: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/12.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 3.2: OnCreate OGL Init
![Page 13: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/13.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
GraphicsSystem abstraction …
![Page 14: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/14.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Using GraphicsSystem abstraction
![Page 15: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/15.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 4.1: GraphicsSystem class
![Page 16: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/16.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 4.1: using GraphicsSystem
![Page 17: Chapter 4: Working with Graphics APIs](https://reader036.vdocuments.us/reader036/viewer/2022081421/56813d50550346895da70b63/html5/thumbnails/17.jpg)
Chapter 4
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer
Tutorial 4.1: RectangleClass