Difference between revisions of "Talk:Code Style"

(Questions were resolved.)
(Swallowed a G.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
== 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());
 +
 +
--[[User:Boolsheet|Boolsheet]] 13:14, 7 January 2013 (GMT)

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)