Chapter 1, Introduction to OpenGL
- You should read chapter 1.
- OpenGL Syntax
- Functions
- glFunctionName are OpenGL functions.
- These are mostly graphics calls.
- glDrawArrays is an instruction to draw something.
- In general, OpenGL interacts with the GPU.
- OpenGL is covered throughout the book.
- glutFunctionName are glut functions.
- Two types
- glutCreateWindow interacts with the OS to create a main window.
- glutDisplayFunc tells glut what to call when the image needs rediplayed.
- In general, glut interacts with the operating system.
- glut is covered in appendix A.
- Constants
- GL_COLOR_BUFFER_BIT - this refers to the color bits in the frame buffer.
- GLUT_KEY_DOWN refers to a key press event.
- To be more portable, OpenGL has a set of type definitions.
- GLfloat is the floating point type. (See table 1, page 10)
- This is a C library, so there is not function overloading based on type.
- Many functions have multiple versions.
- glColor*
- 3 or 4
- b,s,i,f,d,ub,us,ui
- glColor3ui()
- The OpenGL Pipeline
-
- Specifying data (Vertex Data) is somewhat complex.
- Chapter 3 is all about this.
- Probably more time than we want to spend.
- But probably the most basic for an OpenGL literate person.
- This is most (or all) of the task accomplished in the init function.
- Shaders
- Programmable portions of the pipeline.
- Allow users to implement portions of the graphics pipeline.
- We need to provide Vertex and Fragment shaders. All others are optional.
- Other parts: Primitive Setup, Clipping, Rasterization
- We have seen parts of this.