Updated docs.

This commit is contained in:
bkaradzic 2013-02-16 11:51:36 -08:00
parent 5ba2b24e1e
commit da9382cad7

View file

@ -162,14 +162,17 @@
/// ///
#define BGFX_TEXTURE_NONE UINT32_C(0x00000000) #define BGFX_TEXTURE_NONE UINT32_C(0x00000000)
#define BGFX_TEXTURE_U_REPEAT UINT32_C(0x00000000)
#define BGFX_TEXTURE_U_MIRROR UINT32_C(0x00000001) #define BGFX_TEXTURE_U_MIRROR UINT32_C(0x00000001)
#define BGFX_TEXTURE_U_CLAMP UINT32_C(0x00000002) #define BGFX_TEXTURE_U_CLAMP UINT32_C(0x00000002)
#define BGFX_TEXTURE_U_SHIFT 0 #define BGFX_TEXTURE_U_SHIFT 0
#define BGFX_TEXTURE_U_MASK UINT32_C(0x00000003) #define BGFX_TEXTURE_U_MASK UINT32_C(0x00000003)
#define BGFX_TEXTURE_V_REPEAT UINT32_C(0x00000000)
#define BGFX_TEXTURE_V_MIRROR UINT32_C(0x00000010) #define BGFX_TEXTURE_V_MIRROR UINT32_C(0x00000010)
#define BGFX_TEXTURE_V_CLAMP UINT32_C(0x00000020) #define BGFX_TEXTURE_V_CLAMP UINT32_C(0x00000020)
#define BGFX_TEXTURE_V_SHIFT 4 #define BGFX_TEXTURE_V_SHIFT 4
#define BGFX_TEXTURE_V_MASK UINT32_C(0x00000030) #define BGFX_TEXTURE_V_MASK UINT32_C(0x00000030)
#define BGFX_TEXTURE_W_REPEAT UINT32_C(0x00000000)
#define BGFX_TEXTURE_W_MIRROR UINT32_C(0x00000100) #define BGFX_TEXTURE_W_MIRROR UINT32_C(0x00000100)
#define BGFX_TEXTURE_W_CLAMP UINT32_C(0x00000200) #define BGFX_TEXTURE_W_CLAMP UINT32_C(0x00000200)
#define BGFX_TEXTURE_W_SHIFT 8 #define BGFX_TEXTURE_W_SHIFT 8
@ -353,7 +356,8 @@ namespace bgfx
/// Callback interface to implement application specific behavior. /// Callback interface to implement application specific behavior.
/// Cached items are currently used only when for OpenGL binary shaders. /// Cached items are currently used only when for OpenGL binary shaders.
/// ///
/// NOTE: 'fatal' callback can be called from any thread. Other callbacks /// NOTE:
/// 'fatal' callback can be called from any thread. Other callbacks
/// are called from the render thread. /// are called from the render thread.
struct CallbackI struct CallbackI
{ {
@ -444,7 +448,10 @@ namespace bgfx
/// End VertexDecl. /// End VertexDecl.
void end(); void end();
/// Add attribute to VertexDecl. Note: Must be called between begin/end. /// Add attribute to VertexDecl.
///
/// NOTE:
/// Must be called between begin/end.
void add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized = false, bool _asInt = false); void add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized = false, bool _asInt = false);
/// Decode attribute. /// Decode attribute.
@ -615,10 +622,17 @@ namespace bgfx
/// Create texture from memory buffer. /// Create texture from memory buffer.
/// @param _mem DDS texture data. /// @param _mem DDS texture data.
/// @param _flags Default texture sampling mode is linear, and wrap mode is repeat. /// @param _flags Default texture sampling mode is linear, and wrap mode
/// BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode. /// is repeat.
/// BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling. ///
/// BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap
/// mode.
///
/// BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic
/// sampling.
///
/// BGFX_TEXTURE_SRGB - Sample as sRGB texture. /// BGFX_TEXTURE_SRGB - Sample as sRGB texture.
///
/// @param _info Returns parsed DDS texture information. /// @param _info Returns parsed DDS texture information.
/// @returns Texture handle. /// @returns Texture handle.
TextureHandle createTexture(const Memory* _mem, uint32_t _flags = BGFX_TEXTURE_NONE, TextureInfo* _info = NULL); TextureHandle createTexture(const Memory* _mem, uint32_t _flags = BGFX_TEXTURE_NONE, TextureInfo* _info = NULL);
@ -666,9 +680,7 @@ namespace bgfx
/// Set view clear flags. /// Set view clear flags.
/// ///
/// @param _id view id. /// @param _id view id.
/// @param _flags clear flags. /// @param _flags clear flags. See: BGFX_CLEAR_*
/// See: BGFX_CLEAR_*
///
/// @param _rgba color clear value. /// @param _rgba color clear value.
/// @param _depth depth clear value. /// @param _depth depth clear value.
/// @param _stencil stencil clear value. /// @param _stencil stencil clear value.
@ -699,7 +711,24 @@ namespace bgfx
void setViewTransformMask(uint32_t _viewMask, const void* _view, const void* _proj, uint8_t _other = 0xff); void setViewTransformMask(uint32_t _viewMask, const void* _view, const void* _proj, uint8_t _other = 0xff);
/// Set render states for draw primitive. /// Set render states for draw primitive.
/// BGFX_STATE_* /// @param _state State flags. Default state for primitive type is
/// triangles. See: BGFX_STATE_DEFAULT.
///
/// BGFX_STATE_ALPHA_TEST - Enable alpha test.
/// BGFX_STATE_ALPHA_WRITE - Enable alpha write.
/// BGFX_STATE_ALPHA_TEST_* - Alpha test function.
/// BGFX_STATE_DEPTH_WRITE - Enable depth write.
/// BGFX_STATE_DEPTH_TEST_* - Depth test function.
/// BGFX_STATE_BLEND_* - See NOTE: BGFX_STATE_BLEND_FUNC.
/// BGFX_STATE_CULL_* - Backface culling mode.
/// BGFX_STATE_RGB_WRITE - Enable RGB write.
/// BGFX_STATE_SRGBWRITE - Enable sRGB write.
/// BGFX_STATE_MSAA - Enable MSAA.
/// BGFX_STATE_PT_[LINES/POINTS] - Primitive type.
///
/// NOTE:
/// Use BGFX_STATE_ALPHA_REF, BGFX_STATE_BLEND_FUNC and
/// BGFX_STATE_BLEND_FUNC macros to setup more complex states.
void setState(uint64_t _state); void setState(uint64_t _state);
/// Set stencil test state. /// Set stencil test state.