Browse Source

Code cleanup, doc++

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
4aa01e073e
  1. 4
      src/AbstractShaderProgram.h
  2. 7
      src/Buffer.h
  3. 2
      src/Context.cpp
  4. 2
      src/Implementation/TextureState.h
  5. 4
      src/MeshTools/CompressIndices.h

4
src/AbstractShaderProgram.h

@ -95,6 +95,7 @@ MyShader* setProjection(const Matrix4& matrix) {
@endcode
@subsection AbstractShaderProgram-attribute-location Binding attribute location
The preferred workflow is to specify attribute location for vertex shader
input attributes and fragment shader output attributes explicitly in the
shader code, e.g.:
@ -142,6 +143,7 @@ bindFragmentDataLocationIndexed(1, 1, "ambient");
@endcode
@subsection AbstractShaderProgram-uniform-location Uniform locations
The preferred workflow is to specify uniform locations directly in the shader
code, e.g.:
@code
@ -162,6 +164,7 @@ GLint projectionUniform = uniformLocation("projection");
@endcode
@subsection AbstractShaderProgram-texture-layer Binding texture layer uniforms
The preferred workflow is to specify texture layers directly in the shader
code, e.g.:
@code
@ -202,6 +205,7 @@ mesh.draw();
@endcode
@section AbstractShaderProgram-performance-optimization Performance optimizations
The engine tracks currently used shader program to avoid unnecessary calls to
@fn_gl{UseProgram}.

7
src/Buffer.h

@ -38,6 +38,7 @@ Encapsulates one OpenGL buffer object and provides functions for convenient
data updates.
@section Buffer-data Data updating
Default way to set or update buffer data with setData() or setSubData() is to
explicitly specify data size and pass the pointer to it:
@code
@ -61,6 +62,7 @@ buffer.setData(data, Buffer::Usage::StaticDraw);
@endcode
@section Buffer-performance-optimization Performance optimizations
The engine tracks currently bound buffers to avoid unnecessary calls to
@fn_gl{BindBuffer}. If the buffer is already bound to some target,
functions copy(), setData() and setSubData() use that target in
@ -307,6 +309,9 @@ class MAGNUM_EXPORT Buffer {
*
* Default target hint is `Target::Array`.
* @see setData(), setSubData()
* @todo Target::ElementArray cannot be used when no VAO is bound -
* http://www.opengl.org/wiki/Vertex_Specification#Index_buffers
* ... damned GL state
*/
inline void setTargetHint(Target hint) { _targetHint = hint; }
@ -314,6 +319,8 @@ class MAGNUM_EXPORT Buffer {
* @brief Bind buffer
* @param target %Target
*
* @todo Allow binding to Target::ElementArray only if VAO is bound
* to avoid potential issues?
* @see @fn_gl{BindBuffer}
*/
inline void bind(Target target) { bind(target, _id); }

2
src/Context.cpp

@ -22,11 +22,11 @@
#include "AbstractShaderProgram.h"
#include "AbstractTexture.h"
#include "Buffer.h"
#include "BufferedTexture.h"
#include "Extensions.h"
#include "IndexedMesh.h"
#include "Mesh.h"
#include "Implementation/State.h"
#include "BufferedTexture.h"
using namespace std;

2
src/Implementation/TextureState.h

@ -17,8 +17,6 @@
#include "Magnum.h"
#include "Buffer.h"
namespace Magnum { namespace Implementation {
struct TextureState {

4
src/MeshTools/CompressIndices.h

@ -90,8 +90,8 @@ inline std::tuple<std::size_t, Type, char*> compressIndices(const std::vector<st
The same as compressIndices(const std::vector<std::uint32_t>&), but this
function writes the output to mesh's index buffer and updates index count and
type in the mesh accordingly, so you don't have to call Mesh::setIndexCount()
and Mesh::setIndexType() on your own.
type in the mesh accordingly, so you don't have to call
IndexedMesh::setIndexCount() and IndexedMesh::setIndexType() on your own.
@see MeshTools::interleave()
*/

Loading…
Cancel
Save