mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Merge pull request #602 from MikePopoloski/master
Adding missing C99 functions
This commit is contained in:
commit
4fe6184c59
3 changed files with 41 additions and 1 deletions
|
@ -1414,7 +1414,7 @@ namespace bgfx
|
|||
///
|
||||
/// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
|
||||
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
|
||||
/// @attention C99 equivalent is `bgfx_read_texture`.
|
||||
/// @attention C99 equivalent is `bgfx_read_frame_buffer`.
|
||||
///
|
||||
void readTexture(FrameBufferHandle _handle, uint8_t _attachment, void* _data);
|
||||
|
||||
|
@ -1614,6 +1614,7 @@ namespace bgfx
|
|||
///
|
||||
void setViewRect(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
|
||||
|
||||
/// @attention C99 equivalent is `bgfx_set_view_rect_auto`.
|
||||
///
|
||||
void setViewRect(uint8_t _id, uint16_t _x, uint16_t _y, BackbufferRatio::Enum _ratio);
|
||||
|
||||
|
|
|
@ -758,6 +758,12 @@ BGFX_C_API void bgfx_update_texture_3d(bgfx_texture_handle_t _handle, uint8_t _m
|
|||
/**/
|
||||
BGFX_C_API void bgfx_update_texture_cube(bgfx_texture_handle_t _handle, uint8_t _side, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const bgfx_memory_t* _mem, uint16_t _pitch);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_read_texture(bgfx_texture_handle_t _handle, void* _data);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_read_frame_buffer(bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, void* _data);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_destroy_texture(bgfx_texture_handle_t _handle);
|
||||
|
||||
|
@ -800,6 +806,9 @@ BGFX_C_API void bgfx_set_view_name(uint8_t _id, const char* _name);
|
|||
/**/
|
||||
BGFX_C_API void bgfx_set_view_rect(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_set_view_rect_auto(uint8_t _id, uint16_t _x, uint16_t _y, bgfx_backbuffer_ratio_t _ratio);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_set_view_scissor(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
|
||||
|
||||
|
@ -824,6 +833,9 @@ BGFX_C_API void bgfx_set_view_transform_stereo(uint8_t _id, const void* _view, c
|
|||
/**/
|
||||
BGFX_C_API void bgfx_set_view_remap(uint8_t _id, uint8_t _num, const void* _remap);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_reset_view(uint8_t _id);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_set_marker(const char* _marker);
|
||||
|
||||
|
@ -932,6 +944,9 @@ BGFX_C_API void bgfx_discard();
|
|||
/**/
|
||||
BGFX_C_API void bgfx_blit(uint8_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);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_blit_frame_buffer(uint8_t _id, bgfx_texture_handle_t _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, bgfx_frame_buffer_handle_t _src, uint8_t _attachment, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_save_screen_shot(const char* _filePath);
|
||||
|
||||
|
|
24
src/bgfx.cpp
24
src/bgfx.cpp
|
@ -3986,6 +3986,18 @@ BGFX_C_API void bgfx_update_texture_cube(bgfx_texture_handle_t _handle, uint8_t
|
|||
bgfx::updateTextureCube(handle.cpp, _side, _mip, _x, _y, _width, _height, (const bgfx::Memory*)_mem, _pitch);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_read_texture(bgfx_texture_handle_t _handle, void* _data)
|
||||
{
|
||||
union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle = { _handle };
|
||||
bgfx::readTexture(handle.cpp, _data);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_read_frame_buffer(bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, void* _data)
|
||||
{
|
||||
union { bgfx_frame_buffer_handle_t c; bgfx::FrameBufferHandle cpp; } handle = { _handle };
|
||||
bgfx::readTexture(handle.cpp, _attachment, _data);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_destroy_texture(bgfx_texture_handle_t _handle)
|
||||
{
|
||||
union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle = { _handle };
|
||||
|
@ -4073,6 +4085,11 @@ BGFX_C_API void bgfx_set_view_rect(uint8_t _id, uint16_t _x, uint16_t _y, uint16
|
|||
bgfx::setViewRect(_id, _x, _y, _width, _height);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_set_view_rect_auto(uint8_t _id, uint16_t _x, uint16_t _y, bgfx_backbuffer_ratio_t _ratio)
|
||||
{
|
||||
bgfx::setViewRect(_id, _x, _y, bgfx::BackbufferRatio::Enum(_ratio));
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_set_view_scissor(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
|
||||
{
|
||||
bgfx::setViewScissor(_id, _x, _y, _width, _height);
|
||||
|
@ -4330,6 +4347,13 @@ BGFX_C_API void bgfx_blit(uint8_t _id, bgfx_texture_handle_t _dst, uint8_t _dstM
|
|||
bgfx::blit(_id, dst.cpp, _dstMip, _dstX, _dstY, _dstZ, src.cpp, _srcMip, _srcX, _srcY, _srcZ, _width, _height, _depth);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_blit_frame_buffer(uint8_t _id, bgfx_texture_handle_t _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, bgfx_frame_buffer_handle_t _src, uint8_t _attachment, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth)
|
||||
{
|
||||
union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } dst = { _dst };
|
||||
union { bgfx_frame_buffer_handle_t c; bgfx::FrameBufferHandle cpp; } src = { _src };
|
||||
bgfx::blit(_id, dst.cpp, _dstMip, _dstX, _dstY, _dstZ, src.cpp, _attachment, _srcMip, _srcX, _srcY, _srcZ, _width, _height, _depth);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_save_screen_shot(const char* _filePath)
|
||||
{
|
||||
bgfx::saveScreenShot(_filePath);
|
||||
|
|
Loading…
Reference in a new issue