Browse Source

Fixed IDL to match PR #1767.

Бранимир Караџић 6 years ago
parent
commit
f4e23fa80b
3 changed files with 27 additions and 22 deletions
  1. 14 14
      include/bgfx/c99/bgfx.h
  2. 6 1
      scripts/codegen.lua
  3. 7 7
      src/bgfx.idl.inl

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

@@ -1068,7 +1068,7 @@ BGFX_C_API bool bgfx_init(const bgfx_init_t * _init);
  * Shutdown bgfx library.
  * Shutdown bgfx library.
  *
  *
  */
  */
-BGFX_C_API void bgfx_shutdown();
+BGFX_C_API void bgfx_shutdown(void);
 
 
 /**
 /**
  * Reset graphic settings and back-buffer size.
  * Reset graphic settings and back-buffer size.
@@ -1114,7 +1114,7 @@ BGFX_C_API uint32_t bgfx_frame(bool _capture);
  *   Library must be initialized.
  *   Library must be initialized.
  *
  *
  */
  */
-BGFX_C_API bgfx_renderer_type_t bgfx_get_renderer_type();
+BGFX_C_API bgfx_renderer_type_t bgfx_get_renderer_type(void);
 
 
 /**
 /**
  * Returns renderer capabilities.
  * Returns renderer capabilities.
@@ -1122,14 +1122,14 @@ BGFX_C_API bgfx_renderer_type_t bgfx_get_renderer_type();
  *   Library must be initialized.
  *   Library must be initialized.
  *
  *
  */
  */
-BGFX_C_API const bgfx_caps_t* bgfx_get_caps();
+BGFX_C_API const bgfx_caps_t* bgfx_get_caps(void);
 
 
 /**
 /**
  * Returns performance counters.
  * Returns performance counters.
  * @attention Pointer returned is valid until `bgfx::frame` is called.
  * @attention Pointer returned is valid until `bgfx::frame` is called.
  *
  *
  */
  */
-BGFX_C_API const bgfx_stats_t* bgfx_get_stats();
+BGFX_C_API const bgfx_stats_t* bgfx_get_stats(void);
 
 
 /**
 /**
  * Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
  * Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
@@ -2078,7 +2078,7 @@ BGFX_C_API void bgfx_destroy_uniform(bgfx_uniform_handle_t _handle);
  * Create occlusion query.
  * Create occlusion query.
  *
  *
  */
  */
-BGFX_C_API bgfx_occlusion_query_handle_t bgfx_create_occlusion_query();
+BGFX_C_API bgfx_occlusion_query_handle_t bgfx_create_occlusion_query(void);
 
 
 /**
 /**
  * Retrieve occlusion query result from previous frame.
  * Retrieve occlusion query result from previous frame.
@@ -2744,7 +2744,7 @@ BGFX_C_API void bgfx_set_platform_data(const bgfx_platform_data_t * _data);
  * @warning Must be called only on render thread.
  * @warning Must be called only on render thread.
  *
  *
  */
  */
-BGFX_C_API const bgfx_internal_data_t* bgfx_get_internal_data();
+BGFX_C_API const bgfx_internal_data_t* bgfx_get_internal_data(void);
 
 
 /**
 /**
  * Override internal texture with externally created texture. Previously
  * Override internal texture with externally created texture. Previously
@@ -3195,7 +3195,7 @@ BGFX_C_API void bgfx_dispatch_indirect(bgfx_view_id_t _id, bgfx_program_handle_t
  * Discard all previously set state for draw or compute call.
  * Discard all previously set state for draw or compute call.
  *
  *
  */
  */
