Skip to content

Commit

Permalink
Add documentation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mogemimi committed Aug 20, 2019
1 parent f6f5f43 commit 3ba1ddf
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
1 change: 1 addition & 0 deletions include/Pomdog/Graphics/DepthFormat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Pomdog {

/// DepthFormat specifies the format used by pixels in the depth-stencil buffer.
enum class DepthFormat : std::uint8_t {
/// 16-bit buffer format. 16 bits for depth.
Depth16,
Expand Down
7 changes: 7 additions & 0 deletions include/Pomdog/Graphics/RenderTarget2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,25 @@ class POMDOG_EXPORT RenderTarget2D final : public Texture {
RenderTarget2D& operator=(const RenderTarget2D&) = delete;
RenderTarget2D& operator=(RenderTarget2D&&) = default;

/// Gets the width of the texture data, in pixels.
std::int32_t GetWidth() const;

/// Gets the height of the texture data, in pixels.
std::int32_t GetHeight() const;

/// Gets the mipmap level.
std::int32_t GetLevelCount() const;

/// Gets the format of the pixel data in the render target.
SurfaceFormat GetFormat() const;

/// Gets the format of the pixel data in the depth-stencil buffer.
DepthFormat GetDepthStencilFormat() const;

/// Gets the size of the texture resource.
Rectangle GetBounds() const;

/// Gets the pointer of the native render target.
Detail::NativeRenderTarget2D* GetNativeRenderTarget2D();

private:
Expand Down
7 changes: 4 additions & 3 deletions include/Pomdog/Graphics/ShaderLanguage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

namespace Pomdog {

/// ShaderLanguage specifies the shader language supported by the graphics device.
enum class ShaderLanguage : std::uint8_t {
///@brief The OpenGL shading language (GLSL)
/// The OpenGL shading language (GLSL)
GLSL,

///@brief The DirectX high-level shading language (HLSL)
/// The DirectX high-level shading language (HLSL)
HLSL,

///@brief The Metal shading language
/// The Metal shading language
Metal,
};

Expand Down
25 changes: 17 additions & 8 deletions include/Pomdog/Graphics/SurfaceFormat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,50 @@

namespace Pomdog {

/// SurfaceFormat specifies the format used by pixels in the texture.
enum class SurfaceFormat : std::uint8_t {
///@brief 8-bit alpha only.
/// A single-component, 8-bit unsigned-normalized integer format for alpha only.
A8_UNorm,

///@brief 8-bit alpha only.
/// A single-component, 8-bit unsigned-normalized integer format that has 8-bits for the red channel.
R8_UNorm,

///@remarks UNorm means "unsigned normalized" integer.
/// A two-component, 16-bit unsigned-normalized integer format that has 8-bits per channel.
R8G8_UNorm,

///@remarks UNorm means "unsigned normalized" integer.
/// A four-component, 32-bit unsigned-normalized integer format that has 8-bits per channel.
R8G8B8A8_UNorm,

/// A four-component, 32-bit unsigned-normalized integer format that has
/// 10-bits for each RGB color and a 2-bits for alpha.
R10G10B10A2_UNorm,

/// A three-component, 32-bit floating-point format that has
/// a 11-bits for red and green channels, and a 10-bits for blue channel.
R11G11B10_Float,

///@remarks UNorm means "unsigned normalized" integer.
/// A four-component, 32-bit unsigned-normalized integer format that has 8-bits per channel.
B8G8R8A8_UNorm,

/// A single-component, 32-bit floating-point format that has 32-bits for the red channel.
R32_Float,

/// A four-component, 128-bit floating-point format that has 32-bits per channel.
R32G32B32A32_Float,

/// A two-component, 32-bit floating-point format that has 16-bits per channel.
R16G16_Float,

/// A four-component, 64-bit floating-point format that has 16-bits per channel.
R16G16B16A16_Float,

///@remarks UNorm means "unsigned normalized" integer.
/// A four-component, block-compression format for unsigned-normalized integer texel data.
BlockComp1_UNorm,

///@remarks UNorm means "unsigned normalized" integer.
/// A four-component, block-compression format for unsigned-normalized integer texel data.
BlockComp2_UNorm,

///@remarks UNorm means "unsigned normalized" integer.
/// A four-component, block-compression format for unsigned-normalized integer texel data.
BlockComp3_UNorm,
};

Expand Down
6 changes: 6 additions & 0 deletions include/Pomdog/Graphics/Texture2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,22 @@ class POMDOG_EXPORT Texture2D final : public Texture {
Texture2D& operator=(const Texture2D&) = delete;
Texture2D& operator=(Texture2D&&) = default;

/// Gets the width of the texture data, in pixels.
std::int32_t GetWidth() const;

/// Gets the height of the texture data, in pixels.
std::int32_t GetHeight() const;

/// Gets the mipmap level.
std::int32_t GetLevelCount() const;

/// Gets the format of the pixel data in the texture.
SurfaceFormat GetFormat() const;

/// Sets texture data.
void SetData(const void* pixelData);

/// Gets the pointer of the native texture resource.
Detail::NativeTexture2D* GetNativeTexture2D();

private:
Expand Down

0 comments on commit 3ba1ddf

Please sign in to comment.