Graphics Reference
In-Depth Information
• categorize graphics API calls into semantic functionality (e.g., initialize, set
up for drawing);
• use the abstraction we have developed in developing simple graphics appli-
cations.
If we re-examine the tutorials from Chapter 3, we observe the following.
APIs are complex. The two APIs we worked with dictated a nine file
source code project for drawing two simple squares!
Disciplinary concepts trump API. In the Chapter 3 tutorials, we applied
concepts from computer graphics to:
- categorize API functions calls according to semantic functionality;
- identify scene drawing functions;
- implement a new class to modify the scene.
We have parsed, partially understood, and designed new classes to modify
the source code without knowing the details of the APIs.
Additionally, modern APIs are constantly evolving with frequent new releases
and updates. These observations suggest that an efficient approach to work with
modern APIs would be the following.
• Learn the disciplinary concepts.
• Derive the functionality required for our implementation.
• Examine appropriate APIs and design classes around API functions to ful-
fill the requirements of our implementations.
In this way, we approach working with an API based on the requirements for sup-
porting our knowledge and our applications: we will only examine relevant API
functions and classes. Because of the large numbers and the constant changes,
studying and understanding each API function in detail may not be an efficient
approach to learning how to work with an API.
In this chapter, we first examine the relationship between graphics APIs and
GUI APIs, the two types of APIs we must work with in all of our applications.
Then we introduce and implement a framework for programming with graphics
APIs. Our goal is not to learn any particular graphics API; rather, we are inter-
ested in deriving an abstract framework that would allow us to use a graphics API
without the details or the complexities.
Search WWH ::




Custom Search