Browse Source

IDL C#: Added enum comments.

Бранимир Караџић 6 years ago
parent
commit
541a379722
5 changed files with 405 additions and 22 deletions
  1. 372 0
      bindings/cs/bgfx.cs
  2. 7 7
      include/bgfx/bgfx.h
  3. 7 7
      include/bgfx/c99/bgfx.h
  4. 7 7
      scripts/bgfx.idl
  5. 12 1
      scripts/bindings-cs.lua

+ 372 - 0
bindings/cs/bgfx.cs

@@ -392,15 +392,54 @@ public static partial class bgfx
 	
 	
 	public enum RendererType
 	public enum RendererType
 	{
 	{
+		/// <summary>
+		/// No rendering.
+		/// </summary>
 		Noop,
 		Noop,
+	
+		/// <summary>
+		/// Direct3D 9.0
+		/// </summary>
 		Direct3D9,
 		Direct3D9,
+	
+		/// <summary>
+		/// Direct3D 11.0
+		/// </summary>
 		Direct3D11,
 		Direct3D11,
+	
+		/// <summary>
+		/// Direct3D 12.0
+		/// </summary>
 		Direct3D12,
 		Direct3D12,
+	
+		/// <summary>
+		/// GNM
+		/// </summary>
 		Gnm,
 		Gnm,
+	
+		/// <summary>
+		/// Metal
+		/// </summary>
 		Metal,
 		Metal,
+	
+		/// <summary>
+		/// NVN
+		/// </summary>
 		Nvn,
 		Nvn,
+	
+		/// <summary>
+		/// OpenGL ES 2.0+
+		/// </summary>
 		OpenGLES,
 		OpenGLES,
+	
+		/// <summary>
+		/// OpenGL 2.1+
+		/// </summary>
 		OpenGL,
 		OpenGL,
+	
+		/// <summary>
+		/// Vulkan
+		/// </summary>
 		Vulkan,
 		Vulkan,
 	
 	
 		Count
 		Count
@@ -408,8 +447,19 @@ public static partial class bgfx
 	
 	
 	public enum Access
 	public enum Access
 	{
 	{
+		/// <summary>
+		/// Read.
+		/// </summary>
 		Read,
 		Read,
+	
+		/// <summary>
+		/// Write.
+		/// </summary>
 		Write,
 		Write,
+	
+		/// <summary>
+		/// Read and write.
+		/// </summary>
 		ReadWrite,
 		ReadWrite,
 	
 	
 		Count
 		Count
@@ -417,23 +467,94 @@ public static partial class bgfx
 	
 	
 	public enum Attrib
 	public enum Attrib
 	{
 	{
+		/// <summary>
+		/// a_position
+		/// </summary>
 		Position,
 		Position,
+	
+		/// <summary>
+		/// a_normal
+		/// </summary>
 		Normal,
 		Normal,
+	
+		/// <summary>
+		/// a_tangent
+		/// </summary>
 		Tangent,
 		Tangent,
+	
+		/// <summary>
+		/// a_bitangent
+		/// </summary>
 		Bitangent,
 		Bitangent,
+	
+		/// <summary>
+		/// a_color0
+		/// </summary>
 		Color0,
 		Color0,
+	
+		/// <summary>
+		/// a_color1
+		/// </summary>
 		Color1,
 		Color1,
+	
+		/// <summary>
+		/// a_color2
+		/// </summary>
 		Color2,
 		Color2,
+	
+		/// <summary>
+		/// a_color3
+		/// </summary>
 		Color3,
 		Color3,
+	
+		/// <summary>
+		/// a_indices
+		/// </summary>
 		Indices,
 		Indices,
+	
+		/// <summary>
+		/// a_weight
+		/// </summary>
 		Weight,
 		Weight,
+	
+		/// <summary>
+		/// a_texcoord0
+		/// </summary>
 		TexCoord0,
 		TexCoord0,
+	
+		/// <summary>
+		/// a_texcoord1
+		/// </summary>
 		TexCoord1,
 		TexCoord1,
+	
+		/// <summary>
+		/// a_texcoord2
+		/// </summary>
 		TexCoord2,
 		TexCoord2,
+	
+		/// <summary>
+		/// a_texcoord3
+		/// </summary>
 		TexCoord3,
 		TexCoord3,
+	
+		/// <summary>
+		/// a_texcoord4
+		/// </summary>
 		TexCoord4,
 		TexCoord4,
+	
+		/// <summary>
+		/// a_texcoord5
+		/// </summary>
 		TexCoord5,
 		TexCoord5,
+	
+		/// <summary>
+		/// a_texcoord6
+		/// </summary>
 		TexCoord6,
 		TexCoord6,
+	
+		/// <summary>
+		/// a_texcoord7
+		/// </summary>
 		TexCoord7,
 		TexCoord7,
 	
 	
 		Count
 		Count
@@ -441,10 +562,29 @@ public static partial class bgfx
 	
 	
 	public enum AttribType
 	public enum AttribType
 	{
 	{
+		/// <summary>
+		/// Uint8
+		/// </summary>
 		Uint8,
 		Uint8,
+	
+		/// <summary>
+		/// Uint10, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_UINT10`.
+		/// </summary>
 		Uint10,
 		Uint10,
+	
+		/// <summary>
+		/// Int16
+		/// </summary>
 		Int16,
 		Int16,
+	
+		/// <summary>
+		/// Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
+		/// </summary>
 		Half,
 		Half,
+	
+		/// <summary>
+		/// Float
+		/// </summary>
 		Float,
 		Float,
 	
 	
 		Count
 		Count
@@ -452,32 +592,139 @@ public static partial class bgfx
 	
 	
 	public enum TextureFormat
 	public enum TextureFormat
 	{
 	{
+		/// <summary>
+		/// DXT1 R5G6B5A1
+		/// </summary>
 		BC1,
 		BC1,
+	
+		/// <summary>
+		/// DXT3 R5G6B5A4
+		/// </summary>
 		BC2,
 		BC2,
+	
+		/// <summary>
+		/// DXT5 R5G6B5A8
+		/// </summary>
 		BC3,
 		BC3,
+	
+		/// <summary>
+		/// LATC1/ATI1 R8
+		/// </summary>
 		BC4,
 		BC4,
+	
+		/// <summary>
+		/// LATC2/ATI2 RG8
+		/// </summary>
 		BC5,
 		BC5,
+	
+		/// <summary>
+		/// BC6H RGB16F
+		/// </summary>
 		BC6H,
 		BC6H,
+	
+		/// <summary>
+		/// BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
+		/// </summary>
 		BC7,
 		BC7,
+	
+		/// <summary>
+		/// ETC1 RGB8
+		/// </summary>
 		ETC1,
 		ETC1,
+	
+		/// <summary>
+		/// ETC2 RGB8
+		/// </summary>
 		ETC2,
 		ETC2,
+	
+		/// <summary>
+		/// ETC2 RGBA8
+		/// </summary>
 		ETC2A,
 		ETC2A,
+	
+		/// <summary>
+		/// ETC2 RGB8A1
+		/// </summary>
 		ETC2A1,
 		ETC2A1,
+	
+		/// <summary>
+		/// PVRTC1 RGB 2BPP
+		/// </summary>
 		PTC12,
 		PTC12,
+	
+		/// <summary>
+		/// PVRTC1 RGB 4BPP
+		/// </summary>
 		PTC14,
 		PTC14,
+	
+		/// <summary>
+		/// PVRTC1 RGBA 2BPP
+		/// </summary>
 		PTC12A,
 		PTC12A,
+	
+		/// <summary>
+		/// PVRTC1 RGBA 4BPP
+		/// </summary>
 		PTC14A,
 		PTC14A,
+	
+		/// <summary>
+		/// PVRTC2 RGBA 2BPP
+		/// </summary>
 		PTC22,
 		PTC22,
+	
+		/// <summary>
+		/// PVRTC2 RGBA 4BPP
+		/// </summary>
 		PTC24,
 		PTC24,
+	
+		/// <summary>
+		/// ATC RGB 4BPP
+		/// </summary>
 		ATC,
 		ATC,
+	
+		/// <summary>
+		/// ATCE RGBA 8 BPP explicit alpha
+		/// </summary>
 		ATCE,
 		ATCE,
+	
+		/// <summary>
+		/// ATCI RGBA 8 BPP interpolated alpha
+		/// </summary>
 		ATCI,
 		ATCI,
+	
+		/// <summary>
+		/// ASTC 4x4 8.0 BPP
+		/// </summary>
 		ASTC4x4,
 		ASTC4x4,
+	
+		/// <summary>
+		/// ASTC 5x5 5.12 BPP
+		/// </summary>
 		ASTC5x5,
 		ASTC5x5,
+	
+		/// <summary>
+		/// ASTC 6x6 3.56 BPP
+		/// </summary>
 		ASTC6x6,
 		ASTC6x6,
+	
+		/// <summary>
+		/// ASTC 8x5 3.20 BPP
+		/// </summary>
 		ASTC8x5,
 		ASTC8x5,
+	
+		/// <summary>
+		/// ASTC 8x6 2.67 BPP
+		/// </summary>
 		ASTC8x6,
 		ASTC8x6,
+	
+		/// <summary>
+		/// ASTC 10x5 2.56 BPP
+		/// </summary>
 		ASTC10x5,
 		ASTC10x5,
+	
+		/// <summary>
+		/// Compressed formats above.
+		/// </summary>
 		Unknown,
 		Unknown,
 		R1,
 		R1,
 		A8,
 		A8,
@@ -528,6 +775,10 @@ public static partial class bgfx
 		RGB5A1,
 		RGB5A1,
 		RGB10A2,
 		RGB10A2,
 		RG11B10F,
 		RG11B10F,
+	
+		/// <summary>
+		/// Depth formats below.
+		/// </summary>
 		UnknownDepth,
 		UnknownDepth,
 		D16,
 		D16,
 		D24,
 		D24,
@@ -543,10 +794,29 @@ public static partial class bgfx
 	
 	
 	public enum UniformType
 	public enum UniformType
 	{
 	{
+		/// <summary>
+		/// Sampler.
+		/// </summary>
 		Sampler,
 		Sampler,
+	
+		/// <summary>
+		/// Reserved, do not use.
+		/// </summary>
 		End,
 		End,
+	
+		/// <summary>
+		/// 4 floats vector.
+		/// </summary>
 		Vec4,
 		Vec4,
+	
+		/// <summary>
+		/// 3x3 matrix.
+		/// </summary>
 		Mat3,
 		Mat3,
+	
+		/// <summary>
+		/// 4x4 matrix.
+		/// </summary>
 		Mat4,
 		Mat4,
 	
 	
 		Count
 		Count
@@ -554,11 +824,34 @@ public static partial class bgfx
 	
 	
 	public enum BackbufferRatio
 	public enum BackbufferRatio
 	{
 	{
+		/// <summary>
+		/// Equal to backbuffer.
+		/// </summary>
 		Equal,
 		Equal,
+	
+		/// <summary>
+		/// One half size of backbuffer.
+		/// </summary>
 		Half,
 		Half,
+	
+		/// <summary>
+		/// One quarter size of backbuffer.
+		/// </summary>
 		Quarter,
 		Quarter,
+	
+		/// <summary>
+		/// One eighth size of backbuffer.
+		/// </summary>
 		Eighth,
 		Eighth,
+	
+		/// <summary>
+		/// One sixteenth size of backbuffer.
+		/// </summary>
 		Sixteenth,
 		Sixteenth,
+	
+		/// <summary>
+		/// Double size of backbuffer.
+		/// </summary>
 		Double,
 		Double,
 	
 	
 		Count
 		Count
@@ -566,8 +859,19 @@ public static partial class bgfx
 	
 	
 	public enum OcclusionQueryResult
 	public enum OcclusionQueryResult
 	{
 	{
+		/// <summary>
+		/// Query failed test.
+		/// </summary>
 		Invisible,
 		Invisible,
+	
+		/// <summary>
+		/// Query passed test.
+		/// </summary>
 		Visible,
 		Visible,
+	
+		/// <summary>
+		/// Query result is not available yet.
+		/// </summary>
 		NoResult,
 		NoResult,
 	
 	
 		Count
 		Count
@@ -575,10 +879,29 @@ public static partial class bgfx
 	
 	
 	public enum Topology
 	public enum Topology
 	{
 	{
+		/// <summary>
+		/// Triangle list.
+		/// </summary>
 		TriList,
 		TriList,
+	
+		/// <summary>
+		/// Triangle strip.
+		/// </summary>
 		TriStrip,
 		TriStrip,
+	
+		/// <summary>
+		/// Line list.
+		/// </summary>
 		LineList,
 		LineList,
+	
+		/// <summary>
+		/// Line strip.
+		/// </summary>
 		LineStrip,
 		LineStrip,
+	
+		/// <summary>
+		/// Point list.
+		/// </summary>
 		PointList,
 		PointList,
 	
 	
 		Count
 		Count
@@ -586,10 +909,29 @@ public static partial class bgfx
 	
 	
 	public enum TopologyConvert
 	public enum TopologyConvert
 	{
 	{
+		/// <summary>
+		/// Flip winding order of triangle list.
+		/// </summary>
 		TriListFlipWinding,
 		TriListFlipWinding,
+	
+		/// <summary>
+		/// Flip winding order of trinagle strip.
+		/// </summary>
 		TriStripFlipWinding,
 		TriStripFlipWinding,
+	
+		/// <summary>
+		/// Convert triangle list to line list.
+		/// </summary>
 		TriListToLineList,
 		TriListToLineList,
+	
+		/// <summary>
+		/// Convert triangle strip to triangle list.
+		/// </summary>
 		TriStripToTriList,
 		TriStripToTriList,
+	
+		/// <summary>
+		/// Convert line strip to line list.
+		/// </summary>
 		LineStripToLineList,
 		LineStripToLineList,
 	
 	
 		Count
 		Count
@@ -615,9 +957,24 @@ public static partial class bgfx
 	
 	
 	public enum ViewMode
 	public enum ViewMode
 	{
 	{
+		/// <summary>
+		/// Default sort order.
+		/// </summary>
 		Default,
 		Default,
+	
+		/// <summary>
+		/// Sort in the same order in which submit calls were called.
+		/// </summary>
 		Sequential,
 		Sequential,
+	
+		/// <summary>
+		/// Sort draw call depth in ascending order.
+		/// </summary>
 		DepthAscending,
 		DepthAscending,
+	
+		/// <summary>
+		/// Sort draw call depth in descending order.
+		/// </summary>
 		DepthDescending,
 		DepthDescending,
 	
 	
 		Count
 		Count
@@ -625,9 +982,24 @@ public static partial class bgfx
 	
 	
 	public enum RenderFrame
 	public enum RenderFrame
 	{
 	{
+		/// <summary>
+		/// Renderer context is not created yet.
+		/// </summary>
 		NoContext,
 		NoContext,
+	
+		/// <summary>
+		/// Renderer context is created and rendering.
+		/// </summary>
 		Render,
 		Render,
+	
+		/// <summary>
+		/// Renderer context wait for main thread signal timed out without rendering.
+		/// </summary>
 		Timeout,
 		Timeout,
+	
+		/// <summary>
+		/// Renderer context is getting destroyed.
+		/// </summary>
 		Exiting,
 		Exiting,
 	
 	
 		Count
 		Count

+ 7 - 7
include/bgfx/bgfx.h

@@ -157,13 +157,13 @@ namespace bgfx
 		/// Texture formats:
 		/// Texture formats:
 		enum Enum
 		enum Enum
 		{
 		{
-			BC1,          //!< DXT1
-			BC2,          //!< DXT3
-			BC3,          //!< DXT5
-			BC4,          //!< LATC1/ATI1
-			BC5,          //!< LATC2/ATI2
-			BC6H,         //!< BC6H
-			BC7,          //!< BC7
+			BC1,          //!< DXT1 R5G6B5A1
+			BC2,          //!< DXT3 R5G6B5A4
+			BC3,          //!< DXT5 R5G6B5A8
+			BC4,          //!< LATC1/ATI1 R8
+			BC5,          //!< LATC2/ATI2 RG8
+			BC6H,         //!< BC6H RGB16F
+			BC7,          //!< BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
 			ETC1,         //!< ETC1 RGB8
 			ETC1,         //!< ETC1 RGB8
 			ETC2,         //!< ETC2 RGB8
 			ETC2,         //!< ETC2 RGB8
 			ETC2A,        //!< ETC2 RGBA8
 			ETC2A,        //!< ETC2 RGBA8

+ 7 - 7
include/bgfx/c99/bgfx.h

@@ -170,13 +170,13 @@ typedef enum bgfx_attrib_type
  */
  */
 typedef enum bgfx_texture_format
 typedef enum bgfx_texture_format
 {
 {
-    BGFX_TEXTURE_FORMAT_BC1,                  /** ( 0) DXT1                           */
-    BGFX_TEXTURE_FORMAT_BC2,                  /** ( 1) DXT3                           */
-    BGFX_TEXTURE_FORMAT_BC3,                  /** ( 2) DXT5                           */
-    BGFX_TEXTURE_FORMAT_BC4,                  /** ( 3) LATC1/ATI1                     */
-    BGFX_TEXTURE_FORMAT_BC5,                  /** ( 4) LATC2/ATI2                     */
-    BGFX_TEXTURE_FORMAT_BC6H,                 /** ( 5) BC6H                           */
-    BGFX_TEXTURE_FORMAT_BC7,                  /** ( 6) BC7                            */
+    BGFX_TEXTURE_FORMAT_BC1,                  /** ( 0) DXT1 R5G6B5A1                  */
+    BGFX_TEXTURE_FORMAT_BC2,                  /** ( 1) DXT3 R5G6B5A4                  */
+    BGFX_TEXTURE_FORMAT_BC3,                  /** ( 2) DXT5 R5G6B5A8                  */
+    BGFX_TEXTURE_FORMAT_BC4,                  /** ( 3) LATC1/ATI1 R8                  */
+    BGFX_TEXTURE_FORMAT_BC5,                  /** ( 4) LATC2/ATI2 RG8                 */
+    BGFX_TEXTURE_FORMAT_BC6H,                 /** ( 5) BC6H RGB16F                    */
+    BGFX_TEXTURE_FORMAT_BC7,                  /** ( 6) BC7 RGB 4-7 bits per color channel, 0-8 bits alpha */
     BGFX_TEXTURE_FORMAT_ETC1,                 /** ( 7) ETC1 RGB8                      */
     BGFX_TEXTURE_FORMAT_ETC1,                 /** ( 7) ETC1 RGB8                      */
     BGFX_TEXTURE_FORMAT_ETC2,                 /** ( 8) ETC2 RGB8                      */
     BGFX_TEXTURE_FORMAT_ETC2,                 /** ( 8) ETC2 RGB8                      */
     BGFX_TEXTURE_FORMAT_ETC2A,                /** ( 9) ETC2 RGBA8                     */
     BGFX_TEXTURE_FORMAT_ETC2A,                /** ( 9) ETC2 RGBA8                     */

+ 7 - 7
scripts/bgfx.idl

@@ -491,13 +491,13 @@ enum.AttribType { comment = "Attribute types:" }
 ---
 ---
 --- @attention Availability depends on Caps (see: formats).
 --- @attention Availability depends on Caps (see: formats).
 enum.TextureFormat { comment = "Texture formats:" }
 enum.TextureFormat { comment = "Texture formats:" }
-	.BC1                             --- DXT1
-	.BC2                             --- DXT3
-	.BC3                             --- DXT5
-	.BC4                             --- LATC1/ATI1
-	.BC5                             --- LATC2/ATI2
-	.BC6H                            --- BC6H
-	.BC7                             --- BC7
+	.BC1                             --- DXT1 R5G6B5A1
+	.BC2                             --- DXT3 R5G6B5A4
+	.BC3                             --- DXT5 R5G6B5A8
+	.BC4                             --- LATC1/ATI1 R8
+	.BC5                             --- LATC2/ATI2 RG8
+	.BC6H                            --- BC6H RGB16F
+	.BC7                             --- BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
 	.ETC1                            --- ETC1 RGB8
 	.ETC1                            --- ETC1 RGB8
 	.ETC2                            --- ETC2 RGB8
 	.ETC2                            --- ETC2 RGB8
 	.ETC2A                           --- ETC2 RGBA8
 	.ETC2A                           --- ETC2 RGBA8

+ 12 - 1
scripts/bindings-cs.lua

@@ -235,7 +235,18 @@ function converter.types(typ)
 
 
 		yield("public enum " .. typ.typename)
 		yield("public enum " .. typ.typename)
 		yield("{")
 		yield("{")
-		for _, enum in ipairs(typ.enum) do
+		for idx, enum in ipairs(typ.enum) do
+
+			if enum.comment ~= nil then
+				if idx ~= 1 then
+					yield("")
+				end
+
+				yield("\t/// <summary>")
+				yield("\t/// " .. enum.comment)
+				yield("\t/// </summary>")
+			end
+
 			yield("\t" .. enum.name .. ",")
 			yield("\t" .. enum.name .. ",")
 		end
 		end
 		yield("");
 		yield("");