First you need to understand that OpenGL does not really understand the term βmodelβ, all that OpenGL sees is the stream of vertices that make up it, and depending on the current mode, it uses these vertex flows to draw triangles on the screen.
Each iteration of the personnel cycle is as follows:
- clear all buffers
- for each window element (main scene, HUD, minimap, etc.):
- set of scissor and viewport
- conditionally clear depth and / or stencil
- given design matrix
- set the model view matrix for the initial view
- for each model
- apply model transformation to matrix stack
- bind model data (textures, vertices, etc.).
- issue model drawing commands
- clipboards
OpenGL does not remember what happens there. There was (is) some tool called Display Lists, but they cannot store all kinds of commands - they are also outdated and removed from the latest versions of OpenGL. The immediate mode commands glBegin, glEnd, glVertex, glNormal, and glTexCoord have also been removed.
So, the idea is to load some data (textures, vertex arrays, etc.) into OpenGL buffer objects. However, OpenGL directly understands only the textures they represent (images). All other types of buffers require you to tell OpenGL how to deal with them. This is done by calling gl {Vertex, Color, TexCoord, Normal, Attrib} Pointer to set data access parameters and glDraw {Arrays, Elements} to invoke OpenGL, receiving a stream of vertices for submission to the rasterizer.
source share