bring log allocator up to date

This commit is contained in:
Colin Davidson
2024-01-17 13:11:10 -08:00
263 changed files with 32404 additions and 25810 deletions
+4
View File
@@ -23,6 +23,10 @@ when ODIN_OS == .Windows {
}
} else when ODIN_OS == .Linux {
foreign import lib "system:cmark"
} else when ODIN_OS == .Darwin {
foreign import lib "system:cmark"
} else {
foreign import lib "system:cmark"
}
Option :: enum c.int {
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package CoreVideo
DisplayLinkRef :: distinct rawptr
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
foreign import "system:Foundation.framework"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
import "core:intrinsics"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSAutoreleasePool")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
import "core:intrinsics"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSBundle")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSColorSpace")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSData")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSDate")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSDictionary")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
import "core:c"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
foreign import "system:Foundation.framework"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSEvent")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
Locking :: struct($T: typeid) {using _: Object}
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
import "core:builtin"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSNotification")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
import "core:c"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
import "core:intrinsics"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSOpenPanel")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
ModalResponse :: enum UInteger {
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSPasteboard")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
Range :: struct {
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSSavePanel")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSScreen")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSSet")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
foreign import "system:Foundation.framework"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
import "core:intrinsics"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSURL")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSUndoManager")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSUserActivity")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
@(objc_class="NSUserDefaults")
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
import "core:strings"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Foundation
foreign import "system:Foundation.framework"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Metal
import NS "vendor:darwin/Foundation"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Metal
import NS "vendor:darwin/Foundation"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Metal
import NS "vendor:darwin/Foundation"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Metal
import NS "vendor:darwin/Foundation"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_Metal
import NS "vendor:darwin/Foundation"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_MetalKit
import NS "vendor:darwin/Foundation"
-1
View File
@@ -1,4 +1,3 @@
//+build darwin
package objc_QuartzCore
import NS "vendor:darwin/Foundation"
+374 -374
View File
File diff suppressed because it is too large Load Diff
+324 -324
View File
File diff suppressed because it is too large Load Diff
+19 -19
View File
@@ -15,7 +15,7 @@ HRESULT :: dxgi.HRESULT
IUnknown :: dxgi.IUnknown
IUnknown_VTable :: dxgi.IUnknown_VTable
@(default_calling_convention="stdcall", link_prefix="D3D")
@(default_calling_convention="system", link_prefix="D3D")
foreign d3dcompiler {
ReadFileToBlob :: proc(pFileName: [^]u16, ppContents: ^^ID3DBlob) -> HRESULT ---
WriteBlobToFile :: proc(pBlob: ^ID3DBlob, pFileName: [^]u16, bOverwrite: BOOL) -> HRESULT ---
@@ -124,8 +124,8 @@ ID3D10Blob :: struct #raw_union {
}
ID3D10Blob_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
GetBufferPointer: proc "stdcall" (this: ^ID3D10Blob) -> rawptr,
GetBufferSize: proc "stdcall" (this: ^ID3D10Blob) -> SIZE_T,
GetBufferPointer: proc "system" (this: ^ID3D10Blob) -> rawptr,
GetBufferSize: proc "system" (this: ^ID3D10Blob) -> SIZE_T,
}
@@ -145,8 +145,8 @@ ID3DInclude :: struct {
vtable: ^ID3DInclude_VTable,
}
ID3DInclude_VTable :: struct {
Open: proc "stdcall" (this: ^ID3DInclude, IncludeType: INCLUDE_TYPE, pFileName: cstring, pParentData: rawptr, ppData: ^rawptr, pBytes: ^u32) -> HRESULT,
Close: proc "stdcall" (this: ^ID3DInclude, pData: rawptr) -> HRESULT,
Open: proc "system" (this: ^ID3DInclude, IncludeType: INCLUDE_TYPE, pFileName: cstring, pParentData: rawptr, ppData: ^rawptr, pBytes: ^u32) -> HRESULT,
Close: proc "system" (this: ^ID3DInclude, pData: rawptr) -> HRESULT,
}
// Default file includer
@@ -159,7 +159,7 @@ ID3D11Module :: struct #raw_union {
}
ID3D11Module_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
CreateInstance: proc "stdcall" (this: ^ID3D11Module, pNamespace: cstring, ppModuleInstance: ^^ID3D11ModuleInstance) -> HRESULT,
CreateInstance: proc "system" (this: ^ID3D11Module, pNamespace: cstring, ppModuleInstance: ^^ID3D11ModuleInstance) -> HRESULT,
}
@@ -169,16 +169,16 @@ ID3D11ModuleInstance :: struct #raw_union {
}
ID3D11ModuleInstance_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
BindConstantBuffer: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, cbDstOffset: u32) -> HRESULT,
BindConstantBufferByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, cbDstOffset: u32) -> HRESULT,
BindResource: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT,
BindResourceByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT,
BindSampler: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT,
BindSamplerByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT,
BindUnorderedAccessView: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT,
BindUnorderedAccessViewByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT,
BindResourceAsUnorderedAccessView: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSrvSlot: u32, uDstUavSlot: u32, uCount: u32) -> HRESULT,
BindResourceAsUnorderedAccessViewByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pSrvName: cstring, uDstUavSlot: u32, uCount: u32) -> HRESULT,
BindConstantBuffer: proc "system" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, cbDstOffset: u32) -> HRESULT,
BindConstantBufferByName: proc "system" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, cbDstOffset: u32) -> HRESULT,
BindResource: proc "system" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT,
BindResourceByName: proc "system" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT,
BindSampler: proc "system" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT,
BindSamplerByName: proc "system" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT,
BindUnorderedAccessView: proc "system" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT,
BindUnorderedAccessViewByName: proc "system" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT,
BindResourceAsUnorderedAccessView: proc "system" (this: ^ID3D11ModuleInstance, uSrcSrvSlot: u32, uDstUavSlot: u32, uCount: u32) -> HRESULT,
BindResourceAsUnorderedAccessViewByName: proc "system" (this: ^ID3D11ModuleInstance, pSrvName: cstring, uDstUavSlot: u32, uCount: u32) -> HRESULT,
}
@@ -188,9 +188,9 @@ ID3D11Linker :: struct #raw_union {
}
ID3D11Linker_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
Link: proc "stdcall" (this: ^ID3D11Linker, pEntry: ^ID3D11ModuleInstance, pEntryName: cstring, pTargetName: cstring, uFlags: u32, ppShaderBlob: ^^ID3DBlob, ppErrorBuffer: ^^ID3DBlob) -> HRESULT,
UseLibrary: proc "stdcall" (this: ^ID3D11Linker, pLibraryMI: ^ID3D11ModuleInstance) -> HRESULT,
AddClipPlaneFromCBuffer: proc "stdcall" (this: ^ID3D11Linker, uCBufferSlot: u32, uCBufferEntry: u32) -> HRESULT,
Link: proc "system" (this: ^ID3D11Linker, pEntry: ^ID3D11ModuleInstance, pEntryName: cstring, pTargetName: cstring, uFlags: u32, ppShaderBlob: ^^ID3DBlob, ppErrorBuffer: ^^ID3DBlob) -> HRESULT,
UseLibrary: proc "system" (this: ^ID3D11Linker, pLibraryMI: ^ID3D11ModuleInstance) -> HRESULT,
AddClipPlaneFromCBuffer: proc "system" (this: ^ID3D11Linker, uCBufferSlot: u32, uCBufferEntry: u32) -> HRESULT,
}
+194 -178
View File
@@ -31,16 +31,16 @@ IUnknown :: struct {
using _iunknown_vtable: ^IUnknown_VTable,
}
IUnknown_VTable :: struct {
QueryInterface: proc "stdcall" (this: ^IUnknown, riid: ^IID, ppvObject: ^rawptr) -> HRESULT,
AddRef: proc "stdcall" (this: ^IUnknown) -> ULONG,
Release: proc "stdcall" (this: ^IUnknown) -> ULONG,
QueryInterface: proc "system" (this: ^IUnknown, riid: ^IID, ppvObject: ^rawptr) -> HRESULT,
AddRef: proc "system" (this: ^IUnknown) -> ULONG,
Release: proc "system" (this: ^IUnknown) -> ULONG,
}
@(default_calling_convention="stdcall")
@(default_calling_convention="system")
foreign dxgi {
CreateDXGIFactory :: proc(riid: ^IID, ppFactory: ^rawptr) -> HRESULT ---
CreateDXGIFactory1 :: proc(riid: ^IID, ppFactory: ^rawptr) -> HRESULT ---
CreateDXGIFactory2 :: proc(Flags: u32, riid: ^IID, ppFactory: ^rawptr) -> HRESULT ---
CreateDXGIFactory2 :: proc(Flags: CREATE_FACTORY, riid: ^IID, ppFactory: ^rawptr) -> HRESULT ---
DXGIGetDebugInterface1 :: proc(Flags: u32, riid: ^IID, pDebug: ^rawptr) -> HRESULT ---
}
@@ -76,10 +76,11 @@ RESOURCE_PRIORITY :: enum u32 {
MAXIMUM = 0xc8000000,
}
MAP :: enum u32 {
READ = 1,
WRITE = 2,
DISCARD = 4,
MAP :: distinct bit_set[MAP_FLAG; u32]
MAP_FLAG :: enum u32 {
READ = 0,
WRITE = 1,
DISCARD = 2,
}
ENUM_MODES :: distinct bit_set[ENUM_MODE; u32]
@@ -117,10 +118,20 @@ MWA_VALID :: MWA{
.NO_PRINT_SCREEN,
}
SHARED_RESOURCE_RW :: distinct bit_set[SHARED_RESOURCE_RW_FLAG; u32]
SHARED_RESOURCE_RW_FLAG :: enum u32 {
READ = 31,
WRITE = 0,
}
SHARED_RESOURCE_READ :: 0x80000000
SHARED_RESOURCE_WRITE :: 1
CREATE_FACTORY_DEBUG :: 0x1
CREATE_FACTORY :: distinct bit_set[CREATE_FACTORY_FLAG; u32]
CREATE_FACTORY_FLAG :: enum u32 {
DEBUG = 0,
}
RATIONAL :: struct {
Numerator: u32,
Denominator: u32,
@@ -418,20 +429,21 @@ SWAP_EFFECT :: enum i32 {
FLIP_DISCARD = 4,
}
SWAP_CHAIN_FLAG :: enum u32 { // TODO: convert to bit_set
NONPREROTATED = 0x1,
ALLOW_MODE_SWITCH = 0x2,
GDI_COMPATIBLE = 0x4,
RESTRICTED_CONTENT = 0x8,
RESTRICT_SHARED_RESOURCE_DRIVER = 0x10,
DISPLAY_ONLY = 0x20,
FRAME_LATENCY_WAITABLE_OBJECT = 0x40,
FOREGROUND_LAYER = 0x80,
FULLSCREEN_VIDEO = 0x100,
YUV_VIDEO = 0x200,
HW_PROTECTED = 0x400,
ALLOW_TEARING = 0x800,
RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS = 0x1000,
SWAP_CHAIN :: distinct bit_set[SWAP_CHAIN_FLAG; u32]
SWAP_CHAIN_FLAG :: enum u32 {
NONPREROTATED = 0,
ALLOW_MODE_SWITCH,
GDI_COMPATIBLE,
RESTRICTED_CONTENT,
RESTRICT_SHARED_RESOURCE_DRIVER,
DISPLAY_ONLY,
FRAME_LATENCY_WAITABLE_OBJECT,
FOREGROUND_LAYER,
FULLSCREEN_VIDEO,
YUV_VIDEO,
HW_PROTECTED,
ALLOW_TEARING,
RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS,
}
SWAP_CHAIN_DESC :: struct {
@@ -442,7 +454,7 @@ SWAP_CHAIN_DESC :: struct {
OutputWindow: HWND,
Windowed: BOOL,
SwapEffect: SWAP_EFFECT,
Flags: u32,
Flags: SWAP_CHAIN,
}
@@ -454,10 +466,10 @@ IObject :: struct #raw_union {
}
IObject_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
SetPrivateData: proc "stdcall" (this: ^IObject, Name: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT,
SetPrivateDataInterface: proc "stdcall" (this: ^IObject, Name: ^GUID, pUnknown: ^IUnknown) -> HRESULT,
GetPrivateData: proc "stdcall" (this: ^IObject, Name: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT,
GetParent: proc "stdcall" (this: ^IObject, riid: ^IID, ppParent: ^rawptr) -> HRESULT,
SetPrivateData: proc "system" (this: ^IObject, Name: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT,
SetPrivateDataInterface: proc "system" (this: ^IObject, Name: ^GUID, pUnknown: ^IUnknown) -> HRESULT,
GetPrivateData: proc "system" (this: ^IObject, Name: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT,
GetParent: proc "system" (this: ^IObject, riid: ^IID, ppParent: ^rawptr) -> HRESULT,
}
IDeviceSubObject_UUID_STRING :: "3D3E0379-F9DE-4D58-BB6C-18D62992F1A6"
@@ -468,7 +480,7 @@ IDeviceSubObject :: struct #raw_union {
}
IDeviceSubObject_VTable :: struct {
using idxgiobject_vtable: IObject_VTable,
GetDevice: proc "stdcall" (this: ^IDeviceSubObject, riid: ^IID, ppDevice: ^rawptr) -> HRESULT,
GetDevice: proc "system" (this: ^IDeviceSubObject, riid: ^IID, ppDevice: ^rawptr) -> HRESULT,
}
IResource_UUID_STRING :: "035F3AB4-482E-4E50-B41F-8A7F8BD8960B"
@@ -479,10 +491,10 @@ IResource :: struct #raw_union {
}
IResource_VTable :: struct {
using idxgidevicesubobject_vtable: IDeviceSubObject_VTable,
GetSharedHandle: proc "stdcall" (this: ^IResource, pSharedHandle: ^HANDLE) -> HRESULT,
GetUsage: proc "stdcall" (this: ^IResource, pUsage: ^USAGE) -> HRESULT,
SetEvictionPriority: proc "stdcall" (this: ^IResource, EvictionPriority: u32) -> HRESULT,
GetEvictionPriority: proc "stdcall" (this: ^IResource, pEvictionPriority: ^u32) -> HRESULT,
GetSharedHandle: proc "system" (this: ^IResource, pSharedHandle: ^HANDLE) -> HRESULT,
GetUsage: proc "system" (this: ^IResource, pUsage: ^USAGE) -> HRESULT,
SetEvictionPriority: proc "system" (this: ^IResource, EvictionPriority: RESOURCE_PRIORITY) -> HRESULT,
GetEvictionPriority: proc "system" (this: ^IResource, pEvictionPriority: ^RESOURCE_PRIORITY) -> HRESULT,
}
IKeyedMutex_UUID_STRING :: "9D8E1289-D7B3-465F-8126-250E349AF85D"
@@ -493,8 +505,8 @@ IKeyedMutex :: struct #raw_union {
}
IKeyedMutex_VTable :: struct {
using idxgidevicesubobject_vtable: IDeviceSubObject_VTable,
AcquireSync: proc "stdcall" (this: ^IKeyedMutex, Key: u64, dwMilliseconds: u32) -> HRESULT,
ReleaseSync: proc "stdcall" (this: ^IKeyedMutex, Key: u64) -> HRESULT,
AcquireSync: proc "system" (this: ^IKeyedMutex, Key: u64, dwMilliseconds: u32) -> HRESULT,
ReleaseSync: proc "system" (this: ^IKeyedMutex, Key: u64) -> HRESULT,
}
ISurface_UUID_STRING :: "CAFCB56C-6AC3-4889-BF47-9E23BBD260EC"
@@ -505,9 +517,9 @@ ISurface :: struct #raw_union {
}
ISurface_VTable :: struct {
using idxgidevicesubobject_vtable: IDeviceSubObject_VTable,
GetDesc: proc "stdcall" (this: ^ISurface, pDesc: ^SURFACE_DESC) -> HRESULT,
Map: proc "stdcall" (this: ^ISurface, pLockedRect: ^MAPPED_RECT, MapFlags: u32) -> HRESULT,
Unmap: proc "stdcall" (this: ^ISurface) -> HRESULT,
GetDesc: proc "system" (this: ^ISurface, pDesc: ^SURFACE_DESC) -> HRESULT,
Map: proc "system" (this: ^ISurface, pLockedRect: ^MAPPED_RECT, MapFlags: MAP) -> HRESULT,
Unmap: proc "system" (this: ^ISurface) -> HRESULT,
}
ISurface1_UUID_STRING :: "4AE63092-6327-4C1B-80AE-BFE12EA32B86"
@@ -518,8 +530,8 @@ ISurface1 :: struct #raw_union {
}
ISurface1_VTable :: struct {
using idxgisurface_vtable: ISurface_VTable,
GetDC: proc "stdcall" (this: ^ISurface1, Discard: BOOL, phdc: ^HDC) -> HRESULT,
ReleaseDC: proc "stdcall" (this: ^ISurface1, pDirtyRect: ^RECT) -> HRESULT,
GetDC: proc "system" (this: ^ISurface1, Discard: BOOL, phdc: ^HDC) -> HRESULT,
ReleaseDC: proc "system" (this: ^ISurface1, pDirtyRect: ^RECT) -> HRESULT,
}
IAdapter_UUID_STRING :: "2411E7E1-12AC-4CCF-BD14-9798E8534DC0"
@@ -530,9 +542,9 @@ IAdapter :: struct #raw_union {
}
IAdapter_VTable :: struct {
using idxgiobject_vtable: IObject_VTable,
EnumOutputs: proc "stdcall" (this: ^IAdapter, Output: u32, ppOutput: ^^IOutput) -> HRESULT,
GetDesc: proc "stdcall" (this: ^IAdapter, pDesc: ^ADAPTER_DESC) -> HRESULT,
CheckInterfaceSupport: proc "stdcall" (this: ^IAdapter, InterfaceName: ^GUID, pUMDVersion: ^LARGE_INTEGER) -> HRESULT,
EnumOutputs: proc "system" (this: ^IAdapter, Output: u32, ppOutput: ^^IOutput) -> HRESULT,
GetDesc: proc "system" (this: ^IAdapter, pDesc: ^ADAPTER_DESC) -> HRESULT,
CheckInterfaceSupport: proc "system" (this: ^IAdapter, InterfaceName: ^GUID, pUMDVersion: ^LARGE_INTEGER) -> HRESULT,
}
IOutput_UUID_STRING :: "AE02EEDB-C735-4690-8D52-5A8DC20213AA"
@@ -543,18 +555,18 @@ IOutput :: struct #raw_union {
}
IOutput_VTable :: struct {
using idxgiobject_vtable: IObject_VTable,
GetDesc: proc "stdcall" (this: ^IOutput, pDesc: ^OUTPUT_DESC) -> HRESULT,
GetDisplayModeList: proc "stdcall" (this: ^IOutput, EnumFormat: FORMAT, Flags: u32, pNumModes: ^u32, pDesc: ^MODE_DESC) -> HRESULT,
FindClosestMatchingMode: proc "stdcall" (this: ^IOutput, pModeToMatch: ^MODE_DESC, pClosestMatch: ^MODE_DESC, pConcernedDevice: ^IUnknown) -> HRESULT,
WaitForVBlank: proc "stdcall" (this: ^IOutput) -> HRESULT,
TakeOwnership: proc "stdcall" (this: ^IOutput, pDevice: ^IUnknown, Exclusive: BOOL) -> HRESULT,
ReleaseOwnership: proc "stdcall" (this: ^IOutput),
GetGammaControlCapabilities: proc "stdcall" (this: ^IOutput, pGammaCaps: ^GAMMA_CONTROL_CAPABILITIES) -> HRESULT,
SetGammaControl: proc "stdcall" (this: ^IOutput, pArray: ^GAMMA_CONTROL) -> HRESULT,
GetGammaControl: proc "stdcall" (this: ^IOutput, pArray: ^GAMMA_CONTROL) -> HRESULT,
SetDisplaySurface: proc "stdcall" (this: ^IOutput, pScanoutSurface: ^ISurface) -> HRESULT,
GetDisplaySurfaceData: proc "stdcall" (this: ^IOutput, pDestination: ^ISurface) -> HRESULT,
GetFrameStatistics: proc "stdcall" (this: ^IOutput, pStats: ^FRAME_STATISTICS) -> HRESULT,
GetDesc: proc "system" (this: ^IOutput, pDesc: ^OUTPUT_DESC) -> HRESULT,
GetDisplayModeList: proc "system" (this: ^IOutput, EnumFormat: FORMAT, Flags: ENUM_MODES, pNumModes: ^u32, pDesc: ^MODE_DESC) -> HRESULT,
FindClosestMatchingMode: proc "system" (this: ^IOutput, pModeToMatch: ^MODE_DESC, pClosestMatch: ^MODE_DESC, pConcernedDevice: ^IUnknown) -> HRESULT,
WaitForVBlank: proc "system" (this: ^IOutput) -> HRESULT,
TakeOwnership: proc "system" (this: ^IOutput, pDevice: ^IUnknown, Exclusive: BOOL) -> HRESULT,
ReleaseOwnership: proc "system" (this: ^IOutput),
GetGammaControlCapabilities: proc "system" (this: ^IOutput, pGammaCaps: ^GAMMA_CONTROL_CAPABILITIES) -> HRESULT,
SetGammaControl: proc "system" (this: ^IOutput, pArray: ^GAMMA_CONTROL) -> HRESULT,
GetGammaControl: proc "system" (this: ^IOutput, pArray: ^GAMMA_CONTROL) -> HRESULT,
SetDisplaySurface: proc "system" (this: ^IOutput, pScanoutSurface: ^ISurface) -> HRESULT,
GetDisplaySurfaceData: proc "system" (this: ^IOutput, pDestination: ^ISurface) -> HRESULT,
GetFrameStatistics: proc "system" (this: ^IOutput, pStats: ^FRAME_STATISTICS) -> HRESULT,
}
ISwapChain_UUID_STRING :: "310D36A0-D2E7-4C0A-AA04-6A9D23B8886A"
@@ -565,16 +577,16 @@ ISwapChain :: struct #raw_union {
}
ISwapChain_VTable :: struct {
using idxgidevicesubobject_vtable: IDeviceSubObject_VTable,
Present: proc "stdcall" (this: ^ISwapChain, SyncInterval: u32, Flags: u32) -> HRESULT,
GetBuffer: proc "stdcall" (this: ^ISwapChain, Buffer: u32, riid: ^IID, ppSurface: ^rawptr) -> HRESULT,
SetFullscreenState: proc "stdcall" (this: ^ISwapChain, Fullscreen: BOOL, pTarget: ^IOutput) -> HRESULT,
GetFullscreenState: proc "stdcall" (this: ^ISwapChain, pFullscreen: ^BOOL, ppTarget: ^^IOutput) -> HRESULT,
GetDesc: proc "stdcall" (this: ^ISwapChain, pDesc: ^SWAP_CHAIN_DESC) -> HRESULT,
ResizeBuffers: proc "stdcall" (this: ^ISwapChain, BufferCount: u32, Width: u32, Height: u32, NewFormat: FORMAT, SwapChainFlags: u32) -> HRESULT,
ResizeTarget: proc "stdcall" (this: ^ISwapChain, pNewTargetParameters: ^MODE_DESC) -> HRESULT,
GetContainingOutput: proc "stdcall" (this: ^ISwapChain, ppOutput: ^^IOutput) -> HRESULT,
GetFrameStatistics: proc "stdcall" (this: ^ISwapChain, pStats: ^FRAME_STATISTICS) -> HRESULT,
GetLastPresentCount: proc "stdcall" (this: ^ISwapChain, pLastPresentCount: ^u32) -> HRESULT,
Present: proc "system" (this: ^ISwapChain, SyncInterval: u32, Flags: PRESENT) -> HRESULT,
GetBuffer: proc "system" (this: ^ISwapChain, Buffer: u32, riid: ^IID, ppSurface: ^rawptr) -> HRESULT,
SetFullscreenState: proc "system" (this: ^ISwapChain, Fullscreen: BOOL, pTarget: ^IOutput) -> HRESULT,
GetFullscreenState: proc "system" (this: ^ISwapChain, pFullscreen: ^BOOL, ppTarget: ^^IOutput) -> HRESULT,
GetDesc: proc "system" (this: ^ISwapChain, pDesc: ^SWAP_CHAIN_DESC) -> HRESULT,
ResizeBuffers: proc "system" (this: ^ISwapChain, BufferCount: u32, Width: u32, Height: u32, NewFormat: FORMAT, SwapChainFlags: SWAP_CHAIN) -> HRESULT,
ResizeTarget: proc "system" (this: ^ISwapChain, pNewTargetParameters: ^MODE_DESC) -> HRESULT,
GetContainingOutput: proc "system" (this: ^ISwapChain, ppOutput: ^^IOutput) -> HRESULT,
GetFrameStatistics: proc "system" (this: ^ISwapChain, pStats: ^FRAME_STATISTICS) -> HRESULT,
GetLastPresentCount: proc "system" (this: ^ISwapChain, pLastPresentCount: ^u32) -> HRESULT,
}
IFactory_UUID_STRING :: "7B7166EC-21C7-44AE-B21A-C9AE321AE369"
@@ -585,11 +597,11 @@ IFactory :: struct #raw_union {
}
IFactory_VTable :: struct {
using idxgiobject_vtable: IObject_VTable,
EnumAdapters: proc "stdcall" (this: ^IFactory, Adapter: u32, ppAdapter: ^^IAdapter) -> HRESULT,
MakeWindowAssociation: proc "stdcall" (this: ^IFactory, WindowHandle: HWND, Flags: u32) -> HRESULT,
GetWindowAssociation: proc "stdcall" (this: ^IFactory, pWindowHandle: ^HWND) -> HRESULT,
CreateSwapChain: proc "stdcall" (this: ^IFactory, pDevice: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC, ppSwapChain: ^^ISwapChain) -> HRESULT,
CreateSoftwareAdapter: proc "stdcall" (this: ^IFactory, Module: HMODULE, ppAdapter: ^^IAdapter) -> HRESULT,
EnumAdapters: proc "system" (this: ^IFactory, Adapter: u32, ppAdapter: ^^IAdapter) -> HRESULT,
MakeWindowAssociation: proc "system" (this: ^IFactory, WindowHandle: HWND, Flags: MWA) -> HRESULT,
GetWindowAssociation: proc "system" (this: ^IFactory, pWindowHandle: ^HWND) -> HRESULT,
CreateSwapChain: proc "system" (this: ^IFactory, pDevice: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC, ppSwapChain: ^^ISwapChain) -> HRESULT,
CreateSoftwareAdapter: proc "system" (this: ^IFactory, Module: HMODULE, ppAdapter: ^^IAdapter) -> HRESULT,
}
IDevice_UUID_STRING :: "54EC77FA-1377-44E6-8C32-88FD5F44C84C"
IDevice_UUID := &IID{0x54EC77FA, 0x1377, 0x44E6, {0x8C, 0x32, 0x88, 0xFD, 0x5F, 0x44, 0xC8, 0x4C}}
@@ -599,11 +611,11 @@ IDevice :: struct #raw_union {
}
IDevice_VTable :: struct {
using idxgiobject_vtable: IObject_VTable,
GetAdapter: proc "stdcall" (this: ^IDevice, pAdapter: ^^IAdapter) -> HRESULT,
CreateSurface: proc "stdcall" (this: ^IDevice, pDesc: ^SURFACE_DESC, NumSurfaces: u32, Usage: USAGE, pSharedResource: ^SHARED_RESOURCE, ppSurface: ^^ISurface) -> HRESULT,
QueryResourceResidency: proc "stdcall" (this: ^IDevice, ppResources: ^^IUnknown, pResidencyStatus: ^RESIDENCY, NumResources: u32) -> HRESULT,
SetGPUThreadPriority: proc "stdcall" (this: ^IDevice, Priority: i32) -> HRESULT,
GetGPUThreadPriority: proc "stdcall" (this: ^IDevice, pPriority: ^i32) -> HRESULT,
GetAdapter: proc "system" (this: ^IDevice, pAdapter: ^^IAdapter) -> HRESULT,
CreateSurface: proc "system" (this: ^IDevice, pDesc: ^SURFACE_DESC, NumSurfaces: u32, Usage: USAGE, pSharedResource: ^SHARED_RESOURCE, ppSurface: ^^ISurface) -> HRESULT,
QueryResourceResidency: proc "system" (this: ^IDevice, ppResources: ^^IUnknown, pResidencyStatus: ^RESIDENCY, NumResources: u32) -> HRESULT,
SetGPUThreadPriority: proc "system" (this: ^IDevice, Priority: i32) -> HRESULT,
GetGPUThreadPriority: proc "system" (this: ^IDevice, pPriority: ^i32) -> HRESULT,
}
ADAPTER_FLAG :: enum u32 { // TODO: convert to bit_set
NONE = 0x0,
@@ -622,7 +634,7 @@ ADAPTER_DESC1 :: struct {
DedicatedSystemMemory: SIZE_T,
SharedSystemMemory: SIZE_T,
AdapterLuid: LUID,
Flags: u32,
Flags: ADAPTER_FLAG,
}
DISPLAY_COLOR_SPACE :: struct {
@@ -639,8 +651,8 @@ IFactory1 :: struct #raw_union {
}
IFactory1_VTable :: struct {
using idxgifactory_vtable: IFactory_VTable,
EnumAdapters1: proc "stdcall" (this: ^IFactory1, Adapter: u32, ppAdapter: ^^IAdapter1) -> HRESULT,
IsCurrent: proc "stdcall" (this: ^IFactory1) -> BOOL,
EnumAdapters1: proc "system" (this: ^IFactory1, Adapter: u32, ppAdapter: ^^IAdapter1) -> HRESULT,
IsCurrent: proc "system" (this: ^IFactory1) -> BOOL,
}
IAdapter1_UUID_STRING :: "29038F61-3839-4626-91FD-086879011A05"
@@ -651,7 +663,7 @@ IAdapter1 :: struct #raw_union {
}
IAdapter1_VTable :: struct {
using idxgiadapter_vtable: IAdapter_VTable,
GetDesc1: proc "stdcall" (this: ^IAdapter1, pDesc: ^ADAPTER_DESC1) -> HRESULT,
GetDesc1: proc "system" (this: ^IAdapter1, pDesc: ^ADAPTER_DESC1) -> HRESULT,
}
IDevice1_UUID_STRING :: "77DB970F-6276-48BA-BA28-070143B4392C"
@@ -662,8 +674,8 @@ IDevice1 :: struct #raw_union {
}
IDevice1_VTable :: struct {
using idxgidevice_vtable: IDevice_VTable,
SetMaximumFrameLatency: proc "stdcall" (this: ^IDevice1, MaxLatency: u32) -> HRESULT,
GetMaximumFrameLatency: proc "stdcall" (this: ^IDevice1, pMaxLatency: ^u32) -> HRESULT,
SetMaximumFrameLatency: proc "system" (this: ^IDevice1, MaxLatency: u32) -> HRESULT,
GetMaximumFrameLatency: proc "system" (this: ^IDevice1, pMaxLatency: ^u32) -> HRESULT,
}
IDisplayControl_UUID_STRING :: "EA9DBF1A-C88E-4486-854A-98AA0138F30C"
@@ -674,8 +686,8 @@ IDisplayControl :: struct #raw_union {
}
IDisplayControl_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
IsStereoEnabled: proc "stdcall" (this: ^IDisplayControl) -> BOOL,
SetStereoEnabled: proc "stdcall" (this: ^IDisplayControl, enabled: BOOL),
IsStereoEnabled: proc "system" (this: ^IDisplayControl) -> BOOL,
SetStereoEnabled: proc "system" (this: ^IDisplayControl, enabled: BOOL),
}
OUTDUPL_MOVE_RECT :: struct {
SourcePoint: POINT,
@@ -700,7 +712,7 @@ OUTDUPL_POINTER_SHAPE_TYPE :: enum i32 {
}
OUTDUPL_POINTER_SHAPE_INFO :: struct {
Type: u32,
Type: OUTDUPL_POINTER_SHAPE_TYPE,
Width: u32,
Height: u32,
Pitch: u32,
@@ -727,14 +739,14 @@ IOutputDuplication :: struct #raw_union {
}
IOutputDuplication_VTable :: struct {
using idxgiobject_vtable: IObject_VTable,
GetDesc: proc "stdcall" (this: ^IOutputDuplication, pDesc: ^OUTDUPL_DESC),
AcquireNextFrame: proc "stdcall" (this: ^IOutputDuplication, TimeoutInMilliseconds: u32, pFrameInfo: ^OUTDUPL_FRAME_INFO, ppDesktopResource: ^^IResource) -> HRESULT,
GetFrameDirtyRects: proc "stdcall" (this: ^IOutputDuplication, DirtyRectsBufferSize: u32, pDirtyRectsBuffer: ^RECT, pDirtyRectsBufferSizeRequired: ^u32) -> HRESULT,
GetFrameMoveRects: proc "stdcall" (this: ^IOutputDuplication, MoveRectsBufferSize: u32, pMoveRectBuffer: ^OUTDUPL_MOVE_RECT, pMoveRectsBufferSizeRequired: ^u32) -> HRESULT,
GetFramePointerShape: proc "stdcall" (this: ^IOutputDuplication, PointerShapeBufferSize: u32, pPointerShapeBuffer: rawptr, pPointerShapeBufferSizeRequired: ^u32, pPointerShapeInfo: ^OUTDUPL_POINTER_SHAPE_INFO) -> HRESULT,
MapDesktopSurface: proc "stdcall" (this: ^IOutputDuplication, pLockedRect: ^MAPPED_RECT) -> HRESULT,
UnMapDesktopSurface: proc "stdcall" (this: ^IOutputDuplication) -> HRESULT,
ReleaseFrame: proc "stdcall" (this: ^IOutputDuplication) -> HRESULT,
GetDesc: proc "system" (this: ^IOutputDuplication, pDesc: ^OUTDUPL_DESC),
AcquireNextFrame: proc "system" (this: ^IOutputDuplication, TimeoutInMilliseconds: u32, pFrameInfo: ^OUTDUPL_FRAME_INFO, ppDesktopResource: ^^IResource) -> HRESULT,
GetFrameDirtyRects: proc "system" (this: ^IOutputDuplication, DirtyRectsBufferSize: u32, pDirtyRectsBuffer: ^RECT, pDirtyRectsBufferSizeRequired: ^u32) -> HRESULT,
GetFrameMoveRects: proc "system" (this: ^IOutputDuplication, MoveRectsBufferSize: u32, pMoveRectBuffer: ^OUTDUPL_MOVE_RECT, pMoveRectsBufferSizeRequired: ^u32) -> HRESULT,
GetFramePointerShape: proc "system" (this: ^IOutputDuplication, PointerShapeBufferSize: u32, pPointerShapeBuffer: rawptr, pPointerShapeBufferSizeRequired: ^u32, pPointerShapeInfo: ^OUTDUPL_POINTER_SHAPE_INFO) -> HRESULT,
MapDesktopSurface: proc "system" (this: ^IOutputDuplication, pLockedRect: ^MAPPED_RECT) -> HRESULT,
UnMapDesktopSurface: proc "system" (this: ^IOutputDuplication) -> HRESULT,
ReleaseFrame: proc "system" (this: ^IOutputDuplication) -> HRESULT,
}
ALPHA_MODE :: enum i32 {
UNSPECIFIED = 0,
@@ -753,7 +765,7 @@ ISurface2 :: struct #raw_union {
}
ISurface2_VTable :: struct {
using idxgisurface1_vtable: ISurface1_VTable,
GetResource: proc "stdcall" (this: ^ISurface2, riid: ^IID, ppParentResource: ^rawptr, pSubresourceIndex: ^u32) -> HRESULT,
GetResource: proc "system" (this: ^ISurface2, riid: ^IID, ppParentResource: ^rawptr, pSubresourceIndex: ^u32) -> HRESULT,
}
IResource1_UUID_STRING :: "30961379-4609-4A41-998E-54FE567EE0C1"
@@ -764,8 +776,8 @@ IResource1 :: struct #raw_union {
}
IResource1_VTable :: struct {
using idxgiresource_vtable: IResource_VTable,
CreateSubresourceSurface: proc "stdcall" (this: ^IResource1, index: u32, ppSurface: ^^ISurface2) -> HRESULT,
CreateSharedHandle: proc "stdcall" (this: ^IResource1, pAttributes: ^win32.SECURITY_ATTRIBUTES, dwAccess: u32, lpName: ^i16, pHandle: ^HANDLE) -> HRESULT,
CreateSubresourceSurface: proc "system" (this: ^IResource1, index: u32, ppSurface: ^^ISurface2) -> HRESULT,
CreateSharedHandle: proc "system" (this: ^IResource1, pAttributes: ^win32.SECURITY_ATTRIBUTES, dwAccess: SHARED_RESOURCE_RW, lpName: ^i16, pHandle: ^HANDLE) -> HRESULT,
}
OFFER_RESOURCE_PRIORITY :: enum i32 {
LOW = 1,
@@ -782,9 +794,9 @@ IDevice2 :: struct #raw_union {
}
IDevice2_VTable :: struct {
using idxgidevice1_vtable: IDevice1_VTable,
OfferResources: proc "stdcall" (this: ^IDevice2, NumResources: u32, ppResources: ^^IResource, Priority: OFFER_RESOURCE_PRIORITY) -> HRESULT,
ReclaimResources: proc "stdcall" (this: ^IDevice2, NumResources: u32, ppResources: ^^IResource, pDiscarded: ^BOOL) -> HRESULT,
EnqueueSetEvent: proc "stdcall" (this: ^IDevice2, hEvent: HANDLE) -> HRESULT,
OfferResources: proc "system" (this: ^IDevice2, NumResources: u32, ppResources: ^^IResource, Priority: OFFER_RESOURCE_PRIORITY) -> HRESULT,
ReclaimResources: proc "system" (this: ^IDevice2, NumResources: u32, ppResources: ^^IResource, pDiscarded: ^BOOL) -> HRESULT,
EnqueueSetEvent: proc "system" (this: ^IDevice2, hEvent: HANDLE) -> HRESULT,
}
MODE_DESC1 :: struct {
Width: u32,
@@ -813,7 +825,7 @@ SWAP_CHAIN_DESC1 :: struct {
Scaling: SCALING,
SwapEffect: SWAP_EFFECT,
AlphaMode: ALPHA_MODE,
Flags: u32,
Flags: SWAP_CHAIN,
}
SWAP_CHAIN_FULLSCREEN_DESC :: struct {
@@ -840,17 +852,17 @@ ISwapChain1 :: struct #raw_union {
}
ISwapChain1_VTable :: struct {
using idxgiswapchain_vtable: ISwapChain_VTable,
GetDesc1: proc "stdcall" (this: ^ISwapChain1, pDesc: ^SWAP_CHAIN_DESC1) -> HRESULT,
GetFullscreenDesc: proc "stdcall" (this: ^ISwapChain1, pDesc: ^SWAP_CHAIN_FULLSCREEN_DESC) -> HRESULT,
GetHwnd: proc "stdcall" (this: ^ISwapChain1, pHwnd: ^HWND) -> HRESULT,
GetCoreWindow: proc "stdcall" (this: ^ISwapChain1, refiid: ^IID, ppUnk: ^rawptr) -> HRESULT,
Present1: proc "stdcall" (this: ^ISwapChain1, SyncInterval: u32, PresentFlags: u32, pPresentParameters: ^PRESENT_PARAMETERS) -> HRESULT,
IsTemporaryMonoSupported: proc "stdcall" (this: ^ISwapChain1) -> BOOL,
GetRestrictToOutput: proc "stdcall" (this: ^ISwapChain1, ppRestrictToOutput: ^^IOutput) -> HRESULT,
SetBackgroundColor: proc "stdcall" (this: ^ISwapChain1, pColor: ^RGBA) -> HRESULT,
GetBackgroundColor: proc "stdcall" (this: ^ISwapChain1, pColor: ^RGBA) -> HRESULT,
SetRotation: proc "stdcall" (this: ^ISwapChain1, Rotation: MODE_ROTATION) -> HRESULT,
GetRotation: proc "stdcall" (this: ^ISwapChain1, pRotation: ^MODE_ROTATION) -> HRESULT,
GetDesc1: proc "system" (this: ^ISwapChain1, pDesc: ^SWAP_CHAIN_DESC1) -> HRESULT,
GetFullscreenDesc: proc "system" (this: ^ISwapChain1, pDesc: ^SWAP_CHAIN_FULLSCREEN_DESC) -> HRESULT,
GetHwnd: proc "system" (this: ^ISwapChain1, pHwnd: ^HWND) -> HRESULT,
GetCoreWindow: proc "system" (this: ^ISwapChain1, refiid: ^IID, ppUnk: ^rawptr) -> HRESULT,
Present1: proc "system" (this: ^ISwapChain1, SyncInterval: u32, PresentFlags: PRESENT, pPresentParameters: ^PRESENT_PARAMETERS) -> HRESULT,
IsTemporaryMonoSupported: proc "system" (this: ^ISwapChain1) -> BOOL,
GetRestrictToOutput: proc "system" (this: ^ISwapChain1, ppRestrictToOutput: ^^IOutput) -> HRESULT,
SetBackgroundColor: proc "system" (this: ^ISwapChain1, pColor: ^RGBA) -> HRESULT,
GetBackgroundColor: proc "system" (this: ^ISwapChain1, pColor: ^RGBA) -> HRESULT,
SetRotation: proc "system" (this: ^ISwapChain1, Rotation: MODE_ROTATION) -> HRESULT,
GetRotation: proc "system" (this: ^ISwapChain1, pRotation: ^MODE_ROTATION) -> HRESULT,
}
IFactory2_UUID_STRING :: "50C83A1C-E072-4C48-87B0-3630FA36A6D0"
@@ -861,17 +873,17 @@ IFactory2 :: struct #raw_union {
}
IFactory2_VTable :: struct {
using idxgifactory1_vtable: IFactory1_VTable,
IsWindowedStereoEnabled: proc "stdcall" (this: ^IFactory2) -> BOOL,
CreateSwapChainForHwnd: proc "stdcall" (this: ^IFactory2, pDevice: ^IUnknown, hWnd: HWND, pDesc: ^SWAP_CHAIN_DESC1, pFullscreenDesc: ^SWAP_CHAIN_FULLSCREEN_DESC, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT,
CreateSwapChainForCoreWindow: proc "stdcall" (this: ^IFactory2, pDevice: ^IUnknown, pWindow: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT,
GetSharedResourceAdapterLuid: proc "stdcall" (this: ^IFactory2, hResource: HANDLE, pLuid: ^LUID) -> HRESULT,
RegisterStereoStatusWindow: proc "stdcall" (this: ^IFactory2, WindowHandle: HWND, wMsg: u32, pdwCookie: ^u32) -> HRESULT,
RegisterStereoStatusEvent: proc "stdcall" (this: ^IFactory2, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT,
UnregisterStereoStatus: proc "stdcall" (this: ^IFactory2, dwCookie: u32),
RegisterOcclusionStatusWindow: proc "stdcall" (this: ^IFactory2, WindowHandle: HWND, wMsg: u32, pdwCookie: ^u32) -> HRESULT,
RegisterOcclusionStatusEvent: proc "stdcall" (this: ^IFactory2, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT,
UnregisterOcclusionStatus: proc "stdcall" (this: ^IFactory2, dwCookie: u32),
CreateSwapChainForComposition: proc "stdcall" (this: ^IFactory2, pDevice: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT,
IsWindowedStereoEnabled: proc "system" (this: ^IFactory2) -> BOOL,
CreateSwapChainForHwnd: proc "system" (this: ^IFactory2, pDevice: ^IUnknown, hWnd: HWND, pDesc: ^SWAP_CHAIN_DESC1, pFullscreenDesc: ^SWAP_CHAIN_FULLSCREEN_DESC, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT,
CreateSwapChainForCoreWindow: proc "system" (this: ^IFactory2, pDevice: ^IUnknown, pWindow: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT,
GetSharedResourceAdapterLuid: proc "system" (this: ^IFactory2, hResource: HANDLE, pLuid: ^LUID) -> HRESULT,
RegisterStereoStatusWindow: proc "system" (this: ^IFactory2, WindowHandle: HWND, wMsg: u32, pdwCookie: ^u32) -> HRESULT,
RegisterStereoStatusEvent: proc "system" (this: ^IFactory2, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT,
UnregisterStereoStatus: proc "system" (this: ^IFactory2, dwCookie: u32),
RegisterOcclusionStatusWindow: proc "system" (this: ^IFactory2, WindowHandle: HWND, wMsg: u32, pdwCookie: ^u32) -> HRESULT,
RegisterOcclusionStatusEvent: proc "system" (this: ^IFactory2, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT,
UnregisterOcclusionStatus: proc "system" (this: ^IFactory2, dwCookie: u32),
CreateSwapChainForComposition: proc "system" (this: ^IFactory2, pDevice: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT,
}
GRAPHICS_PREEMPTION_GRANULARITY :: enum i32 {
DMA_BUFFER_BOUNDARY = 0,
@@ -899,7 +911,7 @@ ADAPTER_DESC2 :: struct {
DedicatedSystemMemory: SIZE_T,
SharedSystemMemory: SIZE_T,
AdapterLuid: LUID,
Flags: u32,
Flags: ADAPTER_FLAG,
GraphicsPreemptionGranularity: GRAPHICS_PREEMPTION_GRANULARITY,
ComputePreemptionGranularity: COMPUTE_PREEMPTION_GRANULARITY,
}
@@ -913,7 +925,7 @@ IAdapter2 :: struct #raw_union {
}
IAdapter2_VTable :: struct {
using idxgiadapter1_vtable: IAdapter1_VTable,
GetDesc2: proc "stdcall" (this: ^IAdapter2, pDesc: ^ADAPTER_DESC2) -> HRESULT,
GetDesc2: proc "system" (this: ^IAdapter2, pDesc: ^ADAPTER_DESC2) -> HRESULT,
}
IOutput1_UUID_STRING :: "00CDDEA8-939B-4B83-A340-A685226666CC"
@@ -924,10 +936,10 @@ IOutput1 :: struct #raw_union {
}
IOutput1_VTable :: struct {
using idxgioutput_vtable: IOutput_VTable,
GetDisplayModeList1: proc "stdcall" (this: ^IOutput1, EnumFormat: FORMAT, Flags: u32, pNumModes: ^u32, pDesc: ^MODE_DESC1) -> HRESULT,
FindClosestMatchingMode1: proc "stdcall" (this: ^IOutput1, pModeToMatch: ^MODE_DESC1, pClosestMatch: ^MODE_DESC1, pConcernedDevice: ^IUnknown) -> HRESULT,
GetDisplaySurfaceData1: proc "stdcall" (this: ^IOutput1, pDestination: ^IResource) -> HRESULT,
DuplicateOutput: proc "stdcall" (this: ^IOutput1, pDevice: ^IUnknown, ppOutputDuplication: ^^IOutputDuplication) -> HRESULT,
GetDisplayModeList1: proc "system" (this: ^IOutput1, EnumFormat: FORMAT, Flags: ENUM_MODES, pNumModes: ^u32, pDesc: ^MODE_DESC1) -> HRESULT,
FindClosestMatchingMode1: proc "system" (this: ^IOutput1, pModeToMatch: ^MODE_DESC1, pClosestMatch: ^MODE_DESC1, pConcernedDevice: ^IUnknown) -> HRESULT,
GetDisplaySurfaceData1: proc "system" (this: ^IOutput1, pDestination: ^IResource) -> HRESULT,
DuplicateOutput: proc "system" (this: ^IOutput1, pDevice: ^IUnknown, ppOutputDuplication: ^^IOutputDuplication) -> HRESULT,
}
IDevice3_UUID_STRING :: "6007896C-3244-4AFD-BF18-A6D3BEDA5023"
IDevice3_UUID := &IID{0x6007896C, 0x3244, 0x4AFD, {0xBF, 0x18, 0xA6, 0xD3, 0xBE, 0xDA, 0x50, 0x23}}
@@ -937,7 +949,7 @@ IDevice3 :: struct #raw_union {
}
IDevice3_VTable :: struct {
using idxgidevice2_vtable: IDevice2_VTable,
Trim: proc "stdcall" (this: ^IDevice3),
Trim: proc "system" (this: ^IDevice3),
}
MATRIX_3X2_F :: struct {
_11: f32,
@@ -957,13 +969,13 @@ ISwapChain2 :: struct #raw_union {
}
ISwapChain2_VTable :: struct {
using idxgiswapchain1_vtable: ISwapChain1_VTable,
SetSourceSize: proc "stdcall" (this: ^ISwapChain2, Width: u32, Height: u32) -> HRESULT,
GetSourceSize: proc "stdcall" (this: ^ISwapChain2, pWidth: ^u32, pHeight: ^u32) -> HRESULT,
SetMaximumFrameLatency: proc "stdcall" (this: ^ISwapChain2, MaxLatency: u32) -> HRESULT,
GetMaximumFrameLatency: proc "stdcall" (this: ^ISwapChain2, pMaxLatency: ^u32) -> HRESULT,
GetFrameLatencyWaitableObject: proc "stdcall" (this: ^ISwapChain2) -> HANDLE,
SetMatrixTransform: proc "stdcall" (this: ^ISwapChain2, pMatrix: ^MATRIX_3X2_F) -> HRESULT,
GetMatrixTransform: proc "stdcall" (this: ^ISwapChain2, pMatrix: ^MATRIX_3X2_F) -> HRESULT,
SetSourceSize: proc "system" (this: ^ISwapChain2, Width: u32, Height: u32) -> HRESULT,
GetSourceSize: proc "system" (this: ^ISwapChain2, pWidth: ^u32, pHeight: ^u32) -> HRESULT,
SetMaximumFrameLatency: proc "system" (this: ^ISwapChain2, MaxLatency: u32) -> HRESULT,
GetMaximumFrameLatency: proc "system" (this: ^ISwapChain2, pMaxLatency: ^u32) -> HRESULT,
GetFrameLatencyWaitableObject: proc "system" (this: ^ISwapChain2) -> HANDLE,
SetMatrixTransform: proc "system" (this: ^ISwapChain2, pMatrix: ^MATRIX_3X2_F) -> HRESULT,
GetMatrixTransform: proc "system" (this: ^ISwapChain2, pMatrix: ^MATRIX_3X2_F) -> HRESULT,
}
IOutput2_UUID_STRING :: "595E39D1-2724-4663-99B1-DA969DE28364"
@@ -974,7 +986,7 @@ IOutput2 :: struct #raw_union {
}
IOutput2_VTable :: struct {
using idxgioutput1_vtable: IOutput1_VTable,
SupportsOverlays: proc "stdcall" (this: ^IOutput2) -> BOOL,
SupportsOverlays: proc "system" (this: ^IOutput2) -> BOOL,
}
IFactory3_UUID_STRING :: "25483823-CD46-4C7D-86CA-47AA95B837BD"
@@ -985,16 +997,17 @@ IFactory3 :: struct #raw_union {
}
IFactory3_VTable :: struct {
using idxgifactory2_vtable: IFactory2_VTable,
GetCreationFlags: proc "stdcall" (this: ^IFactory3) -> u32,
GetCreationFlags: proc "system" (this: ^IFactory3) -> CREATE_FACTORY,
}
DECODE_SWAP_CHAIN_DESC :: struct {
Flags: u32,
Flags: SWAP_CHAIN,
}
MULTIPLANE_OVERLAY_YCbCr_FLAGS :: enum u32 { // TODO: convert to bit_set
NOMINAL_RANGE = 0x1,
BT709 = 0x2,
xvYCC = 0x4,
MULTIPLANE_OVERLAY_YCbCr :: distinct bit_set[MULTIPLANE_OVERLAY_YCbCr_FLAGS; u32]
MULTIPLANE_OVERLAY_YCbCr_FLAGS :: enum u32 {
NOMINAL_RANGE = 0,
BT709,
xvYCC,
}
@@ -1006,15 +1019,15 @@ IDecodeSwapChain :: struct #raw_union {
}
IDecodeSwapChain_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
PresentBuffer: proc "stdcall" (this: ^IDecodeSwapChain, BufferToPresent: u32, SyncInterval: u32, Flags: u32) -> HRESULT,
SetSourceRect: proc "stdcall" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT,
SetTargetRect: proc "stdcall" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT,
SetDestSize: proc "stdcall" (this: ^IDecodeSwapChain, Width: u32, Height: u32) -> HRESULT,
GetSourceRect: proc "stdcall" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT,
GetTargetRect: proc "stdcall" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT,
GetDestSize: proc "stdcall" (this: ^IDecodeSwapChain, pWidth: ^u32, pHeight: ^u32) -> HRESULT,
SetColorSpace: proc "stdcall" (this: ^IDecodeSwapChain, ColorSpace: MULTIPLANE_OVERLAY_YCbCr_FLAGS) -> HRESULT,
GetColorSpace: proc "stdcall" (this: ^IDecodeSwapChain) -> MULTIPLANE_OVERLAY_YCbCr_FLAGS,
PresentBuffer: proc "system" (this: ^IDecodeSwapChain, BufferToPresent: u32, SyncInterval: u32, Flags: PRESENT) -> HRESULT,
SetSourceRect: proc "system" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT,
SetTargetRect: proc "system" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT,
SetDestSize: proc "system" (this: ^IDecodeSwapChain, Width: u32, Height: u32) -> HRESULT,
GetSourceRect: proc "system" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT,
GetTargetRect: proc "system" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT,
GetDestSize: proc "system" (this: ^IDecodeSwapChain, pWidth: ^u32, pHeight: ^u32) -> HRESULT,
SetColorSpace: proc "system" (this: ^IDecodeSwapChain, ColorSpace: MULTIPLANE_OVERLAY_YCbCr) -> HRESULT,
GetColorSpace: proc "system" (this: ^IDecodeSwapChain) -> MULTIPLANE_OVERLAY_YCbCr,
}
IFactoryMedia_UUID_STRING :: "41E7D1F2-A591-4F7B-A2E5-FA9C843E1C12"
@@ -1025,8 +1038,8 @@ IFactoryMedia :: struct #raw_union {
}
IFactoryMedia_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
CreateSwapChainForCompositionSurfaceHandle: proc "stdcall" (this: ^IFactoryMedia, pDevice: ^IUnknown, hSurface: HANDLE, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT,
CreateDecodeSwapChainForCompositionSurfaceHandle: proc "stdcall" (this: ^IFactoryMedia, pDevice: ^IUnknown, hSurface: HANDLE, pDesc: ^DECODE_SWAP_CHAIN_DESC, pYuvDecodeBuffers: ^IResource, pRestrictToOutput: ^IOutput, ppSwapChain: ^^IDecodeSwapChain) -> HRESULT,
CreateSwapChainForCompositionSurfaceHandle: proc "system" (this: ^IFactoryMedia, pDevice: ^IUnknown, hSurface: HANDLE, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT,
CreateDecodeSwapChainForCompositionSurfaceHandle: proc "system" (this: ^IFactoryMedia, pDevice: ^IUnknown, hSurface: HANDLE, pDesc: ^DECODE_SWAP_CHAIN_DESC, pYuvDecodeBuffers: ^IResource, pRestrictToOutput: ^IOutput, ppSwapChain: ^^IDecodeSwapChain) -> HRESULT,
}
FRAME_PRESENTATION_MODE :: enum i32 {
COMPOSED = 0,
@@ -1054,13 +1067,14 @@ ISwapChainMedia :: struct #raw_union {
}
ISwapChainMedia_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
GetFrameStatisticsMedia: proc "stdcall" (this: ^ISwapChainMedia, pStats: ^FRAME_STATISTICS_MEDIA) -> HRESULT,
SetPresentDuration: proc "stdcall" (this: ^ISwapChainMedia, Duration: u32) -> HRESULT,
CheckPresentDurationSupport: proc "stdcall" (this: ^ISwapChainMedia, DesiredPresentDuration: u32, pClosestSmallerPresentDuration: ^u32, pClosestLargerPresentDuration: ^u32) -> HRESULT,
GetFrameStatisticsMedia: proc "system" (this: ^ISwapChainMedia, pStats: ^FRAME_STATISTICS_MEDIA) -> HRESULT,
SetPresentDuration: proc "system" (this: ^ISwapChainMedia, Duration: u32) -> HRESULT,
CheckPresentDurationSupport: proc "system" (this: ^ISwapChainMedia, DesiredPresentDuration: u32, pClosestSmallerPresentDuration: ^u32, pClosestLargerPresentDuration: ^u32) -> HRESULT,
}
OVERLAY_SUPPORT_FLAG :: enum u32 { // TODO: convert to bit_set
DIRECT = 0x1,
SCALING = 0x2,
OVERLAY_SUPPORT :: distinct bit_set[OVERLAY_SUPPORT_FLAG; u32]
OVERLAY_SUPPORT_FLAG :: enum u32 {
DIRECT = 0,
SCALING = 1,
}
@@ -1072,11 +1086,12 @@ IOutput3 :: struct #raw_union {
}
IOutput3_VTable :: struct {
using idxgioutput2_vtable: IOutput2_VTable,
CheckOverlaySupport: proc "stdcall" (this: ^IOutput3, EnumFormat: FORMAT, pConcernedDevice: ^IUnknown, pFlags: ^u32) -> HRESULT,
CheckOverlaySupport: proc "system" (this: ^IOutput3, EnumFormat: FORMAT, pConcernedDevice: ^IUnknown, pFlags: ^OVERLAY_SUPPORT) -> HRESULT,
}
SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG :: enum u32 { // TODO: convert to bit_set
PRESENT = 0x1,
OVERLAY_PRESENT = 0x2,
SWAP_CHAIN_COLOR_SPACE_SUPPORT :: distinct bit_set[SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG; u32]
SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG :: enum u32 {
PRESENT = 0,
OVERLAY_PRESENT = 1,
}
@@ -1088,13 +1103,14 @@ ISwapChain3 :: struct #raw_union {
}
ISwapChain3_VTable :: struct {
using idxgiswapchain2_vtable: ISwapChain2_VTable,
GetCurrentBackBufferIndex: proc "stdcall" (this: ^ISwapChain3) -> u32,
CheckColorSpaceSupport: proc "stdcall" (this: ^ISwapChain3, ColorSpace: COLOR_SPACE_TYPE, pColorSpaceSupport: ^u32) -> HRESULT,
SetColorSpace1: proc "stdcall" (this: ^ISwapChain3, ColorSpace: COLOR_SPACE_TYPE) -> HRESULT,
ResizeBuffers1: proc "stdcall" (this: ^ISwapChain3, BufferCount: u32, Width: u32, Height: u32, Format: FORMAT, SwapChainFlags: u32, pCreationNodeMask: ^u32, ppPresentQueue: ^^IUnknown) -> HRESULT,
GetCurrentBackBufferIndex: proc "system" (this: ^ISwapChain3) -> u32,
CheckColorSpaceSupport: proc "system" (this: ^ISwapChain3, ColorSpace: COLOR_SPACE_TYPE, pColorSpaceSupport: ^SWAP_CHAIN_COLOR_SPACE_SUPPORT) -> HRESULT,
SetColorSpace1: proc "system" (this: ^ISwapChain3, ColorSpace: COLOR_SPACE_TYPE) -> HRESULT,
ResizeBuffers1: proc "system" (this: ^ISwapChain3, BufferCount: u32, Width: u32, Height: u32, Format: FORMAT, SwapChainFlags: SWAP_CHAIN, pCreationNodeMask: ^u32, ppPresentQueue: ^^IUnknown) -> HRESULT,
}
OVERLAY_COLOR_SPACE_SUPPORT_FLAG :: enum u32 { // TODO: convert to bit_set
PRESENT = 0x1,
OVERLAY_COLOR_SPACE_SUPPORT :: distinct bit_set[OVERLAY_COLOR_SPACE_SUPPORT_FLAG; u32]
OVERLAY_COLOR_SPACE_SUPPORT_FLAG :: enum u32 {
PRESENT = 0,
}
@@ -1106,7 +1122,7 @@ IOutput4 :: struct #raw_union {
}
IOutput4_VTable :: struct {
using idxgioutput3_vtable: IOutput3_VTable,
CheckOverlayColorSpaceSupport: proc "stdcall" (this: ^IOutput4, Format: FORMAT, ColorSpace: COLOR_SPACE_TYPE, pConcernedDevice: ^IUnknown, pFlags: ^u32) -> HRESULT,
CheckOverlayColorSpaceSupport: proc "system" (this: ^IOutput4, Format: FORMAT, ColorSpace: COLOR_SPACE_TYPE, pConcernedDevice: ^IUnknown, pFlags: ^OVERLAY_COLOR_SPACE_SUPPORT) -> HRESULT,
}
IFactory4_UUID_STRING :: "1BC6EA02-EF36-464F-BF0C-21CA39E5168A"
@@ -1117,8 +1133,8 @@ IFactory4 :: struct #raw_union {
}
IFactory4_VTable :: struct {
using idxgifactory3_vtable: IFactory3_VTable,
EnumAdapterByLuid: proc "stdcall" (this: ^IFactory4, AdapterLuid: LUID, riid: ^IID, ppvAdapter: ^rawptr) -> HRESULT,
EnumWarpAdapter: proc "stdcall" (this: ^IFactory4, riid: ^IID, ppvAdapter: ^rawptr) -> HRESULT,
EnumAdapterByLuid: proc "system" (this: ^IFactory4, AdapterLuid: LUID, riid: ^IID, ppvAdapter: ^rawptr) -> HRESULT,
EnumWarpAdapter: proc "system" (this: ^IFactory4, riid: ^IID, ppvAdapter: ^rawptr) -> HRESULT,
}
MEMORY_SEGMENT_GROUP :: enum i32 {
LOCAL = 0,
@@ -1141,12 +1157,12 @@ IAdapter3 :: struct #raw_union {
}
IAdapter3_VTable :: struct {
using idxgiadapter2_vtable: IAdapter2_VTable,
RegisterHardwareContentProtectionTeardownStatusEvent: proc "stdcall" (this: ^IAdapter3, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT,
UnregisterHardwareContentProtectionTeardownStatus: proc "stdcall" (this: ^IAdapter3, dwCookie: u32),
QueryVideoMemoryInfo: proc "stdcall" (this: ^IAdapter3, NodeIndex: u32, MemorySegmentGroup: MEMORY_SEGMENT_GROUP, pVideoMemoryInfo: ^QUERY_VIDEO_MEMORY_INFO) -> HRESULT,
SetVideoMemoryReservation: proc "stdcall" (this: ^IAdapter3, NodeIndex: u32, MemorySegmentGroup: MEMORY_SEGMENT_GROUP, Reservation: u64) -> HRESULT,
RegisterVideoMemoryBudgetChangeNotificationEvent: proc "stdcall" (this: ^IAdapter3, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT,
UnregisterVideoMemoryBudgetChangeNotification: proc "stdcall" (this: ^IAdapter3, dwCookie: u32),
RegisterHardwareContentProtectionTeardownStatusEvent: proc "system" (this: ^IAdapter3, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT,
UnregisterHardwareContentProtectionTeardownStatus: proc "system" (this: ^IAdapter3, dwCookie: u32),
QueryVideoMemoryInfo: proc "system" (this: ^IAdapter3, NodeIndex: u32, MemorySegmentGroup: MEMORY_SEGMENT_GROUP, pVideoMemoryInfo: ^QUERY_VIDEO_MEMORY_INFO) -> HRESULT,
SetVideoMemoryReservation: proc "system" (this: ^IAdapter3, NodeIndex: u32, MemorySegmentGroup: MEMORY_SEGMENT_GROUP, Reservation: u64) -> HRESULT,
RegisterVideoMemoryBudgetChangeNotificationEvent: proc "system" (this: ^IAdapter3, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT,
UnregisterVideoMemoryBudgetChangeNotification: proc "system" (this: ^IAdapter3, dwCookie: u32),
}
ERROR_ACCESS_DENIED :: HRESULT(-2005270485) //0x887A002B
+41 -41
View File
@@ -77,43 +77,43 @@ IInfoQueue :: struct #raw_union {
}
IInfoQueue_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
SetMessageCountLimit: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, MessageCountLimit: UINT64) -> HRESULT,
ClearStoredMessages: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID),
GetMessage: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, MessageIndex: UINT64, pMessage: ^INFO_QUEUE_MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT,
GetNumStoredMessagesAllowedByRetrievalFilters: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetNumStoredMessages: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetNumMessagesDiscardedByMessageCountLimit: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetMessageCountLimit: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetNumMessagesAllowedByStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetNumMessagesDeniedByStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
AddStorageFilterEntries: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: INFO_QUEUE_FILTER) -> HRESULT,
GetStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT,
ClearStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID),
PushEmptyStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushDenyAllStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushCopyOfStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT,
PopStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID),
GetStorageFilterStackSize: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT,
AddRetrievalFilterEntries: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT,
GetRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT,
ClearRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID),
PushEmptyRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushDenyAllRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushCopyOfRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT,
PopRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID),
GetRetrievalFilterStackSize: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT,
AddMessage: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY, Severity: INFO_QUEUE_MESSAGE_SEVERITY, ID: INFO_QUEUE_MESSAGE_ID, pDescription: LPCSTR) -> HRESULT,
AddApplicationMessage: proc "stdcall" (this: ^IInfoQueue, Severity: INFO_QUEUE_MESSAGE_SEVERITY, pDescription: LPCSTR) -> HRESULT,
SetBreakOnCategory: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT,
SetBreakOnSeverity: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Severity: INFO_QUEUE_MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT,
SetBreakOnID: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, ID: INFO_QUEUE_MESSAGE_ID, bEnable: BOOL) -> HRESULT,
GetBreakOnCategory: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY) -> BOOL,
GetBreakOnSeverity: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Severity: INFO_QUEUE_MESSAGE_SEVERITY) -> BOOL,
GetBreakOnID: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, ID: INFO_QUEUE_MESSAGE_ID) -> BOOL,
SetMuteDebugOutput: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, bMute: BOOL),
GetMuteDebugOutput: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> BOOL,
SetMessageCountLimit: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, MessageCountLimit: UINT64) -> HRESULT,
ClearStoredMessages: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID),
GetMessage: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, MessageIndex: UINT64, pMessage: ^INFO_QUEUE_MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT,
GetNumStoredMessagesAllowedByRetrievalFilters: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetNumStoredMessages: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetNumMessagesDiscardedByMessageCountLimit: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetMessageCountLimit: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetNumMessagesAllowedByStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
GetNumMessagesDeniedByStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64,
AddStorageFilterEntries: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: INFO_QUEUE_FILTER) -> HRESULT,
GetStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT,
ClearStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID),
PushEmptyStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushDenyAllStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushCopyOfStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT,
PopStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID),
GetStorageFilterStackSize: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT,
AddRetrievalFilterEntries: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT,
GetRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT,
ClearRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID),
PushEmptyRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushDenyAllRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushCopyOfRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT,
PushRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT,
PopRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID),
GetRetrievalFilterStackSize: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT,
AddMessage: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY, Severity: INFO_QUEUE_MESSAGE_SEVERITY, ID: INFO_QUEUE_MESSAGE_ID, pDescription: LPCSTR) -> HRESULT,
AddApplicationMessage: proc "system" (this: ^IInfoQueue, Severity: INFO_QUEUE_MESSAGE_SEVERITY, pDescription: LPCSTR) -> HRESULT,
SetBreakOnCategory: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT,
SetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Severity: INFO_QUEUE_MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT,
SetBreakOnID: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, ID: INFO_QUEUE_MESSAGE_ID, bEnable: BOOL) -> HRESULT,
GetBreakOnCategory: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY) -> BOOL,
GetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Severity: INFO_QUEUE_MESSAGE_SEVERITY) -> BOOL,
GetBreakOnID: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, ID: INFO_QUEUE_MESSAGE_ID) -> BOOL,
SetMuteDebugOutput: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, bMute: BOOL),
GetMuteDebugOutput: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> BOOL,
}
IDebug_UUID_STRING :: "119E7452-DE9E-40fe-8806-88F90C12B441"
@@ -124,7 +124,7 @@ IDebug :: struct #raw_union {
}
IDebug_VTable :: struct {
using iunknown_vtable: IUnknown_VTable,
ReportLiveObjects: proc "stdcall" (this: ^IDebug, apiid: GUID, flags: DEBUG_RLO_FLAGS),
ReportLiveObjects: proc "system" (this: ^IDebug, apiid: GUID, flags: DEBUG_RLO_FLAGS),
}
IDebug1_UUID_STRING :: "c5a05f0c-16f2-4adf-9f4d-a8c4d58ac550"
@@ -135,7 +135,7 @@ IDebug1 :: struct #raw_union {
}
IDebug1_VTable :: struct {
using idxgidebug_vtable: IDebug_VTable,
EnableLeakTrackingForThread: proc "stdcall" (this: ^IDebug1),
DisableLeakTrackingForThread: proc "stdcall" (this: ^IDebug1),
IsLeakTrackingEnabledForThread: proc "stdcall" (this: ^IDebug1) -> BOOL,
EnableLeakTrackingForThread: proc "system" (this: ^IDebug1),
DisableLeakTrackingForThread: proc "system" (this: ^IDebug1),
IsLeakTrackingEnabledForThread: proc "system" (this: ^IDebug1) -> BOOL,
}
+1 -1
View File
@@ -181,7 +181,7 @@ foreign glfw {
SetCharCallback :: proc(window: WindowHandle, cbfun: CharProc) -> CharProc ---
SetCharModsCallback :: proc(window: WindowHandle, cbfun: CharModsProc) -> CharModsProc ---
SetCursorEnterCallback :: proc(window: WindowHandle, cbfun: CursorEnterProc) -> CursorEnterProc ---
SetJoystickCallback :: proc(window: WindowHandle, cbfun: JoystickProc) -> JoystickProc ---
SetJoystickCallback :: proc(cbfun: JoystickProc) -> JoystickProc ---
SetErrorCallback :: proc(cbfun: ErrorProc) -> ErrorProc ---
}
+1 -1
View File
@@ -2,7 +2,7 @@
package glfw
import NS "vendor:darwin/foundation"
import NS "vendor:darwin/Foundation"
when GLFW_SHARED {
#panic("Dynamic linking for glfw is not supported for darwin yet")
+1 -3
View File
@@ -10,10 +10,8 @@ when MINIAUDIO_SHARED {
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
handle :: distinct rawptr
+1 -3
View File
@@ -4,10 +4,8 @@ import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/************************************************************************************************************************************************************
+1 -3
View File
@@ -4,10 +4,8 @@ import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/************************************************************************************************************************************************************
+1 -3
View File
@@ -2,10 +2,8 @@ package miniaudio
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
import "core:c"
+1 -3
View File
@@ -4,10 +4,8 @@ import c "core:c/libc"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/*
+1 -3
View File
@@ -4,10 +4,8 @@ import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/************************************************************************************************************************************************************
+1 -3
View File
@@ -4,10 +4,8 @@ import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/************************************************************************************************************************************************************
+1 -3
View File
@@ -4,10 +4,8 @@ import c "core:c/libc"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/**************************************************************************************************************************************************************
+1 -3
View File
@@ -4,10 +4,8 @@ import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
waveform_type :: enum c.int {
+1 -3
View File
@@ -4,10 +4,8 @@ import c "core:c/libc"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/*
+1 -3
View File
@@ -4,10 +4,8 @@ import c "core:c/libc"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
MAX_LOG_CALLBACKS :: 4
+1 -3
View File
@@ -4,10 +4,8 @@ import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/************************************************************************************************************************************************************
+1 -3
View File
@@ -4,10 +4,8 @@ import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/************************************************************************************************************************************************************
+1 -3
View File
@@ -2,10 +2,8 @@ package miniaudio
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
@(default_calling_convention="c", link_prefix="ma_")
+1 -3
View File
@@ -4,10 +4,8 @@ import c "core:c/libc"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
@(default_calling_convention="c", link_prefix="ma_")
+1 -3
View File
@@ -4,10 +4,8 @@ import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
} else when ODIN_OS == .Linux {
foreign import lib "lib/miniaudio.a"
} else {
foreign import lib "system:miniaudio"
foreign import lib "lib/miniaudio.a"
}
/************************************************************************************************************************************************************
+1 -1
View File
@@ -39,7 +39,7 @@ features
- **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
- Written in plain C code (C99) using PascalCase/camelCase notation
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3 or ES 2.0**)
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3, ES 2.0 or ES 3.0**)
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
- Multiple **Fonts** formats supported (TTF, Image fonts, AngelCode fonts)
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
libraylib.so.500
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
libraylib.so.5.0.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
libraylib.5.0.0.dylib
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
libraylib.5.0.0.dylib
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
libraylib.5.0.0.dylib
BIN
View File
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
libraylib.5.0.0.dylib
+20 -3
View File
@@ -23,7 +23,9 @@ when ODIN_OS == .Windows {
} else when ODIN_OS == .Darwin {
when ODIN_ARCH == .arm64 {
when RAYGUI_SHARED {
// #panic("Cannot link libraygui.450.dylib: not in the vendor collection")
foreign import lib {
"macos-arm64/libraygui.dylib",
}
} else {
foreign import lib {
"macos-arm64/libraygui.a",
@@ -34,7 +36,9 @@ when ODIN_OS == .Windows {
}
} else {
when RAYGUI_SHARED {
// #panic("Cannot link libraygui.450.dylib: not in the vendor collection")
foreign import lib {
"macos/libraygui.dylib",
}
} else {
foreign import lib {
"macos/libraygui.a",
@@ -72,6 +76,18 @@ GuiTextAlignment :: enum c.int {
TEXT_ALIGN_RIGHT,
}
GuiTextAlignmentVertical :: enum c.int {
TEXT_ALIGN_TOP = 0,
TEXT_ALIGN_MIDDLE,
TEXT_ALIGN_BOTTOM,
}
GuiTextWrapMode :: enum c.int {
TEXT_WRAP_NONE = 0,
TEXT_WRAP_CHAR,
TEXT_WRAP_WORD,
}
// Gui controls
GuiControl :: enum c.int {
// Default -> populates to all controls when set
@@ -284,6 +300,7 @@ foreign lib {
GuiLabelButton :: proc(bounds: Rectangle, text: cstring) -> bool --- // Label button control, show true when clicked
GuiToggle :: proc(bounds: Rectangle, text: cstring, active: ^bool) -> c.int --- // Toggle Button control, returns true when active
GuiToggleGroup :: proc(bounds: Rectangle, text: cstring, active: ^c.int) -> c.int --- // Toggle Group control, returns active toggle index
GuiToggleSlider :: proc(bounds: Rectangle, text: cstring, active: ^c.int) -> c.int ---
GuiCheckBox :: proc(bounds: Rectangle, text: cstring, checked: ^bool) -> bool --- // Check Box control, returns true when active
GuiComboBox :: proc(bounds: Rectangle, text: cstring, active: ^c.int) -> c.int --- // Combo Box control, returns selected item index
@@ -573,4 +590,4 @@ GuiIconName :: enum c.int {
ICON_253 = 253,
ICON_254 = 254,
ICON_255 = 255,
}
}
+164 -73
View File
@@ -1,9 +1,9 @@
/*
Package vendor:raylib implements bindings for version 4.5 of the raylib library (https://www.raylib.com/)
Package vendor:raylib implements bindings for version 5.0 of the raylib library (https://www.raylib.com/)
*********************************************************************************************
*
* raylib v4.5 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
* raylib v5.0 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
*
* FEATURES:
* - NO external dependencies, all required libraries included with raylib
@@ -124,7 +124,7 @@ when ODIN_OS == .Windows {
// multiple copies of raylib.so, but since these bindings are for
// particular version of the library, I better specify it. Ideally,
// though, it's best specified in terms of major (.so.4)
"linux/libraylib.so.450",
"linux/libraylib.so.500",
"system:dl",
"system:pthread",
}
@@ -139,7 +139,7 @@ when ODIN_OS == .Windows {
when ODIN_ARCH == .arm64 {
when RAYLIB_SHARED {
foreign import lib {
"macos-arm64/libraylib.450.dylib",
"macos-arm64/libraylib.500.dylib",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
@@ -155,7 +155,7 @@ when ODIN_OS == .Windows {
} else {
when RAYLIB_SHARED {
foreign import lib {
"macos/libraylib.450.dylib",
"macos/libraylib.500.dylib",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
@@ -173,7 +173,10 @@ when ODIN_OS == .Windows {
foreign import lib "system:raylib"
}
VERSION :: "4.5"
VERSION_MAJOR :: 5
VERSION_MINOR :: 0
VERSION_PATCH :: 0
VERSION :: "5.0"
PI :: 3.14159265358979323846
DEG2RAD :: PI/180.0
@@ -514,6 +517,19 @@ FilePathList :: struct {
paths: [^]cstring, // Filepaths entries
}
// Automation event
AutomationEvent :: struct {
frame: c.uint, // Event frame
type: c.uint, // Event type (AutomationEventType)
params: [4]c.int, // Event parameters (if required) ---
}
// Automation event list
AutomationEventList :: struct {
capacity: c.uint, // Events max entries (MAX_AUTOMATION_EVENTS)
count: c.uint, // Events entries count
events: [^]AutomationEvent, // Events entries
}
//----------------------------------------------------------------------------------
// Enumerators Definition
@@ -535,6 +551,7 @@ ConfigFlag :: enum c.int {
WINDOW_TRANSPARENT = 4, // Set to allow transparent framebuffer
WINDOW_HIGHDPI = 13, // Set to support HighDPI
WINDOW_MOUSE_PASSTHROUGH = 14, // Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
BORDERLESS_WINDOWED_MODE = 15, // Set to run program in borderless windowed mode
MSAA_4X_HINT = 5, // Set to try enabling MSAA 4X
INTERLACED_HINT = 16, // Set to try enabling interlaced video format (for V3D)
}
@@ -805,6 +822,9 @@ PixelFormat :: enum c.int {
UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
UNCOMPRESSED_R16, // 16 bpp (1 channel - float)
UNCOMPRESSED_R16G16B16, // 16*3 bpp (3 channels - float)
UNCOMPRESSED_R16G16B16A16, // 16*4 bpp (4 channels - float)
COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
COMPRESSED_DXT3_RGBA, // 8 bpp
@@ -869,7 +889,7 @@ BlendMode :: enum c.int {
// Gestures
// NOTE: It could be used as flags to enable only some gestures
Gesture :: enum c.int {
Gesture :: enum c.uint {
TAP = 0, // Tap gesture
DOUBLETAP = 1, // Double tap gesture
HOLD = 2, // Hold gesture
@@ -881,7 +901,7 @@ Gesture :: enum c.int {
PINCH_IN = 8, // Pinch in gesture
PINCH_OUT = 9, // Pinch out gesture
}
Gestures :: distinct bit_set[Gesture; c.int]
Gestures :: distinct bit_set[Gesture; c.uint]
// Camera system modes
CameraMode :: enum c.int {
@@ -910,8 +930,8 @@ NPatchLayout :: enum c.int {
// Callbacks to hook some internal functions
// WARNING: This callbacks are intended for advance users
TraceLogCallback :: #type proc "c" (logLevel: TraceLogLevel, text: cstring, args: c.va_list) // Logging: Redirect trace log messages
LoadFileDataCallback :: #type proc "c"(fileName: cstring, bytesRead: ^c.uint) -> [^]u8 // FileIO: Load binary data
SaveFileDataCallback :: #type proc "c" (fileName: cstring, data: rawptr, bytesToWrite: c.uint) -> bool // FileIO: Save binary data
LoadFileDataCallback :: #type proc "c"(fileName: cstring, dataSize: ^c.int) -> [^]u8 // FileIO: Load binary data
SaveFileDataCallback :: #type proc "c" (fileName: cstring, data: rawptr, dataSize: c.int) -> bool // FileIO: Save binary data
LoadFileTextCallback :: #type proc "c" (fileName: cstring) -> [^]u8 // FileIO: Load text data
SaveFileTextCallback :: #type proc "c" (fileName: cstring, text: cstring) -> bool // FileIO: Save text data
@@ -932,7 +952,7 @@ foreign lib {
// Window-related functions
InitWindow :: proc(width, height: c.int, title: cstring) --- // Initialize window and OpenGL context
WindowShouldClose :: proc() -> bool --- // Check if KEY_ESCAPE pressed or Close icon pressed
WindowShouldClose :: proc() -> bool --- // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
CloseWindow :: proc() --- // Close window and unload OpenGL context
IsWindowReady :: proc() -> bool --- // Check if window has been initialized successfully
IsWindowFullscreen :: proc() -> bool --- // Check if window is currently fullscreen
@@ -945,17 +965,20 @@ foreign lib {
SetWindowState :: proc(flags: ConfigFlags) --- // Set window configuration state using flags (only PLATFORM_DESKTOP)
ClearWindowState :: proc(flags: ConfigFlags) --- // Clear window configuration state flags
ToggleFullscreen :: proc() --- // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
ToggleBorderlessWindowed :: proc() --- // Toggle window state: borderless windowed (only PLATFORM_DESKTOP)
MaximizeWindow :: proc() --- // Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
MinimizeWindow :: proc() --- // Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
RestoreWindow :: proc() --- // Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
SetWindowIcon :: proc(image: Image) --- // Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)
SetWindowIcons :: proc(images: [^]Image, count: c.int) --- // Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
SetWindowTitle :: proc(title: cstring) --- // Set title for window (only PLATFORM_DESKTOP)
SetWindowTitle :: proc(title: cstring) --- // Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)
SetWindowPosition :: proc(x, y: c.int) --- // Set window position on screen (only PLATFORM_DESKTOP)
SetWindowMonitor :: proc(monitor: c.int) --- // Set monitor for the current window (fullscreen mode)
SetWindowMonitor :: proc(monitor: c.int) --- // Set monitor for the current window
SetWindowMinSize :: proc(width, height: c.int) --- // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
SetWindowMaxSize :: proc(width, height: c.int) --- // Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
SetWindowSize :: proc(width, height: c.int) --- // Set window dimensions
SetWindowOpacity :: proc(opacity: f32) --- // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
SetWindowFocused :: proc() --- // Set window focused (only PLATFORM_DESKTOP)
GetWindowHandle :: proc() -> rawptr --- // Get native window handle
GetScreenWidth :: proc() -> c.int --- // Get current screen width
GetScreenHeight :: proc() -> c.int --- // Get current screen height
@@ -971,7 +994,7 @@ foreign lib {
GetMonitorRefreshRate :: proc(monitor: c.int) -> c.int --- // Get specified monitor refresh rate
GetWindowPosition :: proc() -> Vector2 --- // Get window position XY on monitor
GetWindowScaleDPI :: proc() -> Vector2 --- // Get window scale DPI factor
GetMonitorName :: proc(monitor: c.int) -> cstring --- // Get the human-readable, UTF-8 encoded name of the primary monitor
GetMonitorName :: proc(monitor: c.int) -> cstring --- // Get the human-readable, UTF-8 encoded name of the specified monitor
SetClipboardText :: proc(text: cstring) --- // Set clipboard text content
GetClipboardText :: proc() -> cstring --- // Get clipboard text content
EnableEventWaiting :: proc() --- // Enable waiting for events on EndDrawing(), no automatic event polling
@@ -980,7 +1003,7 @@ foreign lib {
// Custom frame control functions
// NOTE: Those functions are intended for advance users that want full control over the frame processing
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
SwapScreenBuffer :: proc() --- // Swap back buffer with front buffer (screen drawing)
@@ -1053,21 +1076,26 @@ foreign lib {
GetFrameTime :: proc() -> f32 --- // Returns time in seconds for last frame drawn (delta time)
GetTime :: proc() -> f64 --- // Returns elapsed time in seconds since InitWindow()
// Random value generation functions
SetRandomSeed :: proc(seed: c.uint) --- // Set the seed for the random number generator
GetRandomValue :: proc(min, max: c.int) -> c.int --- // Get a random value between min and max (both included)
LoadRandomSequence :: proc(count : c.uint, min, max: c.int) --- // Load random values sequence, no values repeated
UnloadRandomSequence :: proc(sequence : ^c.int) --- // Unload random values sequence
// Misc. functions
GetRandomValue :: proc(min, max: c.int) -> c.int --- // Returns a random value between min and max (both included)
SetRandomSeed :: proc(seed: c.uint) --- // Set the seed for the random number generator
TakeScreenshot :: proc(fileName: cstring) --- // Takes a screenshot of current screen (filename extension defines format)
SetConfigFlags :: proc(flags: ConfigFlags) --- // Setup init configuration flags (view FLAGS)
SetConfigFlags :: proc(flags: ConfigFlags) --- // Setup init configuration flags (view FLAGS). NOTE: This function is expected to be called before window creation
OpenURL :: proc(url: cstring) --- // Open URL with default system browser (if available)
// NOTE: Following functions implemented in module [utils]
//------------------------------------------------------------------
TraceLog :: proc(logLevel: TraceLogLevel, text: cstring, #c_vararg args: ..any) --- // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)
SetTraceLogLevel :: proc(logLevel: TraceLogLevel) --- // Set the current threshold (minimum) log level
MemAlloc :: proc(size: c.uint) -> rawptr --- // Internal memory allocator
MemRealloc :: proc(ptr: rawptr, size: c.uint) -> rawptr --- // Internal memory reallocator
MemFree :: proc(ptr: rawptr) --- // Internal memory free
OpenURL :: proc(url: cstring) --- // Open URL with default system browser (if available)
// Set custom callbacks
// WARNING: Callbacks setup is intended for advance users
@@ -1079,13 +1107,16 @@ foreign lib {
// Files management functions
LoadFileData :: proc(fileName: cstring, bytesRead: ^c.uint) -> [^]byte --- // Load file data as byte array (read)
UnloadFileData :: proc(data: [^]byte) --- // Unload file data allocated by LoadFileData()
SaveFileData :: proc(fileName: cstring, data: rawptr, bytesToWrite: c.uint) -> bool --- // Save data to file from byte array (write), returns true on success
ExportDataAsCode :: proc(data: rawptr, size: c.uint, fileName: cstring) -> bool --- // Export data to code (.h), returns true on success
LoadFileText :: proc(fileName: cstring) -> [^]byte --- // Load text data from file (read), returns a '\0' terminated string
UnloadFileText :: proc(text: [^]byte) --- // Unload file text data allocated by LoadFileText()
SaveFileText :: proc(fileName: cstring, text: [^]byte) -> bool --- // Save text data to file (write), string must be '\0' terminated, returns true on success
LoadFileData :: proc(fileName: cstring, dataSize: ^c.int) -> [^]byte --- // Load file data as byte array (read)
UnloadFileData :: proc(data: [^]byte) --- // Unload file data allocated by LoadFileData()
SaveFileData :: proc(fileName: cstring, data: rawptr, dataSize: c.int) -> bool --- // Save data to file from byte array (write), returns true on success
ExportDataAsCode :: proc(data: rawptr, dataSize: c.int, fileName: cstring) -> bool --- // Export data to code (.h), returns true on success
LoadFileText :: proc(fileName: cstring) -> [^]byte --- // Load text data from file (read), returns a '\0' terminated string
UnloadFileText :: proc(text: [^]byte) --- // Unload file text data allocated by LoadFileText()
SaveFileText :: proc(fileName: cstring, text: [^]byte) -> bool --- // Save text data to file (write), string must be '\0' terminated, returns true on success
// File system functions
FileExists :: proc(fileName: cstring) -> bool --- // Check if file exists
DirectoryExists :: proc(dirPath: cstring) -> bool --- // Check if a directory path exists
IsFileExtension :: proc(fileName, ext: cstring) -> bool --- // Check file extension (including point: .png, .wav)
@@ -1096,7 +1127,7 @@ foreign lib {
GetDirectoryPath :: proc(filePath: cstring) -> cstring --- // Get full path for a given fileName with path (uses static string)
GetPrevDirectoryPath :: proc(dirPath: cstring) -> cstring --- // Get previous directory path for a given path (uses static string)
GetWorkingDirectory :: proc() -> cstring --- // Get current working directory (uses static string)
GetApplicationDirectory :: proc() -> cstring --- // Get the directory if the running application (uses static string)
GetApplicationDirectory :: proc() -> cstring --- // Get the directory of the running application (uses static string)
ChangeDirectory :: proc(dir: cstring) -> bool --- // Change working directory, return true on success
IsPathFile :: proc(path: cstring) -> bool --- // Check if a given path is a file or a directory
LoadDirectoryFiles :: proc(dirPath: cstring) -> FilePathList --- // Load directory filepaths
@@ -1114,19 +1145,31 @@ foreign lib {
EncodeDataBase64 :: proc(data: rawptr, dataSize: c.int, outputSize: ^c.int) -> [^]byte --- // Encode data to Base64 string, memory must be MemFree()
DecodeDataBase64 :: proc(data: rawptr, outputSize: ^c.int) -> [^]byte --- // Decode Base64 string data, memory must be MemFree()
// Automation events functionality
LoadAutomationEventList :: proc(fileName: cstring) -> AutomationEventList --- // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
UnloadAutomationEventList :: proc(list: ^AutomationEventList) --- // Unload automation events list from file
ExportAutomationEventList :: proc(list: AutomationEventList, fileName: cstring) -> bool --- // Export automation events list as text file
SetAutomationEventList :: proc(list: ^AutomationEventList) --- // Set automation event list to record to
SetAutomationEventBaseFrame :: proc(frame: c.int) --- // Set automation event internal base frame to start recording
StartAutomationEventRecording :: proc() --- // Start recording automation events (AutomationEventList must be set)
StopAutomationEventRecording :: proc() --- // Stop recording automation events
PlayAutomationEvent :: proc(event: AutomationEvent) --- // Play a recorded automation event
//------------------------------------------------------------------------------------
// Input Handling Functions (Module: core)
//------------------------------------------------------------------------------------
// Input-related functions: keyboard
IsKeyPressed :: proc(key: KeyboardKey) -> bool --- // Detect if a key has been pressed once
IsKeyDown :: proc(key: KeyboardKey) -> bool --- // Detect if a key is being pressed
IsKeyReleased :: proc(key: KeyboardKey) -> bool --- // Detect if a key has been released once
IsKeyUp :: proc(key: KeyboardKey) -> bool --- // Detect if a key is NOT being pressed
SetExitKey :: proc(key: KeyboardKey) --- // Set a custom key to exit program (default is ESC)
GetKeyPressed :: proc() -> KeyboardKey --- // Get key pressed (keycode), call it multiple times for keys queued
GetCharPressed :: proc() -> rune --- // Get char pressed (unicode), call it multiple times for chars queued
IsKeyPressed :: proc(key: KeyboardKey) -> bool --- // Detect if a key has been pressed once
IsKeyPressedRepeat :: proc(key: KeyboardKey) -> bool --- // Check if a key has been pressed again (Only PLATFORM_DESKTOP)
IsKeyDown :: proc(key: KeyboardKey) -> bool --- // Detect if a key is being pressed
IsKeyReleased :: proc(key: KeyboardKey) -> bool --- // Detect if a key has been released once
IsKeyUp :: proc(key: KeyboardKey) -> bool --- // Detect if a key is NOT being pressed
GetKeyPressed :: proc() -> KeyboardKey --- // Get key pressed (keycode), call it multiple times for keys queued
GetCharPressed :: proc() -> rune --- // Get char pressed (unicode), call it multiple times for chars queued
SetExitKey :: proc(key: KeyboardKey) --- // Set a custom key to exit program (default is ESC)
// Input-related functions: gamepads
@@ -1146,7 +1189,12 @@ foreign lib {
IsMouseButtonPressed :: proc(button: MouseButton) -> bool --- // Detect if a mouse button has been pressed once
IsMouseButtonDown :: proc(button: MouseButton) -> bool --- // Detect if a mouse button is being pressed
IsMouseButtonReleased :: proc(button: MouseButton) -> bool --- // Detect if a mouse button has been released once
IsMouseButtonUp :: proc(button: MouseButton) -> bool --- // Detect if a mouse button is NOT being pressed
when VERSION != "5.0" {
#panic("IsMouseButtonUp was broken in Raylib 5.0 but should be fixed in Raylib > 5.0. Remove this panic and the when block around it and also remove the workaround version of IsMouseButtonUp just after the end of the 'foreign lib {' block.")
IsMouseButtonUp :: proc(button: MouseButton) -> bool ---
}
GetMouseX :: proc() -> c.int --- // Returns mouse position X
GetMouseY :: proc() -> c.int --- // Returns mouse position Y
GetMousePosition :: proc() -> Vector2 --- // Returns mouse position XY
@@ -1171,7 +1219,8 @@ foreign lib {
//------------------------------------------------------------------------------------
SetGesturesEnabled :: proc(flags: Gestures) --- // Enable a set of gestures using flags
IsGestureDetected :: proc(gesture: Gesture) -> bool --- // Check if a gesture have been detected
// IsGestureDetected :: proc(gesture: Gesture) -> bool --- // Check if a gesture have been detected
GetGestureDetected :: proc() -> Gestures --- // Get latest detected gesture
GetGestureHoldDuration :: proc() -> f32 --- // Get gesture hold time in milliseconds
GetGestureDragVector :: proc() -> Vector2 --- // Get gesture drag vector
@@ -1200,18 +1249,17 @@ foreign lib {
DrawPixel :: proc(posX, posY: c.int, color: Color) --- // Draw a pixel
DrawPixelV :: proc(position: Vector2, color: Color) --- // Draw a pixel (Vector version)
DrawLine :: proc(startPosX, startPosY, endPosX, endPosY: c.int, color: Color) --- // Draw a line
DrawLineV :: proc(startPos, endPos: Vector2, color: Color) --- // Draw a line (Vector version)
DrawLineEx :: proc(startPos, endPos: Vector2, thick: f32, color: Color) --- // Draw a line defining thickness
DrawLineBezier :: proc(startPos, endPos: Vector2, thick: f32, color: Color) --- // Draw a line using cubic-bezier curves in-out
DrawLineBezierQuad :: proc(startPos, endPos: Vector2, controlPos: Vector2, thick: f32, color: Color) --- // Draw line using quadratic bezier curves with a control point
DrawLineBezierCubic :: proc(startPos, endPos: Vector2, startControlPos, endControlPos: Vector2, thick: f32, color: Color) --- // Draw line using cubic bezier curves with 2 control points
DrawLineStrip :: proc(points: [^]Vector2, pointCount: c.int, color: Color) --- // Draw lines sequence
DrawLineV :: proc(startPos, endPos: Vector2, color: Color) --- // Draw a line (using gl lines)
DrawLineEx :: proc(startPos, endPos: Vector2, thick: f32, color: Color) --- // Draw a line (using triangles/quads)
DrawLineStrip :: proc(points: [^]Vector2, pointCount: c.int, color: Color) --- // Draw lines sequence (using gl lines)
DrawLineBezier :: proc(startPos, endPos: Vector2, thick: f32, color: Color) --- // Draw line segment cubic-bezier in-out interpolation
DrawCircle :: proc(centerX, centerY: c.int, radius: f32, color: Color) --- // Draw a color-filled circle
DrawCircleSector :: proc(center: Vector2, radius: f32, startAngle, endAngle: f32, segments: c.int, color: Color) --- // Draw a piece of a circle
DrawCircleSectorLines :: proc(center: Vector2, radius: f32, startAngle, endAngle: f32, segments: c.int, color: Color) --- // Draw circle sector outline
DrawCircleGradient :: proc(centerX, centerY: c.int, radius: f32, color1, color2: Color) --- // Draw a gradient-filled circle
DrawCircleV :: proc(center: Vector2, radius: f32, color: Color) --- // Draw a color-filled circle (Vector version)
DrawCircleLines :: proc(centerX, centerY: c.int, radius: f32, color: Color) --- // Draw circle outline
DrawCircleLinesV :: proc(center: Vector2, radius: f32, color: Color) --- // Draw circle outline (Vector version)
DrawEllipse :: proc(centerX, centerY: c.int, radiusH, radiusV: f32, color: Color) --- // Draw ellipse
DrawEllipseLines :: proc(centerX, centerY: c.int, radiusH, radiusV: f32, color: Color) --- // Draw ellipse outline
DrawRing :: proc(center: Vector2, innerRadius, outerRadius: f32, startAngle, endAngle: f32, segments: c.int, color: Color) --- // Draw ring
@@ -1235,6 +1283,24 @@ foreign lib {
DrawPolyLines :: proc(center: Vector2, sides: c.int, radius: f32, rotation: f32, color: Color) --- // Draw a polygon outline of n sides
DrawPolyLinesEx :: proc(center: Vector2, sides: c.int, radius: f32, rotation: f32, lineThick: f32, color: Color) --- // Draw a polygon outline of n sides with extended parameters
// Splines drawing functions
DrawSplineLinear :: proc(points: [^]Vector2, pointCount: c.int, thick: f32, color: Color) --- // Draw spline: Linear, minimum 2 points
DrawSplineBasis :: proc(points: [^]Vector2, pointCount: c.int, thick: f32, color: Color) --- // Draw spline: B-Spline, minimum 4 points
DrawSplineCatmullRom :: proc(points: [^]Vector2, pointCount: c.int, thick: f32, color: Color) --- // Draw spline: Catmull-Rom, minimum 4 points
DrawSplineBezierQuadratic :: proc(points: [^]Vector2, pointCount: c.int, thick: f32, color: Color) --- // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
DrawSplineBezierCubic :: proc(points: [^]Vector2, pointCount: c.int, thick: f32, color: Color) --- // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
DrawSplineSegmentLinear :: proc(p1, p2: Vector2, thick: f32, color: Color) --- // Draw spline segment: Linear, 2 points
DrawSplineSegmentBasis :: proc(p1, p2, p3, p4: Vector2, thick: f32, color: Color) --- // Draw spline segment: B-Spline, 4 points
DrawSplineSegmentCatmullRom :: proc(p1, p2, p3, p4: Vector2, thick: f32, color: Color) --- // Draw spline segment: Catmull-Rom, 4 points
DrawSplineSegmentBezierQuadratic :: proc(p1, c2, p3: Vector2, thick: f32, color: Color) --- // Draw spline segment: Quadratic Bezier, 2 points, 1 control point
DrawSplineSegmentBezierCubic :: proc(p1, c2, c3, p4: Vector2, thick: f32, color: Color) --- // Draw spline segment: Cubic Bezier, 2 points, 2 control points
// Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]
GetSplinePointLinear :: proc(startPos, endPos: Vector2, t: f32) -> Vector2 --- // Get (evaluate) spline point: Linear
GetSplinePointBasis :: proc(p1, p2, p3, p4: Vector2, t: f32) -> Vector2 --- // Get (evaluate) spline point: B-Spline
GetSplinePointCatmullRom :: proc(p1, p2, p3, p4: Vector2, t: f32) -> Vector2 --- // Get (evaluate) spline point: Catmull-Rom
GetSplinePointBezierQuad :: proc(p1, c2, p3: Vector2, t: f32) -> Vector2 --- // Get (evaluate) spline point: Quadratic Bezier
GetSplinePointBezierCubic :: proc(p1, c2, c3, p4: Vector2, t: f32) -> Vector2 --- // Get (evaluate) spline point: Cubic Bezier
// Basic shapes collision detection functions
CheckCollisionRecs :: proc(rec1, rec2: Rectangle) -> bool --- // Check collision between two rectangles
CheckCollisionCircles :: proc(center1: Vector2, radius1: f32, center2: Vector2, radius2: f32) -> bool --- // Check collision between two circles
@@ -1254,6 +1320,7 @@ foreign lib {
LoadImage :: proc(fileName: cstring) -> Image --- // Load image from file into CPU memory (RAM)
LoadImageRaw :: proc(fileName: cstring, width, height: c.int, format: PixelFormat, headerSize: c.int) -> Image --- // Load image from RAW file data
LoadImageSvg :: proc(fileNameOrString: cstring, width, height: c.int) -> Image --- // Load image from SVG file data or string with specified size
LoadImageAnim :: proc(fileName: cstring, frames: [^]c.int) -> Image --- // Load image sequence from file (frames appended to image.data)
LoadImageFromMemory :: proc(fileType: cstring, fileData: rawptr, dataSize: c.int) -> Image --- // Load image from memory buffer, fileType refers to extension: i.e. '.png'
LoadImageFromTexture :: proc(texture: Texture2D) -> Image --- // Load image from GPU texture data
@@ -1261,14 +1328,15 @@ foreign lib {
IsImageReady :: proc(image: Image) -> bool --- // Check if an image is ready
UnloadImage :: proc(image: Image) --- // Unload image from CPU memory (RAM)
ExportImage :: proc(image: Image, fileName: cstring) -> bool --- // Export image data to file, returns true on success
ExportImageToMemory :: proc(image: Image, fileType: cstring, fileSize: ^c.int) -> rawptr --- // Export image to memory buffer
ExportImageAsCode :: proc(image: Image, fileName: cstring) -> bool --- // Export image as code file defining an array of bytes, returns true on success
// Image generation functions
GenImageColor :: proc(width, height: c.int, color: Color) -> Image --- // Generate image: plain color
GenImageGradientV :: proc(width, height: c.int, top, bottom: Color) -> Image --- // Generate image: vertical gradient
GenImageGradientH :: proc(width, height: c.int, left, right: Color) -> Image --- // Generate image: horizontal gradient
GenImageGradientLinear :: proc(width, height, direction: c.int, start, end: Color) -> Image --- // Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient
GenImageGradientRadial :: proc(width, height: c.int, density: f32, inner, outer: Color) -> Image --- // Generate image: radial gradient
GenImageGradientSquare :: proc(width, height: c.int, density: f32, inner, outer: Color) -> Image --- // Generate image: square gradient
GenImageChecked :: proc(width, height: c.int, checksX, checksY: c.int, col1, col2: Color) -> Image --- // Generate image: checked
GenImageWhiteNoise :: proc(width, height: c.int, factor: f32) -> Image --- // Generate image: white noise
GenImagePerlinNoise :: proc(width, height: c.int, offsetX, offsetY: c.int, scale: f32) -> Image --- // Generate image: perlin noise
@@ -1296,6 +1364,7 @@ foreign lib {
ImageDither :: proc(image: ^Image, rBpp, gBpp, bBpp, aBpp: c.int) --- // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
ImageFlipVertical :: proc(image: ^Image) --- // Flip image vertically
ImageFlipHorizontal :: proc(image: ^Image) --- // Flip image horizontally
ImageRotate :: proc(image: ^Image, degrees: c.int) --- // Rotate image by input angle in degrees( -359 to 359)
ImageRotateCW :: proc(image: ^Image) --- // Rotate image clockwise 90deg
ImageRotateCCW :: proc(image: ^Image) --- // Rotate image counter-clockwise 90deg
ImageColorTint :: proc(image: ^Image, color: Color) --- // Modify image color: tint
@@ -1386,34 +1455,35 @@ foreign lib {
// Font loading/unloading functions
GetFontDefault :: proc() -> Font --- // Get the default Font
LoadFont :: proc(fileName: cstring) -> Font --- // Load font from file into GPU memory (VRAM)
LoadFontEx :: proc(fileName: cstring, fontSize: c.int, fontChars: [^]rune, glyphCount: c.int) -> Font --- // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
LoadFontFromImage :: proc(image: Image, key: Color, firstChar: rune) -> Font --- // Load font from Image (XNA style)
LoadFontFromMemory :: proc(fileType: cstring, fileData: rawptr, dataSize: c.int, fontSize: c.int, fontChars: [^]rune, glyphCount: c.int) -> Font --- // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
IsFontReady :: proc(font: Font) -> bool --- // Check if a font is ready
LoadFontData :: proc(fileData: rawptr, dataSize: c.int, fontSize: c.int, fontChars: [^]rune, glyphCount: c.int, type: FontType) -> [^]GlyphInfo --- // Load font data for further use
GenImageFontAtlas :: proc(chars: [^]GlyphInfo, recs: ^[^]Rectangle, glyphCount: c.int, fontSize: c.int, padding: c.int, packMethod: c.int) -> Image --- // Generate image font atlas using chars info
UnloadFontData :: proc(chars: [^]GlyphInfo, glyphCount: c.int) --- // Unload font chars info data (RAM)
UnloadFont :: proc(font: Font) --- // Unload font from GPU memory (VRAM)
ExportFontAsCode :: proc(font: Font, fileName: cstring) -> bool --- // Export font as code file, returns true on success
GetFontDefault :: proc() -> Font --- // Get the default Font
LoadFont :: proc(fileName: cstring) -> Font --- // Load font from file into GPU memory (VRAM)
LoadFontEx :: proc(fileName: cstring, fontSize: c.int, codepoints: [^]rune, codepointCount: c.int) -> Font --- // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set
LoadFontFromImage :: proc(image: Image, key: Color, firstChar: rune) -> Font --- // Load font from Image (XNA style)
LoadFontFromMemory :: proc(fileType: cstring, fileData: rawptr, dataSize: c.int, fontSize: c.int, codepoints: [^]rune, codepointCount: c.int) -> Font --- // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
IsFontReady :: proc(font: Font) -> bool --- // Check if a font is ready
LoadFontData :: proc(fileData: rawptr, dataSize: c.int, fontSize: c.int, codepoints: [^]rune, codepointCount: c.int, type: FontType) -> [^]GlyphInfo --- // Load font data for further use
GenImageFontAtlas :: proc(glyphs: [^]GlyphInfo, glyphRecs: ^[^]Rectangle, codepointCount: c.int, fontSize: c.int, padding: c.int, packMethod: c.int) -> Image --- // Generate image font atlas using chars info
UnloadFontData :: proc(glyphs: [^]GlyphInfo, glyphCount: c.int) --- // Unload font chars info data (RAM)
UnloadFont :: proc(font: Font) --- // Unload font from GPU memory (VRAM)
ExportFontAsCode :: proc(font: Font, fileName: cstring) -> bool --- // Export font as code file, returns true on success
// Text drawing functions
DrawFPS :: proc(posX, posY: c.int) --- // Draw current FPS
DrawText :: proc(text: cstring, posX, posY: c.int, fontSize: c.int, color: Color) --- // Draw text (using default font)
DrawTextEx :: proc(font: Font, text: cstring, position: Vector2, fontSize: f32, spacing: f32, tint: Color) --- // Draw text using font and additional parameters
DrawTextPro :: proc(font: Font, text: cstring, position, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color) --- // Draw text using Font and pro parameters (rotation)
DrawTextCodepoint :: proc(font: Font, codepoint: rune, position: Vector2, fontSize: f32, tint: Color) --- // Draw one character (codepoint)
DrawTextCodepoints :: proc(font: Font, codepoints: [^]rune, count: c.int, position: Vector2, fontSize: f32, spacing: f32, tint: Color) --- // Draw multiple character (codepoint)
DrawFPS :: proc(posX, posY: c.int) --- // Draw current FPS
DrawText :: proc(text: cstring, posX, posY: c.int, fontSize: c.int, color: Color) --- // Draw text (using default font)
DrawTextEx :: proc(font: Font, text: cstring, position: Vector2, fontSize: f32, spacing: f32, tint: Color) --- // Draw text using font and additional parameters
DrawTextPro :: proc(font: Font, text: cstring, position, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color) --- // Draw text using Font and pro parameters (rotation)
DrawTextCodepoint :: proc(font: Font, codepoint: rune, position: Vector2, fontSize: f32, tint: Color) --- // Draw one character (codepoint)
DrawTextCodepoints :: proc(font: Font, codepoints: [^]rune, codepointCount: c.int, position: Vector2, fontSize: f32, spacing: f32, tint: Color) --- // Draw multiple character (codepoint)
// Text font info functions
MeasureText :: proc(text: cstring, fontSize: c.int) -> c.int --- // Measure string width for default font
MeasureTextEx :: proc(font: Font, text: cstring, fontSize: f32, spacing: f32) -> Vector2 --- // Measure string size for Font
GetGlyphIndex :: proc(font: Font, codepoint: rune) -> c.int --- // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
GetGlyphInfo :: proc(font: Font, codepoint: rune) -> GlyphInfo --- // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
GetGlyphAtlasRec :: proc(font: Font, codepoint: rune) -> Rectangle --- // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
SetTextLineSpacing :: proc(spacing: c.int) --- // Set vertical line spacing when drawing with line-breaks
MeasureText :: proc(text: cstring, fontSize: c.int) -> c.int --- // Measure string width for default font
MeasureTextEx :: proc(font: Font, text: cstring, fontSize: f32, spacing: f32) -> Vector2 --- // Measure string size for Font
GetGlyphIndex :: proc(font: Font, codepoint: rune) -> c.int --- // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
GetGlyphInfo :: proc(font: Font, codepoint: rune) -> GlyphInfo --- // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
GetGlyphAtlasRec :: proc(font: Font, codepoint: rune) -> Rectangle --- // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
// Text codepoints management functions (unicode characters)
@@ -1536,10 +1606,10 @@ foreign lib {
// Model animations loading/unloading functions
LoadModelAnimations :: proc(fileName: cstring, animCount: ^c.uint) -> [^]ModelAnimation --- // Load model animations from file
LoadModelAnimations :: proc(fileName: cstring, animCount: ^c.int) -> [^]ModelAnimation --- // Load model animations from file
UpdateModelAnimation :: proc(model: Model, anim: ModelAnimation, frame: c.int) --- // Update model animation pose
UnloadModelAnimation :: proc(anim: ModelAnimation) --- // Unload animation data
UnloadModelAnimations :: proc(animations: [^]ModelAnimation, count: c.uint) --- // Unload animation array data
UnloadModelAnimations :: proc(animations: [^]ModelAnimation, animCount: c.int) --- // Unload animation array data
IsModelAnimationValid :: proc(model: Model, anim: ModelAnimation) -> bool --- // Check model animation skeleton match
// Collision detection functions
@@ -1563,6 +1633,7 @@ foreign lib {
CloseAudioDevice :: proc() --- // Close the audio device and context
IsAudioDeviceReady :: proc() -> bool --- // Check if audio device has been initialized successfully
SetMasterVolume :: proc(volume: f32) --- // Set master volume (listener)
GetMasterVolume :: proc() -> f32 --- // Get master volume (listener)
// Wave/Sound loading/unloading functions
@@ -1571,10 +1642,12 @@ foreign lib {
IsWaveReady :: proc(wave: Wave) -> bool --- // Checks if wave data is ready
LoadSound :: proc(fileName: cstring) -> Sound --- // Load sound from file
LoadSoundFromWave :: proc(wave: Wave) -> Sound --- // Load sound from wave data
LoadSoundAlias :: proc(source: Sound) -> Sound --- // Create a new sound that shares the same sample data as the source sound, does not own the sound data
IsSoundReady :: proc(sound: Sound) -> bool --- // Checks if a sound is ready
UpdateSound :: proc(sound: Sound, data: rawptr, sampleCount: c.int) --- // Update sound buffer with new data
UpdateSound :: proc(sound: Sound, data: rawptr, frameCount: c.int) --- // Update sound buffer with new data
UnloadWave :: proc(wave: Wave) --- // Unload wave data
UnloadSound :: proc(sound: Sound) --- // Unload sound
UnloadSoundAlias :: proc(alias: Sound) --- // Unload a sound alias (does not deallocate sample data)
ExportWave :: proc(wave: Wave, fileName: cstring) -> bool --- // Export wave data to file, returns true on success
ExportWaveAsCode :: proc(wave: Wave, fileName: cstring) -> bool --- // Export wave sample data to code (.h), returns true on success
@@ -1594,6 +1667,7 @@ foreign lib {
LoadWaveSamples :: proc(wave: Wave) -> [^]f32 --- // Load samples data from wave as a 32bit float data array
UnloadWaveSamples :: proc(samples: [^]f32) --- // Unload samples data loaded with LoadWaveSamples()
// Music management functions
LoadMusicStream :: proc(fileName: cstring) -> Music --- // Load music stream from file
@@ -1631,13 +1705,30 @@ foreign lib {
SetAudioStreamBufferSizeDefault :: proc(size: c.int) --- // Default size for new audio streams
SetAudioStreamCallback :: proc(stream: AudioStream, callback: AudioCallback) --- // Audio thread callback to request new data
AttachAudioStreamProcessor :: proc(stream: AudioStream, processor: AudioCallback) --- // Attach audio stream processor to stream
AttachAudioStreamProcessor :: proc(stream: AudioStream, processor: AudioCallback) --- // Attach audio stream processor to stream, receives the samples as <float>s
DetachAudioStreamProcessor :: proc(stream: AudioStream, processor: AudioCallback) --- // Detach audio stream processor from stream
AttachAudioMixedProcessor :: proc(processor: AudioCallback) --- // Attach audio stream processor to the entire audio pipeline
AttachAudioMixedProcessor :: proc(processor: AudioCallback) --- // Attach audio stream processor to the entire audio pipeline, receives the samples as <float>s
DetachAudioMixedProcessor :: proc(processor: AudioCallback) --- // Detach audio stream processor from the entire audio pipeline
}
// Workaround for broken IsMouseButtonUp in Raylib 5.0.
when VERSION == "5.0" {
IsMouseButtonUp :: proc "c" (button: MouseButton) -> bool {
return !IsMouseButtonDown(button)
}
} else {
#panic("Remove this this when block and everything inside it for Raylib > 5.0. It's just here to fix a bug in Raylib 5.0. See IsMouseButtonUp inside 'foreign lib {' block.")
}
// Check if a gesture have been detected
IsGestureDetected :: proc "c" (gesture: Gesture) -> bool {
@(default_calling_convention="c")
foreign lib {
IsGestureDetected :: proc "c" (gesture: Gestures) -> bool ---
}
return IsGestureDetected({gesture})
}
// Text formatting with variables (sprintf style)
+84 -73
View File
@@ -1,83 +1,84 @@
/**********************************************************************************************
*
* rlgl v4.5 - A multi-OpenGL abstraction layer with an immediate-mode style API
* rlgl v5.0 - A multi-OpenGL abstraction layer with an immediate-mode style API
*
* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0)
* that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
* DESCRIPTION:
* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0)
* that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
*
* When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are
* initialized on rlglInit() to accumulate vertex data.
* ADDITIONAL NOTES:
* When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are
* initialized on rlglInit() to accumulate vertex data.
*
* When an internal state change is required all the stored vertex data is renderer in batch,
* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch.
* When an internal state change is required all the stored vertex data is renderer in batch,
* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch.
*
* Some additional resources are also loaded for convenience, here the complete list:
* - Default batch (RLGL.defaultBatch): RenderBatch system to accumulate vertex data
* - Default texture (RLGL.defaultTextureId): 1x1 white pixel R8G8B8A8
* - Default shader (RLGL.State.defaultShaderId, RLGL.State.defaultShaderLocs)
*
* Internal buffer (and additional resources) must be manually unloaded calling rlglClose().
* Some resources are also loaded for convenience, here the complete list:
* - Default batch (RLGL.defaultBatch): RenderBatch system to accumulate vertex data
* - Default texture (RLGL.defaultTextureId): 1x1 white pixel R8G8B8A8
* - Default shader (RLGL.State.defaultShaderId, RLGL.State.defaultShaderLocs)
*
* Internal buffer (and resources) must be manually unloaded calling rlglClose().
*
* CONFIGURATION:
* #define GRAPHICS_API_OPENGL_11
* #define GRAPHICS_API_OPENGL_21
* #define GRAPHICS_API_OPENGL_33
* #define GRAPHICS_API_OPENGL_43
* #define GRAPHICS_API_OPENGL_ES2
* #define GRAPHICS_API_OPENGL_ES3
* Use selected OpenGL graphics backend, should be supported by platform
* Those preprocessor defines are only used on rlgl module, if OpenGL version is
* required by any other module, use rlGetVersion() to check it
*
* #define GRAPHICS_API_OPENGL_11
* #define GRAPHICS_API_OPENGL_21
* #define GRAPHICS_API_OPENGL_33
* #define GRAPHICS_API_OPENGL_43
* #define GRAPHICS_API_OPENGL_ES2
* Use selected OpenGL graphics backend, should be supported by platform
* Those preprocessor defines are only used on rlgl module, if OpenGL version is
* required by any other module, use rlGetVersion() to check it
* #define RLGL_IMPLEMENTATION
* Generates the implementation of the library into the included file.
* If not defined, the library is in header only mode and can be included in other headers
* or source files without problems. But only ONE file should hold the implementation.
*
* #define RLGL_IMPLEMENTATION
* Generates the implementation of the library into the included file.
* If not defined, the library is in header only mode and can be included in other headers
* or source files without problems. But only ONE file should hold the implementation.
* #define RLGL_RENDER_TEXTURES_HINT
* Enable framebuffer objects (fbo) support (enabled by default)
* Some GPUs could not support them despite the OpenGL version
*
* #define RLGL_RENDER_TEXTURES_HINT
* Enable framebuffer objects (fbo) support (enabled by default)
* Some GPUs could not support them despite the OpenGL version
* #define RLGL_SHOW_GL_DETAILS_INFO
* Show OpenGL extensions and capabilities detailed logs on init
*
* #define RLGL_SHOW_GL_DETAILS_INFO
* Show OpenGL extensions and capabilities detailed logs on init
* #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
* Enable debug context (only available on OpenGL 4.3)
*
* #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
* Enable debug context (only available on OpenGL 4.3)
* rlgl capabilities could be customized just defining some internal
* values before library inclusion (default values listed):
*
* rlgl capabilities could be customized just defining some internal
* values before library inclusion (default values listed):
* #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
* #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
* #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
* #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
*
* #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
* #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
* #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
* #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
* #define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
* #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
* #define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance
* #define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance
*
* #define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
* #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
* #define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance
* #define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance
* When loading a shader, the following vertex attributes and uniform
* location names are tried to be set automatically:
*
* When loading a shader, the following vertex attribute and uniform
* location names are tried to be set automatically:
*
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: 0
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: 1
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: 2
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: 3
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: 4
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView))
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2)
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: 0
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: 1
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: 2
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: 3
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: 4
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: 5
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView))
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2)
*
* DEPENDENCIES:
*
* - OpenGL libraries (depending on platform and OpenGL version selected)
* - GLAD OpenGL extensions loading library (only for OpenGL 3.3 Core, 4.3 Core)
*
@@ -108,6 +109,8 @@ package raylib
import "core:c"
RLGL_VERSION :: "4.5"
when ODIN_OS == .Windows {
foreign import lib {
"windows/raylib.lib",
@@ -143,7 +146,12 @@ RL_GRAPHICS_API_OPENGL_21 :: true
RL_GRAPHICS_API_OPENGL_33 :: RL_GRAPHICS_API_OPENGL_21 // default currently
RL_GRAPHICS_API_OPENGL_ES2 :: false
RL_GRAPHICS_API_OPENGL_43 :: false
RL_GRAPHICS_API_OPENGL_ES3 :: false
when RL_GRAPHICS_API_OPENGL_ES3 {
RL_GRAPHICS_API_OPENGL_ES2 :: true
}
when !RL_GRAPHICS_API_OPENGL_ES2 {
// This is the maximum amount of elements (quads) per batch
// NOTE: Be careful with text, every letter maps to a quad
@@ -300,6 +308,7 @@ GlVersion :: enum c.int {
OPENGL_33, // OpenGL 3.3 (GLSL 330)
OPENGL_43, // OpenGL 4.3 (using GLSL 330)
OPENGL_ES_20, // OpenGL ES 2.0 (GLSL 100)
OPENGL_ES_30, // OpenGL ES 3.0 (GLSL 300 es)
}
@@ -315,13 +324,13 @@ ShaderAttributeDataType :: enum c.int {
// NOTE: By default up to 8 color channels defined, but it can be more
FramebufferAttachType :: enum c.int {
COLOR_CHANNEL0 = 0, // Framebuffer attachment type: color 0
COLOR_CHANNEL1, // Framebuffer attachment type: color 1
COLOR_CHANNEL2, // Framebuffer attachment type: color 2
COLOR_CHANNEL3, // Framebuffer attachment type: color 3
COLOR_CHANNEL4, // Framebuffer attachment type: color 4
COLOR_CHANNEL5, // Framebuffer attachment type: color 5
COLOR_CHANNEL6, // Framebuffer attachment type: color 6
COLOR_CHANNEL7, // Framebuffer attachment type: color 7
COLOR_CHANNEL1 = 1, // Framebuffer attachment type: color 1
COLOR_CHANNEL2 = 2, // Framebuffer attachment type: color 2
COLOR_CHANNEL3 = 3, // Framebuffer attachment type: color 3
COLOR_CHANNEL4 = 4, // Framebuffer attachment type: color 4
COLOR_CHANNEL5 = 5, // Framebuffer attachment type: color 5
COLOR_CHANNEL6 = 6, // Framebuffer attachment type: color 6
COLOR_CHANNEL7 = 7, // Framebuffer attachment type: color 7
DEPTH = 100, // Framebuffer attachment type: depth
STENCIL = 200, // Framebuffer attachment type: stencil
}
@@ -329,11 +338,11 @@ FramebufferAttachType :: enum c.int {
// Framebuffer texture attachment type
FramebufferAttachTextureType :: enum c.int {
CUBEMAP_POSITIVE_X = 0, // Framebuffer texture attachment type: cubemap, +X side
CUBEMAP_NEGATIVE_X, // Framebuffer texture attachment type: cubemap, -X side
CUBEMAP_POSITIVE_Y, // Framebuffer texture attachment type: cubemap, +Y side
CUBEMAP_NEGATIVE_Y, // Framebuffer texture attachment type: cubemap, -Y side
CUBEMAP_POSITIVE_Z, // Framebuffer texture attachment type: cubemap, +Z side
CUBEMAP_NEGATIVE_Z, // Framebuffer texture attachment type: cubemap, -Z side
CUBEMAP_NEGATIVE_X = 1, // Framebuffer texture attachment type: cubemap, -X side
CUBEMAP_POSITIVE_Y = 2, // Framebuffer texture attachment type: cubemap, +Y side
CUBEMAP_NEGATIVE_Y = 3, // Framebuffer texture attachment type: cubemap, -Y side
CUBEMAP_POSITIVE_Z = 4, // Framebuffer texture attachment type: cubemap, +Z side
CUBEMAP_NEGATIVE_Z = 5, // Framebuffer texture attachment type: cubemap, -Z side
TEXTURE2D = 100, // Framebuffer texture attachment type: texture2d
RENDERBUFFER = 200, // Framebuffer texture attachment type: renderbuffer
}
@@ -411,6 +420,7 @@ foreign lib {
rlEnableFramebuffer :: proc(id: c.uint) --- // Enable render texture (fbo)
rlDisableFramebuffer :: proc() --- // Disable render texture (fbo), return to default framebuffer
rlActiveDrawBuffers :: proc(count: c.int) --- // Activate multiple draw color buffers
rlBlitFramebuffer :: proc(srcX, srcY, srcWidth, srcHeight, dstX, dstY, dstWidth, dstHeight, bufferMask: c.int) --- // Blit active framebuffer to main framebuffer
// General render state
rlDisableColorBlend :: proc() --- // Disable color blending
@@ -425,7 +435,8 @@ foreign lib {
rlDisableScissorTest :: proc() --- // Disable scissor test
rlScissor :: proc(x, y, width, height: c.int) --- // Scissor test
rlEnableWireMode :: proc() --- // Enable wire mode
rlDisableWireMode :: proc() --- // Disable wire mode
rlEnablePointMode :: proc() --- // Enable point mode
rlDisableWireMode :: proc() --- // Disable wire and point modes
rlSetLineWidth :: proc(width: f32) --- // Set the line drawing width
rlGetLineWidth :: proc() -> f32 --- // Get the line drawing width
rlEnableSmoothLines :: proc() --- // Enable line aliasing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored Regular → Executable
BIN
View File
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More