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

7
src/Buffer.h

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

2
src/Context.cpp

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

2
src/Implementation/TextureState.h

@ -17,8 +17,6 @@
#include "Magnum.h" #include "Magnum.h"
#include "Buffer.h"
namespace Magnum { namespace Implementation { namespace Magnum { namespace Implementation {
struct TextureState { 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 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 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() type in the mesh accordingly, so you don't have to call
and Mesh::setIndexType() on your own. IndexedMesh::setIndexCount() and IndexedMesh::setIndexType() on your own.
@see MeshTools::interleave() @see MeshTools::interleave()
*/ */

Loading…
Cancel
Save