-BGFX_C_API void bgfx_discard();
+BGFX_C_API void bgfx_discard(void);
 
 
 /**
 /**
  * Blit 2D texture region between two 2D textures.
  * Blit 2D texture region between two 2D textures.
@@ -3437,12 +3437,12 @@ struct bgfx_interface_vtbl
     const char* (*get_renderer_name)(bgfx_renderer_type_t _type);
     const char* (*get_renderer_name)(bgfx_renderer_type_t _type);
     void (*init_ctor)(bgfx_init_t* _init);
     void (*init_ctor)(bgfx_init_t* _init);
     bool (*init)(const bgfx_init_t * _init);
     bool (*init)(const bgfx_init_t * _init);
-    void (*shutdown)();
+    void (*shutdown)(void);
     void (*reset)(uint32_t _width, uint32_t _height, uint32_t _flags, bgfx_texture_format_t _format);
     void (*reset)(uint32_t _width, uint32_t _height, uint32_t _flags, bgfx_texture_format_t _format);
     uint32_t (*frame)(bool _capture);
     uint32_t (*frame)(bool _capture);
-    bgfx_renderer_type_t (*get_renderer_type)();
-    const bgfx_caps_t* (*get_caps)();
-    const bgfx_stats_t* (*get_stats)();
+    bgfx_renderer_type_t (*get_renderer_type)(void);
+    const bgfx_caps_t* (*get_caps)(void);
+    const bgfx_stats_t* (*get_stats)(void);
     const bgfx_memory_t* (*alloc)(uint32_t _size);
     const bgfx_memory_t* (*alloc)(uint32_t _size);
     const bgfx_memory_t* (*copy)(const void* _data, uint32_t _size);
     const bgfx_memory_t* (*copy)(const void* _data, uint32_t _size);
     const bgfx_memory_t* (*make_ref)(const void* _data, uint32_t _size);
     const bgfx_memory_t* (*make_ref)(const void* _data, uint32_t _size);
@@ -3509,7 +3509,7 @@ struct bgfx_interface_vtbl
     bgfx_uniform_handle_t (*create_uniform)(const char* _name, bgfx_uniform_type_t _type, uint16_t _num);
     bgfx_uniform_handle_t (*create_uniform)(const char* _name, bgfx_uniform_type_t _type, uint16_t _num);
     void (*get_uniform_info)(bgfx_uniform_handle_t _handle, bgfx_uniform_info_t * _info);
     void (*get_uniform_info)(bgfx_uniform_handle_t _handle, bgfx_uniform_info_t * _info);
     void (*destroy_uniform)(bgfx_uniform_handle_t _handle);
     void (*destroy_uniform)(bgfx_uniform_handle_t _handle);
-    bgfx_occlusion_query_handle_t (*create_occlusion_query)();
+    bgfx_occlusion_query_handle_t (*create_occlusion_query)(void);
     bgfx_occlusion_query_result_t (*get_result)(bgfx_occlusion_query_handle_t _handle, int32_t* _result);
     bgfx_occlusion_query_result_t (*get_result)(bgfx_occlusion_query_handle_t _handle, int32_t* _result);
     void (*destroy_occlusion_query)(bgfx_occlusion_query_handle_t _handle);
     void (*destroy_occlusion_query)(bgfx_occlusion_query_handle_t _handle);
     void (*set_palette_color)(uint8_t _index, const float _rgba[4]);
     void (*set_palette_color)(uint8_t _index, const float _rgba[4]);
@@ -3565,7 +3565,7 @@ struct bgfx_interface_vtbl
     void (*request_screen_shot)(bgfx_frame_buffer_handle_t _handle, const char* _filePath);
     void (*request_screen_shot)(bgfx_frame_buffer_handle_t _handle, const char* _filePath);
     bgfx_render_frame_t (*render_frame)(int32_t _msecs);
     bgfx_render_frame_t (*render_frame)(int32_t _msecs);
     void (*set_platform_data)(const bgfx_platform_data_t * _data);
     void (*set_platform_data)(const bgfx_platform_data_t * _data);
-    const bgfx_internal_data_t* (*get_internal_data)();
+    const bgfx_internal_data_t* (*get_internal_data)(void);
     uintptr_t (*override_internal_texture_ptr)(bgfx_texture_handle_t _handle, uintptr_t _ptr);
     uintptr_t (*override_internal_texture_ptr)(bgfx_texture_handle_t _handle, uintptr_t _ptr);
     uintptr_t (*override_internal_texture)(bgfx_texture_handle_t _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, bgfx_texture_format_t _format, uint64_t _flags);
     uintptr_t (*override_internal_texture)(bgfx_texture_handle_t _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, bgfx_texture_format_t _format, uint64_t _flags);
     void (*set_marker)(const char* _marker);
     void (*set_marker)(const char* _marker);
@@ -3602,7 +3602,7 @@ struct bgfx_interface_vtbl
     void (*set_image)(uint8_t _stage, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
     void (*set_image)(uint8_t _stage, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
     void (*dispatch)(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint32_t _numX, uint32_t _numY, uint32_t _numZ);
     void (*dispatch)(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint32_t _numX, uint32_t _numY, uint32_t _numZ);
     void (*dispatch_indirect)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num);
     void (*dispatch_indirect)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num);
-    void (*discard)();
+    void (*discard)(void);
     void (*blit)(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, bgfx_texture_handle_t _src, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth);
     void (*blit)(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, bgfx_texture_handle_t _src, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth);
 };
 };
 
 

+ 6 - 1
scripts/codegen.lua

@@ -440,6 +440,11 @@ local function codetemp(func)
 		callfunc_c2c = func.cname
 		callfunc_c2c = func.cname
 	end
 	end
 
 
+	outCargs = table.concat(cargs, ", ")
+	if outCargs == "" then
+		outCargs = "void"
+	end
+
 	return {
 	return {
 		RET = func.ret.fulltype,
 		RET = func.ret.fulltype,
 		CRET = func.ret.ctype,
 		CRET = func.ret.ctype,
@@ -447,7 +452,7 @@ local function codetemp(func)
 		CFUNCNAMEUPPER = func.cname:upper(),
 		CFUNCNAMEUPPER = func.cname:upper(),
 		CFUNCNAMECAML = underscorecase_to_camelcase(func.cname),
 		CFUNCNAMECAML = underscorecase_to_camelcase(func.cname),
 		FUNCNAME = func.name,
 		FUNCNAME = func.name,
-		CARGS = table.concat(cargs, ", "),
+		CARGS = outCargs,
 		CPPARGS = table.concat(args, ", "),
 		CPPARGS = table.concat(args, ", "),
 		ARGS = ARGS,
 		ARGS = ARGS,
 		CONVERSION = lines(conversion),
 		CONVERSION = lines(conversion),

+ 7 - 7
src/bgfx.idl.inl

@@ -140,7 +140,7 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type)
 
 
 /* BGFX_C_API bool bgfx_init(const bgfx_init_t * _init) */
 /* BGFX_C_API bool bgfx_init(const bgfx_init_t * _init) */
 
 
