This commit is contained in:
Бранимир Караџић
2020-05-03 19:58:15 -07:00
parent 60b51dcf85
commit f2e79bbe41
7 changed files with 42 additions and 3 deletions

View File

@@ -3446,6 +3446,13 @@ public static partial class bgfx
[DllImport(DllName, EntryPoint="bgfx_set_view_order", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_order(ushort _id, ushort _num, ushort* _order);
/// <summary>
/// Reset all view settings to default.
/// </summary>
///
[DllImport(DllName, EntryPoint="bgfx_reset_view", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void reset_view(ushort _id);
/// <summary>
/// Begin submitting draw calls from thread.
/// </summary>

View File

@@ -1205,6 +1205,11 @@ version(BindBgfx_Static)
*/
void bgfx_set_view_order(bgfx_view_id_t _id, ushort _num, const(bgfx_view_id_t)* _order);
/**
* Reset all view settings to default.
*/
void bgfx_reset_view(bgfx_view_id_t _id);
/**
* Begin submitting draw calls from thread.
* Params:
@@ -3377,6 +3382,12 @@ else
alias da_bgfx_set_view_order = void function(bgfx_view_id_t _id, ushort _num, const(bgfx_view_id_t)* _order);
da_bgfx_set_view_order bgfx_set_view_order;
/**
* Reset all view settings to default.
*/
alias da_bgfx_reset_view = void function(bgfx_view_id_t _id);
da_bgfx_reset_view bgfx_reset_view;
/**
* Begin submitting draw calls from thread.
* Params:

View File

@@ -10,7 +10,7 @@ public import core.stdc.stdarg : va_list;
extern(C) @nogc nothrow:
enum uint BGFX_API_VERSION = 105;
enum uint BGFX_API_VERSION = 106;
alias bgfx_view_id_t = ushort;

View File

@@ -2276,6 +2276,14 @@ BGFX_C_API void bgfx_set_view_transform(bgfx_view_id_t _id, const void* _view, c
*/
BGFX_C_API void bgfx_set_view_order(bgfx_view_id_t _id, uint16_t _num, const bgfx_view_id_t* _order);
/**
* Reset all view settings to default.
*
* @param[in] _id
*
*/
BGFX_C_API void bgfx_reset_view(bgfx_view_id_t _id);
/**
* Begin submitting draw calls from thread.
*
@@ -3361,6 +3369,7 @@ typedef enum bgfx_function_id
BGFX_FUNCTION_ID_SET_VIEW_FRAME_BUFFER,
BGFX_FUNCTION_ID_SET_VIEW_TRANSFORM,
BGFX_FUNCTION_ID_SET_VIEW_ORDER,
BGFX_FUNCTION_ID_RESET_VIEW,
BGFX_FUNCTION_ID_ENCODER_BEGIN,
BGFX_FUNCTION_ID_ENCODER_END,
BGFX_FUNCTION_ID_ENCODER_SET_MARKER,
@@ -3553,6 +3562,7 @@ struct bgfx_interface_vtbl
void (*set_view_frame_buffer)(bgfx_view_id_t _id, bgfx_frame_buffer_handle_t _handle);
void (*set_view_transform)(bgfx_view_id_t _id, const void* _view, const void* _proj);
void (*set_view_order)(bgfx_view_id_t _id, uint16_t _num, const bgfx_view_id_t* _order);
void (*reset_view)(bgfx_view_id_t _id);
bgfx_encoder_t* (*encoder_begin)(bool _forThread);
void (*encoder_end)(bgfx_encoder_t* _encoder);
void (*encoder_set_marker)(bgfx_encoder_t* _this, const char* _marker);

View File

@@ -15,7 +15,7 @@
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_API_VERSION UINT32_C(105)
#define BGFX_API_VERSION UINT32_C(106)
/**
* Color RGB/alpha/depth write. When it's not specified write will be disabled.

View File

@@ -1,7 +1,7 @@
-- vim: syntax=lua
-- bgfx interface
version(105)
version(106)
typedef "bool"
typedef "char"
@@ -2076,6 +2076,11 @@ func.setViewOrder
--- to default state.
{ default = NULL }
--- Reset all view settings to default.
func.resetView
"void"
.id "ViewId" -- _id View id.
--- Begin submitting draw calls from thread.
func.begin { cname = "encoder_begin" }
"Encoder*" --- Encoder.

View File

@@ -671,6 +671,11 @@ BGFX_C_API void bgfx_set_view_order(bgfx_view_id_t _id, uint16_t _num, const bgf
bgfx::setViewOrder((bgfx::ViewId)_id, _num, (const bgfx::ViewId*)_order);
}
BGFX_C_API void bgfx_reset_view(bgfx_view_id_t _id)
{
bgfx::resetView((bgfx::ViewId)_id);
}
BGFX_C_API bgfx_encoder_t* bgfx_encoder_begin(bool _forThread)
{
return (bgfx_encoder_t*)bgfx::begin(_forThread);
@@ -1310,6 +1315,7 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
bgfx_set_view_frame_buffer,
bgfx_set_view_transform,
bgfx_set_view_order,
bgfx_reset_view,
bgfx_encoder_begin,
bgfx_encoder_end,
bgfx_encoder_set_marker,