mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-09-18 08:24:29 +00:00
Removed bgfx/platform.h (#3761)
This commit is contained in:
committed by
GitHub
parent
befae614da
commit
f671eb83bf
@@ -27,7 +27,7 @@
|
||||
#endif //
|
||||
#include <GLFW/glfw3native.h>
|
||||
|
||||
#include <bgfx/platform.h>
|
||||
#include <bgfx/bgfx.h>
|
||||
|
||||
#include <bx/handlealloc.h>
|
||||
#include <bx/thread.h>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#if BX_PLATFORM_EMSCRIPTEN
|
||||
|
||||
#include <bgfx/platform.h>
|
||||
#include <bgfx/bgfx.h>
|
||||
|
||||
#include <emscripten.h>
|
||||
#include <emscripten/html5.h>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# define HAS_METAL_SDK
|
||||
#endif
|
||||
|
||||
#include <bgfx/platform.h>
|
||||
#include <bgfx/bgfx.h>
|
||||
|
||||
#include <bx/thread.h>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include <bgfx/platform.h>
|
||||
#include <bgfx/bgfx.h>
|
||||
|
||||
#include <bx/thread.h>
|
||||
#include <bx/os.h>
|
||||
|
||||
@@ -21,7 +21,7 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wextern-c-compat")
|
||||
#include <SDL2/SDL_syswm.h>
|
||||
BX_PRAGMA_DIAGNOSTIC_POP()
|
||||
|
||||
#include <bgfx/platform.h>
|
||||
#include <bgfx/bgfx.h>
|
||||
#if defined(None) // X11 defines this...
|
||||
# undef None
|
||||
#endif // defined(None)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#if ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_WINDOWS
|
||||
|
||||
#include <bgfx/platform.h>
|
||||
#include <bgfx/bgfx.h>
|
||||
|
||||
#include <bx/mutex.h>
|
||||
#include <bx/handlealloc.h>
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef BGFX_H_HEADER_GUARD
|
||||
#define BGFX_H_HEADER_GUARD
|
||||
|
||||
#define BGFX_IDL_CPP 1
|
||||
|
||||
#include <stdarg.h> // va_list
|
||||
#include <stdint.h> // uint32_t
|
||||
#include <stdlib.h> // NULL
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
* Copyright 2011-2026 Branimir Karadzic. All rights reserved.
|
||||
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
#ifndef BGFX_PLATFORM_H_HEADER_GUARD
|
||||
#define BGFX_PLATFORM_H_HEADER_GUARD
|
||||
|
||||
// NOTICE:
|
||||
// This header file contains platform specific interfaces. It is only
|
||||
// necessary to use this header in conjunction with creating windows.
|
||||
|
||||
#include "bgfx.h"
|
||||
|
||||
#if !BGFX_IDL_CPP
|
||||
|
||||
namespace bgfx
|
||||
{
|
||||
/// Render frame enum.
|
||||
///
|
||||
/// @attention C99's equivalent binding is `bgfx_render_frame_t`.
|
||||
///
|
||||
struct RenderFrame
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
NoContext,
|
||||
Render,
|
||||
Timeout,
|
||||
Exiting,
|
||||
|
||||
Count
|
||||
};
|
||||
};
|
||||
|
||||
/// Render frame.
|
||||
///
|
||||
/// @param _msecs Timeout in milliseconds.
|
||||
///
|
||||
/// @returns Current renderer state. See: `bgfx::RenderFrame`.
|
||||
///
|
||||
/// @attention `bgfx::renderFrame` is blocking call. It waits for
|
||||
/// `bgfx::frame` to be called from API thread to process frame.
|
||||
/// If timeout value is passed call will timeout and return even
|
||||
/// if `bgfx::frame` is not called.
|
||||
///
|
||||
/// @warning This call should be only used on platforms that don't
|
||||
/// allow creating separate rendering thread. If it is called before
|
||||
/// to bgfx::init, render thread won't be created by bgfx::init call.
|
||||
///
|
||||
/// @attention C99's equivalent binding is `bgfx_render_frame`.
|
||||
///
|
||||
RenderFrame::Enum renderFrame(int32_t _msecs = -1);
|
||||
|
||||
/// Set platform data.
|
||||
///
|
||||
/// @warning Must be called before `bgfx::init`.
|
||||
///
|
||||
/// @attention C99's equivalent binding is `bgfx_set_platform_data`.
|
||||
///
|
||||
void setPlatformData(const PlatformData& _data);
|
||||
|
||||
/// Internal data.
|
||||
///
|
||||
/// @attention C99's equivalent binding is `bgfx_internal_data_t`.
|
||||
///
|
||||
struct InternalData
|
||||
{
|
||||
const struct Caps* caps; //!< Renderer capabilities.
|
||||
void* context; //!< GL context, or D3D device.
|
||||
};
|
||||
|
||||
/// Get internal data for interop.
|
||||
///
|
||||
/// @attention It's expected you understand some bgfx internals before you
|
||||
/// use this call.
|
||||
///
|
||||
/// @warning Must be called only on render thread.
|
||||
///
|
||||
/// @attention C99's equivalent binding is `bgfx_get_internal_data`.
|
||||
///
|
||||
const InternalData* getInternalData();
|
||||
|
||||
/// Override internal texture with externally created texture. Previously
|
||||
/// created internal texture will released.
|
||||
///
|
||||
/// @attention It's expected you understand some bgfx internals before you
|
||||
/// use this call.
|
||||
///
|
||||
/// @param[in] _handle Texture handle.
|
||||
/// @param[in] _ptr Native API pointer to texture.
|
||||
/// @param[in] _layerIndex Layer index for texture arrays (only implemented for D3D11).
|
||||
///
|
||||
/// @returns Native API pointer to texture. If result is 0, texture is not created yet from the
|
||||
/// main thread.
|
||||
///
|
||||
/// @warning Must be called only on render thread.
|
||||
///
|
||||
/// @attention C99's equivalent binding is `bgfx_override_internal_texture_ptr`.
|
||||
///
|
||||
uintptr_t overrideInternal(TextureHandle _handle, uintptr_t _ptr, uint16_t _layerIndex = 0);
|
||||
|
||||
/// Override internal texture by creating new texture. Previously created
|
||||
/// internal texture will released.
|
||||
///
|
||||
/// @attention It's expected you understand some bgfx internals before you
|
||||
/// use this call.
|
||||
///
|
||||
/// @param[in] _handle Texture handle.
|
||||
/// @param[in] _width Width.
|
||||
/// @param[in] _height Height.
|
||||
/// @param[in] _numMips Number of mip-maps.
|
||||
/// @param[in] _format Texture format. See: `TextureFormat::Enum`.
|
||||
/// @param[in] _flags Default texture sampling mode is linear, and wrap mode
|
||||
/// is repeat.
|
||||
/// - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
|
||||
/// mode.
|
||||
/// - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
|
||||
/// sampling.
|
||||
///
|
||||
/// @returns Native API pointer to texture. If result is 0, texture is not created yet from the
|
||||
/// main thread.
|
||||
///
|
||||
/// @warning Must be called only on render thread.
|
||||
///
|
||||
/// @attention C99's equivalent binding is `bgfx_override_internal_texture`.
|
||||
///
|
||||
uintptr_t overrideInternal(
|
||||
TextureHandle _handle
|
||||
, uint16_t _width
|
||||
, uint16_t _height
|
||||
, uint8_t _numMips
|
||||
, TextureFormat::Enum _format
|
||||
, uint64_t _flags = BGFX_TEXTURE_NONE|BGFX_SAMPLER_NONE
|
||||
);
|
||||
|
||||
} // namespace bgfx
|
||||
|
||||
#endif // BGFX_IDL_CPP
|
||||
|
||||
#endif // BGFX_PLATFORM_H_HEADER_GUARD
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef BGFX_H_HEADER_GUARD
|
||||
#define BGFX_H_HEADER_GUARD
|
||||
|
||||
#define BGFX_IDL_CPP 1
|
||||
|
||||
#include <stdarg.h> // va_list
|
||||
#include <stdint.h> // uint32_t
|
||||
#include <stdlib.h> // NULL
|
||||
|
||||
@@ -50,6 +50,8 @@ BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InternalData, bgfx_internal_data_t);
|
||||
|
||||
#undef BGFX_C99_STRUCT_SIZE_CHECK
|
||||
|
||||
#if BGFX_CONFIG_C99_API
|
||||
|
||||
$c99
|
||||
|
||||
/* user define functions */
|
||||
@@ -99,3 +101,5 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // BGFX_CONFIG_C99_API
|
||||
|
||||
@@ -50,6 +50,8 @@ BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InternalData, bgfx_internal_data_t);
|
||||
|
||||
#undef BGFX_C99_STRUCT_SIZE_CHECK
|
||||
|
||||
#if BGFX_CONFIG_C99_API
|
||||
|
||||
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 _numLayers, uint16_t _mip, uint8_t _resolve)
|
||||
{
|
||||
bgfx::Attachment* This = (bgfx::Attachment*)_this;
|
||||
@@ -1545,3 +1547,5 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // BGFX_CONFIG_C99_API
|
||||
|
||||
@@ -141,7 +141,6 @@ namespace bgfx
|
||||
#include <bx/thread.h>
|
||||
#include <bx/timer.h>
|
||||
|
||||
#include <bgfx/platform.h>
|
||||
#include <bimg/bimg.h>
|
||||
#include "shader.h"
|
||||
#include "vertexlayout.h"
|
||||
|
||||
@@ -546,4 +546,9 @@ static_assert(BGFX_CONFIG_MAX_VERTEX_STREAMS < 32, "Must be less than 32!");
|
||||
# define BGFX_CONFIG_ENCODER_API_ONLY 0
|
||||
#endif // BGFX_CONFIG_ENCODER_API_ONLY
|
||||
|
||||
/// C99 API is used for shared library and language bindings.
|
||||
#ifndef BGFX_CONFIG_C99_API
|
||||
# define BGFX_CONFIG_C99_API 1
|
||||
#endif // BGFX_CONFIG_C99_API
|
||||
|
||||
#endif // BGFX_CONFIG_H_HEADER_GUARD
|
||||
|
||||
Reference in New Issue
Block a user