SHARE
TWEET

Untitled

a guest Sep 5th, 2012 30 Never
  1. - (void) drawOutlines {
  2.     if(selected){
  3.         [EAGLContext setCurrentContext:context];
  4.         glBindVertexArrayOES(_vertexArray);
  5.        
  6.         effect->modelViewMatrix = mvm;
  7.         GLKMatrix4Scale(effect->modelViewMatrix, 1.15, 1.15, 1.15);
  8.        
  9.         glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer);
  10.         glEnableVertexAttribArray(effect->toon_vertCoord);        
  11.         glVertexAttribPointer(effect->toon_vertCoord, 3, GL_FLOAT, GL_FALSE, 0, 0);
  12.        
  13.         [effect drawOutline];
  14.         glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0);
  15.     }
  16. }
  17.  
  18. - (void) draw {
  19.    
  20.     [EAGLContext setCurrentContext:context];
  21.     glBindVertexArrayOES(_vertexArray);
  22.    
  23.     effect->modelViewMatrix = mvm;
  24.     effect->numberColour = GLKVector4Make(numbers[colorSelected].r, numbers[colorSelected].g, numbers[colorSelected].b, 1);
  25.     effect->faceColour = GLKVector4Make(faceColors[colorSelected].r, faceColors[colorSelected].g, faceColors[colorSelected].b, 1);
  26.  
  27.     glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer);
  28.     glEnableVertexAttribArray(effect->vertCoord);        
  29.     glVertexAttribPointer(effect->vertCoord, 3, GL_FLOAT, GL_FALSE, 0, 0);
  30.    
  31.     [effect prepareToDraw];
  32.     glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0);
  33.    
  34. }
RAW Paste Data
Top