Presentation is loading. Please wait.

Presentation is loading. Please wait.

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Chapter 4: Working with Graphics APIs.

Similar presentations


Presentation on theme: "Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Chapter 4: Working with Graphics APIs."— Presentation transcript:

1 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Chapter 4: Working with Graphics APIs

2 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 We will … Learn relationships between Graphics and GUI API Understand a Graphics API programming framework Use the framework and apply to Tutorial 3.1

3 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 The APIs of Tutorial 3.1: Graphics API: Needs GUI for window to draw in GUI API: Needs Operating system for events Graphics API GUI API Our Source Code Operating System

4 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 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

5 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Graphics API: Programming model

6 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 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

7 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Programming with Graphics API

8 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 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

9 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Tutorial 3.1: OnPaint with D3D

10 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Tutorial 3.2: OnPaint with OGL

11 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Tutorial 3.1: OnCreate D3D Init

12 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Tutorial 3.2: OnCreate OGL Init

13 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 GraphicsSystem abstraction …

14 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Using GraphicsSystem abstraction

15 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Tutorial 4.1: GraphicsSystem class

16 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Tutorial 4.1: using GraphicsSystem

17 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Tutorial 4.1: RectangleClass


Download ppt "Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Chapter 4: Working with Graphics APIs."

Similar presentations


Ads by Google