|
|
@@ -8,6 +8,44 @@
|
|
|
*
|
|
|
*/
|
|
|
|
|
|
+#define BGFX_C99_ENUM_CHECK(_enum, _c99enumcount) \
|
|
|
+ BX_STATIC_ASSERT(_enum::Count == _enum::Enum(_c99enumcount) )
|
|
|
+
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::Fatal, BGFX_FATAL_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::RendererType, BGFX_RENDERER_TYPE_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::Attrib, BGFX_ATTRIB_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::AttribType, BGFX_ATTRIB_TYPE_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::TextureFormat, BGFX_TEXTURE_FORMAT_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::UniformType, BGFX_UNIFORM_TYPE_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::BackbufferRatio, BGFX_BACKBUFFER_RATIO_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::OcclusionQueryResult, BGFX_OCCLUSION_QUERY_RESULT_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::Topology, BGFX_TOPOLOGY_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::TopologyConvert, BGFX_TOPOLOGY_CONVERT_COUNT);
|
|
|
+BGFX_C99_ENUM_CHECK(bgfx::RenderFrame, BGFX_RENDER_FRAME_COUNT);
|
|
|
+
|
|
|
+#undef BGFX_C99_ENUM_CHECK
|
|
|
+
|
|
|
+#define BGFX_C99_STRUCT_SIZE_CHECK(_cppstruct, _c99struct) \
|
|
|
+ BX_STATIC_ASSERT(sizeof(_cppstruct) == sizeof(_c99struct) )
|
|
|
+
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory, bgfx_memory_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform, bgfx_transform_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Stats, bgfx_stats_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::VertexDecl, bgfx_vertex_decl_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientIndexBuffer, bgfx_transient_index_buffer_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientVertexBuffer, bgfx_transient_vertex_buffer_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InstanceDataBuffer, bgfx_instance_data_buffer_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TextureInfo, bgfx_texture_info_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::UniformInfo, bgfx_uniform_info_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Attachment, bgfx_attachment_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Caps::GPU, bgfx_caps_gpu_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Caps::Limits, bgfx_caps_limits_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Caps, bgfx_caps_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::PlatformData, bgfx_platform_data_t);
|
|
|
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InternalData, bgfx_internal_data_t);
|
|
|
+
|
|
|
+#undef BGFX_C99_STRUCT_SIZE_CHECK
|
|
|
+
|
|
|
BGFX_C_API void bgfx_attachment_init(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, uint16_t _layer, uint16_t _mip, uint8_t _resolve)
|
|
|
{
|
|
|
bgfx::Attachment* This = (bgfx::Attachment*)_this;
|