-
-
Save zacharycarter/59ba56a9a2831424651d1807d4a7558b to your computer and use it in GitHub Desktop.
c2nim_errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace bx { struct AllocatorI; } | |
namespace bgfx | |
{ | |
struct Fatal | |
{ | |
enum Enum | |
{ | |
DebugCheck, | |
InvalidShader, | |
UnableToInitialize, | |
UnableToCreateTexture, | |
DeviceLost, | |
Count | |
}; | |
}; | |
struct RendererType | |
{ | |
enum Enum | |
{ | |
Noop, | |
Direct3D9, | |
Direct3D11, | |
Direct3D12, | |
Gnm, | |
Metal, | |
OpenGLES, | |
OpenGL, | |
Vulkan, | |
Count | |
}; | |
}; | |
struct Access | |
{ | |
enum Enum | |
{ | |
Read, | |
Write, | |
ReadWrite, | |
Count | |
}; | |
}; | |
struct Attrib | |
{ | |
enum Enum | |
{ | |
Position, | |
Normal, | |
Tangent, | |
Bitangent, | |
Color0, | |
Color1, | |
Color2, | |
Color3, | |
Indices, | |
Weight, | |
TexCoord0, | |
TexCoord1, | |
TexCoord2, | |
TexCoord3, | |
TexCoord4, | |
TexCoord5, | |
TexCoord6, | |
TexCoord7, | |
Count | |
}; | |
}; | |
struct AttribType | |
{ | |
enum Enum | |
{ | |
Uint8, | |
Uint10, | |
Int16, | |
Half, | |
Float, | |
Count | |
}; | |
}; | |
struct TextureFormat | |
{ | |
enum Enum | |
{ | |
BC1, | |
BC2, | |
BC3, | |
BC4, | |
BC5, | |
BC6H, | |
BC7, | |
ETC1, | |
ETC2, | |
ETC2A, | |
ETC2A1, | |
PTC12, | |
PTC14, | |
PTC12A, | |
PTC14A, | |
PTC22, | |
PTC24, | |
ATC, | |
ATCE, | |
ATCI, | |
ASTC4x4, | |
ASTC5x5, | |
ASTC6x6, | |
ASTC8x5, | |
ASTC8x6, | |
ASTC10x5, | |
Unknown, | |
R1, | |
A8, | |
R8, | |
R8I, | |
R8U, | |
R8S, | |
R16, | |
R16I, | |
R16U, | |
R16F, | |
R16S, | |
R32I, | |
R32U, | |
R32F, | |
RG8, | |
RG8I, | |
RG8U, | |
RG8S, | |
RG16, | |
RG16I, | |
RG16U, | |
RG16F, | |
RG16S, | |
RG32I, | |
RG32U, | |
RG32F, | |
RGB8, | |
RGB8I, | |
RGB8U, | |
RGB8S, | |
RGB9E5F, | |
BGRA8, | |
RGBA8, | |
RGBA8I, | |
RGBA8U, | |
RGBA8S, | |
RGBA16, | |
RGBA16I, | |
RGBA16U, | |
RGBA16F, | |
RGBA16S, | |
RGBA32I, | |
RGBA32U, | |
RGBA32F, | |
R5G6B5, | |
RGBA4, | |
RGB5A1, | |
RGB10A2, | |
RG11B10F, | |
UnknownDepth, | |
D16, | |
D24, | |
D24S8, | |
D32, | |
D16F, | |
D24F, | |
D32F, | |
D0S8, | |
Count | |
}; | |
}; | |
struct UniformType | |
{ | |
enum Enum | |
{ | |
Int1, | |
End, | |
Vec4, | |
Mat3, | |
Mat4, | |
Count | |
}; | |
}; | |
struct BackbufferRatio | |
{ | |
enum Enum | |
{ | |
Equal, | |
Half, | |
Quarter, | |
Eighth, | |
Sixteenth, | |
Double, | |
Count | |
}; | |
}; | |
struct OcclusionQueryResult | |
{ | |
enum Enum | |
{ | |
Invisible, | |
Visible, | |
NoResult, | |
Count | |
}; | |
}; | |
struct Topology | |
{ | |
enum Enum | |
{ | |
TriList, | |
TriStrip, | |
LineList, | |
LineStrip, | |
PointList, | |
Count | |
}; | |
}; | |
struct TopologyConvert | |
{ | |
enum Enum | |
{ | |
TriListFlipWinding, | |
TriStripFlipWinding, | |
TriListToLineList, | |
TriStripToTriList, | |
LineStripToLineList, | |
Count | |
}; | |
}; | |
struct TopologySort | |
{ | |
enum Enum | |
{ | |
DirectionFrontToBackMin, | |
DirectionFrontToBackAvg, | |
DirectionFrontToBackMax, | |
DirectionBackToFrontMin, | |
DirectionBackToFrontAvg, | |
DirectionBackToFrontMax, | |
DistanceFrontToBackMin, | |
DistanceFrontToBackAvg, | |
DistanceFrontToBackMax, | |
DistanceBackToFrontMin, | |
DistanceBackToFrontAvg, | |
DistanceBackToFrontMax, | |
Count | |
}; | |
}; | |
struct ViewMode | |
{ | |
enum Enum | |
{ | |
Default, | |
Sequential, | |
DepthAscending, | |
DepthDescending, | |
Count | |
}; | |
}; | |
static const uint16_t kInvalidHandle = 65535; | |
struct DynamicIndexBufferHandle { uint16_t idx; }; inline bool isValid(DynamicIndexBufferHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct DynamicVertexBufferHandle { uint16_t idx; }; inline bool isValid(DynamicVertexBufferHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct FrameBufferHandle { uint16_t idx; }; inline bool isValid(FrameBufferHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct IndexBufferHandle { uint16_t idx; }; inline bool isValid(IndexBufferHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct IndirectBufferHandle { uint16_t idx; }; inline bool isValid(IndirectBufferHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct OcclusionQueryHandle { uint16_t idx; }; inline bool isValid(OcclusionQueryHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct ProgramHandle { uint16_t idx; }; inline bool isValid(ProgramHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct ShaderHandle { uint16_t idx; }; inline bool isValid(ShaderHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct TextureHandle { uint16_t idx; }; inline bool isValid(TextureHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct UniformHandle { uint16_t idx; }; inline bool isValid(UniformHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct VertexBufferHandle { uint16_t idx; }; inline bool isValid(VertexBufferHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct VertexDeclHandle { uint16_t idx; }; inline bool isValid(VertexDeclHandle _handle) { return bgfx::kInvalidHandle != _handle.idx; } | |
struct CallbackI | |
{ | |
virtual ~CallbackI(); | |
virtual void fatal( | |
const char* _filePath | |
, uint16_t _line | |
, Fatal::Enum _code | |
, const char* _str | |
); | |
virtual void traceVargs( | |
const char* _filePath | |
, uint16_t _line | |
, const char* _format | |
, va_list _argList | |
); | |
virtual void profilerBegin( | |
const char* _name | |
, uint32_t _abgr | |
, const char* _filePath | |
, uint16_t _line | |
); | |
virtual void profilerBeginLiteral( | |
const char* _name | |
, uint32_t _abgr | |
, const char* _filePath | |
, uint16_t _line | |
); | |
virtual void profilerEnd(); | |
virtual uint32_t cacheReadSize(uint64_t _id); | |
virtual bool cacheRead(uint64_t _id, void* _data, uint32_t _size); | |
virtual void cacheWrite(uint64_t _id, const void* _data, uint32_t _size); | |
virtual void screenShot( | |
const char* _filePath | |
, uint32_t _width | |
, uint32_t _height | |
, uint32_t _pitch | |
, const void* _data | |
, uint32_t _size | |
, bool _yflip | |
); | |
virtual void captureBegin( | |
uint32_t _width | |
, uint32_t _height | |
, uint32_t _pitch | |
, TextureFormat::Enum _format | |
, bool _yflip | |
); | |
virtual void captureEnd(); | |
virtual void captureFrame(const void* _data, uint32_t _size); | |
}; | |
// inline CallbackI::~CallbackI() | |
// { | |
// } | |
struct PlatformData | |
{ | |
PlatformData(); | |
void* ndt; | |
void* nwh; | |
void* context; | |
void* backBuffer; | |
void* backBufferDS; | |
}; | |
struct Resolution | |
{ | |
Resolution(); | |
TextureFormat::Enum format; | |
uint32_t width; | |
uint32_t height; | |
uint32_t reset; | |
uint8_t numBackBuffers; | |
uint8_t maxFrameLatency; | |
}; | |
struct Init | |
{ | |
Init(); | |
RendererType::Enum type; | |
uint16_t vendorId; | |
uint16_t deviceId; | |
bool debug; | |
bool profile; | |
PlatformData platformData; | |
Resolution resolution; | |
struct Limits | |
{ | |
uint16_t maxEncoders; | |
uint32_t transientVbSize; | |
uint32_t transientIbSize; | |
}; | |
Limits limits; | |
CallbackI* callback; | |
bx::AllocatorI* allocator; | |
}; | |
typedef void (*ReleaseFn)(void* _ptr, void* _userData); | |
struct Memory | |
{ | |
uint8_t* data; | |
uint32_t size; | |
}; | |
struct Caps | |
{ | |
RendererType::Enum rendererType; | |
uint64_t supported; | |
uint16_t vendorId; | |
uint16_t deviceId; | |
bool homogeneousDepth; | |
bool originBottomLeft; | |
uint8_t numGPUs; | |
struct GPU | |
{ | |
uint16_t vendorId; | |
uint16_t deviceId; | |
}; | |
GPU gpu[4]; | |
struct Limits | |
{ | |
uint32_t maxDrawCalls; | |
uint32_t maxBlits; | |
uint32_t maxTextureSize; | |
uint32_t maxTextureLayers; | |
uint32_t maxViews; | |
uint32_t maxFrameBuffers; | |
uint32_t maxFBAttachments; | |
uint32_t maxPrograms; | |
uint32_t maxShaders; | |
uint32_t maxTextures; | |
uint32_t maxTextureSamplers; | |
uint32_t maxComputeBindings; | |
uint32_t maxVertexDecls; | |
uint32_t maxVertexStreams; | |
uint32_t maxIndexBuffers; | |
uint32_t maxVertexBuffers; | |
uint32_t maxDynamicIndexBuffers; | |
uint32_t maxDynamicVertexBuffers; | |
uint32_t maxUniforms; | |
uint32_t maxOcclusionQueries; | |
uint32_t maxEncoders; | |
uint32_t transientVbSize; | |
uint32_t transientIbSize; | |
}; | |
Limits limits; | |
uint16_t formats[TextureFormat::Count]; | |
}; | |
struct TransientIndexBuffer | |
{ | |
uint8_t* data; | |
uint32_t size; | |
uint32_t startIndex; | |
IndexBufferHandle handle; | |
}; | |
struct TransientVertexBuffer | |
{ | |
uint8_t* data; | |
uint32_t size; | |
uint32_t startVertex; | |
uint16_t stride; | |
VertexBufferHandle handle; | |
VertexDeclHandle decl; | |
}; | |
struct InstanceDataBuffer | |
{ | |
uint8_t* data; | |
uint32_t size; | |
uint32_t offset; | |
uint32_t num; | |
uint16_t stride; | |
VertexBufferHandle handle; | |
}; | |
struct TextureInfo | |
{ | |
TextureFormat::Enum format; | |
uint32_t storageSize; | |
uint16_t width; | |
uint16_t height; | |
uint16_t depth; | |
uint16_t numLayers; | |
uint8_t numMips; | |
uint8_t bitsPerPixel; | |
bool cubeMap; | |
}; | |
struct UniformInfo | |
{ | |
char name[256]; | |
UniformType::Enum type; | |
uint16_t num; | |
}; | |
struct Attachment | |
{ | |
void init(TextureHandle _handle, Access::Enum _access = Access::Write, uint16_t _layer = 0, uint16_t _mip = 0, uint8_t _resolve = (0x01)); | |
Access::Enum access; | |
TextureHandle handle; | |
uint16_t mip; | |
uint16_t layer; | |
uint8_t resolve; | |
}; | |
struct Transform | |
{ | |
float* data; | |
uint16_t num; | |
}; | |
typedef uint16_t ViewId; | |
struct ViewStats | |
{ | |
char name[256]; | |
ViewId view; | |
int64_t cpuTimeElapsed; | |
int64_t gpuTimeElapsed; | |
}; | |
struct EncoderStats | |
{ | |
int64_t cpuTimeBegin; | |
int64_t cpuTimeEnd; | |
}; | |
struct Stats | |
{ | |
int64_t cpuTimeFrame; | |
int64_t cpuTimeBegin; | |
int64_t cpuTimeEnd; | |
int64_t cpuTimerFreq; | |
int64_t gpuTimeBegin; | |
int64_t gpuTimeEnd; | |
int64_t gpuTimerFreq; | |
int64_t waitRender; | |
int64_t waitSubmit; | |
uint32_t numDraw; | |
uint32_t numCompute; | |
uint32_t numBlit; | |
uint32_t maxGpuLatency; | |
uint16_t numDynamicIndexBuffers; | |
uint16_t numDynamicVertexBuffers; | |
uint16_t numFrameBuffers; | |
uint16_t numIndexBuffers; | |
uint16_t numOcclusionQueries; | |
uint16_t numPrograms; | |
uint16_t numShaders; | |
uint16_t numTextures; | |
uint16_t numUniforms; | |
uint16_t numVertexBuffers; | |
uint16_t numVertexDecls; | |
int64_t textureMemoryUsed; | |
int64_t rtMemoryUsed; | |
int32_t transientVbUsed; | |
int32_t transientIbUsed; | |
uint32_t numPrims[Topology::Count]; | |
int64_t gpuMemoryMax; | |
int64_t gpuMemoryUsed; | |
uint16_t width; | |
uint16_t height; | |
uint16_t textWidth; | |
uint16_t textHeight; | |
uint16_t numViews; | |
ViewStats* viewStats; | |
uint8_t numEncoders; | |
EncoderStats* encoderStats; | |
}; | |
struct Encoder | |
{ | |
void setMarker(const char* _marker); | |
void setState( | |
uint64_t _state | |
, uint32_t _rgba = 0 | |
); | |
void setCondition( | |
OcclusionQueryHandle _handle | |
, bool _visible | |
); | |
void setStencil( | |
uint32_t _fstencil | |
, uint32_t _bstencil = (0x00000000U) | |
); | |
uint16_t setScissor( | |
uint16_t _x | |
, uint16_t _y | |
, uint16_t _width | |
, uint16_t _height | |
); | |
void setScissor(uint16_t _cache = 65535); | |
uint32_t setTransform( | |
const void* _mtx | |
, uint16_t _num = 1 | |
); | |
uint32_t allocTransform( | |
Transform* _transform | |
, uint16_t _num | |
); | |
void setTransform( | |
uint32_t _cache | |
, uint16_t _num = 1 | |
); | |
void setUniform( | |
UniformHandle _handle | |
, const void* _value | |
, uint16_t _num = 1 | |
); | |
void setIndexBuffer(IndexBufferHandle _handle); | |
void setIndexBuffer( | |
IndexBufferHandle _handle | |
, uint32_t _firstIndex | |
, uint32_t _numIndices | |
); | |
void setIndexBuffer(DynamicIndexBufferHandle _handle); | |
void setIndexBuffer( | |
DynamicIndexBufferHandle _handle | |
, uint32_t _firstIndex | |
, uint32_t _numIndices | |
); | |
void setIndexBuffer(const TransientIndexBuffer* _tib); | |
void setIndexBuffer( | |
const TransientIndexBuffer* _tib | |
, uint32_t _firstIndex | |
, uint32_t _numIndices | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, VertexBufferHandle _handle | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, VertexBufferHandle _handle | |
, uint32_t _startVertex | |
, uint32_t _numVertices | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, DynamicVertexBufferHandle _handle | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, DynamicVertexBufferHandle _handle | |
, uint32_t _startVertex | |
, uint32_t _numVertices | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, const TransientVertexBuffer* _tvb | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, const TransientVertexBuffer* _tvb | |
, uint32_t _startVertex | |
, uint32_t _numVertices | |
); | |
void setVertexCount(uint32_t _numVertices); | |
void setInstanceDataBuffer(const InstanceDataBuffer* _idb); | |
void setInstanceDataBuffer( | |
const InstanceDataBuffer* _idb | |
, uint32_t _start | |
, uint32_t _num | |
); | |
void setInstanceDataBuffer( | |
VertexBufferHandle _handle | |
, uint32_t _start | |
, uint32_t _num | |
); | |
void setInstanceDataBuffer( | |
DynamicVertexBufferHandle _handle | |
, uint32_t _start | |
, uint32_t _num | |
); | |
void setInstanceCount(uint32_t _numInstances); | |
void setTexture( | |
uint8_t _stage | |
, UniformHandle _sampler | |
, TextureHandle _handle | |
, uint32_t _flags = 4294967295U | |
); | |
void touch(ViewId _id); | |
void submit( | |
ViewId _id | |
, ProgramHandle _program | |
, uint32_t _depth = 0 | |
, bool _preserveState = false | |
); | |
void submit( | |
ViewId _id | |
, ProgramHandle _program | |
, OcclusionQueryHandle _occlusionQuery | |
, uint32_t _depth = 0 | |
, bool _preserveState = false | |
); | |
void submit( | |
ViewId _id | |
, ProgramHandle _program | |
, IndirectBufferHandle _indirectHandle | |
, uint16_t _start = 0 | |
, uint16_t _num = 1 | |
, uint32_t _depth = 0 | |
, bool _preserveState = false | |
); | |
void setBuffer( | |
uint8_t _stage | |
, IndexBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setBuffer( | |
uint8_t _stage | |
, VertexBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setBuffer( | |
uint8_t _stage | |
, DynamicIndexBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setBuffer( | |
uint8_t _stage | |
, DynamicVertexBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setBuffer( | |
uint8_t _stage | |
, IndirectBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setImage( | |
uint8_t _stage | |
, TextureHandle _handle | |
, uint8_t _mip | |
, Access::Enum _access | |
, TextureFormat::Enum _format = TextureFormat::Count | |
); | |
void dispatch( | |
ViewId _id | |
, ProgramHandle _handle | |
, uint32_t _numX = 1 | |
, uint32_t _numY = 1 | |
, uint32_t _numZ = 1 | |
, uint8_t _flags = (0x01) | |
); | |
void dispatch( | |
ViewId _id | |
, ProgramHandle _handle | |
, IndirectBufferHandle _indirectHandle | |
, uint16_t _start = 0 | |
, uint16_t _num = 1 | |
, uint8_t _flags = (0x01) | |
); | |
void discard(); | |
void blit( | |
ViewId _id | |
, TextureHandle _dst | |
, uint16_t _dstX | |
, uint16_t _dstY | |
, TextureHandle _src | |
, uint16_t _srcX = 0 | |
, uint16_t _srcY = 0 | |
, uint16_t _width = 65535 | |
, uint16_t _height = 65535 | |
); | |
void blit( | |
ViewId _id | |
, TextureHandle _dst | |
, uint8_t _dstMip | |
, uint16_t _dstX | |
, uint16_t _dstY | |
, uint16_t _dstZ | |
, TextureHandle _src | |
, uint8_t _srcMip = 0 | |
, uint16_t _srcX = 0 | |
, uint16_t _srcY = 0 | |
, uint16_t _srcZ = 0 | |
, uint16_t _width = 65535 | |
, uint16_t _height = 65535 | |
, uint16_t _depth = 65535 | |
); | |
}; | |
struct VertexDecl | |
{ | |
VertexDecl(); | |
VertexDecl& begin(RendererType::Enum _renderer = RendererType::Noop); | |
void end(); | |
VertexDecl& add( | |
Attrib::Enum _attrib | |
, uint8_t _num | |
, AttribType::Enum _type | |
, bool _normalized = false | |
, bool _asInt = false | |
); | |
VertexDecl& skip(uint8_t _num); | |
void decode( | |
Attrib::Enum _attrib | |
, uint8_t& _num | |
, AttribType::Enum& _type | |
, bool& _normalized | |
, bool& _asInt | |
) const; | |
bool has(Attrib::Enum _attrib) const { return 65535 != m_attributes[_attrib]; } | |
uint16_t getOffset(Attrib::Enum _attrib) const { return m_offset[_attrib]; } | |
uint16_t getStride() const { return m_stride; } | |
uint32_t getSize(uint32_t _num) const { return _num*m_stride; } | |
uint32_t m_hash; | |
uint16_t m_stride; | |
uint16_t m_offset[Attrib::Count]; | |
uint16_t m_attributes[Attrib::Count]; | |
}; | |
void vertexPack( | |
const float _input[4] | |
, bool _inputNormalized | |
, Attrib::Enum _attr | |
, const VertexDecl& _decl | |
, void* _data | |
, uint32_t _index = 0 | |
); | |
void vertexUnpack( | |
float _output[4] | |
, Attrib::Enum _attr | |
, const VertexDecl& _decl | |
, const void* _data | |
, uint32_t _index = 0 | |
); | |
void vertexConvert( | |
const VertexDecl& _destDecl | |
, void* _destData | |
, const VertexDecl& _srcDecl | |
, const void* _srcData | |
, uint32_t _num = 1 | |
); | |
uint16_t weldVertices( | |
uint16_t* _output | |
, const VertexDecl& _decl | |
, const void* _data | |
, uint16_t _num | |
, float _epsilon = 0.001f | |
); | |
uint32_t topologyConvert( | |
TopologyConvert::Enum _conversion | |
, void* _dst | |
, uint32_t _dstSize | |
, const void* _indices | |
, uint32_t _numIndices | |
, bool _index32 | |
); | |
void topologySortTriList( | |
TopologySort::Enum _sort | |
, void* _dst | |
, uint32_t _dstSize | |
, const float _dir[3] | |
, const float _pos[3] | |
, const void* _vertices | |
, uint32_t _stride | |
, const void* _indices | |
, uint32_t _numIndices | |
, bool _index32 | |
); | |
uint8_t getSupportedRenderers( | |
uint8_t _max = 0 | |
, RendererType::Enum* _enum = __null | |
); | |
const char* getRendererName(RendererType::Enum _type); | |
// bool init(const Init& _init = {}); | |
void shutdown(); | |
void reset( | |
uint32_t _width | |
, uint32_t _height | |
, uint32_t _flags = (0x00000000U) | |
, TextureFormat::Enum _format = TextureFormat::Count | |
); | |
Encoder* begin(bool _forThread = false); | |
void end(Encoder* _encoder); | |
uint32_t frame(bool _capture = false); | |
// RendererType::Enum getRendererType(); | |
const Caps* getCaps(); | |
const Stats* getStats(); | |
const Memory* alloc(uint32_t _size); | |
const Memory* copy( | |
const void* _data | |
, uint32_t _size | |
); | |
const Memory* makeRef( | |
const void* _data | |
, uint32_t _size | |
, ReleaseFn _releaseFn = __null | |
, void* _userData = __null | |
); | |
void setDebug(uint32_t _debug); | |
void dbgTextClear( | |
uint8_t _attr = 0 | |
, bool _small = false | |
); | |
void dbgTextPrintf( | |
uint16_t _x | |
, uint16_t _y | |
, uint8_t _attr | |
, const char* _format | |
, ... | |
); | |
void dbgTextPrintfVargs( | |
uint16_t _x | |
, uint16_t _y | |
, uint8_t _attr | |
, const char* _format | |
, va_list _argList | |
); | |
void dbgTextImage( | |
uint16_t _x | |
, uint16_t _y | |
, uint16_t _width | |
, uint16_t _height | |
, const void* _data | |
, uint16_t _pitch | |
); | |
IndexBufferHandle createIndexBuffer( | |
const Memory* _mem | |
, uint16_t _flags = (0x0000) | |
); | |
void destroy(IndexBufferHandle _handle); | |
VertexBufferHandle createVertexBuffer( | |
const Memory* _mem | |
, const VertexDecl& _decl | |
, uint16_t _flags = (0x0000) | |
); | |
void destroy(VertexBufferHandle _handle); | |
DynamicIndexBufferHandle createDynamicIndexBuffer( | |
uint32_t _num | |
, uint16_t _flags = (0x0000) | |
); | |
DynamicIndexBufferHandle createDynamicIndexBuffer( | |
const Memory* _mem | |
, uint16_t _flags = (0x0000) | |
); | |
void update( | |
DynamicIndexBufferHandle _handle | |
, uint32_t _startIndex | |
, const Memory* _mem | |
); | |
void destroy(DynamicIndexBufferHandle _handle); | |
DynamicVertexBufferHandle createDynamicVertexBuffer( | |
uint32_t _num | |
, const VertexDecl& _decl | |
, uint16_t _flags = (0x0000) | |
); | |
DynamicVertexBufferHandle createDynamicVertexBuffer( | |
const Memory* _mem | |
, const VertexDecl& _decl | |
, uint16_t _flags = (0x0000) | |
); | |
void update( | |
DynamicVertexBufferHandle _handle | |
, uint32_t _startVertex | |
, const Memory* _mem | |
); | |
void destroy(DynamicVertexBufferHandle _handle); | |
uint32_t getAvailTransientIndexBuffer(uint32_t _num); | |
uint32_t getAvailTransientVertexBuffer( | |
uint32_t _num | |
, const VertexDecl& _decl | |
); | |
uint32_t getAvailInstanceDataBuffer( | |
uint32_t _num | |
, uint16_t _stride | |
); | |
void allocTransientIndexBuffer( | |
TransientIndexBuffer* _tib | |
, uint32_t _num | |
); | |
void allocTransientVertexBuffer( | |
TransientVertexBuffer* _tvb | |
, uint32_t _num | |
, const VertexDecl& _decl | |
); | |
bool allocTransientBuffers( | |
TransientVertexBuffer* _tvb | |
, const VertexDecl& _decl | |
, uint32_t _numVertices | |
, TransientIndexBuffer* _tib | |
, uint32_t _numIndices | |
); | |
void allocInstanceDataBuffer( | |
InstanceDataBuffer* _idb | |
, uint32_t _num | |
, uint16_t _stride | |
); | |
IndirectBufferHandle createIndirectBuffer(uint32_t _num); | |
void destroy(IndirectBufferHandle _handle); | |
ShaderHandle createShader(const Memory* _mem); | |
uint16_t getShaderUniforms( | |
ShaderHandle _handle | |
, UniformHandle* _uniforms = __null | |
, uint16_t _max = 0 | |
); | |
void setName( | |
ShaderHandle _handle | |
, const char* _name | |
, int32_t _len = 2147483647 | |
); | |
void destroy(ShaderHandle _handle); | |
ProgramHandle createProgram( | |
ShaderHandle _vsh | |
, ShaderHandle _fsh | |
, bool _destroyShaders = false | |
); | |
ProgramHandle createProgram( | |
ShaderHandle _csh | |
, bool _destroyShader = false | |
); | |
void destroy(ProgramHandle _handle); | |
bool isTextureValid( | |
uint16_t _depth | |
, bool _cubeMap | |
, uint16_t _numLayers | |
, TextureFormat::Enum _format | |
, uint64_t _flags | |
); | |
void calcTextureSize( | |
TextureInfo& _info | |
, uint16_t _width | |
, uint16_t _height | |
, uint16_t _depth | |
, bool _cubeMap | |
, bool _hasMips | |
, uint16_t _numLayers | |
, TextureFormat::Enum _format | |
); | |
TextureHandle createTexture( | |
const Memory* _mem | |
, uint64_t _flags = (0x0000000000000000ULL)|(0x00000000U) | |
, uint8_t _skip = 0 | |
, TextureInfo* _info = __null | |
); | |
TextureHandle createTexture2D( | |
uint16_t _width | |
, uint16_t _height | |
, bool _hasMips | |
, uint16_t _numLayers | |
, TextureFormat::Enum _format | |
, uint64_t _flags = (0x0000000000000000ULL)|(0x00000000U) | |
, const Memory* _mem = __null | |
); | |
TextureHandle createTexture2D( | |
BackbufferRatio::Enum _ratio | |
, bool _hasMips | |
, uint16_t _numLayers | |
, TextureFormat::Enum _format | |
, uint64_t _flags = (0x0000000000000000ULL)|(0x00000000U) | |
); | |
TextureHandle createTexture3D( | |
uint16_t _width | |
, uint16_t _height | |
, uint16_t _depth | |
, bool _hasMips | |
, TextureFormat::Enum _format | |
, uint64_t _flags = (0x0000000000000000ULL)|(0x00000000U) | |
, const Memory* _mem = __null | |
); | |
TextureHandle createTextureCube( | |
uint16_t _size | |
, bool _hasMips | |
, uint16_t _numLayers | |
, TextureFormat::Enum _format | |
, uint64_t _flags = (0x0000000000000000ULL)|(0x00000000U) | |
, const Memory* _mem = __null | |
); | |
void updateTexture2D( | |
TextureHandle _handle | |
, uint16_t _layer | |
, uint8_t _mip | |
, uint16_t _x | |
, uint16_t _y | |
, uint16_t _width | |
, uint16_t _height | |
, const Memory* _mem | |
, uint16_t _pitch = 65535 | |
); | |
void updateTexture3D( | |
TextureHandle _handle | |
, uint8_t _mip | |
, uint16_t _x | |
, uint16_t _y | |
, uint16_t _z | |
, uint16_t _width | |
, uint16_t _height | |
, uint16_t _depth | |
, const Memory* _mem | |
); | |
void updateTextureCube( | |
TextureHandle _handle | |
, uint16_t _layer | |
, uint8_t _side | |
, uint8_t _mip | |
, uint16_t _x | |
, uint16_t _y | |
, uint16_t _width | |
, uint16_t _height | |
, const Memory* _mem | |
, uint16_t _pitch = 65535 | |
); | |
uint32_t readTexture( | |
TextureHandle _handle | |
, void* _data | |
, uint8_t _mip = 0 | |
); | |
void setName( | |
TextureHandle _handle | |
, const char* _name | |
, int32_t _len = 2147483647 | |
); | |
void* getDirectAccessPtr(TextureHandle _handle); | |
void destroy(TextureHandle _handle); | |
FrameBufferHandle createFrameBuffer( | |
uint16_t _width | |
, uint16_t _height | |
, TextureFormat::Enum _format | |
, uint64_t _textureFlags = (0x00000002U)|(0x00000008U) | |
); | |
FrameBufferHandle createFrameBuffer( | |
BackbufferRatio::Enum _ratio | |
, TextureFormat::Enum _format | |
, uint64_t _textureFlags = (0x00000002U)|(0x00000008U) | |
); | |
FrameBufferHandle createFrameBuffer( | |
uint8_t _num | |
, const TextureHandle* _handles | |
, bool _destroyTextures = false | |
); | |
FrameBufferHandle createFrameBuffer( | |
uint8_t _num | |
, const Attachment* _attachment | |
, bool _destroyTextures = false | |
); | |
FrameBufferHandle createFrameBuffer( | |
void* _nwh | |
, uint16_t _width | |
, uint16_t _height | |
, TextureFormat::Enum _format = TextureFormat::Count | |
, TextureFormat::Enum _depthFormat = TextureFormat::Count | |
); | |
TextureHandle getTexture( | |
FrameBufferHandle _handle | |
, uint8_t _attachment = 0 | |
); | |
void destroy(FrameBufferHandle _handle); | |
UniformHandle createUniform( | |
const char* _name | |
, UniformType::Enum _type | |
, uint16_t _num = 1 | |
); | |
void getUniformInfo( | |
UniformHandle _handle | |
, UniformInfo& _info | |
); | |
void destroy(UniformHandle _handle); | |
OcclusionQueryHandle createOcclusionQuery(); | |
// OcclusionQueryResult::Enum getResult( | |
// OcclusionQueryHandle _handle | |
// , int32_t* _result = __null | |
// ); | |
void destroy(OcclusionQueryHandle _handle); | |
void setPaletteColor( | |
uint8_t _index | |
, uint32_t _rgba | |
); | |
void setPaletteColor( | |
uint8_t _index | |
, float _r | |
, float _g | |
, float _b | |
, float _a | |
); | |
void setPaletteColor( | |
uint8_t _index | |
, const float _rgba[4] | |
); | |
void setViewName( | |
ViewId _id | |
, const char* _name | |
); | |
void setViewRect( | |
ViewId _id | |
, uint16_t _x | |
, uint16_t _y | |
, uint16_t _width | |
, uint16_t _height | |
); | |
void setViewRect( | |
ViewId _id | |
, uint16_t _x | |
, uint16_t _y | |
, BackbufferRatio::Enum _ratio | |
); | |
void setViewScissor( | |
ViewId _id | |
, uint16_t _x = 0 | |
, uint16_t _y = 0 | |
, uint16_t _width = 0 | |
, uint16_t _height = 0 | |
); | |
void setViewClear( | |
ViewId _id | |
, uint16_t _flags | |
, uint32_t _rgba = 0x000000ff | |
, float _depth = 1.0f | |
, uint8_t _stencil = 0 | |
); | |
void setViewClear( | |
ViewId _id | |
, uint16_t _flags | |
, float _depth | |
, uint8_t _stencil | |
, uint8_t _0 = 255 | |
, uint8_t _1 = 255 | |
, uint8_t _2 = 255 | |
, uint8_t _3 = 255 | |
, uint8_t _4 = 255 | |
, uint8_t _5 = 255 | |
, uint8_t _6 = 255 | |
, uint8_t _7 = 255 | |
); | |
void setViewMode( | |
ViewId _id | |
, ViewMode::Enum _mode = ViewMode::Default | |
); | |
void setViewFrameBuffer( | |
ViewId _id | |
, FrameBufferHandle _handle | |
); | |
void setViewTransform( | |
ViewId _id | |
, const void* _view | |
, const void* _projL | |
, uint8_t _flags = (0x01) | |
, const void* _projR = __null | |
); | |
void setViewOrder( | |
ViewId _id = 0 | |
, uint16_t _num = 65535 | |
, const ViewId* _remap = __null | |
); | |
void resetView(ViewId _id); | |
void setMarker(const char* _marker); | |
void setState( | |
uint64_t _state | |
, uint32_t _rgba = 0 | |
); | |
void setCondition( | |
OcclusionQueryHandle _handle | |
, bool _visible | |
); | |
void setStencil( | |
uint32_t _fstencil | |
, uint32_t _bstencil = (0x00000000U) | |
); | |
uint16_t setScissor( | |
uint16_t _x | |
, uint16_t _y | |
, uint16_t _width | |
, uint16_t _height | |
); | |
void setScissor(uint16_t _cache = 65535); | |
uint32_t setTransform( | |
const void* _mtx | |
, uint16_t _num = 1 | |
); | |
uint32_t allocTransform( | |
Transform* _transform | |
, uint16_t _num | |
); | |
void setTransform( | |
uint32_t _cache | |
, uint16_t _num = 1 | |
); | |
void setUniform( | |
UniformHandle _handle | |
, const void* _value | |
, uint16_t _num = 1 | |
); | |
void setIndexBuffer(IndexBufferHandle _handle); | |
void setIndexBuffer( | |
IndexBufferHandle _handle | |
, uint32_t _firstIndex | |
, uint32_t _numIndices | |
); | |
void setIndexBuffer(DynamicIndexBufferHandle _handle); | |
void setIndexBuffer( | |
DynamicIndexBufferHandle _handle | |
, uint32_t _firstIndex | |
, uint32_t _numIndices | |
); | |
void setIndexBuffer(const TransientIndexBuffer* _tib); | |
void setIndexBuffer( | |
const TransientIndexBuffer* _tib | |
, uint32_t _firstIndex | |
, uint32_t _numIndices | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, VertexBufferHandle _handle | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, VertexBufferHandle _handle | |
, uint32_t _startVertex | |
, uint32_t _numVertices | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, DynamicVertexBufferHandle _handle | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, DynamicVertexBufferHandle _handle | |
, uint32_t _startVertex | |
, uint32_t _numVertices | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, const TransientVertexBuffer* _tvb | |
); | |
void setVertexBuffer( | |
uint8_t _stream | |
, const TransientVertexBuffer* _tvb | |
, uint32_t _startVertex | |
, uint32_t _numVertices | |
); | |
void setVertexCount(uint32_t _numVertices); | |
void setInstanceDataBuffer(const InstanceDataBuffer* _idb); | |
void setInstanceDataBuffer( | |
const InstanceDataBuffer* _idb | |
, uint32_t _start | |
, uint32_t _num | |
); | |
void setInstanceDataBuffer( | |
VertexBufferHandle _handle | |
, uint32_t _start | |
, uint32_t _num | |
); | |
void setInstanceDataBuffer( | |
DynamicVertexBufferHandle _handle | |
, uint32_t _start | |
, uint32_t _num | |
); | |
void setInstanceCount(uint32_t _numInstances); | |
void setTexture( | |
uint8_t _stage | |
, UniformHandle _sampler | |
, TextureHandle _handle | |
, uint32_t _flags = 4294967295U | |
); | |
void touch(ViewId _id); | |
void submit( | |
ViewId _id | |
, ProgramHandle _program | |
, uint32_t _depth = 0 | |
, bool _preserveState = false | |
); | |
void submit( | |
ViewId _id | |
, ProgramHandle _program | |
, OcclusionQueryHandle _occlusionQuery | |
, uint32_t _depth = 0 | |
, bool _preserveState = false | |
); | |
void submit( | |
ViewId _id | |
, ProgramHandle _program | |
, IndirectBufferHandle _indirectHandle | |
, uint16_t _start = 0 | |
, uint16_t _num = 1 | |
, uint32_t _depth = 0 | |
, bool _preserveState = false | |
); | |
void setBuffer( | |
uint8_t _stage | |
, IndexBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setBuffer( | |
uint8_t _stage | |
, VertexBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setBuffer( | |
uint8_t _stage | |
, DynamicIndexBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setBuffer( | |
uint8_t _stage | |
, DynamicVertexBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setBuffer( | |
uint8_t _stage | |
, IndirectBufferHandle _handle | |
, Access::Enum _access | |
); | |
void setImage( | |
uint8_t _stage | |
, TextureHandle _handle | |
, uint8_t _mip | |
, Access::Enum _access | |
, TextureFormat::Enum _format = TextureFormat::Count | |
); | |
void dispatch( | |
ViewId _id | |
, ProgramHandle _handle | |
, uint32_t _numX = 1 | |
, uint32_t _numY = 1 | |
, uint32_t _numZ = 1 | |
, uint8_t _flags = (0x01) | |
); | |
void dispatch( | |
ViewId _id | |
, ProgramHandle _handle | |
, IndirectBufferHandle _indirectHandle | |
, uint16_t _start = 0 | |
, uint16_t _num = 1 | |
, uint8_t _flags = (0x01) | |
); | |
void discard(); | |
void blit( | |
ViewId _id | |
, TextureHandle _dst | |
, uint16_t _dstX | |
, uint16_t _dstY | |
, TextureHandle _src | |
, uint16_t _srcX = 0 | |
, uint16_t _srcY = 0 | |
, uint16_t _width = 65535 | |
, uint16_t _height = 65535 | |
); | |
void blit( | |
ViewId _id | |
, TextureHandle _dst | |
, uint8_t _dstMip | |
, uint16_t _dstX | |
, uint16_t _dstY | |
, uint16_t _dstZ | |
, TextureHandle _src | |
, uint8_t _srcMip = 0 | |
, uint16_t _srcX = 0 | |
, uint16_t _srcY = 0 | |
, uint16_t _srcZ = 0 | |
, uint16_t _width = 65535 | |
, uint16_t _height = 65535 | |
, uint16_t _depth = 65535 | |
); | |
void requestScreenShot( | |
FrameBufferHandle _handle | |
, const char* _filePath | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[n.global] | |
output = .build | |
[n.include] | |
$output/bx/3rdparty | |
$output/bx/include | |
$output/bx/include/compat/osx | |
$output/bx/src | |
$output/bimg/3rdparty | |
$output/bimg/3rdparty/iqa/include | |
$output/bimg/include | |
$output/bgfx/3rdparty/khronos | |
$output/bgfx/include | |
$output/bgfx/include/bgfx | |
$output/bgfx/src | |
[n.prepare] | |
gitoutput.bgfx = bgfx | |
gitremote.bgfx = "https://github.com/bkaradzic/bgfx/" | |
gitsparse.bgfx = """ | |
3rdparty/* | |
include/* | |
src/* | |
""" | |
gitoutput.bx = bx | |
gitremote.bx = "https://github.com/bkaradzic/bx/" | |
gitsparse.bx = """ | |
3rdparty/* | |
include/* | |
src/* | |
""" | |
gitoutput.bimg = bimg | |
gitremote.bimg = "https://github.com/bkaradzic/bimg/" | |
gitsparse.bimg = """ | |
3rdparty/* | |
include/* | |
src/* | |
""" | |
[.build/bgfx/include/bgfx/bgfx.h] | |
preprocess = true | |
defines = true | |
recurse = true | |
flags = "--cpp" | |
ppflags = "" | |
compile.bx = .build/bx/src/amalgamated.cpp | |
compile.bimg = .build/bimg/src/image.cpp | |
compile.bimg.1 = .build/bimg/src/image_gnf.cpp | |
compile.bgfx = .build/bgfx/src/amalgamated.mm | |
pragma-mac = "passC: \"-I.build/bx/include -I.build/bx/include/compat/osx -I.build/bx/3rdparty -I.build/bimg/include -I.build/bimg/3rdparty -I.build/bgfx/include -m64 -Wfatal-errors -msse2 -Wunused-value -Wundef -Wshadow\"" | |
pragma-mac.2 = "passL: \"-framework Foundation\"" | |
rename = ../bgfx.nim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline CallbackI::~CallbackI() | |
{ | |
} | |
/Users/zachcarter/projects/bgfxdotnim/temp-bgfx.nim.c(323, 21) Error: identifier expected, but got: ~ | |
bool init(const Init& _init = {}); | |
/Users/zachcarter/projects/bgfxdotnim/temp-bgfx.nim.c(821, 34) Error: did not expect { | |
RendererType::Enum getRendererType(); | |
/Users/zachcarter/projects/bgfxdotnim/temp-bgfx.nim.c(832, 36) Error: identifier expected, but got: { | |
OcclusionQueryResult::Enum getResult( | |
OcclusionQueryHandle _handle | |
, int32_t* _result = __null | |
); | |
/Users/zachcarter/projects/bgfxdotnim/temp-bgfx.nim.c(1114, 38) Error: identifier expected, but got: { | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment