From 4b18babb622af0298f23d47b0ffb6f2a4eca55ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 27 Mar 2015 22:09:10 -0700 Subject: [PATCH] Updated C99 API. --- examples/25-c99/helloworld.c | 13 +++++++++---- include/bgfx.c99.h | 2 +- src/bgfx.cpp | 6 +++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/examples/25-c99/helloworld.c b/examples/25-c99/helloworld.c index 0eaf81b6..e217e10e 100644 --- a/examples/25-c99/helloworld.c +++ b/examples/25-c99/helloworld.c @@ -15,14 +15,19 @@ uint16_t uint16_max(uint16_t _a, uint16_t _b) int _main_(int _argc, char** _argv) { - uint32_t width = 1280; + uint32_t width = 1280; uint32_t height = 720; - uint32_t debug = BGFX_DEBUG_TEXT; - uint32_t reset = BGFX_RESET_VSYNC; + uint32_t debug = BGFX_DEBUG_TEXT; + uint32_t reset = BGFX_RESET_VSYNC; (void)_argc; (void)_argv; - bgfx_init(BGFX_RENDERER_TYPE_COUNT, NULL, NULL); + bgfx_init(BGFX_RENDERER_TYPE_COUNT + , BGFX_PCI_ID_NONE + , 0 + , NULL + , NULL + ); bgfx_reset(width, height, reset); // Enable debug text. diff --git a/include/bgfx.c99.h b/include/bgfx.c99.h index b7e930ed..38b55e32 100644 --- a/include/bgfx.c99.h +++ b/include/bgfx.c99.h @@ -573,7 +573,7 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type); * specified, library uses default CRT allocator. The library assumes * custom allocator is thread safe. */ -BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator); +BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator); /** * Shutdown bgfx library. diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 232ab2df..3a353942 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -3018,11 +3018,11 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type) return bgfx::getRendererName(bgfx::RendererType::Enum(_type) ); } -BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, struct bgfx_callback_interface* _callback, struct bgfx_reallocator_interface* _allocator) +BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator) { return bgfx::init(bgfx::RendererType::Enum(_type) - , BGFX_PCI_ID_NONE - , 0 + , _vendorId + , _deviceId , reinterpret_cast(_callback) , reinterpret_cast(_allocator) );