Browse Source

Doc++

Added some TODOs, hiding internal Mesh implementation from the
documentation.
pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
0ac52b1c8b
  1. 2
      src/Contexts/Sdl2Context.h
  2. 30
      src/Framebuffer.h
  3. 2
      src/IndexedMesh.cpp
  4. 3
      src/IndexedMesh.h
  5. 2
      src/Mesh.cpp
  6. 3
      src/Mesh.h
  7. 2
      src/Renderbuffer.h

2
src/Contexts/Sdl2Context.h

@ -50,7 +50,7 @@ class Sdl2Context: public AbstractContext {
Sdl2Context(int argc, char** argv, const std::string& title = "Magnum SDL2 context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600)); Sdl2Context(int argc, char** argv, const std::string& title = "Magnum SDL2 context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600));
/** /**
* @brief Destructors * @brief Destructor
* *
* Deletes context and destroys the window. * Deletes context and destroys the window.
*/ */

30
src/Framebuffer.h

@ -38,7 +38,11 @@ class MAGNUM_EXPORT Framebuffer {
Framebuffer& operator=(Framebuffer&& other) = delete; Framebuffer& operator=(Framebuffer&& other) = delete;
public: public:
/** @brief %Framebuffer target */ /**
* @brief %Framebuffer target
*
* @see bind(), bindDefault()
*/
enum class Target: GLenum { enum class Target: GLenum {
/** /**
* For reading only. * For reading only.
@ -56,7 +60,11 @@ class MAGNUM_EXPORT Framebuffer {
ReadDraw = GL_FRAMEBUFFER /**< For both reading and drawing. */ ReadDraw = GL_FRAMEBUFFER /**< For both reading and drawing. */
}; };
/** @brief Draw attachment for default framebuffer */ /**
* @brief Draw attachment for default framebuffer
*
* @see mapDefaultForDraw()
*/
enum class DefaultDrawAttachment: GLenum { enum class DefaultDrawAttachment: GLenum {
None = GL_NONE, /**< Don't use the output. */ None = GL_NONE, /**< Don't use the output. */
BackLeft = GL_BACK_LEFT, /**< Write output to back left framebuffer. */ BackLeft = GL_BACK_LEFT, /**< Write output to back left framebuffer. */
@ -65,7 +73,11 @@ class MAGNUM_EXPORT Framebuffer {
FrontRight = GL_FRONT_RIGHT /**< Write output to front right framebuffer. */ FrontRight = GL_FRONT_RIGHT /**< Write output to front right framebuffer. */
}; };
/** @brief Read attachment for default framebuffer */ /**
* @brief Read attachment for default framebuffer
*
* @see mapDefaultForRead()
*/
enum class DefaultReadAttachment: GLenum { enum class DefaultReadAttachment: GLenum {
FrontLeft = GL_FRONT_LEFT, /**< Read from front left framebuffer. */ FrontLeft = GL_FRONT_LEFT, /**< Read from front left framebuffer. */
FrontRight = GL_FRONT_RIGHT, /**< Read from front right framebuffer. */ FrontRight = GL_FRONT_RIGHT, /**< Read from front right framebuffer. */
@ -78,7 +90,15 @@ class MAGNUM_EXPORT Framebuffer {
FrontAndBack = GL_FRONT_AND_BACK /**< Read from front and back framebuffers. */ FrontAndBack = GL_FRONT_AND_BACK /**< Read from front and back framebuffers. */
}; };
/** @brief Attachment for depth/stencil part of fragment shader output */ /**
* @brief Attachment for depth/stencil part of fragment shader output
*
* @see attachRenderbuffer(Target, DepthStencilAttachment, Renderbuffer*),
* attachTexture1D(Target, DepthStencilAttachment, Texture1D*, GLint),
* attachTexture2D(Target, DepthStencilAttachment, Texture2D*, GLint),
* attachCubeMapTexture(Target, DepthStencilAttachment, CubeMapTexture*, CubeMapTexture::Coordinate, GLint),
* attachTexture3D(Target, DepthStencilAttachment, Texture3D*, GLint)
*/
enum class DepthStencilAttachment: GLenum { enum class DepthStencilAttachment: GLenum {
Depth = GL_DEPTH_ATTACHMENT, /**< Depth output only. */ Depth = GL_DEPTH_ATTACHMENT, /**< Depth output only. */
Stencil = GL_STENCIL_ATTACHMENT, /**< Stencil output only. */ Stencil = GL_STENCIL_ATTACHMENT, /**< Stencil output only. */
@ -90,6 +110,8 @@ class MAGNUM_EXPORT Framebuffer {
* *
* Specifies which data are copied when performing blit operation * Specifies which data are copied when performing blit operation
* using blit(). * using blit().
*
* @todo Use class Set
*/ */
enum class BlitMask: GLbitfield { enum class BlitMask: GLbitfield {
Color = GL_COLOR_BUFFER_BIT, /**< Color only. */ Color = GL_COLOR_BUFFER_BIT, /**< Color only. */

2
src/IndexedMesh.cpp

@ -29,6 +29,7 @@ void IndexedMesh::draw() {
unbind(); unbind();
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
void IndexedMesh::finalize() { void IndexedMesh::finalize() {
if(isFinalized()) return; if(isFinalized()) return;
@ -40,5 +41,6 @@ void IndexedMesh::finalize() {
/* Bind index buffer */ /* Bind index buffer */
_indexBuffer.bind(); _indexBuffer.bind();
} }
#endif
} }

3
src/IndexedMesh.h

@ -52,6 +52,7 @@ class MAGNUM_EXPORT IndexedMesh: public Mesh {
inline GLsizei indexCount() const { return _indexCount; } inline GLsizei indexCount() const { return _indexCount; }
/** @brief Set index count */ /** @brief Set index count */
/** @todo definalize after that? */
inline void setIndexCount(GLsizei count) { _indexCount = count; } inline void setIndexCount(GLsizei count) { _indexCount = count; }
/** @brief Index type */ /** @brief Index type */
@ -77,7 +78,9 @@ class MAGNUM_EXPORT IndexedMesh: public Mesh {
void draw(); void draw();
protected: protected:
#ifndef DOXYGEN_GENERATING_OUTPUT
MAGNUM_LOCAL void finalize(); MAGNUM_LOCAL void finalize();
#endif
private: private:
Buffer _indexBuffer; Buffer _indexBuffer;

2
src/Mesh.cpp

@ -46,6 +46,7 @@ void Mesh::draw() {
unbind(); unbind();
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
void Mesh::finalize() { void Mesh::finalize() {
/* Already finalized */ /* Already finalized */
if(finalized) return; if(finalized) return;
@ -104,6 +105,7 @@ void Mesh::finalize() {
/* Mesh is now finalized, attribute binding is not allowed */ /* Mesh is now finalized, attribute binding is not allowed */
finalized = true; finalized = true;
} }
#endif
void Mesh::bindAttribute(Buffer* buffer, GLuint attribute, GLint size, Type type) { void Mesh::bindAttribute(Buffer* buffer, GLuint attribute, GLint size, Type type) {
/* The mesh is finalized or attribute is already bound, nothing to do */ /* The mesh is finalized or attribute is already bound, nothing to do */

3
src/Mesh.h

@ -44,6 +44,7 @@ class Buffer;
@todo Support for fixed precision type for attributes (OpenGL 4.1, @extension{ARB,ES2_compatibility}) @todo Support for fixed precision type for attributes (OpenGL 4.1, @extension{ARB,ES2_compatibility})
@todo Support for double type for attributes (OpenGL 4.1, @extension{ARB,vertex_attrib_64bit}) @todo Support for double type for attributes (OpenGL 4.1, @extension{ARB,vertex_attrib_64bit})
@todo Support for indirect draw buffer (OpenGL 4.0, @extension{ARB,draw_indirect}) @todo Support for indirect draw buffer (OpenGL 4.0, @extension{ARB,draw_indirect})
@todo Redo in a way that allows glMultiDrawArrays, glDrawArraysInstanced etc.
*/ */
class MAGNUM_EXPORT Mesh { class MAGNUM_EXPORT Mesh {
Mesh(const Mesh& other) = delete; Mesh(const Mesh& other) = delete;
@ -273,6 +274,7 @@ class MAGNUM_EXPORT Mesh {
virtual void draw(); virtual void draw();
protected: protected:
#ifndef DOXYGEN_GENERATING_OUTPUT
/** @brief Unbind any vertex array object */ /** @brief Unbind any vertex array object */
inline static void unbind() { glBindVertexArray(0); } inline static void unbind() { glBindVertexArray(0); }
@ -286,6 +288,7 @@ class MAGNUM_EXPORT Mesh {
* this function is called, no new attribute can be bound. * this function is called, no new attribute can be bound.
*/ */
MAGNUM_LOCAL void finalize(); MAGNUM_LOCAL void finalize();
#endif
private: private:
/** @brief Vertex attribute */ /** @brief Vertex attribute */

2
src/Renderbuffer.h

@ -82,6 +82,8 @@ class Renderbuffer {
DepthFloat = GL_DEPTH_COMPONENT32F, DepthFloat = GL_DEPTH_COMPONENT32F,
Depth24Stencil8 = GL_DEPTH24_STENCIL8, Depth24Stencil8 = GL_DEPTH24_STENCIL8,
DepthFloatStencil8 = GL_DEPTH32F_STENCIL8 DepthFloatStencil8 = GL_DEPTH32F_STENCIL8
/** @todo GL_STENCIL_INDEX1 - GL_STENCIL_INDEX16 (renderbuffer only) */
}; };
/** @copydoc AbstractTexture::InternalFormat */ /** @copydoc AbstractTexture::InternalFormat */

Loading…
Cancel
Save