mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 07:23:35 +00:00
adding sources
This commit is contained in:
@@ -12,6 +12,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "PulseProfile.h"
|
||||
|
||||
@@ -31,6 +32,14 @@ PULSE_DEFINE_NULLABLE_HANDLE(PulseFence);
|
||||
PULSE_DEFINE_NULLABLE_HANDLE(PulseImage);
|
||||
|
||||
// Flags
|
||||
typedef enum PulseBackendBits
|
||||
{
|
||||
PULSE_BACKEND_INVALID = PULSE_BIT(1),
|
||||
PULSE_BACKEND_VULKAN = PULSE_BIT(2),
|
||||
// More to come
|
||||
} PulseBackendBits;
|
||||
typedef PulseFlags PulseBackendFlags;
|
||||
|
||||
typedef enum PulseBufferUsageBits
|
||||
{
|
||||
PULSE_BUFFER_USAGE_TRANSFER_UPLOAD = PULSE_BIT(1),
|
||||
@@ -146,7 +155,6 @@ typedef enum PulseImageFormat
|
||||
} PulseImageFormat;
|
||||
|
||||
// Structs
|
||||
|
||||
typedef struct PulseBufferCreateInfo
|
||||
{
|
||||
PulseBufferUsageFlags usage;
|
||||
@@ -221,6 +229,12 @@ typedef struct PulseImageRegion
|
||||
uint32_t depth;
|
||||
} PulseImageRegion;
|
||||
|
||||
// Functions
|
||||
PULSE_API PulseDevice PulseCreateDevice(PulseBackendFlags backend_candidates, PulseShaderFormatsFlags shader_formats_used);
|
||||
PULSE_API void PulseDestroyDevice(PulseDevice device);
|
||||
PULSE_API PulseBackendBits PulseGetBackendInUseByDevice(PulseDevice device);
|
||||
PULSE_API bool PulseSupportsBackend(PulseBackendFlags backend_candidates, PulseShaderFormatsFlags shader_formats_used);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,71 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#define PULSE_COMPILER_BORDLAND
|
||||
#elif defined(__clang__)
|
||||
#define PULSE_COMPILER_CLANG
|
||||
#ifdef __MINGW32__
|
||||
#define PULSE_COMPILER_MINGW
|
||||
#ifdef __MINGW64_VERSION_MAJOR
|
||||
#define PULSE_COMPILER_MINGW_W64
|
||||
#endif
|
||||
#endif
|
||||
#elif defined(__GNUC__) || defined(__MINGW32__)
|
||||
#define PULSE_COMPILER_GCC
|
||||
#ifdef __MINGW32__
|
||||
#define PULSE_COMPILER_MINGW
|
||||
#ifdef __MINGW64_VERSION_MAJOR
|
||||
#define PULSE_COMPILER_MINGW_W64
|
||||
#endif
|
||||
#endif
|
||||
#elif defined(__INTEL_COMPILER) || defined(__ICL)
|
||||
#define PULSE_COMPILER_INTEL
|
||||
#elif defined(_MSC_VER)
|
||||
#define PULSE_COMPILER_MSVC
|
||||
#else
|
||||
#define PULSE_COMPILER_UNKNOWN
|
||||
#warning "This compiler is not fully supported"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#define PULSE_PLAT_WINDOWS
|
||||
#elif defined(__linux__)
|
||||
#define PULSE_PLAT_LINUX
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
#define PULSE_PLAT_MACOS
|
||||
#elif defined(unix) || defined(__unix__) || defined(__unix)
|
||||
#define PULSE_PLAT_UNIX
|
||||
#else
|
||||
#error "Unknown environment (not Windows, not Linux, not MacOS, not Unix)"
|
||||
#endif
|
||||
|
||||
#ifndef PULSE_STATIC
|
||||
#ifdef PULSE_PLAT_WINDOWS
|
||||
#ifdef PULSE_COMPILER_MSVC
|
||||
#ifdef PULSE_BUILD
|
||||
#define PULSE_API __declspec(dllexport)
|
||||
#else
|
||||
#define PULSE_API __declspec(dllimport)
|
||||
#endif
|
||||
#elif defined(PULSE_COMPILER_GCC)
|
||||
#ifdef PULSE_BUILD
|
||||
#define PULSE_API __attribute__((dllexport))
|
||||
#else
|
||||
#define PULSE_API __attribute__((dllimport))
|
||||
#endif
|
||||
#else
|
||||
#define PULSE_API
|
||||
#endif
|
||||
#elif defined(PULSE_COMPILER_GCC)
|
||||
#define PULSE_API __attribute__((visibility("default")))
|
||||
#else
|
||||
#define PULSE_API
|
||||
#endif
|
||||
#else
|
||||
#define PULSE_API
|
||||
#endif
|
||||
|
||||
#define PULSE_DEFINE_NULLABLE_HANDLE(object) typedef struct object##Handler* object
|
||||
|
||||
#if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L))
|
||||
|
||||
Reference in New Issue
Block a user