From 0ac52b1c8bbab27c79e41043b22250b7a5395dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 4 Jul 2012 00:40:01 +0200 Subject: [PATCH] Doc++ Added some TODOs, hiding internal Mesh implementation from the documentation. --- src/Contexts/Sdl2Context.h | 2 +- src/Framebuffer.h | 30 ++++++++++++++++++++++++++---- src/IndexedMesh.cpp | 2 ++ src/IndexedMesh.h | 3 +++ src/Mesh.cpp | 2 ++ src/Mesh.h | 3 +++ src/Renderbuffer.h | 2 ++ 7 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/Contexts/Sdl2Context.h b/src/Contexts/Sdl2Context.h index b98b559e0..b441f44da 100644 --- a/src/Contexts/Sdl2Context.h +++ b/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& size = Math::Vector2(800, 600)); /** - * @brief Destructors + * @brief Destructor * * Deletes context and destroys the window. */ diff --git a/src/Framebuffer.h b/src/Framebuffer.h index 2344742bb..af4eb14c3 100644 --- a/src/Framebuffer.h +++ b/src/Framebuffer.h @@ -38,7 +38,11 @@ class MAGNUM_EXPORT Framebuffer { Framebuffer& operator=(Framebuffer&& other) = delete; public: - /** @brief %Framebuffer target */ + /** + * @brief %Framebuffer target + * + * @see bind(), bindDefault() + */ enum class Target: GLenum { /** * For reading only. @@ -56,7 +60,11 @@ class MAGNUM_EXPORT Framebuffer { 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 { None = GL_NONE, /**< Don't use the output. */ 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. */ }; - /** @brief Read attachment for default framebuffer */ + /** + * @brief Read attachment for default framebuffer + * + * @see mapDefaultForRead() + */ enum class DefaultReadAttachment: GLenum { FrontLeft = GL_FRONT_LEFT, /**< Read from front left 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. */ }; - /** @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 { Depth = GL_DEPTH_ATTACHMENT, /**< Depth 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 * using blit(). + * + * @todo Use class Set */ enum class BlitMask: GLbitfield { Color = GL_COLOR_BUFFER_BIT, /**< Color only. */ diff --git a/src/IndexedMesh.cpp b/src/IndexedMesh.cpp index 28823fe5d..45679d166 100644 --- a/src/IndexedMesh.cpp +++ b/src/IndexedMesh.cpp @@ -29,6 +29,7 @@ void IndexedMesh::draw() { unbind(); } +#ifndef DOXYGEN_GENERATING_OUTPUT void IndexedMesh::finalize() { if(isFinalized()) return; @@ -40,5 +41,6 @@ void IndexedMesh::finalize() { /* Bind index buffer */ _indexBuffer.bind(); } +#endif } diff --git a/src/IndexedMesh.h b/src/IndexedMesh.h index dad9582cf..948b36d51 100644 --- a/src/IndexedMesh.h +++ b/src/IndexedMesh.h @@ -52,6 +52,7 @@ class MAGNUM_EXPORT IndexedMesh: public Mesh { inline GLsizei indexCount() const { return _indexCount; } /** @brief Set index count */ + /** @todo definalize after that? */ inline void setIndexCount(GLsizei count) { _indexCount = count; } /** @brief Index type */ @@ -77,7 +78,9 @@ class MAGNUM_EXPORT IndexedMesh: public Mesh { void draw(); protected: + #ifndef DOXYGEN_GENERATING_OUTPUT MAGNUM_LOCAL void finalize(); + #endif private: Buffer _indexBuffer; diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 2a71d3238..d703b3bb7 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -46,6 +46,7 @@ void Mesh::draw() { unbind(); } +#ifndef DOXYGEN_GENERATING_OUTPUT void Mesh::finalize() { /* Already finalized */ if(finalized) return; @@ -104,6 +105,7 @@ void Mesh::finalize() { /* Mesh is now finalized, attribute binding is not allowed */ finalized = true; } +#endif void Mesh::bindAttribute(Buffer* buffer, GLuint attribute, GLint size, Type type) { /* The mesh is finalized or attribute is already bound, nothing to do */ diff --git a/src/Mesh.h b/src/Mesh.h index 67f0614d0..458676ed9 100644 --- a/src/Mesh.h +++ b/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 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 Redo in a way that allows glMultiDrawArrays, glDrawArraysInstanced etc. */ class MAGNUM_EXPORT Mesh { Mesh(const Mesh& other) = delete; @@ -273,6 +274,7 @@ class MAGNUM_EXPORT Mesh { virtual void draw(); protected: + #ifndef DOXYGEN_GENERATING_OUTPUT /** @brief Unbind any vertex array object */ inline static void unbind() { glBindVertexArray(0); } @@ -286,6 +288,7 @@ class MAGNUM_EXPORT Mesh { * this function is called, no new attribute can be bound. */ MAGNUM_LOCAL void finalize(); + #endif private: /** @brief Vertex attribute */ diff --git a/src/Renderbuffer.h b/src/Renderbuffer.h index 45112dbde..670f45af5 100644 --- a/src/Renderbuffer.h +++ b/src/Renderbuffer.h @@ -82,6 +82,8 @@ class Renderbuffer { DepthFloat = GL_DEPTH_COMPONENT32F, Depth24Stencil8 = GL_DEPTH24_STENCIL8, DepthFloatStencil8 = GL_DEPTH32F_STENCIL8 + + /** @todo GL_STENCIL_INDEX1 - GL_STENCIL_INDEX16 (renderbuffer only) */ }; /** @copydoc AbstractTexture::InternalFormat */