Monday, June 6, 2016

Renderer.Structure

Cited Tutorial

https://www.opengl.org/wiki/Tutorial:_OpenGL_3.1_The_First_Triangle_(C%2B%2B/Win)


Renderer should gather together all OpenGL Calls


Rendering Context Creation/\ bool createGLContext(**); 
Scene Preparation           /\ void prepareScene(**);
  •         after rendering context created, we are to prepare scene.
  •         we'll do whatever we have to do just once
  •         before the scene is drawn for the first time
Shaders
Settings Data               /\ void setData(**);
Setting Viewport            /\ reshape(**);
Drawing                     /\ drawScene(**);
Cleaning up                 /\ destroyScene(**);






__________________________________________________________________
notions.OpenGL
--------------
Vertex buffer objects (VBO) are familiar item since OpenGL version 1.5, but the vertex array objects require more explanation. Vertex array objects(VAO) encapsulate vertex array state on the client side. These objects allow applications to rapidly switch between large sets of array state.
VAO saves all states for all vertex attributes. The maximum number supported by your video card can be obtained by calling glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &MaxVertexAttribs).
A VAO stores the states of the vertex attribute arrays (if each of them is enabled, their sizes, stride, type, if they are normalized or not, if they contain unconverted integers, vertex attribute array pointers, element array buffer bindings and attribute array buffer bindings). In order to test how it works, we will create two separate (simple) objects with different VAOs.
.
.
.

No comments:

Post a Comment