Difference between revisions of "Talk:Code Style"

(Added a long function call style proposal.)
(Swallowed a G.)
 
Line 12: Line 12:
  
 
   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (GLsizei) width, (GLsizei) height,
 
   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (GLsizei) width, (GLsizei) height,
   ················GL_RGBA, L_UNSIGNED_BYTE, data->getData());
+
   ················GL_RGBA, GL_UNSIGNED_BYTE, data->getData());
 
    
 
    
 
   glTexSubImage2D(GL_TEXTURE_2D,
 
   glTexSubImage2D(GL_TEXTURE_2D,

Latest revision as of 13:26, 7 January 2013

Code style proposals

Long function call alignment and indentation

Break up a function call into two or more lines if it reaches an uncomfortable length. Use one tab of indentation for the additional lines.

 YES:
 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (GLsizei) width, (GLsizei) height,
 ⇥GL_RGBA, GL_UNSIGNED_BYTE, data->getData());
 NO:
 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (GLsizei) width, (GLsizei) height,
 ················GL_RGBA, GL_UNSIGNED_BYTE, data->getData());
 
 glTexSubImage2D(GL_TEXTURE_2D,
 ················0,
 ················0,
 ················0,
 ················(GLsizei) width,
 ················(GLsizei) height,
 ················GL_RGBA,
 ················GL_UNSIGNED_BYTE,
 ················data->getData());

--Boolsheet 13:14, 7 January 2013 (GMT)