CHAPTER 4: Turning On the Lights (^97)
Figure 4-3. Simulated lighting from below (left) and a higher polygon count to simulate shading (right)
- Create a new header to hold some of the systemwide values, and call it
OpenGLSolarSystem.h. For now, it should contain just the following two
lines:
#import <OpenGLES/ES1/gl.h>
#define SS_SUNLIGHT GL_LIGHT0 //GL uses GL_LIGHTx - Add #import "OpenGLSolarSystem.h" to the top of the solar-system view
controller. - Add the code in Listing 4-1, and call it from your viewDidLoad() method
in the viewcontroller where all of the other initializers reside. And make
sure to set the current context; otherwise, you’ll not see a thing.