-BGFX_C_API void bgfx_shutdown()
+BGFX_C_API void bgfx_shutdown(void)
 {
 {
 	bgfx::shutdown();
 	bgfx::shutdown();
 }
 }
@@ -155,17 +155,17 @@ BGFX_C_API uint32_t bgfx_frame(bool _capture)
 	return bgfx::frame(_capture);
 	return bgfx::frame(_capture);
 }
 }
 
 
-BGFX_C_API bgfx_renderer_type_t bgfx_get_renderer_type()
+BGFX_C_API bgfx_renderer_type_t bgfx_get_renderer_type(void)
 {
 {
 	return (bgfx_renderer_type_t)bgfx::getRendererType();
 	return (bgfx_renderer_type_t)bgfx::getRendererType();
 }
 }
 
 
-BGFX_C_API const bgfx_caps_t* bgfx_get_caps()
+BGFX_C_API const bgfx_caps_t* bgfx_get_caps(void)
 {
 {
 	return (const bgfx_caps_t*)bgfx::getCaps();
 	return (const bgfx_caps_t*)bgfx::getCaps();
 }
 }
 
 
-BGFX_C_API const bgfx_stats_t* bgfx_get_stats()
+BGFX_C_API const bgfx_stats_t* bgfx_get_stats(void)
 {
 {
 	return (const bgfx_stats_t*)bgfx::getStats();
 	return (const bgfx_stats_t*)bgfx::getStats();
 }
 }
@@ -587,7 +587,7 @@ BGFX_C_API void bgfx_destroy_uniform(bgfx_uniform_handle_t _handle)
 	bgfx::destroy(handle.cpp);
 	bgfx::destroy(handle.cpp);
 }
 }
 
 
-BGFX_C_API bgfx_occlusion_query_handle_t bgfx_create_occlusion_query()
+BGFX_C_API bgfx_occlusion_query_handle_t bgfx_create_occlusion_query(void)
 {
 {
 	union { bgfx_occlusion_query_handle_t c; bgfx::OcclusionQueryHandle cpp; } handle_ret;
 	union { bgfx_occlusion_query_handle_t c; bgfx::OcclusionQueryHandle cpp; } handle_ret;
 	handle_ret.cpp = bgfx::createOcclusionQuery();
 	handle_ret.cpp = bgfx::createOcclusionQuery();
@@ -939,7 +939,7 @@ BGFX_C_API void bgfx_set_platform_data(const bgfx_platform_data_t * _data)
 	bgfx::setPlatformData(data);
 	bgfx::setPlatformData(data);
 }
 }
 
 
-BGFX_C_API const bgfx_internal_data_t* bgfx_get_internal_data()
+BGFX_C_API const bgfx_internal_data_t* bgfx_get_internal_data(void)
 {
 {
 	return (const bgfx_internal_data_t*)bgfx::getInternalData();
 	return (const bgfx_internal_data_t*)bgfx::getInternalData();
 }
 }
@@ -1150,7 +1150,7 @@ BGFX_C_API void bgfx_dispatch_indirect(bgfx_view_id_t _id, bgfx_program_handle_t
 	bgfx::dispatch((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, _num);
 	bgfx::dispatch((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, _num);
 }
 }
 
 
-BGFX_C_API void bgfx_discard()
+BGFX_C_API void bgfx_discard(void)
 {
 {
 	bgfx::discard();
 	bgfx::discard();
 }
 }