nucLeaRsc2

Untitled

Jan 19th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. // WIKI: These functions say that the attribute index index​ will get its attribute data from whatever buffer object is currently bound to GL_ARRAY_BUFFER​.
  2. // Deci, vor fi trimise catre SHADER datele din bufferul bindat in acest moment de tip GL_ARRAY_BUFFER (deci pot sa pun aceste apeluri si dupa bindarea IBO-ului, ca el e de alt tip (GL_ELEMENT_ARRAY_BUFFER)
  3. unsigned int in_position_pipe = glGetAttribLocation(gl_program_shader, "in_position");
  4. glEnableVertexAttribArray(in_position_pipe);
  5. glVertexAttribPointer(in_position_pipe, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)0);
  6.  
  7. unsigned int in_color_pipe = glGetAttribLocation(gl_program_shader, "in_color");
  8. glEnableVertexAttribArray(in_color_pipe);
  9. glVertexAttribPointer(in_color_pipe, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*)(3 * sizeof(float)));
Advertisement
Add Comment
Please, Sign In to add comment