From 99768ed62512a51b7f2d7cc68c1a6c160bab2177 Mon Sep 17 00:00:00 2001 From: JrSchmidtt Date: Thu, 19 Mar 2026 11:34:18 -0300 Subject: [PATCH 1/2] Add documentation generation tool and initial API documentation - Introduced a new tool for generating API documentation from Go source code. - Created a `gendocs.go` file that processes specified packages and generates Markdown files. - Added an initial API documentation file for the root package. --- .gitignore | 1 - .vscode/launch.json | 12 +- .vscode/tasks.json | 28 +- docs/api/bootstrap.md | 51 + docs/api/debug.md | 34 + docs/api/engine.md | 878 ++++ docs/api/engine_ui.md | 1087 +++++ docs/api/index.md | 32 + docs/api/klib.md | 327 ++ docs/api/matrix.md | 1970 +++++++++ docs/api/platform_audio.md | 116 + docs/api/platform_filesystem.md | 178 + docs/api/platform_hid.md | 665 +++ docs/api/platform_windowing.md | 357 ++ docs/api/registry_shader_data_registry.md | 245 ++ docs/api/rendering.md | 4538 +++++++++++++++++++++ docs/api/root.md | 27 + src/tools/gendocs.go | 233 ++ 18 files changed, 10772 insertions(+), 7 deletions(-) create mode 100644 docs/api/bootstrap.md create mode 100644 docs/api/debug.md create mode 100644 docs/api/engine.md create mode 100644 docs/api/engine_ui.md create mode 100644 docs/api/index.md create mode 100644 docs/api/klib.md create mode 100644 docs/api/matrix.md create mode 100644 docs/api/platform_audio.md create mode 100644 docs/api/platform_filesystem.md create mode 100644 docs/api/platform_hid.md create mode 100644 docs/api/platform_windowing.md create mode 100644 docs/api/registry_shader_data_registry.md create mode 100644 docs/api/rendering.md create mode 100644 docs/api/root.md create mode 100644 src/tools/gendocs.go diff --git a/.gitignore b/.gitignore index eeb6ca770..84afa7f44 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ go.work bin/ logs/ -docs/api external/bin interpreter/kaiju-* *.zip diff --git a/.vscode/launch.json b/.vscode/launch.json index 4d4bca067..c25a0ec40 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -49,16 +49,18 @@ "CGO_ENABLED": "1", } }, { - "name": "Documentation Generator", + "name": "Generate Documentation", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/src/generators/api", + "program": "${workspaceFolder}/src/tools/gendocs.go", + "args": ["${workspaceFolder}/src"], "cwd": "${workspaceFolder}", - "buildFlags": "-tags=generator", "env": { - "CGO_ENABLED": "1", - } + "CGO_ENABLED": "1" + }, + "console": "integratedTerminal", + "showLog": true }, { "name": "Copy Headers", "type": "go", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 47fb16c6f..838aea778 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -27,7 +27,33 @@ "$go" ], "group": "build", - "detail": "go build ${workspaceFolder}/src", + "detail": "go build ${workspaceFolder}/src" + }, { + "label": "Generate Documentation", + "type": "shell", + "command": "go", + "args": [ + "run", + "${workspaceFolder}/src/tools/gendocs.go", + "${workspaceFolder}/src" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "group": { + "kind": "build", + "isDefault": false + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": [], + "detail": "Generate API documentation using go doc" } ] } \ No newline at end of file diff --git a/docs/api/bootstrap.md b/docs/api/bootstrap.md new file mode 100644 index 000000000..4083df5bf --- /dev/null +++ b/docs/api/bootstrap.md @@ -0,0 +1,51 @@ +# Package bootstrap + +**Import path:** `kaijuengine.com/bootstrap` + + + +## Functions + + +### func Main(game GameInterface, platformState any) + + +## Types + + +### type GameInterface interface { + +```go +// Launch is used to bootstrap a game, the game should fill out this +// function's details to initialize itself. No updates are provided by the +// engine, so it is on the the implementing code to take care of registering +// any udpates with the supplied host. +Launch(*engine.Host) +``` + + +```go +// PluginRegistry is used to expose types to be exported for use in Lua. +// Any type returned here will have it's members and functions mapped to +// be called by Lua. You can run the engine with the command line argument +// "generate=pluginapi" to dump a Lua API file and ensure your exposed +// types have been correctly inserted. +PluginRegistry() []reflect.Type +``` + + +```go +// ContentDatabase must return the database interface for the engine to use +// when it is trying to access content. You can use exsiting types that +// implement [assets.Database], or you can create your own. +ContentDatabase() (assets.Database, error) +``` + +} +```go + GameInterface is the primary interface to implement in order to bootstrap a + game/application. +``` + + + diff --git a/docs/api/debug.md b/docs/api/debug.md new file mode 100644 index 000000000..9901f8486 --- /dev/null +++ b/docs/api/debug.md @@ -0,0 +1,34 @@ +# Package debug + +**Import path:** `kaijuengine.com/debug` + + + +## Variables + + +### var NotImplementedError = errors.New("not implemented") + + +## Functions + + +### func Assert(res bool, msg string) + +### func Ensure(res bool) + +### func EnsureMsg(res bool, msg string) + +### func EnsureNotError(err error) + +### func EnsureNotNil(target any) + +### func Halt(msg string) + +### func Log(msg string, args ...any) + +### func Throw(message string) + +### func ThrowNotImplemented(todo string) + + diff --git a/docs/api/engine.md b/docs/api/engine.md new file mode 100644 index 000000000..60479ff3f --- /dev/null +++ b/docs/api/engine.md @@ -0,0 +1,878 @@ +# Package engine + +**Import path:** `kaijuengine.com/engine` + + + +## Constants + + +### const ( + +```go +DefaultWindowWidth = 1280 +DefaultWindowHeight = 720 +``` + +) +### const InvalidFrameId = math.MaxUint64 + +```go + InvalidFrameId can be used to indicate that a frame id is invalid +``` + + + +## Variables + + +### var DebugEntityDataRegistry = map[string]EntityData{} + +### var LaunchParams = LaunchParameters{} + + +## Functions + + +### func LoadLaunchParams() + +### func ReflectValueFromJson(v any, f reflect.Value) + +### func RegisterEntityData(value EntityData) error + + +## Types + + +### type Entity struct { + +```go +Transform matrix.Transform +Parent *Entity +Children []*Entity +``` + + +```go +OnDestroy events.Event +OnDestroyRequested events.Event +OnActivate events.Event +OnDeactivate events.Event +``` + + +```go +// Has unexported fields. +``` + +} +```go + Entity is a struct that represents an arbitrary object in the host system. + It contains a 3D transformation and can be a parent of, or a child to, + other entities. Entities can also contain arbitrary named data to make it + easier to access data that is specific to the entity. +``` + + +```go + Child entities are unordered by default, you'll need to call + #Entity.SetChildrenOrdered to make them ordered. It is recommended to leave + children unordered unless you have a specific reason to order them. +``` + + +### func NewEntity(workGroup *concurrent.WorkGroup) *Entity + +```go + NewEntity creates a new #Entity struct and returns it +``` + + +### func (e *Entity) Activate() + +```go + Activate will set an active flag on the entity that can be queried with + #Entity.IsActive. It will also set the active flag on all children of the + entity. If the entity is already active, this function will do nothing. +``` + + +### func (e *Entity) AddNamedData(key string, data any) + +```go + AddNamedData allows you to add arbitrary data to the entity that can be + accessed by a string key. This is useful for storing data that is specific + to the entity. +``` + + +```go + Named data is stored in a map of slices, so you can add multiple pieces of + data to the same key. It is recommended to compile the data into a single + structure so the slice length is 1, but sometimes that's not reasonable. +``` + + +### func (e *Entity) ChildAt(idx int) *Entity + +```go + ChildAt returns the child entity at the specified index +``` + + +### func (e *Entity) ChildCount() int + +```go + ChildCount returns the number of children the entity has +``` + + +### func (e *Entity) Copy(other *Entity) + + +### func (e *Entity) Deactivate() + +```go + Deactivate will set an active flag on the entity that can be queried with + #Entity.IsActive. It will also set the active flag on all children of the + entity. If the entity is already inactive, this function will do nothing. +``` + + +### func (e *Entity) DestroyShaderData() + + +### func (e *Entity) Duplicate(workGroup *concurrent.WorkGroup) *Entity + + +### func (e *Entity) FindByName(name string) *Entity + +```go + FindByName will search the entity and the tree of children for the first + entity with the specified name. If no entity is found, nil will be returned. +``` + + +### func (e *Entity) ForceCleanup() + +```go + ForceCleanup will force the full cleanup of the entity, typically this is to + be called in very specific scenarios and not directly in game code. Unless + there is a good reason (like this entity no longer bein gin the host). +``` + + +### func (e *Entity) HasChildRecursive(child *Entity) bool + + +### func (e *Entity) HasChildren() bool + +```go + HasChildren returns true if the entity has any children +``` + + +### func (e *Entity) HasParent(parent *Entity) bool + +```go + HasParent will loop through each parent and determine if any of them is the + parent Entity supplied. If so, then it will return true, false otherwise. +``` + + +### func (e *Entity) Id() EntityId + +```go + ID returns the unique identifier of the entity. The Id is only valid for + entities that are not generated through template instantiation. The Id may + also be stripped during game runtime if the entity is never externally + referenced by any other part of the system. +``` + + +### func (e *Entity) IndexOfChild(child *Entity) int + + +### func (e *Entity) Init(workGroup *concurrent.WorkGroup) + + +### func (e *Entity) IsActive() bool + +```go + IsActive will return true if the entity is active, false otherwise +``` + + +### func (e *Entity) IsDestroyed() bool + +```go + IsDestroyed will return true if the entity is destroyed, false otherwise +``` + + +### func (e *Entity) IsRoot() bool + +```go + IsRoot returns true if the entity is the root entity in the hierarchy +``` + + +### func (e *Entity) Name() string + +```go + Name returns the name of the entity +``` + + +### func (e *Entity) NamedData(key string) []any + +```go + NamedData will return the data associated with the specified key. If the key + does not exist, nil will be returned. +``` + + +### func (e *Entity) RemoveNamedData(key string, data any) + +```go + RemoveNamedData will remove the specified data from the entity's named data + map. If the key does not exist, this function will do nothing. +``` + + +```go + *This will remove the entire slice and all of it's data* +``` + + +### func (e *Entity) RemoveNamedDataByName(key string) + +```go + RemoveNamedDataByName will remove all of the stored named data that matches + the given key on the entity +``` + + +### func (e *Entity) Root() *Entity + +```go + Root will return the root entity of the entity's hierarchy +``` + + +### func (e *Entity) SetActive(isActive bool) + +```go + SetActive will set the active flag on the entity that can be queried with + #Entity.IsActive. It will also set the active flag on all children of the + entity. If the entity is already active, this function will do nothing. +``` + + +### func (e *Entity) SetChildrenOrdered() + +```go + SetChildrenOrdered sets the children of the entity to be ordered +``` + + +### func (e *Entity) SetChildrenUnordered() + +```go + SetChildrenUnordered sets the children of the entity to be unordered +``` + + +### func (e *Entity) SetName(name string) + +```go + SetName sets the name of the entity +``` + + +### func (e *Entity) SetParent(newParent *Entity) + +```go + SetParent will set the parent of the entity. If the entity already has + a parent, it will be removed from the parent's children list. If the new + parent is nil, the entity will be removed from the hierarchy and will become + the root entity. If the new parent is not nil, the entity will be added to + the new parent's children list. If the new parent is not active, the entity + will be deactivated as well. +``` + + +```go + This will also handle the transformation parenting internally +``` + + +### func (e *Entity) ShaderData() rendering.DrawInstance + + +### func (e *Entity) StoreShaderData(sd rendering.DrawInstance) + + +### type EntityData interface { + +```go +Init(entity *Entity, host *Host) +``` + +} + +### type EntityId string + +```go + EntityId is a string that represents a unique identifier for an entity. + The identifier is only valid for entities that are not generated through + template instantiation. The identifier may also be stripped during game + runtime if the entity is never externally referenced by any other part of + the system. +``` + + +### type FrameId = uint64 + +```go + FrameId is a unique identifier for a frame +``` + + +### type Host struct { + +```go +Window *windowing.Window +LogStream *logging.LogStream +``` + + +```go +Cameras hostCameras +``` + + +```go +Drawings rendering.Drawings +``` + + +```go +Closing bool +UIUpdater Updater +UILateUpdater Updater +Updater Updater +LateUpdater Updater +``` + + +```go +OnClose events.Event +CloseSignal chan struct{} +``` + + +```go +// Has unexported fields. +``` + +} +```go + Host is the mediator to the entire runtime for the game/editor. It is the + main entry point for the game loop and is responsible for managing all + entities, the window, and the rendering context. The host can be used to + create and manage entities, call update functions on the main thread, + and access various caches and resources. +``` + + +```go + The host is expected to be passed around quite often throughout the program. + It is designed to remove things like service locators, singletons, and other + global state. You can have multiple hosts in a program to isolate things + like windows and game state. +``` + + +### func NewHost(name string, logStream *logging.LogStream, assetDb assets.Database) *Host + +```go + NewHost creates a new host with the given name and log stream. The log + stream is the log handler that is used by the slog package functions. A Host + that is created through NewHost has no function until #Host.Initialize is + called. +``` + + +```go + This is primarily called from #host_container/New +``` + + +### func (host *Host) AssetDatabase() assets.Database + +```go + AssetDatabase returns the asset database for the host +``` + + +### func (host *Host) Audio() *audio.Audio + +```go + Audio returns the audio system for the host +``` + + +### func (host *Host) Close() + +```go + Close will set the closing flag to true and signal the host to clean up + resources and close the window. +``` + + +### func (host *Host) CollisionManager() *collision_system.Manager + +```go + CollisionManager returns the collision manager for this host +``` + + +### func (h *Host) Deadline() (time.Time, bool) + +```go + Deadline is here to fulfil context.Context and will return zero and false +``` + + +### func (host *Host) DestroyEntity(entity *Entity) + +```go + DestroyEntity marks the given entity for destruction. The entity will be + cleaned up at the beginning of the next frame. +``` + + +### func (h *Host) Done() <-chan struct{} + +```go + Done is here to fulfil context.Context and will cose the CloseSignal channel +``` + + +### func (h *Host) Err() error + +```go + Err is here to fulfil context.Context and will return nil or + context.Canceled +``` + + +### func (host *Host) FontCache() *rendering.FontCache + +```go + FontCache returns the font cache for the host +``` + + +### func (host *Host) Frame() FrameId + +```go + Frame will return the current frame id +``` + + +### func (host *Host) Game() any + +```go + Game will return the primary game mediator for the running application. + In the editor, this would be *[editor.Editor], in the running game, this + will be the *game_host.GameHost structure that is generated by the editor + and filled out by the developer. +``` + + +### func (host *Host) ImportPlugins(path string) error + +```go + ImportPlugins will read all of the plugins that are in the specified folder + and prepare them for execution. +``` + + +### func (host *Host) Initialize(width, height, x, y int, platformState any) error + +```go + Initializes the various systems and caches that are mediated through the + host. This includes the window, the shader cache, the texture cache, + the mesh cache, and the font cache, and the camera systems. +``` + + +### func (host *Host) InitializeAudio() (err error) + + +### func (host *Host) InitializeRenderer() error + + +### func (host *Host) Lighting() *lighting.LightingInformation + +```go + Lighting returns a pointer to the internal lighting information +``` + + +### func (host *Host) MaterialCache() *rendering.MaterialCache + +```go + MaterialCache returns the font cache for the host +``` + + +### func (host *Host) MeshCache() *rendering.MeshCache + +```go + MeshCache returns the mesh cache for the host +``` + + +### func (host *Host) Name() string + +```go + Name returns the name of the host +``` + + +### func (host *Host) Physics() *StagePhysics + +```go + Physics returns the stage physics system +``` + + +### func (host *Host) Plugins() []*plugins.LuaVM + +```go + Plugins returns all of the loaded plugins for the host +``` + + +### func (host *Host) PrimaryCamera() cameras.Camera + + +### func (host *Host) Render() + +```go + Render will render the scene. This starts by preparing any drawings that + are pending. It also creates any pending shaders, textures, and meshes + before the start of the render. The frame is then readied, buffers swapped, + and any transformations that are dirty on entities are then cleaned. +``` + + +### func (host *Host) RunAfterFrames(wait int, call func()) + +```go + RunAfterFrames will call the given function after the given number of frames + have passed from the current frame +``` + + +### func (host *Host) RunAfterNextUIClean(call func()) + +```go + RunAfterNextUIClean will run the given function on the next frame. +``` + + +### func (host *Host) RunAfterTime(wait time.Duration, call func()) + +```go + RunAfterTime will call the given function after the given number of time has + passed from the current frame +``` + + +### func (host *Host) RunBeforeRender(call func()) + + +### func (host *Host) RunNextFrame(call func()) + +```go + RunNextFrame will run the given function on the next frame. This is the same + as calling RunAfterFrames(0, func(){}) +``` + + +### func (host *Host) RunOnMainThread(call func()) + + +### func (host *Host) Runtime() float64 + +```go + Runtime will return how long the host has been running in seconds +``` + + +### func (h *Host) SetFrameRateLimit(fps int64) + +```go + SetFrameRateLimit will set the frame rate limit for the host. If the frame + rate is set to 0, then the frame rate limit will be removed. +``` + + +```go + If a frame rate is set, then the host will block until the desired frame + rate is reached before continuing the update loop. +``` + + +### func (host *Host) SetGame(game any) + +```go + SetGame is to be called by the engine in most cases. It is called by the + editor when it first starts up to setup the editor game binding. For a game + generated by the editor, it will be called when the game is bootstrapped and + provide the *game_host.GameHost structure. You can call this function at any + time you want, but you really only should need to for special cases. +``` + + +### func (host *Host) ShaderCache() *rendering.ShaderCache + +```go + ShaderCache returns the shader cache for the host +``` + + +### func (host *Host) StartPhysics() + + +### func (host *Host) Teardown() + +```go + Teardown will destroy the host and all of its resources. This will also + execute the OnClose event. This will also signal the CloseSignal channel. +``` + + +### func (host *Host) TextureCache() *rendering.TextureCache + +```go + TextureCache returns the texture cache for the host +``` + + +### func (host *Host) Threads() *concurrent.Threads + +```go + Threads returns the long-running threads for this instance of host +``` + + +### func (host *Host) UICamera() cameras.Camera + + +### func (host *Host) UIThreads() *concurrent.Threads + +```go + UIThreads returns the long-running threads for the UI +``` + + +### func (host *Host) Update(deltaTime float64) + +```go + Update is the main update loop for the host. This will poll the window for + events, update the entities, and render the scene. This will also check if + the window has been closed or crashed and set the closing flag accordingly. +``` + + +```go + The update order is FrameRunner -> Update -> LateUpdate -> EndUpdate: +``` + + +```go + [-] FrameRunner: Functions added to RunAfterFrames [-] UIUpdate: Functions + added to UIUpdater [-] UILateUpdate: Functions added to UILateUpdater + [-] Update: Functions added to Updater [-] LateUpdate: Functions added to + LateUpdater [-] EndUpdate: Internal functions for preparing for the next + frame +``` + + +```go + Any destroyed entities will also be ticked for their cleanup. This will also + tick the editor entities for cleanup. +``` + + +### func (h *Host) Value(key any) any + +```go + Value is here to fulfil context.Context and will always return nil +``` + + +### func (h *Host) WaitForFrameRate() + +```go + WaitForFrameRate will block until the desired frame rate limit is reached +``` + + +### func (host *Host) WorkGroup() *concurrent.WorkGroup + +```go + WorkGroup returns the work group for this instance of host +``` + + +### type LaunchParameters struct { + +```go +Generate string +StartStage string +Trace bool +RecordPGO bool +AutoTest bool +``` + +} + +### type StagePhysics struct { + +```go +// Has unexported fields. +``` + +} + +### func (p *StagePhysics) AddEntity(entity *Entity, body *physics.RigidBody) + + +### func (p *StagePhysics) Destroy() + + +### func (p *StagePhysics) FindCollision(hit physics.CollisionHit) (*StagePhysicsEntry, bool) + + +### func (p *StagePhysics) IsActive() bool + + +### func (p *StagePhysics) Start() + + +### func (p *StagePhysics) Update(threads *concurrent.Threads, deltaTime float64) + + +### func (p *StagePhysics) World() *physics.World + + +### type StagePhysicsEntry struct { + +```go +Entity *Entity +Body *physics.RigidBody +``` + +} + +### type UpdateId int + + +### func (u *UpdateId) IsValid() bool + + +### type Updater struct { + +```go +// Has unexported fields. +``` + +} +```go + Updater is a struct that stores update functions to be called when the + #Updater.Update function is called. This simply goes through the list from + top to bottom and calls each function. +``` + + +```go + *Note that update functions are unordered, so don't rely on the order* +``` + + +### func NewConcurrentUpdater(threads *concurrent.Threads) Updater + +```go + NewConcurrentUpdater creates a new concurrent #Updater struct and returns it +``` + + +### func NewUpdater() Updater + +```go + NewUpdater creates a new #Updater struct and returns it +``` + + +### func (u *Updater) AddUpdate(update func(float64)) UpdateId + +```go + AddUpdate adds an update function to the list of updates to be called when + the #Updater.Update function is called. It returns the id of the update + function that was added so that it can be removed later. +``` + + +```go + The update function is added to a back-buffer so it will not begin updating + until the next call to #Updater.Update. +``` + + +### func (u *Updater) Destroy() + +```go + Destroy cleans up the updater and should be called when the updater is no + longer needed. It will close the pending and complete channels and clear the + updates map. +``` + + +### func (u *Updater) IsConcurrent() bool + +```go + IsConcurrent will return if this updater is a concurrent updater +``` + + +### func (u *Updater) RemoveUpdate(id *UpdateId) + +```go + RemoveUpdate removes an update function from the list of updates to be + called when the #Updater.Update function is called. It takes the id of the + update function that was returned when the update function was added. +``` + + +```go + The update function is removed from a back-buffer so it will not be removed + until the next call to #Updater.Update. +``` + + +### func (u *Updater) Update(deltaTime float64) + +```go + Update calls all of the update functions that have been added to the + updater. It takes a deltaTime parameter that is the approximate amount of + time since the last call to #Updater.Update. +``` + + + diff --git a/docs/api/engine_ui.md b/docs/api/engine_ui.md new file mode 100644 index 000000000..7667748bc --- /dev/null +++ b/docs/api/engine_ui.md @@ -0,0 +1,1087 @@ +# Package engine/ui + +**Import path:** `kaijuengine.com/engine/ui` + + + +## Constants + + +### const ( + +```go +EventTypeInvalid = EventType(iota) +EventTypeEnter +EventTypeMove +EventTypeExit +EventTypeClick +EventTypeRightClick +EventTypeDoubleClick +EventTypeDown +EventTypeUp +EventTypeRightDown +EventTypeRightUp +EventTypeMiss +EventTypeDragStart +EventTypeDrop +EventTypeDropEnter +EventTypeDropExit +EventTypeDragEnd +EventTypeScroll +EventTypeRebuild +EventTypeDestroy +EventTypeFocus +EventTypeBlur +EventTypeSubmit +EventTypeChange +EventTypeRender +EventTypeKeyDown +EventTypeKeyUp +EventTypeEnd +``` + +) +### const ( + +```go +InputTypeDefault = iota +InputTypeText +InputTypeNumber +InputTypePhone +InputTypeDatetime +``` + +) +### const ( + +```go +PositioningStatic = Positioning(iota) +PositioningAbsolute +PositioningFixed +PositioningRelative +PositioningSticky +``` + +) +### const ( + +```go +PanelScrollDirectionNone = 0x00 +PanelScrollDirectionVertical = 0x01 +PanelScrollDirectionHorizontal = 0x02 +PanelScrollDirectionBoth = 0x03 +``` + +) +### const ( + +```go +BorderStyleNone = iota +BorderStyleHidden +BorderStyleDotted +BorderStyleDashed +BorderStyleSolid +BorderStyleDouble +BorderStyleGroove +BorderStyleRidge +BorderStyleInset +BorderStyleOutset +``` + +) +### const ( + +```go +ContentFitNone = iota +ContentFitWidth +ContentFitHeight +ContentFitBoth +``` + +) +### const ( + +```go +OverflowScroll = iota +OverflowVisible +OverflowHidden +``` + +) +### const ( + +```go +DirtyTypeNone = iota +DirtyTypeLayout +DirtyTypeResize +DirtyTypeGenerated +DirtyTypeColorChange +DirtyTypeScissor +DirtyTypeParent +DirtyTypeParentLayout +DirtyTypeParentResize +DirtyTypeParentGenerated +DirtyTypeParentReGenerated +DirtyTypeParentColorChange +DirtyTypeParentScissor +``` + +) +### const ( + +```go +ElementTypeLabel = ElementType(iota) +ElementTypePanel +ElementTypeButton +ElementTypeCheckbox +ElementTypeImage +ElementTypeInput +ElementTypeProgressBar +ElementTypeSelect +ElementTypeSlider +``` + +) +### const ( + +```go +EntityDataName = "ui" +``` + +) +### const ( + +```go +LabelFontSize = 14.0 +``` + +) + +## Variables + + +### var UIScrollSpeed float32 = 20 + + +## Types + + +### type BasicStylizer struct { + +```go +Parent weak.Pointer[UI] +``` + +} + +### type BorderStyle = int32 + + +### type Button Panel + + +### func (b *Button) Base() *UI + + +### func (b *Button) ButtonData() *buttonData + + +### func (b *Button) Init(texture *rendering.Texture, text string) + + +### func (b *Button) Label() *Label + + +### func (b *Button) SetColor(color matrix.Color) + + +### type Checkbox Panel + + +### func (cb *Checkbox) Base() *UI + + +### func (cb *Checkbox) CheckboxData() *checkboxData + + +### func (cb *Checkbox) Init() + + +### func (cb *Checkbox) IsChecked() bool + + +### func (cb *Checkbox) SetChecked(isChecked bool) + + +### func (cb *Checkbox) SetCheckedWithoutEvent(isChecked bool) + + +### type ContentFit = int32 + + +### type DirtyType = int + + +### type ElementType = uint8 + + +### type EventType = int + + +### type Group struct { + +```go +// Has unexported fields. +``` + +} + +### func (group *Group) Attach(host *engine.Host) + + +### func (group *Group) Detach(host *engine.Host) + + +### func (group *Group) HasRequests() bool + + +### func (group *Group) IsFocusedOnInput() bool + + +### func (g *Group) SetThreaded() + + +### type Image Panel + + +### func (s *Image) Base() *UI + + +### func (img *Image) Frame() int + + +### func (s *Image) ImageData() *imageData + + +### func (s *Image) Init(texture *rendering.Texture) + + +### func (s *Image) InitFlipbook(framesPerSecond float32, textures []*rendering.Texture) + + +### func (s *Image) InitSpriteSheet(framesPerSecond float32, texture *rendering.Texture, jsonStr string) + + +### func (img *Image) PlayAnimation() + + +### func (img *Image) SetFlipBookAnimation(framesPerSecond float32, textures ...*rendering.Texture) + + +### func (img *Image) SetFrame(index int) + + +### func (img *Image) SetFrameRate(framesPerSecond float32) + + +### func (img *Image) SetSpriteSheet(framesPerSecond float32, texture *rendering.Texture, jsonStr string) + + +### func (img *Image) SetTexture(texture *rendering.Texture) + + +### func (img *Image) StopAnimation() + + +### type Input Panel + + +### func (input *Input) Base() *UI + + +### func (input *Input) Focus() + + +### func (input *Input) Init(placeholderText string) + + +### func (input *Input) InputData() *inputData + + +### func (input *Input) InsertText(text string) + + +### func (input *Input) IsFocused() bool + + +### func (input *Input) RemoveFocus() + + +### func (input *Input) SelectAll() + + +### func (input *Input) SetBGColor(newColor matrix.Color) + + +### func (input *Input) SetCursorColor(newColor matrix.Color) + + +### func (input *Input) SetCursorOffset(offset int) + + +### func (input *Input) SetDescription(text string) + + +### func (input *Input) SetFGColor(newColor matrix.Color) + + +### func (input *Input) SetFontFace(face rendering.FontFace) + + +### func (input *Input) SetFontSize(fontSize float32) + + +### func (input *Input) SetFontStyle(style string) + + +### func (input *Input) SetFontWeight(weight string) + + +### func (input *Input) SetNextFocusedInput(next *Input) + + +### func (input *Input) SetPlaceholder(text string) + + +### func (input *Input) SetSelectColor(newColor matrix.Color) + + +### func (input *Input) SetText(text string) + + +### func (input *Input) SetTextWithoutEvent(text string) + + +### func (input *Input) SetTitle(text string) + + +### func (input *Input) SetType(inputType InputType) + + +### func (input *Input) Text() string + + +### type InputType = int32 + + +### type Label UI + + +### func (l *Label) Base() *UI + + +### func (label *Label) BoldRange(start, end int) + + +### func (label *Label) CalculateMaxWidth() float32 + + +### func (label *Label) Clone(to *Label) + + +### func (label *Label) ColorRange(start, end int, newColor, bgColor matrix.Color) + + +### func (label *Label) EnforceBGColor(color matrix.Color) + + +### func (label *Label) EnforceFGColor(color matrix.Color) + + +### func (label *Label) FontFace() rendering.FontFace + + +### func (label *Label) FontSize() float32 + + +### func (label *Label) Hide() + + +### func (label *Label) Init(text string) + + +### func (l *Label) LabelData() *labelData + + +### func (label *Label) LineHeight() float32 + + +### func (label *Label) MaxWidth() float32 + + +### func (label *Label) Measure() matrix.Vec2 + + +### func (label *Label) SetBGColor(newColor matrix.Color) + + +### func (label *Label) SetBaseline(baseline rendering.FontBaseline) + + +### func (label *Label) SetColor(newColor matrix.Color) + + +### func (label *Label) SetFontFace(face rendering.FontFace) + + +### func (label *Label) SetFontSize(size float32) + + +### func (label *Label) SetFontStyle(style string) + + +### func (label *Label) SetFontWeight(weight string) + + +### func (label *Label) SetJustify(justify rendering.FontJustify) + + +### func (label *Label) SetLineHeight(height float32) + + +### func (label *Label) SetMaxWidth(maxWidth float32) + + +### func (label *Label) SetText(text string) + + +### func (label *Label) SetWidthAutoHeight(width float32) + + +### func (label *Label) SetWrap(wrapText bool) + + +### func (label *Label) Show() + + +### func (label *Label) Text() string + + +### func (label *Label) UnEnforceBGColor() + + +### func (label *Label) UnEnforceFGColor() + + +### type Layout struct { + +```go +Stylizer LayoutStylizer +// Has unexported fields. +``` + +} + +### func (l *Layout) Border() matrix.Vec4 + + +### func (l *Layout) CalcOffset() matrix.Vec2 + + +### func (l *Layout) ClearStyles() + + +### func (l *Layout) ContentSize() matrix.Vec2 + + +### func (l *Layout) InnerOffset() matrix.Vec4 + + +### func (l *Layout) LocalInnerOffset() matrix.Vec4 + + +### func (l *Layout) Margin() matrix.Vec4 + + +### func (l *Layout) Offset() matrix.Vec2 + + +### func (l *Layout) Padding() matrix.Vec4 + + +### func (l *Layout) PixelSize() matrix.Vec2 + + +### func (l *Layout) Positioning() Positioning + + +### func (l *Layout) Scale(width, height float32) bool + + +### func (l *Layout) ScaleHeight(height float32) bool + + +### func (l *Layout) ScaleWidth(width float32) bool + + +### func (l *Layout) SetBorder(left, top, right, bottom float32) + + +### func (l *Layout) SetInnerOffset(left, top, right, bottom float32) + + +### func (l *Layout) SetInnerOffsetBottom(offset float32) + + +### func (l *Layout) SetInnerOffsetLeft(offset float32) + + +### func (l *Layout) SetInnerOffsetRight(offset float32) + + +### func (l *Layout) SetInnerOffsetTop(offset float32) + + +### func (l *Layout) SetLocalInnerOffset(left, top, right, bottom float32) + + +### func (l *Layout) SetMargin(left, top, right, bottom float32) + + +### func (l *Layout) SetOffset(x, y float32) + + +### func (l *Layout) SetOffsetX(x float32) + + +### func (l *Layout) SetOffsetY(y float32) + + +### func (l *Layout) SetPadding(left, top, right, bottom float32) + + +### func (l *Layout) SetPositioning(pos Positioning) + + +### func (l *Layout) SetRowLayoutOffset(offset matrix.Vec2) + + +### func (l *Layout) SetZ(z float32) + + +### func (l *Layout) Ui() *UI + + +### func (l *Layout) Z() float32 + + +### type LayoutStylizer interface { + +```go +ProcessStyle(layout *Layout) []error +``` + +} + +### type LeftStylizer struct{ BasicStylizer } + + +### func (s LeftStylizer) ProcessStyle(layout *Layout) []error + + +### type Manager struct { + +```go +Host *engine.Host +Group Group +``` + + +```go +// Has unexported fields. +``` + +} + +### func (man *Manager) Add() *UI + + +### func (man *Manager) Clear() + + +### func (man *Manager) DisableUpdate() + + +### func (man *Manager) EnableUpdate() + + +### func (man *Manager) Hovered() []*UI + + +### func (man *Manager) Init(host *engine.Host) + + +### func (man *Manager) IsUpdateDisabled() bool + + +### func (man *Manager) Remove(ui *UI) + + +### func (man *Manager) Reserve(additionalElements int) + + +### type Overflow = int + + +### type Panel UI + + +### func FirstPanelOnEntity(entity *engine.Entity) *Panel + + +### func (p *Panel) AddChild(target *UI) + + +### func (p *Panel) AllowClickThrough() + + +### func (p *Panel) Background() *rendering.Texture + + +### func (p *Panel) Base() *UI + + +### func (p *Panel) BorderColor() [4]matrix.Color + + +### func (p *Panel) BorderSize() matrix.Vec4 + + +### func (p *Panel) BorderStyle() [4]BorderStyle + + +### func (p *Panel) Child(index int) *UI + + +### func (p *Panel) Color() matrix.Color + + +### func (p *Panel) DisableDragScroll() + + +### func (p *Panel) DontFitContent() + + +### func (p *Panel) DontFitContentHeight() + + +### func (p *Panel) DontFitContentWidth() + + +### func (p *Panel) EnableDragScroll() + + +### func (p *Panel) EnforceColor(color matrix.Color) + + +### func (p *Panel) FitContent() + + +### func (p *Panel) FitContentHeight() + + +### func (p *Panel) FitContentWidth() + + +### func (p *Panel) FittingContent() bool + + +### func (p *Panel) FittingContentHeight() bool + + +### func (p *Panel) FittingContentWidth() bool + + +### func (p *Panel) Freeze() + + +### func (p *Panel) HasBackground() bool + + +### func (p *Panel) HasEnforcedColor() bool + + +### func (panel *Panel) Init(texture *rendering.Texture, elmType ElementType) + + +### func (p *Panel) InsertChild(target *UI, idx int) + + +### func (p *Panel) IsFrozen() bool + + +### func (p *Panel) IsScrolling() bool + + +### func (p *Panel) MaxScroll() matrix.Vec2 + + +### func (p *Panel) Overflow() Overflow + + +### func (p *Panel) PanelData() *panelData + + +### func (p *Panel) RemoveBackground() + + +### func (p *Panel) RemoveChild(target *UI) + + +### func (p *Panel) ResetScroll() + + +### func (p *Panel) ScrollDirection() PanelScrollDirection + + +### func (p *Panel) ScrollToChild(child *UI) + + +### func (p *Panel) ScrollX() float32 + + +### func (p *Panel) ScrollY() float32 + + +### func (p *Panel) SetBackground(tex *rendering.Texture) + + +### func (p *Panel) SetBorderColor(left, top, right, bottom matrix.Color) + + +### func (p *Panel) SetBorderRadius(topLeft, topRight, bottomRight, bottomLeft float32) + + +### func (p *Panel) SetBorderRadiusBottomLeft(r float32) + + +### func (p *Panel) SetBorderRadiusBottomRight(r float32) + + +### func (p *Panel) SetBorderRadiusTopLeft(r float32) + + +### func (p *Panel) SetBorderRadiusTopRight(r float32) + + +### func (p *Panel) SetBorderSize(left, top, right, bottom float32) + + +### func (p *Panel) SetBorderStyle(left, top, right, bottom BorderStyle) + + +### func (p *Panel) SetColor(bgColor matrix.Color) + + +### func (p *Panel) SetMaterial(mat *rendering.Material) + + +### func (p *Panel) SetOverflow(overflow Overflow) + + +### func (p *Panel) SetScrollDirection(direction PanelScrollDirection) + + +### func (p *Panel) SetScrollX(value float32) + + +### func (p *Panel) SetScrollY(value float32) + + +### func (p *Panel) SetUseBlending(useBlending bool) + + +### func (p *Panel) UnEnforceColor() + + +### func (p *Panel) UnFreeze() + + +### type PanelScrollDirection = int32 + + +### type Positioning = int + + +### type ProgressBar Panel + + +### func (p *ProgressBar) Base() *UI + + +### func (p *ProgressBar) Init(fgTexture, bgTexture *rendering.Texture) + + +### func (b *ProgressBar) SetBGColor(bgColor matrix.Color) + + +### func (b *ProgressBar) SetFGColor(fgColor matrix.Color) + + +### func (b *ProgressBar) SetValue(value float32) + + +### func (b ProgressBar) Value() float32 + + +### type RightStylizer struct{ BasicStylizer } + + +### func (s RightStylizer) ProcessStyle(layout *Layout) []error + + +### type Select Panel + + +### func (s *Select) AddOption(name, value string) + + +### func (s *Select) Base() *UI + + +### func (s *Select) ClearOptions() + + +### func (s *Select) Init(text string, options []SelectOption) + + +### func (s *Select) Name() string + + +### func (s *Select) PickOption(index int) + + +### func (s *Select) PickOptionByLabel(label string) + + +### func (s *Select) PickOptionByLabelWithoutEvent(label string) + + +### func (s *Select) PickOptionWithoutEvent(index int) bool + + +### func (s *Select) SelectData() *selectData + + +### func (s *Select) SetColor(newColor matrix.Color) + + +### func (s *Select) SetOptionsColor(newColor matrix.Color) + + +### func (s *Select) Value() string + + +### type SelectOption struct { + +```go +Name string +Value string +// Has unexported fields. +``` + +} + +### type ShaderData struct { + +```go +rendering.ShaderDataBase +UVs matrix.Vec4 +FgColor matrix.Color +BgColor matrix.Color +Scissor matrix.Vec4 +Size2D matrix.Vec4 +BorderRadius matrix.Vec4 +BorderSize matrix.Vec4 +BorderColor [4]matrix.Color +BorderLen matrix.Vec2 +``` + +} + +### func (s ShaderData) Size() int + + +### type Slider Panel + + +### func (s *Slider) Base() *UI + + +### func (slider *Slider) Delta() float32 + + +### func (s *Slider) Init() + + +### func (slider *Slider) SetBGColor(bgColor matrix.Color) + + +### func (slider *Slider) SetFGColor(fgColor matrix.Color) + + +### func (slider *Slider) SetValue(value float32) + + +### func (slider *Slider) SetValueWithoutEvent(value float32) + + +### func (s *Slider) SliderData() *sliderData + + +### func (slider *Slider) Value() float32 + + +### type StretchCenterStylizer struct{ BasicStylizer } + + +### func (s StretchCenterStylizer) ProcessStyle(layout *Layout) []error + + +### type StretchHeightStylizer struct{ BasicStylizer } + + +### func (s StretchHeightStylizer) ProcessStyle(layout *Layout) []error + + +### type StretchWidthStylizer struct{ BasicStylizer } + + +### func (s StretchWidthStylizer) ProcessStyle(layout *Layout) []error + + +### type TriangleStylizer RightStylizer + + +### func (t TriangleStylizer) ProcessStyle(layout *Layout) []error + + +### type UI struct { + +```go +// Has unexported fields. +``` + +} + +### func AllOnEntity(entity *engine.Entity) []*UI + + +### func FirstOnEntity(entity *engine.Entity) *UI + + +### func (ui *UI) AddEvent(evtType EventType, evt func()) events.Id + + +### func (ui *UI) Clean() + + +### func (ui *UI) Clone(parent *engine.Entity) *UI + + +### func (ui *UI) Entity() *engine.Entity + + +### func (ui *UI) Event(evtType EventType) *events.Event + + +### func (ui *UI) ExecuteEvent(evtType EventType) bool + + +### func (ui *UI) FindByName(name string) *UI + + +### func (ui *UI) GenerateScissor() + + +### func (ui *UI) Hide() + + +### func (ui *UI) Host() *engine.Host + + +### func (ui *UI) IsActive() bool + + +### func (ui *UI) IsDown() bool + + +### func (ui *UI) IsInFrontOf(other *UI) bool + + +### func (ui *UI) IsType(elmType ElementType) bool + + +### func (ui *UI) IsValid() bool + + +### func (ui *UI) Layout() *Layout + + +### func (ui *UI) RemoveEvent(evtType EventType, evtId events.Id) + + +### func (ui *UI) SetDirty(dirtyType DirtyType) + + +### func (ui *UI) SetDontClean(val bool) + + +### func (ui *UI) ShaderData() *ShaderData + + +### func (ui *UI) Show() + + +### func (u *UI) ToButton() *Button + + +### func (u *UI) ToCheckbox() *Checkbox + + +### func (u *UI) ToImage() *Image + + +### func (u *UI) ToInput() *Input + + +### func (u *UI) ToLabel() *Label + + +### func (u *UI) ToPanel() *Panel + + +### func (u *UI) ToProgressBar() *ProgressBar + + +### func (u *UI) ToSelect() *Select + + +### func (u *UI) ToSlider() *Slider + + +### func (ui *UI) Type() ElementType + + +### func (ui *UI) Update(deltaTime float64) + + +### type UIElementData interface { + +```go +// Has unexported methods. +``` + +} + + diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 000000000..387593291 --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,32 @@ +# Kaiju Engine API Documentation + +Auto-generated using go doc. + +## Other + +- [debug](debug.md) + +## Core + +- [root](root.md) +- [bootstrap](bootstrap.md) +- [matrix](matrix.md) +- [klib](klib.md) + +## Engine + +- [engine](engine.md) +- [engine/ui](engine_ui.md) + +## Platform + +- [platform/windowing](platform_windowing.md) +- [platform/hid](platform_hid.md) +- [platform/audio](platform_audio.md) +- [platform/filesystem](platform_filesystem.md) + +## Rendering + +- [rendering](rendering.md) +- [registry/shader_data_registry](registry_shader_data_registry.md) + diff --git a/docs/api/klib.md b/docs/api/klib.md new file mode 100644 index 000000000..2d5bb833e --- /dev/null +++ b/docs/api/klib.md @@ -0,0 +1,327 @@ +# Package klib + +**Import path:** `kaijuengine.com/klib` + + + +## Constants + + +### const ( + +```go +ISO8601 = "2006-01-02T15:04:05Z" +``` + +) + +## Variables + + +### var OpenWebsiteAndroidFunc func(url string) + + +## Functions + + +### func AppendUnique[T comparable](slice []T, values ...T) []T + +### func BinaryRead(r io.Reader, data any) error + +### func BinaryReadInt(r io.Reader) (int32, error) + +### func BinaryReadLen(r io.Reader) (int32, error) + +### func BinaryReadString(r io.Reader) (string, error) + +### func BinaryReadStringSlice(r io.Reader) ([]string, error) + +### func BinaryReadVar[T any](r io.Reader) (T, error) + +### func BinaryReadVarSlice[T any](r io.Reader) ([]T, error) + +### func BinaryWrite(w io.Writer, data any) error + +### func BinaryWriteInt(w io.Writer, value int) error + +### func BinaryWriteMap[K comparable, V any](w io.Writer, data map[K]V) error + +### func BinaryWriteMapLen[K comparable, V any](w io.Writer, data map[K]V) error + +### func BinaryWriteSlice[T any](w io.Writer, data []T) error + +### func BinaryWriteSliceLen[T any](w io.Writer, data []T) error + +### func BinaryWriteString(w io.Writer, str string) error + +### func BinaryWriteStringSlice(w io.Writer, data []string) error + +### func ByteArrayToString(byteArray []byte) string + +### func ByteCountToString(bytes uint64) string + +### func ByteSliceToFloat32Slice(data []byte) []float32 + +### func ByteSliceToUInt16Slice(data []byte) []uint16 + +### func CapitalizeFirst(s string) string + +### func Check(outError *error, newError error) bool + +### func CheckAll(res bool) + +### func Clamp[T cmp.Ordered](current, minimum, maximum T) T + +### func ClampAbs[T Signed](value, minimum T) T + +### func CleanNumString(v string) string + +### func Contains[T comparable](slice []T, item T) bool + +### func ConvertByteSliceType[T any](slice []byte) []T + +### func Decrypt(encryptedData []byte, key []byte) ([]byte, error) + +### func DelayCall(d time.Duration, f func(), ctx context.Context) + +### func Encrypt(rawData []byte, key []byte) ([]byte, error) + +### func ErrorIs[T error](err error) bool + +### func ExeExtension() string + +### func ExtractFromSlice[T, S any](s []S, expression func(idx int) T) []T + +### func FindFirstZeroInByteArray(arr []byte) int + +### func FloatEquals[T Float](a, b T) bool + +### func FormatFloatToNDecimals[T float32 | float64](f T, decimals int) string + +### func InterfaceUnderlyingPointer[T any](s T) unsafe.Pointer + +### func IsMobile() bool + +### func JsonDecode[T any](decoder *json.Decoder, container *T) error + +### func MM2PX[T Number](pixels, mm, targetMM T) T + +### func MapJoin[T comparable, U any](a, b map[T]U) map[T]U + +### func MapKeys[T comparable, U any](m map[T]U) []T + +### func MapKeysSorted[T cmp.Ordered, U any](m map[T]U) []T + +### func MapValues[T comparable, U any](m map[T]U) []U + +### func Memcpy(dst unsafe.Pointer, src unsafe.Pointer, size uint64) + +### func Must(err error) + +### func MustReturn[T any](ret T, err error) T + +### func MustReturn2[T, U any](ret1 T, ret2 U, err error) (T, U) + +### func NotYetImplemented(issueId int) + +### func OpenWebsite(url string) + +### func PrintStack() + +### func ReadRootFile(fs *os.Root, filePath string) ([]byte, error) + +### func RemakeSlice[S any](s []S) []S + +### func RemoveNils[S any](slice []*S) []*S + +### func RemoveUnordered[T any](slice []T, idx int) []T + +### func ReplaceStringRecursive(s string, old string, new string) string + +### func Should(err error) bool + +### func ShouldReturn[T any](ret T, err error) T + +### func Shuffle[T any](slice []T, rng *rand.Rand) + +### func ShuffleRandom[T any](slice []T) + +### func SizedStructToByteArray(s unsafe.Pointer, size int) []byte + +### func SliceMove[S any](s []S, from, to int) + +### func SliceSetCap[S any](s []S, amount int) []S + +### func SliceSetLen[S any](s []S, newLen int) []S + +### func SlicesAreTheSame[S comparable](a []S, b []S) bool + +### func SlicesRemoveElement[S comparable](s []S, e S) []S + +### func SortDirEntries(entries []os.DirEntry) []os.DirEntry + +### func StringValueCompare(a, b string) int + +```go + StringValueCompare compares two strings as integers or floats if possible, + otherwise compares as strings +``` + + +### func StringsContainsCaseInsensitive(s []string, value string) bool + +### func StripFloatStringZeros(fString string) string + +### func StructSliceToByteArray[T any](s []T) []byte + +### func StructToByteArray[T any](s T) []byte + +### func TickerWait(interval, limit time.Duration, condition func() bool) bool + +### func ToSnakeCase(str string) string + +### func Trace(message string) + +### func TraceString(message string) string + +### func TraceStrings(message string, skip int) []string + +### func WipeSlice[S any](s []S) []S + +```go + WipeSlice will clear out the slice before returning [:0]. The purpose + for this is that if there are pointers held within the slice, they hold + their references for as long as they are within the capacity of the slice. + Due to this, pointers are not collected by the GC unless actually wiped out + from the slice. +``` + + +### func WriteRootFile(fs *os.Root, filePath string, data []byte) error + + +## Types + + +### type Complex interface { + +```go +~complex64 | ~complex128 +``` + +} + +### type ErrorList struct { + +```go +Errors []error +``` + +} + +### func NewErrorList() ErrorList + + +### func (e *ErrorList) AddAny(err error) + + +### func (e *ErrorList) Any() bool + + +### func (e *ErrorList) First() error + + +### type Float interface { + +```go +~float32 | ~float64 +``` + +} + +### type Integer interface { + +```go +SignedInteger | Unsigned +``` + +} + +### type Number interface { + +```go +Integer | Float | Complex +``` + +} + +### type Ordered interface { + +```go +Integer | Float | ~string +``` + +} + +### type Serializable interface { + +```go +Serialize(stream io.Writer) +Deserialize(stream io.Reader) +``` + +} + +### type Set[T comparable] map[T]struct{} + + +### func NewSet[T comparable]() Set[T] + + +### func (s Set[T]) Add(val T) + + +### func (s Set[T]) Contains(val T) bool + + +### func (s Set[T]) MarshalJSON() ([]byte, error) + + +### func (s Set[T]) Remove(val T) + + +### func (s Set[T]) ToSlice() []T + + +### func (s *Set[T]) UnmarshalJSON(data []byte) error + +```go + UnmarshalJSON decodes a JSON array into the set +``` + + +### type Signed interface { + +```go +SignedInteger | Float +``` + +} + +### type SignedInteger interface { + +```go +~int | ~int8 | ~int16 | ~int32 | ~int64 +``` + +} + +### type Unsigned interface { + +```go +~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr +``` + +} + + diff --git a/docs/api/matrix.md b/docs/api/matrix.md new file mode 100644 index 000000000..9aa06a9aa --- /dev/null +++ b/docs/api/matrix.md @@ -0,0 +1,1970 @@ +# Package matrix + +**Import path:** `kaijuengine.com/matrix` + + + +## Constants + + +### const ( + +```go +Mat4Row0 = iota +Mat4Row1 +Mat4Row2 +Mat4Row3 +``` + +) +### const ( + +```go +Mat4Col0 = iota +Mat4Col1 +Mat4Col2 +Mat4Col3 +``` + +) +### const ( + +```go +Mat4x0y0 = x0y0 +Mat4x1y0 = x1y0 +Mat4x2y0 = x2y0 +Mat4x3y0 = x3y0 +Mat4x0y1 = x0y1 +Mat4x1y1 = x1y1 +Mat4x2y1 = x2y1 +Mat4x3y1 = x3y1 +Mat4x0y2 = x0y2 +Mat4x1y2 = x1y2 +Mat4x2y2 = x2y2 +Mat4x3y2 = x3y2 +Mat4x0y3 = x0y3 +Mat4x1y3 = x1y3 +Mat4x2y3 = x2y3 +Mat4x3y3 = x3y3 +``` + +) +### const ( + +```go +TransformWorkGroup = "transform" +TransformResetWorkGroup = "transformReset" +``` + +) +### const DegToRadVal = (math.Pi / 180.0) + +### const FloatMax = Float(math.MaxFloat32) + +### const FloatSmallestNonzero = Float(math.SmallestNonzeroFloat32) + +### const RadToDegVal = (180.0 / math.Pi) + +### const Roughly = 0.001 + +### const Tiny = 0.0001 + + +## Functions + + +### func AbsInt(a int) int + +### func Approx(a, b Float) bool + +### func ApproxTo(a, b, tolerance Float) bool + +### func IsInf(x Float, sign int) bool + +### func IsNaN(x Float) bool + +### func Mat4Approx(a, b Mat4) bool + +### func Mat4ApproxTo(a, b Mat4, delta Float) bool + +### func QuaternionApprox(a, b Quaternion) bool + +### func Vec2Approx(a, b Vec2) bool + +### func Vec2ApproxTo(a, b Vec2, delta Float) bool + +### func Vec2Nearly(a, b Vec2) bool + +### func Vec2Roughly(a, b Vec2) bool + +### func Vec3Approx(a, b Vec3) bool + +### func Vec3ApproxTo(a, b Vec3, delta Float) bool + +### func Vec4Approx(a, b Vec4) bool + +### func Vec4ApproxTo(a, b Vec4, delta Float) bool + +### func Vec4Roughly(a, b Vec4) bool + + +## Types + + +### type Color Vec4 + + +### func ColorAqua() Color + + +### func ColorAquamarine() Color + + +### func ColorAzure() Color + + +### func ColorBeige() Color + + +### func ColorBisque() Color + + +### func ColorBlack() Color + + +### func ColorBlanchedAlmond() Color + + +### func ColorBlue() Color + + +### func ColorBlueViolet() Color + + +### func ColorBrown() Color + + +### func ColorBurlyWood() Color + + +### func ColorCadetBlue() Color + + +### func ColorChartreuse() Color + + +### func ColorChocolate() Color + + +### func ColorClear() Color + + +### func ColorCoral() Color + + +### func ColorCornSilk() Color + + +### func ColorCornflowerBlue() Color + + +### func ColorCrimson() Color + + +### func ColorCyan() Color + + +### func ColorDarkBG() Color + + +### func ColorDarkBlue() Color + + +### func ColorDarkCyan() Color + + +### func ColorDarkGoldenrod() Color + + +### func ColorDarkGray() Color + + +### func ColorDarkGreen() Color + + +### func ColorDarkKhaki() Color + + +### func ColorDarkMagenta() Color + + +### func ColorDarkModeGrayBG() Color + + +### func ColorDarkModeGrayFG() Color + + +### func ColorDarkOliveGreen() Color + + +### func ColorDarkOrange() Color + + +### func ColorDarkOrchid() Color + + +### func ColorDarkRed() Color + + +### func ColorDarkSalmon() Color + + +### func ColorDarkSeaGreen() Color + + +### func ColorDarkSlateBlue() Color + + +### func ColorDarkSlateGray() Color + + +### func ColorDarkTurquoise() Color + + +### func ColorDarkViolet() Color + + +### func ColorDeepPink() Color + + +### func ColorDeepSkyBlue() Color + + +### func ColorDimGray() Color + + +### func ColorDodgerBlue() Color + + +### func ColorFirebrick() Color + + +### func ColorFloralWhite() Color + + +### func ColorForestGreen() Color + + +### func ColorFromColor8(c Color8) Color + + +### func ColorFromHexString(str string) (Color, error) + + +### func ColorFromVec3(v Vec3) Color + + +### func ColorFromVec4(v Vec4) Color + + +### func ColorFuchsia() Color + + +### func ColorGainsboro() Color + + +### func ColorGhostWhite() Color + + +### func ColorGold() Color + + +### func ColorGoldenrod() Color + + +### func ColorGray() Color + + +### func ColorGreen() Color + + +### func ColorGreenYellow() Color + + +### func ColorHoneydew() Color + + +### func ColorHotPink() Color + + +### func ColorIndianRed() Color + + +### func ColorIndigo() Color + + +### func ColorIvory() Color + + +### func ColorKhaki() Color + + +### func ColorLavender() Color + + +### func ColorLavenderBlush() Color + + +### func ColorLawnGreen() Color + + +### func ColorLemonChiffon() Color + + +### func ColorLightBlue() Color + + +### func ColorLightCoral() Color + + +### func ColorLightCyan() Color + + +### func ColorLightGoldenrodYellow() Color + + +### func ColorLightGreen() Color + + +### func ColorLightGrey() Color + + +### func ColorLightPink() Color + + +### func ColorLightSalmon() Color + + +### func ColorLightSeaGreen() Color + + +### func ColorLightSkyBlue() Color + + +### func ColorLightSlateGray() Color + + +### func ColorLightSteelBlue() Color + + +### func ColorLightYellow() Color + + +### func ColorLime() Color + + +### func ColorLimeGreen() Color + + +### func ColorLinen() Color + + +### func ColorMagenta() Color + + +### func ColorMaroon() Color + + +### func ColorMediumAquamarine() Color + + +### func ColorMediumBlue() Color + + +### func ColorMediumOrchid() Color + + +### func ColorMediumPurple() Color + + +### func ColorMediumSeaGreen() Color + + +### func ColorMediumSlateBlue() Color + + +### func ColorMediumSpringGreen() Color + + +### func ColorMediumTurquoise() Color + + +### func ColorMediumVioletRed() Color + + +### func ColorMidnightBlue() Color + + +### func ColorMintCream() Color + + +### func ColorMistyRose() Color + + +### func ColorMix(lhs, rhs Color, amount Float) Color + + +### func ColorMoccasin() Color + + +### func ColorNavajoWhite() Color + + +### func ColorNavy() Color + + +### func ColorOldLace() Color + + +### func ColorOlive() Color + + +### func ColorOliveDrab() Color + + +### func ColorOrange() Color + + +### func ColorOrangeRed() Color + + +### func ColorOrchid() Color + + +### func ColorPaleGoldenrod() Color + + +### func ColorPaleGreen() Color + + +### func ColorPaleTurquoise() Color + + +### func ColorPaleVioletred() Color + + +### func ColorPapayaWhip() Color + + +### func ColorPeachPuff() Color + + +### func ColorPeru() Color + + +### func ColorPink() Color + + +### func ColorPlum() Color + + +### func ColorPowderBlue() Color + + +### func ColorPurple() Color + + +### func ColorRGBAInt(r, g, b, a int) Color + + +### func ColorRGBInt(r, g, b int) Color + + +### func ColorRed() Color + + +### func ColorRosyBrown() Color + + +### func ColorRoyalBlue() Color + + +### func ColorSaddleBrown() Color + + +### func ColorSalmon() Color + + +### func ColorSandyBrown() Color + + +### func ColorSeaGreen() Color + + +### func ColorSeashell() Color + + +### func ColorSienna() Color + + +### func ColorSilver() Color + + +### func ColorSky() Color + + +### func ColorSkyBlue() Color + + +### func ColorSlateBlue() Color + + +### func ColorSlateGray() Color + + +### func ColorSlateGrey() Color + + +### func ColorSnow() Color + + +### func ColorSpringGreen() Color + + +### func ColorSteelBlue() Color + + +### func ColorTan() Color + + +### func ColorTeal() Color + + +### func ColorThistle() Color + + +### func ColorTomato() Color + + +### func ColorTransparent() Color + + +### func ColorTurquoise() Color + + +### func ColorViolet() Color + + +### func ColorWheat() Color + + +### func ColorWhite() Color + + +### func ColorWhiteSmoke() Color + + +### func ColorYellow() Color + + +### func ColorYellowGreen() Color + + +### func ColorZero() Color + + +### func NewColor(r, g, b, a Float) Color + + +### func (c Color) A() Float + + +### func (c Color) AsColor8() Color8 + + +### func (c Color) B() Float + + +### func (lhs Color) Equals(rhs Color) bool + + +### func (c Color) G() Float + + +### func (c Color) Hex() string + + +### func (c *Color) Inverted() Color + + +### func (c Color) IsZero() bool + + +### func (c *Color) MultiplyAssign(other Color) + + +### func (c *Color) PA() *Float + + +### func (c *Color) PB() *Float + + +### func (c *Color) PG() *Float + + +### func (c *Color) PR() *Float + + +### func (c Color) R() Float + + +### func (c Color) RGBA() (Float, Float, Float, Float) + + +### func (c Color) ScaleWithoutAlpha(scale Float) Color + + +### func (c *Color) SetA(a Float) + + +### func (c *Color) SetB(b Float) + + +### func (c *Color) SetG(g Float) + + +### func (c *Color) SetR(r Float) + + +### type Color8 [4]uint8 + + +### func Color8FromBytes(bytes []byte) Color8 + + +### func Color8FromColor(c Color) Color8 + + +### func Color8FromHexString(str string) (Color8, error) + + +### func NewColor8(r, g, b, a uint8) Color8 + + +### func (c Color8) A() uint8 + + +### func (c Color8) AsColor() Color + + +### func (c Color8) B() uint8 + + +### func (c Color8) Equal(rhs Color8) bool + + +### func (c Color8) G() uint8 + + +### func (c Color8) Hex() string + + +### func (c *Color8) PA() *uint8 + + +### func (c *Color8) PB() *uint8 + + +### func (c *Color8) PG() *uint8 + + +### func (c *Color8) PR() *uint8 + + +### func (c Color8) R() uint8 + + +### func (c Color8) RGBA() (uint8, uint8, uint8, uint8) + + +### func (c *Color8) SetA(a uint8) + + +### func (c *Color8) SetB(b uint8) + + +### func (c *Color8) SetG(g uint8) + + +### func (c *Color8) SetR(r uint8) + + +### func (lhs Color8) Similar(rhs Color8, tolerance uint8) bool + + +### func (c Color8) ToUintRaw() uint32 + + +### type ColorComponent = int + + +### const ( + +```go +R ColorComponent = iota +G +B +A +``` + +) +### type Float = float32 + + +### func Abs(x Float) Float + + +### func Acos(x Float) Float + + +### func Asin(x Float) Float + + +### func Atan(x Float) Float + + +### func Atan2(y Float, x Float) Float + + +### func Ceil(x Float) Float + + +### func Clamp(current, minimum, maximum Float) Float + + +### func Cos(x Float) Float + + +### func Deg2Rad(degree Float) Float + + +### func Floor(x Float) Float + + +### func Inf(sign int) Float + + +### func Lerp(v0, v1, t Float) Float + + +### func Log2(x Float) Float + + +### func Max(a Float, b Float) Float + + +### func Min(a Float, b Float) Float + + +### func Mod(x Float, y Float) Float + + +### func NaN() Float + + +### func Pow(x Float, y Float) Float + + +### func Rad2Deg(radian Float) Float + + +### func Round(x Float) Float + + +### func Sin(x Float) Float + + +### func Sqrt(x Float) Float + + +### func Tan(x Float) Float + + +### func Vec2Dot(v, other Vec2) Float + + +### func Vec3Dot(v, other Vec3) Float + + +### func Vec4Dot(a, b Vec4) Float + + +### type Mat3 [9]Float + + +### func Mat3FromMat4(m Mat4) Mat3 + + +### func Mat3Identity() Mat3 + + +### func Mat3Zero() Mat3 + + +### func NewMat3() Mat3 + + +### func (m Mat3) ColumnVector(col int) Vec3 + + +### func (m Mat3) Multiply(rhs Mat3) Mat3 + + +### func (m *Mat3) MultiplyAssign(rhs Mat3) + + +### func (m Mat3) MultiplyVec3(v Vec3) Vec3 + + +### func (m *Mat3) Reset() + + +### func (m Mat3) RowVector(row int) Vec3 + + +### func (m Mat3) ToMat4() Mat4 + + +### func (m Mat3) Transpose() Mat3 + + +### type Mat4 [16]Float + + +### func Mat4FromSlice(a []Float) Mat4 + + +### func Mat4Identity() Mat4 + + +### func Mat4LookAt(eye, center, up Vec3) Mat4 + + +### func Mat4Multiply(a, b Mat4) Mat4 + + +### func Mat4Zero() Mat4 + + +### func NewMat4() Mat4 + + +### func (m *Mat4) AddAssign(rhs Mat4) + + +### func (m Mat4) At(rowIndex, colIndex int) Float + + +### func (m Mat4) ColumnVector(col int) Vec4 + + +### func (m Mat4) Equals(other Mat4) bool + + +### func (m Mat4) ExtractPosition() Vec3 + + +### func (m Mat4) ExtractRotation() Quaternion + + +### func (m Mat4) ExtractScale() Vec3 + + +### func (m Mat4) Forward() Vec3 + + +### func (m *Mat4) Inverse() + + +### func (m Mat4) Inverted() Mat4 + + +### func (m Mat4) IsIdentity() bool + + +### func (m *Mat4) LookAt(eye, center, up Vec3) + + +### func (m *Mat4) Mat3() Mat3 + + +### func (m Mat4) Mat4ProjToVulkan() Mat4 + + +### func (m Mat4) Mat4Project(pos Vec3, viewport Vec4) Vec3 + + +### func (m Mat4) Mat4UnProject(p Vec3, invViewProj Mat4, viewport Vec4) Vec3 + + +### func (a *Mat4) MultiplyAssign(b Mat4) + + +### func (m *Mat4) NegateAssign() + + +### func (m *Mat4) Orthographic(left, right, bottom, top, near, far Float) + + +### func (m *Mat4) Perspective(fovy, aspect, nearVal, farVal Float) + + +### func (m *Mat4) Reset() + + +### func (m Mat4) Right() Vec3 + + +### func (m *Mat4) Rotate(rotate Vec3) + + +### func (m *Mat4) RotateAngles(axis Vec3, angle Float) + + +### func (m *Mat4) RotateX(angles Float) + + +### func (m *Mat4) RotateY(angles Float) + + +### func (m *Mat4) RotateZ(angles Float) + + +### func (m Mat4) RowVector(row int) Vec4 + + +### func (m *Mat4) Scale(scale Vec3) + + +### func (m *Mat4) SetTranslation(translation Vec3) + + +### func (m *Mat4) SubtractAssign(rhs Mat4) + + +### func (m Mat4) ToQuaternion() Quaternion + + +### func (m Mat4) TransformPoint(point Vec3) Vec3 + + +### func (m *Mat4) Translate(translation Vec3) + + +### func (m Mat4) Transpose() Mat4 + + +### func (m *Mat4) TransposeAssign() + + +### func (m Mat4) Up() Vec3 + + +### func (m *Mat4) Zero() + + +### type Quaternion [4]Float + + +### func NewQuaternion(w, x, y, z Float) Quaternion + + +### func QuatAngleBetween(lhs, rhs Vec3) Quaternion + + +### func QuaternionAxisAngle(axis Vec3, angle Float) Quaternion + + +### func QuaternionFromArray(xyzw [4]Float) Quaternion + + +### func QuaternionFromEuler(v Vec3) Quaternion + + +### func QuaternionFromMat4(m Mat4) Quaternion + + +### func QuaternionFromSlice(xyzw []Float) Quaternion + + +### func QuaternionFromVec4(v Vec4) Quaternion + + +### func QuaternionFromXYZW(xyzw [4]Float) Quaternion + + +### func QuaternionFromXYZWSlice(xyzw []Float) Quaternion + + +### func QuaternionIdentity() Quaternion + + +### func QuaternionLerp(from, to Quaternion, factor Float) Quaternion + + +### func QuaternionLookAt(from, to Vec3) Quaternion + + +### func QuaternionSlerp(from, to Quaternion, factor Float) Quaternion + + +### func (q *Quaternion) AddAssign(rhs Quaternion) + + +### func (q *Quaternion) Conjugate() + + +### func (q *Quaternion) Inverse() + + +### func (q Quaternion) IsZero() bool + + +### func (q Quaternion) Multiply(rhs Quaternion) Quaternion + + +### func (q *Quaternion) MultiplyAssign(rhs Quaternion) + + +### func (q Quaternion) MultiplyVec3(rhs Vec3) Vec3 + + +### func (q Quaternion) Normal() Quaternion + + +### func (q *Quaternion) Normalize() + + +### func (q Quaternion) ToEuler() Vec3 + + +### func (q Quaternion) ToMat4() Mat4 + + +### func (q Quaternion) W() Float + + +### func (q Quaternion) X() Float + + +### func (q Quaternion) Y() Float + + +### func (q Quaternion) Z() Float + + +### type QuaternionComponent = int + + +### const ( + +```go +Qw QuaternionComponent = iota +Qx +Qy +Qz +``` + +) +### type Transform struct { + +```go +// Has unexported fields. +``` + +} + +### func (t *Transform) AddPosition(add Vec3) + + +### func (t *Transform) AddRotation(add Vec3) + + +### func (t *Transform) AddScale(add Vec3) + + +### func (t *Transform) ContainsPoint(point Vec3) bool + + +### func (t *Transform) ContainsPoint2D(point Vec2) bool + + +### func (t *Transform) Copy(other Transform) + + +### func (t *Transform) Forward() Vec3 + + +### func (t *Transform) Initialize(workGroup *concurrent.WorkGroup) + + +### func (t *Transform) InverseWorldMatrix() Mat4 + + +### func (t *Transform) IsDirty() bool + + +### func (t *Transform) LocalPosition() Vec3 + + +### func (t *Transform) LookAt(point Vec3) + + +### func (t *Transform) Matrix() Mat4 + + +### func (t *Transform) Parent() *Transform + + +### func (t *Transform) Position() Vec3 + + +### func (t *Transform) ResetDirty() + + +### func (t *Transform) Right() Vec3 + + +### func (t *Transform) Rotation() Vec3 + + +### func (t *Transform) Scale() Vec3 + + +### func (t *Transform) ScaleWithoutChildren(scale Vec3) + +```go + ScaleWithoutChildren will scale a transform without changing the world scale + of the children of this transform. That is to say, it will update all the + child transform scales to return to their original world scale after scaling + this transform. +``` + + +### func (t *Transform) SetChildrenOrdered() + + +### func (t *Transform) SetChildrenUnordered() + + +### func (t *Transform) SetDirty() + + +### func (t *Transform) SetLocalPosition(position Vec3) + + +### func (t *Transform) SetParent(parent *Transform) + + +### func (t *Transform) SetPosition(position Vec3) + + +### func (t *Transform) SetRotation(rotation Vec3) + + +### func (t *Transform) SetScale(scale Vec3) + + +### func (t *Transform) SetWorldPosition(position Vec3) + + +### func (t *Transform) SetWorldRotation(rotation Vec3) + + +### func (t *Transform) SetWorldScale(scale Vec3) + + +### func (t *Transform) SetupRawTransform() + + +### func (t *Transform) Up() Vec3 + + +### func (t *Transform) WorldMatrix() Mat4 + + +### func (t *Transform) WorldPosition() Vec3 + + +### func (t *Transform) WorldRotation() Vec3 + + +### func (t *Transform) WorldScale() Vec3 + + +### func (t *Transform) WorldTransform() (Vec3, Vec3, Vec3) + + +### type Vec2 [2]Float + + +### func NewVec2(x, y Float) Vec2 + + +### func Vec2Down() Vec2 + + +### func Vec2FromArray(a [2]Float) Vec2 + + +### func Vec2FromSlice(a []Float) Vec2 + + +### func Vec2FromString(str string) Vec2 + + +### func Vec2Half() Vec2 + + +### func Vec2Largest() Vec2 + + +### func Vec2Left() Vec2 + + +### func Vec2Lerp(from, to Vec2, t Float) Vec2 + + +### func Vec2Max(a, b Vec2) Vec2 + + +### func Vec2MaxAbs(a, b Vec2) Vec2 + + +### func Vec2Min(a, b Vec2) Vec2 + + +### func Vec2MinAbs(a, b Vec2) Vec2 + + +### func Vec2One() Vec2 + + +### func Vec2Right() Vec2 + + +### func Vec2Up() Vec2 + + +### func Vec2Zero() Vec2 + + +### func (v Vec2) Abs() Vec2 + + +### func (v Vec2) Add(other Vec2) Vec2 + + +### func (v *Vec2) AddAssign(other Vec2) + + +### func (v Vec2) Angle(other Vec2) Float + + +### func (v Vec2) AsVec2i() Vec2i + + +### func (v *Vec2) AsVec3() Vec3 + + +### func (v Vec2) Distance(other Vec2) Float + + +### func (v Vec2) Divide(other Vec2) Vec2 + + +### func (v *Vec2) DivideAssign(other Vec2) + + +### func (v Vec2) Equals(other Vec2) bool + + +### func (v Vec2) Height() Float + + +### func (v *Vec2) Inverse() + + +### func (v Vec2) LargestAxis() Float + + +### func (v Vec2) LargestAxisDelta() Float + + +### func (v Vec2) Length() Float + + +### func (v Vec2) Multiply(other Vec2) Vec2 + + +### func (v *Vec2) MultiplyAssign(other Vec2) + + +### func (v Vec2) Negative() Vec2 + + +### func (v Vec2) Normal() Vec2 + + +### func (v *Vec2) Normalize() + + +### func (v *Vec2) PX() *Float + + +### func (v *Vec2) PY() *Float + + +### func (v Vec2) Scale(scalar Float) Vec2 + + +### func (v *Vec2) ScaleAssign(scalar Float) + + +### func (v *Vec2) SetHeight(y Float) + + +### func (v *Vec2) SetWidth(x Float) + + +### func (v *Vec2) SetX(x Float) + + +### func (v *Vec2) SetY(y Float) + + +### func (v Vec2) Shrink(scalar Float) Vec2 + + +### func (v *Vec2) ShrinkAssign(scalar Float) + + +### func (v Vec2) String() string + + +### func (v Vec2) Subtract(other Vec2) Vec2 + + +### func (v *Vec2) SubtractAssign(other Vec2) + + +### func (v Vec2) Width() Float + + +### func (v Vec2) X() Float + + +### func (v Vec2) XY() (Float, Float) + + +### func (v Vec2) Y() Float + + +### type Vec2i [2]int32 + + +### func (v Vec2i) Height() int32 + + +### func (v *Vec2i) SetHeight(height int32) + + +### func (v *Vec2i) SetWidth(width int32) + + +### func (v *Vec2i) SetX(x int32) + + +### func (v *Vec2i) SetY(y int32) + + +### func (v Vec2i) Width() int32 + + +### func (v Vec2i) X() int32 + + +### func (v Vec2i) Y() int32 + + +### type Vec3 [3]Float + + +### func Mat4ToScreenSpace(pos Vec3, view, projection Mat4, viewport Vec4) (Vec3, bool) + + +### func NewVec3(x, y, z Float) Vec3 + + +### func NewVec3XYZ(xyz Float) Vec3 + + +### func Vec3Abs(v Vec3) Vec3 + + +### func Vec3Backward() Vec3 + + +### func Vec3Cross(v, other Vec3) Vec3 + + +### func Vec3Down() Vec3 + + +### func Vec3Forward() Vec3 + + +### func Vec3FromArray(a [3]Float) Vec3 + + +### func Vec3FromSlice(a []Float) Vec3 + + +### func Vec3FromString(str string) Vec3 + + +### func Vec3Half() Vec3 + + +### func Vec3Inf(sign int) Vec3 + + +### func Vec3Largest() Vec3 + + +### func Vec3Left() Vec3 + + +### func Vec3Lerp(from, to Vec3, t Float) Vec3 + + +### func Vec3Max(v ...Vec3) Vec3 + + +### func Vec3MaxAbs(v ...Vec3) Vec3 + + +### func Vec3Min(v ...Vec3) Vec3 + + +### func Vec3MinAbs(v ...Vec3) Vec3 + + +### func Vec3NaN() Vec3 + + +### func Vec3One() Vec3 + + +### func Vec3Right() Vec3 + + +### func Vec3Up() Vec3 + + +### func Vec3Zero() Vec3 + + +### func (v Vec3) Abs() Vec3 + + +### func (v Vec3) Add(other Vec3) Vec3 + + +### func (v *Vec3) AddAssign(other Vec3) + + +### func (v *Vec3) AddX(x Float) + + +### func (v *Vec3) AddY(y Float) + + +### func (v *Vec3) AddZ(z Float) + + +### func (v Vec3) Angle(other Vec3) Float + + +### func (v Vec3) AsAligned16() [4]Float + + +### func (v Vec3) AsVec2() Vec2 + + +### func (v Vec3) AsVec3i() Vec3i + + +### func (v Vec3) AsVec4() Vec4 + + +### func (v Vec3) AsVec4WithW(w Float) Vec4 + + +### func (v Vec3) Depth() Float + + +### func (v Vec3) Distance(other Vec3) Float + + +### func (v Vec3) Divide(other Vec3) Vec3 + + +### func (v *Vec3) DivideAssign(other Vec3) + + +### func (v Vec3) Equals(other Vec3) bool + + +### func (v Vec3) Height() Float + + +### func (v *Vec3) Inverse() + + +### func (v Vec3) IsInf(sign int) bool + + +### func (v Vec3) IsNaN() bool + + +### func (v Vec3) IsZero() bool + + +### func (v Vec3) LargestAxis() Float + + +### func (v Vec3) LargestAxisDelta() Float + + +### func (v Vec3) Length() Float + + +### func (v Vec3) LengthSquared() Float + + +### func (v Vec3) LongestAxis() int + + +### func (v Vec3) LongestAxisValue() Float + + +### func (v Vec3) Multiply(other Vec3) Vec3 + + +### func (v *Vec3) MultiplyAssign(other Vec3) + + +### func (v Vec3) MultiplyMat3(rhs Mat3) Vec3 + + +### func (v Vec3) Negative() Vec3 + + +### func (v Vec3) Normal() Vec3 + + +### func (v *Vec3) Normalize() + + +### func (v Vec3) Orthogonal() Vec3 + + +### func (v *Vec3) PX() *Float + + +### func (v *Vec3) PY() *Float + + +### func (v *Vec3) PZ() *Float + + +### func (v Vec3) Scale(scalar Float) Vec3 + + +### func (v *Vec3) ScaleAssign(scalar Float) + + +### func (v *Vec3) ScaleX(s Float) + + +### func (v *Vec3) ScaleY(s Float) + + +### func (v *Vec3) ScaleZ(s Float) + + +### func (v *Vec3) SetX(x Float) + + +### func (v *Vec3) SetY(y Float) + + +### func (v *Vec3) SetZ(z Float) + + +### func (v Vec3) Shrink(scalar Float) Vec3 + + +### func (v *Vec3) ShrinkAssign(scalar Float) + + +### func (v Vec3) SignedAngle(other Vec3, axis Vec3) Float + +```go + SignedAngle returns the signed angle (in radians) from v to other around the + given axis. The sign is positive for counterclockwise rotation when looking + along the axis direction. Assumes non-zero vectors; returns 0 if v or other + is zero-length or they are equal. For best precision, normalize v, other, + and axis before calling if they aren't already. +``` + + +### func (v Vec3) SquareDistance(b Vec3) Float + + +### func (v Vec3) String() string + + +### func (v Vec3) Subtract(other Vec3) Vec3 + + +### func (v *Vec3) SubtractAssign(other Vec3) + + +### func (v Vec3) Width() Float + + +### func (v Vec3) X() Float + + +### func (v Vec3) XY() Vec2 + + +### func (v Vec3) XYZ() (Float, Float, Float) + + +### func (v Vec3) XZ() Vec2 + + +### func (v Vec3) Y() Float + + +### func (v Vec3) Z() Float + + +### type Vec3MinMax struct { + +```go +Min Vec3 +Max Vec3 +``` + +} + +### func NewVec3MinMax() Vec3MinMax + + +### type Vec3i [3]int32 + + +### func (v Vec3i) Depth() int32 + + +### func (v Vec3i) Height() int32 + + +### func (v *Vec3i) SetDepth(depth int32) + + +### func (v *Vec3i) SetHeight(height int32) + + +### func (v *Vec3i) SetWidth(width int32) + + +### func (v *Vec3i) SetX(x int32) + + +### func (v *Vec3i) SetY(y int32) + + +### func (v *Vec3i) SetZ(z int32) + + +### func (v Vec3i) Width() int32 + + +### func (v Vec3i) X() int32 + + +### func (v Vec3i) Y() int32 + + +### func (v Vec3i) Z() int32 + + +### type Vec4 [4]Float + + +### func Mat4MultiplyVec4(a Mat4, b Vec4) Vec4 + + +### func NewVec4(x, y, z, w Float) Vec4 + + +### func Vec4Area(xa, ya, xb, yb Float) Vec4 + + +### func Vec4FromArray(a [4]Float) Vec4 + + +### func Vec4FromSlice(a []Float) Vec4 + + +### func Vec4FromString(str string) Vec4 + + +### func Vec4Half() Vec4 + + +### func Vec4Largest() Vec4 + + +### func Vec4Lerp(from, to Vec4, t Float) Vec4 + + +### func Vec4Max(a, b Vec4) Vec4 + + +### func Vec4MaxAbs(a, b Vec4) Vec4 + + +### func Vec4Min(a, b Vec4) Vec4 + + +### func Vec4MinAbs(a, b Vec4) Vec4 + + +### func Vec4MultiplyMat4(v Vec4, m Mat4) Vec4 + + +### func Vec4One() Vec4 + + +### func Vec4Zero() Vec4 + + +### func (v Vec4) Abs() Vec4 + + +### func (v Vec4) Add(other Vec4) Vec4 + + +### func (v *Vec4) AddAssign(other Vec4) + + +### func (v Vec4) Angle(other Vec4) Float + + +### func (v Vec4) AreaContains(x, y Float) bool + + +### func (v Vec4) AsVec3() Vec3 + + +### func (v Vec4) AsVec4i() Vec4i + + +### func (v Vec4) Bottom() Float + + +### func (v Vec4) BoxContains(x, y Float) bool + + +### func (v Vec4) Distance(other Vec4) Float + + +### func (v Vec4) Divide(other Vec4) Vec4 + + +### func (v *Vec4) DivideAssign(other Vec4) + + +### func (v Vec4) Equals(other Vec4) bool + + +### func (v Vec4) Height() Float + + +### func (v Vec4) Horizontal() Float + + +### func (v *Vec4) Inverse() + + +### func (v Vec4) LargestAxis() Float + + +### func (v Vec4) LargestAxisDelta() Float + + +### func (v Vec4) Left() Float + + +### func (v Vec4) Length() Float + + +### func (v Vec4) Multiply(other Vec4) Vec4 + + +### func (v *Vec4) MultiplyAssign(other Vec4) + + +### func (v Vec4) Negative() Vec4 + + +### func (v Vec4) Normal() Vec4 + + +### func (v *Vec4) Normalize() + + +### func (v *Vec4) PW() *Float + + +### func (v *Vec4) PX() *Float + + +### func (v *Vec4) PY() *Float + + +### func (v *Vec4) PZ() *Float + + +### func (v Vec4) Right() Float + + +### func (v Vec4) Scale(scalar Float) Vec4 + + +### func (v *Vec4) ScaleAssign(scalar Float) + + +### func (v Vec4) ScreenAreaContains(x, y Float) bool + + +### func (v *Vec4) SetBottom(w Float) + + +### func (v *Vec4) SetHeight(w Float) + + +### func (v *Vec4) SetLeft(x Float) + + +### func (v *Vec4) SetRight(z Float) + + +### func (v *Vec4) SetTop(y Float) + + +### func (v *Vec4) SetW(w Float) + + +### func (v *Vec4) SetWidth(z Float) + + +### func (v *Vec4) SetX(x Float) + + +### func (v *Vec4) SetY(y Float) + + +### func (v *Vec4) SetZ(z Float) + + +### func (v Vec4) Shrink(scalar Float) Vec4 + + +### func (v *Vec4) ShrinkAssign(scalar Float) + + +### func (v Vec4) String() string + + +### func (v Vec4) Subtract(other Vec4) Vec4 + + +### func (v *Vec4) SubtractAssign(other Vec4) + + +### func (v Vec4) Top() Float + + +### func (v Vec4) Vertical() Float + + +### func (v Vec4) W() Float + + +### func (v Vec4) Width() Float + + +### func (v Vec4) X() Float + + +### func (v Vec4) XYZW() (Float, Float, Float, Float) + + +### func (v Vec4) Y() Float + + +### func (v Vec4) Z() Float + + +### type Vec4i [4]int32 + + +### func (v Vec4i) Height() int32 + + +### func (v Vec4i) W() int32 + + +### func (v Vec4i) Width() int32 + + +### func (v Vec4i) X() int32 + + +### func (v Vec4i) Y() int32 + + +### func (v Vec4i) Z() int32 + + +### type VectorComponent = int + + +### const ( + +```go +Vx VectorComponent = iota +Vy +Vz +Vw +``` + +) + diff --git a/docs/api/platform_audio.md b/docs/api/platform_audio.md new file mode 100644 index 000000000..bbae15c1d --- /dev/null +++ b/docs/api/platform_audio.md @@ -0,0 +1,116 @@ +# Package platform/audio + +**Import path:** `kaijuengine.com/platform/audio` + + + +## Constants + + +### const InvalidVoiceHandle = VoiceHandle(0) + + +## Types + + +### type Audio struct { + +```go +// Has unexported fields. +``` + +} + +### func New() (*Audio, error) + + +### func (a *Audio) IsMusicMuted() bool + + +### func (a *Audio) IsSoundMuted() bool + + +### func (a *Audio) IsValidVoiceHandle(handle VoiceHandle) bool + + +### func (a *Audio) LoadMusic(adb assets.Database, key string) (*AudioClip, error) + + +### func (a *Audio) LoadSound(adb assets.Database, key string) (*AudioClip, error) + + +### func (a *Audio) MusicById(id string) (*AudioClip, bool) + + +### func (a *Audio) MusicVolume() float32 + + +### func (a *Audio) MuteMusic() + + +### func (a *Audio) MuteSounds() + + +### func (a *Audio) Play(clip *AudioClip) VoiceHandle + + +### func (a *Audio) PlayMusic(key string) (*AudioClip, VoiceHandle) + + +### func (a *Audio) PlaySound(key string) (*AudioClip, VoiceHandle) + + +### func (a *Audio) Seek(handle VoiceHandle, seconds float64) bool + + +### func (a *Audio) SetLooping(handle VoiceHandle, looping bool) + + +### func (a *Audio) SetMusicVolume(volume float32) + + +### func (a *Audio) SetSoundVolume(volume float32) + + +### func (a *Audio) SoundById(id string) (*AudioClip, bool) + + +### func (a *Audio) SoundVolume() float32 + + +### func (a *Audio) Stop(handle VoiceHandle) + + +### func (a *Audio) StopSource(clip *AudioClip) + + +### func (a *Audio) UnloadClip(clip *AudioClip) + + +### func (a *Audio) UnmuteMusic() + + +### func (a *Audio) UnmuteSounds() + + +### type AudioClip struct { + +```go +// Has unexported fields. +``` + +} + +### func (c *AudioClip) Length() float64 + + +### type SoloudHandle = *C.Soloud + + +### type SoloudWav = *C.Wav + + +### type VoiceHandle = uint32 + + + diff --git a/docs/api/platform_filesystem.md b/docs/api/platform_filesystem.md new file mode 100644 index 000000000..5ea934727 --- /dev/null +++ b/docs/api/platform_filesystem.md @@ -0,0 +1,178 @@ +# Package platform/filesystem + +**Import path:** `kaijuengine.com/platform/filesystem` + + + +## Functions + + +### func CopyDirectory(src, dst string) error + +```go + CopyDirectory copies the directory at the source path to the destination + path. +``` + + +### func CopyFile(src, dst string) error + +```go + CopyFile copies the file from the source path to the destination path. + If the destination file already exists, an error will be returned. +``` + + +### func CopyFileOverwrite(src, dst string) error + +```go + CopyFileOverwrite copies the file from the source path to the destination + path. If the destination file already exists, it will be truncated. +``` + + +### func CopyGoSourceFile(src, dst string) error + +```go + CopyGoSourceFile copies go specific source code from the source path to the + destination path. If the destination file already exists, an error will be + returned. This function is used to ensure that the generated files have the + correct header. +``` + + +### func CreateDirectory(path string) error + +```go + CreateDirectory creates a directory at the specified path with full + permissions. +``` + + +### func DeleteDirectory(path string) error + +```go + DeleteDirectory deletes the directory at the specified path. +``` + + +### func DirectoryExists(path string) bool + +```go + DirectoryExists returns true if the directory exists at the specified path. +``` + + +### func FileExists(path string) bool + +```go + FileExists returns true if the file exists at the specified path. +``` + + +### func GameDirectory() (string, error) + +```go + GameDirectory will attempt to find the default directory for the application + to store and load it's data to and from +``` + + +### func ImageDirectory() (string, error) + +```go + ImageDirectory will attempt to find the default user directory where images + are stored. This function is OS specific. +``` + + +### func KnownDirectories() map[string]string + +```go + KnownDirectories returns a list of known, common directories on the current + computer. On windows this is things like Photos, Documents, etc. +``` + + +### func ListFilesRecursive(path string) ([]string, error) + +```go + ListFilesRecursive returns a list of all files in the specified, it walks + through all of the subdirectories as well. +``` + + +### func ListFoldersRecursive(path string) ([]string, error) + +```go + ListFoldersRecursive returns a list of all directories in the specified, + it walks through all of the subdirectories as well. +``` + + +### func ListRecursive(path string) ([]string, error) + +```go + ListRecursive returns a list of all files and directories in the specified, + it walks through all of the subdirectories as well. +``` + + +### func OpenFileBrowserToFolder(path string) error + +### func OpenFileDialogWindow(startPath string, extensions []DialogExtension, ok func(path string), cancel func(), windowHandle unsafe.Pointer) error + +### func OpenSaveFileDialogWindow(startPath string, fileName string, extensions []DialogExtension, ok func(path string), cancel func(), windowHandle unsafe.Pointer) error + +### func ReadFile(path string) ([]byte, error) + +```go + ReadFile reads the binary data from the file at the specified path. If the + file does not exist, an error will be returned. +``` + + +### func ReadTextFile(path string) (string, error) + +```go + ReadTextFile reads the text data from the file at the specified path. + If the file does not exist, an error will be returned. +``` + + +### func Unzip(src, dest string) error + +### func WriteFile(path string, data []byte) error + +```go + WriteFile writes the binary data to the file at the specified path. + This will use permissions 0644 for the file. If the file already exists, + it will be overwritten. +``` + + +### func WriteTextFile(path string, data string) error + +```go + WriteTextFile writes the text data to the file at the specified path. + This will use permissions 0644 for the file. If the file already exists, + it will be overwritten. +``` + + +### func Zip(srcDir, outFile string, skipFiles, skipFolders, skipExtensions []string) error + + +## Types + + +### type DialogExtension struct { + +```go +Name string +Extension string +``` + +} + + diff --git a/docs/api/platform_hid.md b/docs/api/platform_hid.md new file mode 100644 index 000000000..c018a3607 --- /dev/null +++ b/docs/api/platform_hid.md @@ -0,0 +1,665 @@ +# Package platform/hid + +**Import path:** `kaijuengine.com/platform/hid` + + + +## Constants + + +### const ( + +```go +ControllerButtonUp = iota +ControllerButtonDown +ControllerButtonLeft +ControllerButtonRight +ControllerButtonStart +ControllerButtonSelect +ControllerButtonLeftStick +ControllerButtonRightStick +ControllerButtonLeftBumper +ControllerButtonRightBumper +ControllerButtonEx1 // TODO: Name this correctly +ControllerButtonEx2 // TODO: Name this correctly +ControllerButtonA +ControllerButtonB +ControllerButtonX +ControllerButtonY +ControllerButtonMax +``` + +) +### const ( + +```go +ControllerAxisLeftVertical = iota +ControllerAxisLeftHorizontal +ControllerAxisRightVertical +ControllerAxisRightHorizontal +ControllerAxisLeftTrigger +ControllerAxisRightTrigger +ControllerAxisMax +``` + +) +### const ( + +```go +MouseButtonLeft = iota +MouseButtonMiddle +MouseButtonRight +MouseButtonX1 +MouseButtonX2 +MouseButtonLast +``` + +) +### const ( + +```go +MouseRelease = iota +MousePress +MouseRepeat +MouseInvalid = -1 +MouseButtonStateInvalid = -1 +``` + +) +### const ( + +```go +ControllerMaxDevices = 8 +``` + +) +```go + Based off XBOX controller +``` + + +### const ( + +```go +MaxTouchPointersAvailable = 10 +``` + +) + +## Types + + +### type Controller struct { + +```go +// Has unexported fields. +``` + +} + +### func NewController() Controller + +```go + NewController creates a new controller. This is called automatically by the + system and should not be called by the end-developer +``` + + +### func (c *Controller) Available(id int) bool + +```go + Available returns true if the controller is available. This is called + automatically by the system and should not be called by the end-developer +``` + + +### func (c *Controller) Axis(id, stick int) float32 + +```go + Axis returns the axis value for the given controller and stick +``` + + +### func (c *Controller) Connected(id int) + +```go + Connected returns true if the controller is connected. This is called + automatically by the system and should not be called by the end-developer +``` + + +### func (c *Controller) Disconnected(id int) + +```go + Disconnected returns true if the controller is disconnected. This is called + automatically by the system and should not be called by the end-developer +``` + + +### func (c *Controller) EndUpdate() + +```go + EndUpdate is called at the end of the frame. It updates the state of each + controller for the next frame. This is called automatically by the system + and should not be called by the end-developer +``` + + +### func (c *Controller) IsButtonDown(id, button int) bool + +```go + IsButtonDown returns true if the button is down +``` + + +### func (c *Controller) IsButtonHeld(id, button int) bool + +```go + IsButtonHeld returns true if the button is held +``` + + +### func (c *Controller) IsButtonUp(id, button int) bool + +```go + IsButtonUp returns true if the button is up +``` + + +### func (c *Controller) Reset() + +```go + Reset will completely wipe the state of all controllers +``` + + +### func (c *Controller) SetAxis(id, stick int, axis float32) + +```go + SetAxis sets the axis on the given controller. This is called automatically + by the system and should not be called by the end-developer +``` + + +### func (c *Controller) SetButtonDown(id, button int) + +```go + SetButtonDown sets the button down on the given controller. This is called + automatically by the system and should not be called by the end-developer +``` + + +### func (c *Controller) SetButtonUp(id, button int) + +```go + SetButtonUp sets the button up on the given controller. This is called + automatically by the system and should not be called by the end-developer +``` + + +### type ControllerDevice struct { + +```go +// Has unexported fields. +``` + +} + +### type Cursor struct { + +```go +// Has unexported fields. +``` + +} + +### func NewCursor(mouse *Mouse, touch *Touch, stylus *Stylus) Cursor + + +### func (c *Cursor) Held() bool + + +### func (c *Cursor) Moved() bool + + +### func (c *Cursor) Poll() + + +### func (c *Cursor) Position() matrix.Vec2 + + +### func (c *Cursor) Pressed() bool + + +### func (c *Cursor) Released() bool + + +### func (c *Cursor) ScreenPosition() matrix.Vec2 + + +### func (c *Cursor) UIPosition(uiSize, windowSize matrix.Vec2) matrix.Vec2 + + +### type KeyCallbackId int + + +### type KeyState = uint8 + + +### const ( + +```go +KeyStateIdle KeyState = iota +KeyStateDown +KeyStateHeld +KeyStateUp +KeyStatePressedAndReleased +KeyStateToggled +``` + +) +### type Keyboard struct { + +```go +// Has unexported fields. +``` + +} + +### func NewKeyboard() Keyboard + + +### func (k *Keyboard) AddKeyCallback(cb func(keyId int, keyState KeyState)) KeyCallbackId + + +### func (k *Keyboard) EndUpdate() + + +### func (k *Keyboard) GetKeyLastClicked(keyId int) time.Time + + +### func (k Keyboard) HasAlt() bool + + +### func (k Keyboard) HasCtrl() bool + + +### func (k Keyboard) HasModifier() bool + + +### func (k Keyboard) HasShift() bool + + +### func (k Keyboard) IsToggleKey(key KeyboardKey) bool + + +### func (k Keyboard) IsToggleKeyOn(key KeyboardKey) bool + + +### func (k Keyboard) KeyDown(key KeyboardKey) bool + + +### func (k Keyboard) KeyHeld(key KeyboardKey) bool + + +### func (k *Keyboard) KeyToRune(key KeyboardKey) rune + + +### func (k Keyboard) KeyUp(key KeyboardKey) bool + + +### func (k *Keyboard) RemoveKeyCallback(id KeyCallbackId) + + +### func (k *Keyboard) Reset() + + +### func (k *Keyboard) SetKeyDown(key KeyboardKey) + + +### func (k *Keyboard) SetKeyDownUp(key KeyboardKey) + + +### func (k *Keyboard) SetKeyUp(key KeyboardKey) + + +### func (k *Keyboard) SetToggleKeyState(key KeyboardKey, state KeyState) + + +### func (k *Keyboard) ToggleKey(key KeyboardKey) + + +### type KeyboardKey = int + + +### const ( + +```go +KeyBoardKeyInvalid KeyboardKey = -1 + iota +KeyboardKeyLeftAlt +KeyboardKeyRightAlt +KeyboardKeyLeftCtrl +KeyboardKeyRightCtrl +KeyboardKeyLeftShift +KeyboardKeyRightShift +KeyboardKeyA +KeyboardKeyB +KeyboardKeyC +KeyboardKeyD +KeyboardKeyE +KeyboardKeyF +KeyboardKeyG +KeyboardKeyH +KeyboardKeyI +KeyboardKeyJ +KeyboardKeyK +KeyboardKeyL +KeyboardKeyM +KeyboardKeyN +KeyboardKeyO +KeyboardKeyP +KeyboardKeyQ +KeyboardKeyR +KeyboardKeyS +KeyboardKeyT +KeyboardKeyU +KeyboardKeyV +KeyboardKeyW +KeyboardKeyX +KeyboardKeyY +KeyboardKeyZ +KeyboardKeyLeft +KeyboardKeyUp +KeyboardKeyRight +KeyboardKeyDown +KeyboardKeyEscape +KeyboardKeyTab +KeyboardKeySpace +KeyboardKeyBackspace +KeyboardKeyBackQuote +KeyboardKeyDelete +KeyboardKeyReturn +KeyboardKeyEnter +KeyboardKeyComma +KeyboardKeyPeriod +KeyboardKeyBackSlash +KeyboardKeyForwardSlash +KeyboardKeyOpenBracket +KeyboardKeyCloseBracket +KeyboardKeySemicolon +KeyboardKeyQuote +KeyboardKeyEqual +KeyboardKeyMinus +KeyboardKey0 +KeyboardKey1 +KeyboardKey2 +KeyboardKey3 +KeyboardKey4 +KeyboardKey5 +KeyboardKey6 +KeyboardKey7 +KeyboardKey8 +KeyboardKey9 +KeyboardNumKey0 +KeyboardNumKey1 +KeyboardNumKey2 +KeyboardNumKey3 +KeyboardNumKey4 +KeyboardNumKey5 +KeyboardNumKey6 +KeyboardNumKey7 +KeyboardNumKey8 +KeyboardNumKey9 +KeyboardNumKeyDivide +KeyboardNumKeyMultiply +KeyboardNumKeyAdd +KeyboardNumKeySubtract +KeyboardNumKeyPeriod +KeyboardKeyF1 +KeyboardKeyF2 +KeyboardKeyF3 +KeyboardKeyF4 +KeyboardKeyF5 +KeyboardKeyF6 +KeyboardKeyF7 +KeyboardKeyF8 +KeyboardKeyF9 +KeyboardKeyF10 +KeyboardKeyF11 +KeyboardKeyF12 +KeyboardKeyCapsLock +KeyboardKeyScrollLock +KeyboardKeyNumLock +KeyboardKeyPrintScreen +KeyboardKeyPause +KeyboardKeyInsert +KeyboardKeyHome +KeyboardKeyPageUp +KeyboardKeyPageDown +KeyboardKeyEnd +KeyboardKeyMaximum +``` + +) +### func ToKeyboardKey(nativeKey int) KeyboardKey + + +### type Mouse struct { + +```go +X, Y float32 +SX, SY float32 +CX, CY float32 +ScrollX, ScrollY float32 +``` + + +```go +// Has unexported fields. +``` + +} + +### func NewMouse() Mouse + + +### func (m Mouse) ButtonChanged() bool + + +### func (m Mouse) ButtonState(index int) int + + +### func (m Mouse) CenteredPosition() matrix.Vec2 + + +### func (m *Mouse) EndUpdate() + + +### func (m *Mouse) ForceHeld(index int) + + +### func (m Mouse) Held(index int) bool + + +### func (m Mouse) Moved() bool + + +### func (m Mouse) Position() matrix.Vec2 + + +### func (m Mouse) Pressed(index int) bool + + +### func (m Mouse) Released(index int) bool + + +### func (m *Mouse) Reset() + + +### func (m Mouse) ScreenPosition() matrix.Vec2 + + +### func (m Mouse) Scroll() matrix.Vec2 + + +### func (m Mouse) Scrolled() bool + + +### func (m *Mouse) SetDown(index int) + + +### func (m *Mouse) SetPosition(x, y, windowWidth, windowHeight float32) + + +### func (m *Mouse) SetScroll(x, y float32) + + +### func (m *Mouse) SetUp(index int) + + +### type Stylus struct { + +```go +X float32 +Y float32 +SX float32 +SY float32 +Pressure float32 +Distance float32 +// Has unexported fields. +``` + +} + +### func NewStylus() Stylus + + +### func (s *Stylus) ActionState() int + + +### func (s *Stylus) EndUpdate() + + +### func (s *Stylus) Held() bool + + +### func (s *Stylus) IsActive() bool + + +### func (s *Stylus) Moved() bool + + +### func (s *Stylus) Pressed() bool + + +### func (s *Stylus) Released() bool + + +### func (s *Stylus) Reset() + + +### func (s *Stylus) Set(x, y, pressure, distance, windowHeight float32) + + +### func (s *Stylus) SetActionState(state StylusActionState) + + +### type StylusActionState = int + + +### const ( + +```go +StylusActionNone StylusActionState = iota +StylusActionHoverEnter +StylusActionHoverMove +StylusActionHoverExit +StylusActionDown +StylusActionMove +StylusActionUp +StylusActionHeld +StylusActionHover +``` + +) +### type Touch struct { + +```go +Pointers []*TouchPointer +Pool [MaxTouchPointersAvailable]TouchPointer +``` + +} + +### func NewTouch() Touch + + +### func (t *Touch) Cancel() + + +### func (t *Touch) Cancelled() bool + + +### func (t *Touch) EndUpdate() + + +### func (t *Touch) Held() bool + + +### func (t *Touch) Moved() bool + + +### func (t *Touch) Pointer(index int) *TouchPointer + + +### func (t *Touch) Pressed() bool + + +### func (t *Touch) Released() bool + + +### func (t *Touch) Reset() + + +### func (t *Touch) SetDown(id int64, x, y, windowHeight float32) + + +### func (t *Touch) SetMoved(id int64, x, y, windowHeight float32) + + +### func (t *Touch) SetPressure(id int64, pressure float32) + + +### func (t *Touch) SetUp(id int64, x, y, windowHeight float32) + + +### type TouchAction = int + + +### const ( + +```go +TouchActionNone TouchAction = -1 +TouchActionDown TouchAction = internalTouchActionDown +TouchActionUp TouchAction = internalTouchActionUp +TouchActionMove TouchAction = internalTouchActionMove +TouchActionCancel TouchAction = -2 +TouchActionHeld TouchAction = -3 +``` + +) +### type TouchPointer struct { + +```go +Pressure float32 +X float32 +Y float32 +SX float32 +SY float32 +State TouchAction +Id int64 +``` + +} + + diff --git a/docs/api/platform_windowing.md b/docs/api/platform_windowing.md new file mode 100644 index 000000000..63c5e9744 --- /dev/null +++ b/docs/api/platform_windowing.md @@ -0,0 +1,357 @@ +# Package platform/windowing + +**Import path:** `kaijuengine.com/platform/windowing` + + + +## Functions + + +### func DPI2PX(pixels, mm, targetMM int) int + +### func DPI2PXF(pixels, mm, targetMM float64) float64 + +### func HasDragData() bool + +### func SetDragData(data DragDataTarget) + +### func UpdateDragData(sender *Window, x, y int) + +### func UpdateDragDrop(sender *Window, x, y int) + + +## Types + + +### type ControllerStateWindowEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type DragDataTarget interface { + +```go +DragUpdate() +``` + +} + +### var ( + +```go +OnDragStop events.Event +``` + +) +### func DragData() DragDataTarget + + +### type FileSearch struct { + +```go +Title string +Extension string +``` + +} + +### type KeyboardButtonWindowEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type MouseButtonWindowEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type MouseMoveWindowEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type MouseScrollWindowEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type SetHandleEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type StylusActionState = int32 + + +### type StylusStateWindowEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type TouchActionState = int32 + + +### type TouchStateWindowEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type Window struct { + +```go +Mouse hid.Mouse +Keyboard hid.Keyboard +Touch hid.Touch +Stylus hid.Stylus +Controller hid.Controller +Cursor hid.Cursor +GpuHost rendering.GPUApplication +GpuInstance *rendering.GPUApplicationInstance +OnResize events.Event +OnMove events.Event +OnActivate events.Event +OnDeactivate events.Event +``` + + +```go +// Has unexported fields. +``` + +} + +### func FindWindowAtPoint(x, y int) (*Window, bool) + + +### func New(windowName string, width, height, x, y int, adb assets.Database, platformState any) (*Window, error) + + +### func (w *Window) AddBorder() + + +### func (w *Window) Center() (x int, y int) + + +### func (w *Window) ClipboardContents() string + + +### func (w *Window) CopyToClipboard(text string) + + +### func (w *Window) CursorIbeam() + + +### func (w *Window) CursorSizeAll() + + +### func (w *Window) CursorSizeNS() + + +### func (w *Window) CursorSizeWE() + + +### func (w *Window) CursorStandard() + + +### func (w *Window) Destroy() + + +### func (w *Window) DisableRawMouseInput() + + +### func (w *Window) DotsPerMillimeter() float64 + + +### func (w *Window) EnableRawMouseInput() + + +### func (w *Window) EndUpdate() + + +### func (w *Window) Focus() + + +### func (w *Window) GetDrawableSize() (int32, int32) + + +### func (w *Window) GetInstanceExtensions() []string + + +### func (w *Window) Height() int + + +### func (w *Window) HideCursor() + + +### func (w *Window) IsClosed() bool + + +### func (w *Window) IsCrashed() bool + + +### func (w *Window) IsFullScreen() bool + + +### func (w *Window) IsMinimized() bool + + +### func (w *Window) IsPCSize() bool + + +### func (w *Window) IsPhoneSize() bool + + +### func (w *Window) IsTabletSize() bool + + +### func (w *Window) LockCursor(x, y int) + + +### func (w *Window) OpenFileDialog(startPath string, extensions []filesystem.DialogExtension, ok func(path string), cancel func()) error + + +### func (w *Window) PlatformInstance() unsafe.Pointer + + +### func (w *Window) PlatformWindow() unsafe.Pointer + + +### func (w *Window) Poll() + + +### func (w *Window) Position() (x int, y int) + + +### func (w *Window) ReadApplicationAsset(path string) ([]byte, error) + +```go + ReadApplicationAsset will read an asset bound to the application. This is + typically only useful on mobile platforms like Android. Platforms like + Linux, Windows, and Mac will return an error, use #ReadFile instead +``` + + +### func (w *Window) RemoveBorder() + + +### func (w *Window) SaveFileDialog(startPath string, fileName string, extensions []filesystem.DialogExtension, ok func(path string), cancel func()) error + + +### func (w *Window) ScreenSizeMM() (int, int, error) + + +### func (w *Window) SetCursorPosition(x, y int) + + +### func (w *Window) SetFullscreen() + + +### func (w *Window) SetIcon(img image.Image) + + +### func (w *Window) SetPosition(x, y int) + + +### func (w *Window) SetSize(width, height int) + + +### func (w *Window) SetTitle(name string) + + +### func (w *Window) SetWindowed(width, height int) + + +### func (w *Window) ShowCursor() + + +### func (w *Window) SizeMM() (int, int, error) + + +### func (w *Window) SwapBuffers() + + +### func (w *Window) ToLocalPosition(x, y int) (int, int) + + +### func (w *Window) ToScreenPosition(x, y int) (int, int) + + +### func (w *Window) UnlockCursor() + + +### func (w *Window) Viewport() matrix.Vec4 + + +### func (w *Window) Width() int + + +### func (w *Window) X() int + + +### func (w *Window) XY() (int, int) + + +### func (w *Window) Y() int + + +### type WindowActivityEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type WindowEventActivityType = uint32 + + +### type WindowEventButtonType = uint32 + + +### type WindowEventControllerConnectionType = uint32 + + +### type WindowEventType = uint8 + + +### type WindowMoveEvent struct { + +```go +// Has unexported fields. +``` + +} + +### type WindowResizeEvent struct { + +```go +// Has unexported fields. +``` + +} + + diff --git a/docs/api/registry_shader_data_registry.md b/docs/api/registry_shader_data_registry.md new file mode 100644 index 000000000..313506a62 --- /dev/null +++ b/docs/api/registry_shader_data_registry.md @@ -0,0 +1,245 @@ +# Package registry/shader_data_registry + +**Import path:** `kaijuengine.com/registry/shader_data_registry` + + + +## Constants + + +### const ( + +```go +ShaderDataStandardFlagOutline = StandardShaderDataFlags(1 << iota) +// Enable bit will be set anytime there are flags. This is needed because +// bits at the extremes of the float will be truncated to 0 otherwise. By +// setting this bit (largest exponent bit 2^1) this issue can be prevented. +ShaderDataStandardFlagEnable = 1 << 30 +``` + +) + +## Functions + + +### func Create(name string) rendering.DrawInstance + +### func StandardShaderDataFlagsClear(target rendering.DrawInstance, flag StandardShaderDataFlags) + +### func StandardShaderDataFlagsSet(target rendering.DrawInstance, flag StandardShaderDataFlags) + +### func StandardShaderDataFlagsTest(target rendering.DrawInstance, flag StandardShaderDataFlags) bool + + +## Types + + +### type ShaderDataEdFrustumWire struct { + +```go +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +Color matrix.Color +FrustumProjection matrix.Mat4 +``` + +} + +### func (t ShaderDataEdFrustumWire) Size() int + + +### type ShaderDataEdThumbPreviewMesh struct { + +```go +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +View matrix.Mat4 `visible:"false"` +Projection matrix.Mat4 `visible:"false"` +``` + +} + +### func (s *ShaderDataEdThumbPreviewMesh) SetCamera(view, projection matrix.Mat4) + + +### func (ShaderDataEdThumbPreviewMesh) Size() int + + +### type ShaderDataEdTransformWire struct { + +```go +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +Color matrix.Color +``` + +} + +### func (t ShaderDataEdTransformWire) Size() int + + +### type ShaderDataGrid struct { + +```go +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +Color matrix.Color +``` + +} + +### func (t ShaderDataGrid) Size() int + + +### type ShaderDataPBR struct { + +```go +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +VertColors matrix.Color +MeRoEmAo matrix.Vec4 +Flags StandardShaderDataFlags `visible:"false"` +LightIds [4]int32 `visible:"false"` +``` + +} + +### func (s *ShaderDataPBR) SelectLights(lights rendering.LightsForRender) + + +### func (t ShaderDataPBR) Size() int + + +### type ShaderDataParticle struct { + +```go +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +Color matrix.Color +UVs matrix.Vec4 `default:"0,0,1,1"` +``` + +} + +### func (t ShaderDataParticle) Size() int + + +### type ShaderDataPbrSkinned struct { + +```go +rendering.SkinnedShaderDataHeader `visible:"false"` +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +VertColors matrix.Color +MeRoEmAo matrix.Vec4 +Flags StandardShaderDataFlags `visible:"false"` +LightIds [4]int32 `visible:"false"` +``` + +} + +### func (t *ShaderDataPbrSkinned) BoundDataPointer() unsafe.Pointer + + +### func (t *ShaderDataPbrSkinned) InstanceBoundDataSize() int + + +### func (t ShaderDataPbrSkinned) Size() int + + +### func (t *ShaderDataPbrSkinned) SkinningHeader() *rendering.SkinnedShaderDataHeader + + +### func (t *ShaderDataPbrSkinned) UpdateBoundData() bool + + +### type ShaderDataStandard struct { + +```go +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +Color matrix.Color +Flags StandardShaderDataFlags `visible:"false"` +``` + +} + +### func (ShaderDataStandard) Size() int + + +### type ShaderDataStandardSkinned struct { + +```go +rendering.SkinnedShaderDataHeader `visible:"false"` +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +Color matrix.Color +Flags StandardShaderDataFlags `visible:"false"` +``` + +} + +### func (t *ShaderDataStandardSkinned) BoundDataPointer() unsafe.Pointer + + +### func (t *ShaderDataStandardSkinned) InstanceBoundDataSize() int + + +### func (t ShaderDataStandardSkinned) Size() int + + +### func (t *ShaderDataStandardSkinned) SkinningHeader() *rendering.SkinnedShaderDataHeader + + +### func (t *ShaderDataStandardSkinned) UpdateBoundData() bool + + +### type ShaderDataUnlit struct { + +```go +rendering.ShaderDataBase `visible:"false"` +``` + + +```go +Color matrix.Color +UVs matrix.Vec4 `default:"0,0,1,1"` +Flags StandardShaderDataFlags `visible:"false"` +``` + +} + +### func (t ShaderDataUnlit) Size() int + + +### type StandardShaderDataFlags = uint32 + + + diff --git a/docs/api/rendering.md b/docs/api/rendering.md new file mode 100644 index 000000000..f9bdbf408 --- /dev/null +++ b/docs/api/rendering.md @@ -0,0 +1,4538 @@ +# Package rendering + +**Import path:** `kaijuengine.com/rendering` + + + +## Constants + + +### const ( + +```go +FontJustifyLeft = FontJustify(iota) +FontJustifyCenter +FontJustifyRight +``` + +) +### const ( + +```go +FontBaselineBottom = FontBaseline(iota) +FontBaselineCenter +FontBaselineTop +``` + +) +### const ( + +```go +FontBold = FontFace("OpenSans-Bold") +FontBoldItalic = FontFace("OpenSans-BoldItalic") +FontExtraBold = FontFace("OpenSans-ExtraBold") +FontExtraBoldItalic = FontFace("OpenSans-ExtraBoldItalic") +FontItalic = FontFace("OpenSans-Italic") +FontLight = FontFace("OpenSans-Light") +FontLightItalic = FontFace("OpenSans-LightItalic") +FontRegular = FontFace("OpenSans-Regular") +FontSemiBold = FontFace("OpenSans-SemiBold") +FontSemiBoldItalic = FontFace("OpenSans-SemiBoldItalic") +``` + +) +### const ( + +```go +MaxJoints = 50 +MaxSkinInstances = 50 +``` + +) +### const ( + +```go +GPUSuccess = iota +GPUNotReady +GPUTimeout +GPUEventSet +GPUEventReset +GPUIncomplete +GPUErrorOutOfHostMemory +GPUErrorOutOfDeviceMemory +GPUErrorInitializationFailed +GPUErrorDeviceLost +GPUErrorMemoryMapFailed +GPUErrorLayerNotPresent +GPUErrorExtensionNotPresent +GPUErrorFeatureNotPresent +GPUErrorIncompatibleDriver +GPUErrorTooManyObjects +GPUErrorFormatNotSupported +GPUErrorFragmentedPool +GPUErrorOutOfPoolMemory +GPUErrorInvalidExternalHandle +GPUErrorSurfaceLost +GPUErrorNativeWindowInUse +GPUSuboptimal +GPUErrorOutOfDate +GPUErrorIncompatibleDisplay +GPUErrorValidationFailed +GPUErrorInvalidShaderNv +GPUErrorInvalidDrmFormatModifierPlaneLayout +GPUErrorFragmentation +GPUErrorNotPermitted +``` + +) +### const ( + +```go +MaxLocalLights = 20 +``` + + +```go +MaxCascades = 3 +``` + +) +### const ( + +```go +LightTypeDirectional = LightType(iota) +LightTypePoint +LightTypeSpot +``` + +) +### const ( + +```go +QuadPivotCenter = QuadPivot(iota) +QuadPivotLeft +QuadPivotTop +QuadPivotRight +QuadPivotBottom +QuadPivotBottomLeft +QuadPivotBottomRight +QuadPivotTopLeft +QuadPivotTopRight +``` + +) +### const ( + +```go +QuaternionSize = int(unsafe.Sizeof(matrix.Quaternion{})) +``` + +) +### const ( + +```go +CubeMapSides = 6 +``` + +) +### const ( + +```go +BytesInPixel = 4 +MaxCommandPools = 5 +MaxSecondaryCommands = 25 +``` + +) +### const ( + +```go +DefaultFontEMSize = 14.0 +``` + +) +### const ( + +```go +GPUWholeSize = (^uintptr(0)) +``` + +) +### const ( + +```go +GenerateUniqueTextureKey = "" +``` + +) +### const ShaderBaseDataStart = unsafe.Offsetof(ShaderDataBase{}.model) + + +## Variables + + +### var ( + +```go +StringVkFormat = map[string]vulkan_const.Format{ + "Undefined": vulkan_const.FormatUndefined, + detectDepthFormatKey: vulkan_const.FormatUndefined, + swapChainFormatKey: vulkan_const.FormatUndefined, + "R4g4UnormPack8": vulkan_const.FormatR4g4UnormPack8, + "R4g4b4a4UnormPack16": vulkan_const.FormatR4g4b4a4UnormPack16, + "B4g4r4a4UnormPack16": vulkan_const.FormatB4g4r4a4UnormPack16, + "R5g6b5UnormPack16": vulkan_const.FormatR5g6b5UnormPack16, + "B5g6r5UnormPack16": vulkan_const.FormatB5g6r5UnormPack16, + "R5g5b5a1UnormPack16": vulkan_const.FormatR5g5b5a1UnormPack16, + "B5g5r5a1UnormPack16": vulkan_const.FormatB5g5r5a1UnormPack16, + "A1r5g5b5UnormPack16": vulkan_const.FormatA1r5g5b5UnormPack16, + "R8Unorm": vulkan_const.FormatR8Unorm, + "R8Snorm": vulkan_const.FormatR8Snorm, + "R8Uscaled": vulkan_const.FormatR8Uscaled, + "R8Sscaled": vulkan_const.FormatR8Sscaled, + "R8Uint": vulkan_const.FormatR8Uint, + "R8Sint": vulkan_const.FormatR8Sint, + "R8Srgb": vulkan_const.FormatR8Srgb, + "R8g8Unorm": vulkan_const.FormatR8g8Unorm, + "R8g8Snorm": vulkan_const.FormatR8g8Snorm, + "R8g8Uscaled": vulkan_const.FormatR8g8Uscaled, + "R8g8Sscaled": vulkan_const.FormatR8g8Sscaled, + "R8g8Uint": vulkan_const.FormatR8g8Uint, + "R8g8Sint": vulkan_const.FormatR8g8Sint, + "R8g8Srgb": vulkan_const.FormatR8g8Srgb, + "R8g8b8Unorm": vulkan_const.FormatR8g8b8Unorm, + "R8g8b8Snorm": vulkan_const.FormatR8g8b8Snorm, + "R8g8b8Uscaled": vulkan_const.FormatR8g8b8Uscaled, + "R8g8b8Sscaled": vulkan_const.FormatR8g8b8Sscaled, + "R8g8b8Uint": vulkan_const.FormatR8g8b8Uint, + "R8g8b8Sint": vulkan_const.FormatR8g8b8Sint, + "R8g8b8Srgb": vulkan_const.FormatR8g8b8Srgb, + "B8g8r8Unorm": vulkan_const.FormatB8g8r8Unorm, + "B8g8r8Snorm": vulkan_const.FormatB8g8r8Snorm, + "B8g8r8Uscaled": vulkan_const.FormatB8g8r8Uscaled, + "B8g8r8Sscaled": vulkan_const.FormatB8g8r8Sscaled, + "B8g8r8Uint": vulkan_const.FormatB8g8r8Uint, + "B8g8r8Sint": vulkan_const.FormatB8g8r8Sint, + "B8g8r8Srgb": vulkan_const.FormatB8g8r8Srgb, + "R8g8b8a8Unorm": vulkan_const.FormatR8g8b8a8Unorm, + "R8g8b8a8Snorm": vulkan_const.FormatR8g8b8a8Snorm, + "R8g8b8a8Uscaled": vulkan_const.FormatR8g8b8a8Uscaled, + "R8g8b8a8Sscaled": vulkan_const.FormatR8g8b8a8Sscaled, + "R8g8b8a8Uint": vulkan_const.FormatR8g8b8a8Uint, + "R8g8b8a8Sint": vulkan_const.FormatR8g8b8a8Sint, + "R8g8b8a8Srgb": vulkan_const.FormatR8g8b8a8Srgb, + "B8g8r8a8Unorm": vulkan_const.FormatB8g8r8a8Unorm, + "B8g8r8a8Snorm": vulkan_const.FormatB8g8r8a8Snorm, + "B8g8r8a8Uscaled": vulkan_const.FormatB8g8r8a8Uscaled, + "B8g8r8a8Sscaled": vulkan_const.FormatB8g8r8a8Sscaled, + "B8g8r8a8Uint": vulkan_const.FormatB8g8r8a8Uint, + "B8g8r8a8Sint": vulkan_const.FormatB8g8r8a8Sint, + "B8g8r8a8Srgb": vulkan_const.FormatB8g8r8a8Srgb, + "A8b8g8r8UnormPack32": vulkan_const.FormatA8b8g8r8UnormPack32, + "A8b8g8r8SnormPack32": vulkan_const.FormatA8b8g8r8SnormPack32, + "A8b8g8r8UscaledPack32": vulkan_const.FormatA8b8g8r8UscaledPack32, + "A8b8g8r8SscaledPack32": vulkan_const.FormatA8b8g8r8SscaledPack32, + "A8b8g8r8UintPack32": vulkan_const.FormatA8b8g8r8UintPack32, + "A8b8g8r8SintPack32": vulkan_const.FormatA8b8g8r8SintPack32, + "A8b8g8r8SrgbPack32": vulkan_const.FormatA8b8g8r8SrgbPack32, + "A2r10g10b10UnormPack32": vulkan_const.FormatA2r10g10b10UnormPack32, + "A2r10g10b10SnormPack32": vulkan_const.FormatA2r10g10b10SnormPack32, + "A2r10g10b10UscaledPack32": vulkan_const.FormatA2r10g10b10UscaledPack32, + "A2r10g10b10SscaledPack32": vulkan_const.FormatA2r10g10b10SscaledPack32, + "A2r10g10b10UintPack32": vulkan_const.FormatA2r10g10b10UintPack32, + "A2r10g10b10SintPack32": vulkan_const.FormatA2r10g10b10SintPack32, + "A2b10g10r10UnormPack32": vulkan_const.FormatA2b10g10r10UnormPack32, + "A2b10g10r10SnormPack32": vulkan_const.FormatA2b10g10r10SnormPack32, + "A2b10g10r10UscaledPack32": vulkan_const.FormatA2b10g10r10UscaledPack32, + "A2b10g10r10SscaledPack32": vulkan_const.FormatA2b10g10r10SscaledPack32, + "A2b10g10r10UintPack32": vulkan_const.FormatA2b10g10r10UintPack32, + "A2b10g10r10SintPack32": vulkan_const.FormatA2b10g10r10SintPack32, + "R16Unorm": vulkan_const.FormatR16Unorm, + "R16Snorm": vulkan_const.FormatR16Snorm, + "R16Uscaled": vulkan_const.FormatR16Uscaled, + "R16Sscaled": vulkan_const.FormatR16Sscaled, + "R16Uint": vulkan_const.FormatR16Uint, + "R16Sint": vulkan_const.FormatR16Sint, + "R16Sfloat": vulkan_const.FormatR16Sfloat, + "R16g16Unorm": vulkan_const.FormatR16g16Unorm, + "R16g16Snorm": vulkan_const.FormatR16g16Snorm, + "R16g16Uscaled": vulkan_const.FormatR16g16Uscaled, + "R16g16Sscaled": vulkan_const.FormatR16g16Sscaled, + "R16g16Uint": vulkan_const.FormatR16g16Uint, + "R16g16Sint": vulkan_const.FormatR16g16Sint, + "R16g16Sfloat": vulkan_const.FormatR16g16Sfloat, + "R16g16b16Unorm": vulkan_const.FormatR16g16b16Unorm, + "R16g16b16Snorm": vulkan_const.FormatR16g16b16Snorm, + "R16g16b16Uscaled": vulkan_const.FormatR16g16b16Uscaled, + "R16g16b16Sscaled": vulkan_const.FormatR16g16b16Sscaled, + "R16g16b16Uint": vulkan_const.FormatR16g16b16Uint, + "R16g16b16Sint": vulkan_const.FormatR16g16b16Sint, + "R16g16b16Sfloat": vulkan_const.FormatR16g16b16Sfloat, + "R16g16b16a16Unorm": vulkan_const.FormatR16g16b16a16Unorm, + "R16g16b16a16Snorm": vulkan_const.FormatR16g16b16a16Snorm, + "R16g16b16a16Uscaled": vulkan_const.FormatR16g16b16a16Uscaled, + "R16g16b16a16Sscaled": vulkan_const.FormatR16g16b16a16Sscaled, + "R16g16b16a16Uint": vulkan_const.FormatR16g16b16a16Uint, + "R16g16b16a16Sint": vulkan_const.FormatR16g16b16a16Sint, + "R16g16b16a16Sfloat": vulkan_const.FormatR16g16b16a16Sfloat, + "R32Uint": vulkan_const.FormatR32Uint, + "R32Sint": vulkan_const.FormatR32Sint, + "R32Sfloat": vulkan_const.FormatR32Sfloat, + "R32g32Uint": vulkan_const.FormatR32g32Uint, + "R32g32Sint": vulkan_const.FormatR32g32Sint, + "R32g32Sfloat": vulkan_const.FormatR32g32Sfloat, + "R32g32b32Uint": vulkan_const.FormatR32g32b32Uint, + "R32g32b32Sint": vulkan_const.FormatR32g32b32Sint, + "R32g32b32Sfloat": vulkan_const.FormatR32g32b32Sfloat, + "R32g32b32a32Uint": vulkan_const.FormatR32g32b32a32Uint, + "R32g32b32a32Sint": vulkan_const.FormatR32g32b32a32Sint, + "R32g32b32a32Sfloat": vulkan_const.FormatR32g32b32a32Sfloat, + "R64Uint": vulkan_const.FormatR64Uint, + "R64Sint": vulkan_const.FormatR64Sint, + "R64Sfloat": vulkan_const.FormatR64Sfloat, + "R64g64Uint": vulkan_const.FormatR64g64Uint, + "R64g64Sint": vulkan_const.FormatR64g64Sint, + "R64g64Sfloat": vulkan_const.FormatR64g64Sfloat, + "R64g64b64Uint": vulkan_const.FormatR64g64b64Uint, + "R64g64b64Sint": vulkan_const.FormatR64g64b64Sint, + "R64g64b64Sfloat": vulkan_const.FormatR64g64b64Sfloat, + "R64g64b64a64Uint": vulkan_const.FormatR64g64b64a64Uint, + "R64g64b64a64Sint": vulkan_const.FormatR64g64b64a64Sint, + "R64g64b64a64Sfloat": vulkan_const.FormatR64g64b64a64Sfloat, + "B10g11r11UfloatPack32": vulkan_const.FormatB10g11r11UfloatPack32, + "E5b9g9r9UfloatPack32": vulkan_const.FormatE5b9g9r9UfloatPack32, + "D16Unorm": vulkan_const.FormatD16Unorm, + "X8D24UnormPack32": vulkan_const.FormatX8D24UnormPack32, + "D32Sfloat": vulkan_const.FormatD32Sfloat, + "S8Uint": vulkan_const.FormatS8Uint, + "D16UnormS8Uint": vulkan_const.FormatD16UnormS8Uint, + "D24UnormS8Uint": vulkan_const.FormatD24UnormS8Uint, + "D32SfloatS8Uint": vulkan_const.FormatD32SfloatS8Uint, + "Bc1RgbUnormBlock": vulkan_const.FormatBc1RgbUnormBlock, + "Bc1RgbSrgbBlock": vulkan_const.FormatBc1RgbSrgbBlock, + "Bc1RgbaUnormBlock": vulkan_const.FormatBc1RgbaUnormBlock, + "Bc1RgbaSrgbBlock": vulkan_const.FormatBc1RgbaSrgbBlock, + "Bc2UnormBlock": vulkan_const.FormatBc2UnormBlock, + "Bc2SrgbBlock": vulkan_const.FormatBc2SrgbBlock, + "Bc3UnormBlock": vulkan_const.FormatBc3UnormBlock, + "Bc3SrgbBlock": vulkan_const.FormatBc3SrgbBlock, + "Bc4UnormBlock": vulkan_const.FormatBc4UnormBlock, + "Bc4SnormBlock": vulkan_const.FormatBc4SnormBlock, + "Bc5UnormBlock": vulkan_const.FormatBc5UnormBlock, + "Bc5SnormBlock": vulkan_const.FormatBc5SnormBlock, + "Bc6hUfloatBlock": vulkan_const.FormatBc6hUfloatBlock, + "Bc6hSfloatBlock": vulkan_const.FormatBc6hSfloatBlock, + "Bc7UnormBlock": vulkan_const.FormatBc7UnormBlock, + "Bc7SrgbBlock": vulkan_const.FormatBc7SrgbBlock, + "Etc2R8g8b8UnormBlock": vulkan_const.FormatEtc2R8g8b8UnormBlock, + "Etc2R8g8b8SrgbBlock": vulkan_const.FormatEtc2R8g8b8SrgbBlock, + "Etc2R8g8b8a1UnormBlock": vulkan_const.FormatEtc2R8g8b8a1UnormBlock, + "Etc2R8g8b8a1SrgbBlock": vulkan_const.FormatEtc2R8g8b8a1SrgbBlock, + "Etc2R8g8b8a8UnormBlock": vulkan_const.FormatEtc2R8g8b8a8UnormBlock, + "Etc2R8g8b8a8SrgbBlock": vulkan_const.FormatEtc2R8g8b8a8SrgbBlock, + "EacR11UnormBlock": vulkan_const.FormatEacR11UnormBlock, + "EacR11SnormBlock": vulkan_const.FormatEacR11SnormBlock, + "EacR11g11UnormBlock": vulkan_const.FormatEacR11g11UnormBlock, + "EacR11g11SnormBlock": vulkan_const.FormatEacR11g11SnormBlock, + "Astc4x4UnormBlock": vulkan_const.FormatAstc4x4UnormBlock, + "Astc4x4SrgbBlock": vulkan_const.FormatAstc4x4SrgbBlock, + "Astc5x4UnormBlock": vulkan_const.FormatAstc5x4UnormBlock, + "Astc5x4SrgbBlock": vulkan_const.FormatAstc5x4SrgbBlock, + "Astc5x5UnormBlock": vulkan_const.FormatAstc5x5UnormBlock, + "Astc5x5SrgbBlock": vulkan_const.FormatAstc5x5SrgbBlock, + "Astc6x5UnormBlock": vulkan_const.FormatAstc6x5UnormBlock, + "Astc6x5SrgbBlock": vulkan_const.FormatAstc6x5SrgbBlock, + "Astc6x6UnormBlock": vulkan_const.FormatAstc6x6UnormBlock, + "Astc6x6SrgbBlock": vulkan_const.FormatAstc6x6SrgbBlock, + "Astc8x5UnormBlock": vulkan_const.FormatAstc8x5UnormBlock, + "Astc8x5SrgbBlock": vulkan_const.FormatAstc8x5SrgbBlock, + "Astc8x6UnormBlock": vulkan_const.FormatAstc8x6UnormBlock, + "Astc8x6SrgbBlock": vulkan_const.FormatAstc8x6SrgbBlock, + "Astc8x8UnormBlock": vulkan_const.FormatAstc8x8UnormBlock, + "Astc8x8SrgbBlock": vulkan_const.FormatAstc8x8SrgbBlock, + "Astc10x5UnormBlock": vulkan_const.FormatAstc10x5UnormBlock, + "Astc10x5SrgbBlock": vulkan_const.FormatAstc10x5SrgbBlock, + "Astc10x6UnormBlock": vulkan_const.FormatAstc10x6UnormBlock, + "Astc10x6SrgbBlock": vulkan_const.FormatAstc10x6SrgbBlock, + "Astc10x8UnormBlock": vulkan_const.FormatAstc10x8UnormBlock, + "Astc10x8SrgbBlock": vulkan_const.FormatAstc10x8SrgbBlock, + "Astc10x10UnormBlock": vulkan_const.FormatAstc10x10UnormBlock, + "Astc10x10SrgbBlock": vulkan_const.FormatAstc10x10SrgbBlock, + "Astc12x10UnormBlock": vulkan_const.FormatAstc12x10UnormBlock, + "Astc12x10SrgbBlock": vulkan_const.FormatAstc12x10SrgbBlock, + "Astc12x12UnormBlock": vulkan_const.FormatAstc12x12UnormBlock, + "Astc12x12SrgbBlock": vulkan_const.FormatAstc12x12SrgbBlock, + "G8b8g8r8422Unorm": vulkan_const.FormatG8b8g8r8422Unorm, + "B8g8r8g8422Unorm": vulkan_const.FormatB8g8r8g8422Unorm, + "G8B8R83plane420Unorm": vulkan_const.FormatG8B8R83plane420Unorm, + "G8B8r82plane420Unorm": vulkan_const.FormatG8B8r82plane420Unorm, + "G8B8R83plane422Unorm": vulkan_const.FormatG8B8R83plane422Unorm, + "G8B8r82plane422Unorm": vulkan_const.FormatG8B8r82plane422Unorm, + "G8B8R83plane444Unorm": vulkan_const.FormatG8B8R83plane444Unorm, + "R10x6UnormPack16": vulkan_const.FormatR10x6UnormPack16, + "R10x6g10x6Unorm2pack16": vulkan_const.FormatR10x6g10x6Unorm2pack16, + "R10x6g10x6b10x6a10x6Unorm4pack16": vulkan_const.FormatR10x6g10x6b10x6a10x6Unorm4pack16, + "G10x6b10x6g10x6r10x6422Unorm4pack16": vulkan_const.FormatG10x6b10x6g10x6r10x6422Unorm4pack16, + "B10x6g10x6r10x6g10x6422Unorm4pack16": vulkan_const.FormatB10x6g10x6r10x6g10x6422Unorm4pack16, + "G10x6B10x6R10x63plane420Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane420Unorm3pack16, + "G10x6B10x6r10x62plane420Unorm3pack16": vulkan_const.FormatG10x6B10x6r10x62plane420Unorm3pack16, + "G10x6B10x6R10x63plane422Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane422Unorm3pack16, + "G10x6B10x6r10x62plane422Unorm3pack16": vulkan_const.FormatG10x6B10x6r10x62plane422Unorm3pack16, + "G10x6B10x6R10x63plane444Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane444Unorm3pack16, + "R12x4UnormPack16": vulkan_const.FormatR12x4UnormPack16, + "R12x4g12x4Unorm2pack16": vulkan_const.FormatR12x4g12x4Unorm2pack16, + "R12x4g12x4b12x4a12x4Unorm4pack16": vulkan_const.FormatR12x4g12x4b12x4a12x4Unorm4pack16, + "G12x4b12x4g12x4r12x4422Unorm4pack16": vulkan_const.FormatG12x4b12x4g12x4r12x4422Unorm4pack16, + "B12x4g12x4r12x4g12x4422Unorm4pack16": vulkan_const.FormatB12x4g12x4r12x4g12x4422Unorm4pack16, + "G12x4B12x4R12x43plane420Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane420Unorm3pack16, + "G12x4B12x4r12x42plane420Unorm3pack16": vulkan_const.FormatG12x4B12x4r12x42plane420Unorm3pack16, + "G12x4B12x4R12x43plane422Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane422Unorm3pack16, + "G12x4B12x4r12x42plane422Unorm3pack16": vulkan_const.FormatG12x4B12x4r12x42plane422Unorm3pack16, + "G12x4B12x4R12x43plane444Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane444Unorm3pack16, + "G16b16g16r16422Unorm": vulkan_const.FormatG16b16g16r16422Unorm, + "B16g16r16g16422Unorm": vulkan_const.FormatB16g16r16g16422Unorm, + "G16B16R163plane420Unorm": vulkan_const.FormatG16B16R163plane420Unorm, + "G16B16r162plane420Unorm": vulkan_const.FormatG16B16r162plane420Unorm, + "G16B16R163plane422Unorm": vulkan_const.FormatG16B16R163plane422Unorm, + "G16B16r162plane422Unorm": vulkan_const.FormatG16B16r162plane422Unorm, + "G16B16R163plane444Unorm": vulkan_const.FormatG16B16R163plane444Unorm, + "Pvrtc12bppUnormBlockImg": vulkan_const.FormatPvrtc12bppUnormBlockImg, + "Pvrtc14bppUnormBlockImg": vulkan_const.FormatPvrtc14bppUnormBlockImg, + "Pvrtc22bppUnormBlockImg": vulkan_const.FormatPvrtc22bppUnormBlockImg, + "Pvrtc24bppUnormBlockImg": vulkan_const.FormatPvrtc24bppUnormBlockImg, + "Pvrtc12bppSrgbBlockImg": vulkan_const.FormatPvrtc12bppSrgbBlockImg, + "Pvrtc14bppSrgbBlockImg": vulkan_const.FormatPvrtc14bppSrgbBlockImg, + "Pvrtc22bppSrgbBlockImg": vulkan_const.FormatPvrtc22bppSrgbBlockImg, + "Pvrtc24bppSrgbBlockImg": vulkan_const.FormatPvrtc24bppSrgbBlockImg, +} +StringVkBlendFactor = map[string]vulkan_const.BlendFactor{ + "Zero": vulkan_const.BlendFactorZero, + "One": vulkan_const.BlendFactorOne, + "SrcColor": vulkan_const.BlendFactorSrcColor, + "SrcAlpha": vulkan_const.BlendFactorSrcAlpha, + "OneMinusSrcColor": vulkan_const.BlendFactorOneMinusSrcColor, + "DstColor": vulkan_const.BlendFactorDstColor, + "OneMinusDstColor": vulkan_const.BlendFactorOneMinusDstColor, + "OneMinusSrcAlpha": vulkan_const.BlendFactorOneMinusSrcAlpha, + "DstAlpha": vulkan_const.BlendFactorDstAlpha, + "OneMinusDstAlpha": vulkan_const.BlendFactorOneMinusDstAlpha, + "ConstantColor": vulkan_const.BlendFactorConstantColor, + "OneMinusConstantColor": vulkan_const.BlendFactorOneMinusConstantColor, + "ConstantAlpha": vulkan_const.BlendFactorConstantAlpha, + "OneMinusConstantAlpha": vulkan_const.BlendFactorOneMinusConstantAlpha, + "SrcAlphaSaturate": vulkan_const.BlendFactorSrcAlphaSaturate, + "Src1Color": vulkan_const.BlendFactorSrc1Color, + "OneMinusSrc1Color": vulkan_const.BlendFactorOneMinusSrc1Color, + "Src1Alpha": vulkan_const.BlendFactorSrc1Alpha, + "OneMinusSrc1Alpha": vulkan_const.BlendFactorOneMinusSrc1Alpha, +} +StringVkBlendOp = map[string]vulkan_const.BlendOp{ + "Add": vulkan_const.BlendOpAdd, + "Subtract": vulkan_const.BlendOpSubtract, + "ReverseSubtract": vulkan_const.BlendOpReverseSubtract, + "Min": vulkan_const.BlendOpMin, + "Max": vulkan_const.BlendOpMax, + "Zero": vulkan_const.BlendOpZero, + "Src": vulkan_const.BlendOpSrc, + "Dst": vulkan_const.BlendOpDst, + "SrcOver": vulkan_const.BlendOpSrcOver, + "DstOver": vulkan_const.BlendOpDstOver, + "SrcIn": vulkan_const.BlendOpSrcIn, + "DstIn": vulkan_const.BlendOpDstIn, + "SrcOut": vulkan_const.BlendOpSrcOut, + "DstOut": vulkan_const.BlendOpDstOut, + "SrcAtop": vulkan_const.BlendOpSrcAtop, + "DstAtop": vulkan_const.BlendOpDstAtop, + "Xor": vulkan_const.BlendOpXor, + "Multiply": vulkan_const.BlendOpMultiply, + "Screen": vulkan_const.BlendOpScreen, + "Overlay": vulkan_const.BlendOpOverlay, + "Darken": vulkan_const.BlendOpDarken, + "Lighten": vulkan_const.BlendOpLighten, + "Colordodge": vulkan_const.BlendOpColordodge, + "Colorburn": vulkan_const.BlendOpColorburn, + "Hardlight": vulkan_const.BlendOpHardlight, + "Softlight": vulkan_const.BlendOpSoftlight, + "Difference": vulkan_const.BlendOpDifference, + "Exclusion": vulkan_const.BlendOpExclusion, + "Invert": vulkan_const.BlendOpInvert, + "InvertRgb": vulkan_const.BlendOpInvertRgb, + "Lineardodge": vulkan_const.BlendOpLineardodge, + "Linearburn": vulkan_const.BlendOpLinearburn, + "Vividlight": vulkan_const.BlendOpVividlight, + "Linearlight": vulkan_const.BlendOpLinearlight, + "Pinlight": vulkan_const.BlendOpPinlight, + "Hardmix": vulkan_const.BlendOpHardmix, + "HslHue": vulkan_const.BlendOpHslHue, + "HslSaturation": vulkan_const.BlendOpHslSaturation, + "HslColor": vulkan_const.BlendOpHslColor, + "HslLuminosity": vulkan_const.BlendOpHslLuminosity, + "Plus": vulkan_const.BlendOpPlus, + "PlusClamped": vulkan_const.BlendOpPlusClamped, + "PlusClampedAlpha": vulkan_const.BlendOpPlusClampedAlpha, + "PlusDarker": vulkan_const.BlendOpPlusDarker, + "Minus": vulkan_const.BlendOpMinus, + "MinusClamped": vulkan_const.BlendOpMinusClamped, + "Contrast": vulkan_const.BlendOpContrast, + "InvertOvg": vulkan_const.BlendOpInvertOvg, + "Red": vulkan_const.BlendOpRed, + "Green": vulkan_const.BlendOpBlue, + "Blue": vulkan_const.BlendOpBlue, +} +StringVkLogicOp = map[string]vulkan_const.LogicOp{ + "Clear": vulkan_const.LogicOpClear, + "And": vulkan_const.LogicOpAnd, + "AndReverse": vulkan_const.LogicOpAndReverse, + "Copy": vulkan_const.LogicOpCopy, + "AndInverted": vulkan_const.LogicOpAndInverted, + "NoOp": vulkan_const.LogicOpNoOp, + "Xor": vulkan_const.LogicOpXor, + "Or": vulkan_const.LogicOpOr, + "Nor": vulkan_const.LogicOpNor, + "Equivalent": vulkan_const.LogicOpEquivalent, + "Invert": vulkan_const.LogicOpInvert, + "OrReverse": vulkan_const.LogicOpOrReverse, + "CopyInverted": vulkan_const.LogicOpCopyInverted, + "OrInverted": vulkan_const.LogicOpOrInverted, + "Nand": vulkan_const.LogicOpNand, + "Set": vulkan_const.LogicOpSet, +} +StringVkCompareOp = map[string]vulkan_const.CompareOp{ + "Never": vulkan_const.CompareOpNever, + "Equal": vulkan_const.CompareOpEqual, + "LessOrEqual": vulkan_const.CompareOpLessOrEqual, + "Greater": vulkan_const.CompareOpGreater, + "NotEqual": vulkan_const.CompareOpNotEqual, + "GreaterOrEqual": vulkan_const.CompareOpGreaterOrEqual, + "Always": vulkan_const.CompareOpAlways, + "Less": vulkan_const.CompareOpLess, +} +StringVkStencilOp = map[string]vulkan_const.StencilOp{ + "Zero": vulkan_const.StencilOpZero, + "Replace": vulkan_const.StencilOpReplace, + "IncrementAndClamp": vulkan_const.StencilOpIncrementAndClamp, + "DecrementAndClamp": vulkan_const.StencilOpDecrementAndClamp, + "Invert": vulkan_const.StencilOpInvert, + "IncrementAndWrap": vulkan_const.StencilOpIncrementAndWrap, + "DecrementAndWrap": vulkan_const.StencilOpDecrementAndWrap, + "Keep": vulkan_const.StencilOpKeep, +} +StringVkPrimitiveTopology = map[string]vulkan_const.PrimitiveTopology{ + "Points": vulkan_const.PrimitiveTopologyPointList, + "Lines": vulkan_const.PrimitiveTopologyLineList, + "Triangles": vulkan_const.PrimitiveTopologyTriangleList, + "Patches": vulkan_const.PrimitiveTopologyPatchList, +} +StringVkPolygonMode = map[string]vulkan_const.PolygonMode{ + "Point": vulkan_const.PolygonModePoint, + "Line": vulkan_const.PolygonModeLine, + "Fill": vulkan_const.PolygonModeFill, +} +StringVkCullModeFlagBits = map[string]vulkan_const.CullModeFlagBits{ + "None": vulkan_const.CullModeNone, + "Front": vulkan_const.CullModeFrontBit, + "Back": vulkan_const.CullModeBackBit, +} +StringVkFrontFace = map[string]vulkan_const.FrontFace{ + "Clockwise": vulkan_const.FrontFaceClockwise, + "CounterClockwise": vulkan_const.FrontFaceCounterClockwise, +} +StringVkSampleCountFlagBits = map[string]GPUSampleCountFlags{ + swapChainSampleCountKey: GPUSampleSwapChainCount, + "1Bit": GPUSampleCount1Bit, + "2Bit": GPUSampleCount2Bit, + "4Bit": GPUSampleCount4Bit, + "8Bit": GPUSampleCount8Bit, + "16Bit": GPUSampleCount16Bit, + "32Bit": GPUSampleCount32Bit, + "64Bit": GPUSampleCount64Bit, +} +StringVkPatchControlPoints = map[string]uint32{ + "Lines": 2, + "Triangles": 3, + "Quads": 4, +} +StringVkAttachmentLoadOp = map[string]GPUAttachmentLoadOp{ + "Load": GPUAttachmentLoadOpLoad, + "Clear": GPUAttachmentLoadOpClear, + "DontCare": GPUAttachmentLoadOpDontCare, +} +StringVkAttachmentStoreOp = map[string]GPUAttachmentStoreOp{ + "Store": GPUAttachmentStoreOpStore, + "DontCare": GPUAttachmentStoreOpDontCare, +} +StringVkImageLayout = map[string]GPUImageLayout{ + "Undefined": GPUImageLayoutUndefined, + "General": GPUImageLayoutGeneral, + "ColorAttachmentOptimal": GPUImageLayoutColorAttachmentOptimal, + "DepthStencilAttachmentOptimal": GPUImageLayoutDepthStencilAttachmentOptimal, + "DepthStencilReadOnlyOptimal": GPUImageLayoutDepthStencilReadOnlyOptimal, + "ShaderReadOnlyOptimal": GPUImageLayoutShaderReadOnlyOptimal, + "TransferSrcOptimal": GPUImageLayoutTransferSrcOptimal, + "TransferDstOptimal": GPUImageLayoutTransferDstOptimal, + "Preinitialized": GPUImageLayoutPreinitialized, + "DepthReadOnlyStencilAttachmentOptimal": GPUImageLayoutDepthReadOnlyStencilAttachmentOptimal, + "DepthAttachmentStencilReadOnlyOptimal": GPUImageLayoutDepthAttachmentStencilReadOnlyOptimal, + "PresentSrc": GPUImageLayoutPresentSrc, + "SharedPresent": GPUImageLayoutSharedPresent, + "ShadingRateOptimalNv": GPUImageLayoutShadingRateOptimalNv, +} +StringVkPipelineStageFlagBits = map[string]vulkan_const.PipelineStageFlagBits{ + "TopOfPipeBit": vulkan_const.PipelineStageTopOfPipeBit, + "DrawIndirectBit": vulkan_const.PipelineStageDrawIndirectBit, + "VertexInputBit": vulkan_const.PipelineStageVertexInputBit, + "VertexShaderBit": vulkan_const.PipelineStageVertexShaderBit, + "TessellationControlShaderBit": vulkan_const.PipelineStageTessellationControlShaderBit, + "TessellationEvaluationShaderBit": vulkan_const.PipelineStageTessellationEvaluationShaderBit, + "GeometryShaderBit": vulkan_const.PipelineStageGeometryShaderBit, + "FragmentShaderBit": vulkan_const.PipelineStageFragmentShaderBit, + "EarlyFragmentTestsBit": vulkan_const.PipelineStageEarlyFragmentTestsBit, + "LateFragmentTestsBit": vulkan_const.PipelineStageLateFragmentTestsBit, + "ColorAttachmentOutputBit": vulkan_const.PipelineStageColorAttachmentOutputBit, + "ComputeShaderBit": vulkan_const.PipelineStageComputeShaderBit, + "TransferBit": vulkan_const.PipelineStageTransferBit, + "BottomOfPipeBit": vulkan_const.PipelineStageBottomOfPipeBit, + "HostBit": vulkan_const.PipelineStageHostBit, + "AllGraphicsBit": vulkan_const.PipelineStageAllGraphicsBit, + "AllCommandsBit": vulkan_const.PipelineStageAllCommandsBit, + "TransformFeedbackBit": vulkan_const.PipelineStageTransformFeedbackBit, + "ConditionalRenderingBit": vulkan_const.PipelineStageConditionalRenderingBit, + "CommandProcessBitNvx": vulkan_const.PipelineStageCommandProcessBitNvx, + "ShadingRateImageBitNv": vulkan_const.PipelineStageShadingRateImageBitNv, + "RaytracingBitNvx": vulkan_const.PipelineStageRaytracingBitNvx, + "TaskShaderBitNv": vulkan_const.PipelineStageTaskShaderBitNv, + "MeshShaderBitNv": vulkan_const.PipelineStageMeshShaderBitNv, +} +StringVkAccessFlagBits = map[string]GPUAccessFlags{ + "IndirectCommandReadBit": GPUAccessIndirectCommandReadBit, + "IndexReadBit": GPUAccessIndexReadBit, + "VertexAttributeReadBit": GPUAccessVertexAttributeReadBit, + "UniformReadBit": GPUAccessUniformReadBit, + "InputAttachmentReadBit": GPUAccessInputAttachmentReadBit, + "ShaderReadBit": GPUAccessShaderReadBit, + "ShaderWriteBit": GPUAccessShaderWriteBit, + "ColorAttachmentReadBit": GPUAccessColorAttachmentReadBit, + "ColorAttachmentWriteBit": GPUAccessColorAttachmentWriteBit, + "DepthStencilAttachmentReadBit": GPUAccessDepthStencilAttachmentReadBit, + "DepthStencilAttachmentWriteBit": GPUAccessDepthStencilAttachmentWriteBit, + "TransferReadBit": GPUAccessTransferReadBit, + "TransferWriteBit": GPUAccessTransferWriteBit, + "HostReadBit": GPUAccessHostReadBit, + "HostWriteBit": GPUAccessHostWriteBit, + "MemoryReadBit": GPUAccessMemoryReadBit, + "MemoryWriteBit": GPUAccessMemoryWriteBit, + "TransformFeedbackWriteBit": GPUAccessTransformFeedbackWriteBit, + "TransformFeedbackCounterReadBit": GPUAccessTransformFeedbackCounterReadBit, + "TransformFeedbackCounterWriteBit": GPUAccessTransformFeedbackCounterWriteBit, + "ConditionalRenderingReadBit": GPUAccessConditionalRenderingReadBit, + "CommandProcessReadBitNvx": GPUAccessCommandProcessReadBitNvx, + "CommandProcessWriteBitNvx": GPUAccessCommandProcessWriteBitNvx, + "ColorAttachmentReadNoncoherentBit": GPUAccessColorAttachmentReadNoncoherentBit, + "ShadingRateImageReadBitNv": GPUAccessShadingRateImageReadBitNv, + "AccelerationStructureReadBitNvx": GPUAccessAccelerationStructureReadBitNvx, + "AccelerationStructureWriteBitNvx": GPUAccessAccelerationStructureWriteBitNvx, +} +StringVkShaderStageFlagBits = map[string]vulkan_const.ShaderStageFlagBits{ + "VertexBit": vulkan_const.ShaderStageVertexBit, + "TessellationControlBit": vulkan_const.ShaderStageTessellationControlBit, + "TessellationEvaluationBit": vulkan_const.ShaderStageTessellationEvaluationBit, + "GeometryBit": vulkan_const.ShaderStageGeometryBit, + "FragmentBit": vulkan_const.ShaderStageFragmentBit, + "ComputeBit": vulkan_const.ShaderStageComputeBit, + "AllGraphics": vulkan_const.ShaderStageAllGraphics, + "All": vulkan_const.ShaderStageAll, + "RaygenBitNvx": vulkan_const.ShaderStageRaygenBitNvx, + "AnyHitBitNvx": vulkan_const.ShaderStageAnyHitBitNvx, + "ClosestHitBitNvx": vulkan_const.ShaderStageClosestHitBitNvx, + "MissBitNvx": vulkan_const.ShaderStageMissBitNvx, + "IntersectionBitNvx": vulkan_const.ShaderStageIntersectionBitNvx, + "CallableBitNvx": vulkan_const.ShaderStageCallableBitNvx, + "TaskBitNv": vulkan_const.ShaderStageTaskBitNv, + "MeshBitNv": vulkan_const.ShaderStageMeshBitNv, + "FlagBitsMaxEnum": vulkan_const.ShaderStageFlagBitsMaxEnum, +} +StringVkPipelineBindPoint = map[string]vulkan_const.PipelineBindPoint{ + "Graphics": vulkan_const.PipelineBindPointGraphics, + "Compute": vulkan_const.PipelineBindPointCompute, + "RaytracingNvx": vulkan_const.PipelineBindPointRaytracingNvx, +} +StringVkDependencyFlagBits = map[string]vulkan_const.DependencyFlagBits{ + "ByRegionBit": vulkan_const.DependencyByRegionBit, + "DeviceGroupBit": vulkan_const.DependencyDeviceGroupBit, + "ViewLocalBit": vulkan_const.DependencyViewLocalBit, +} +StringVkColorComponentFlagBits = map[string]vulkan_const.ColorComponentFlagBits{ + "R": vulkan_const.ColorComponentRBit, + "G": vulkan_const.ColorComponentGBit, + "B": vulkan_const.ColorComponentBBit, + "A": vulkan_const.ColorComponentABit, +} +StringVkPipelineCreateFlagBits = map[string]vulkan_const.PipelineCreateFlagBits{ + "DisableOptimizationBit": vulkan_const.PipelineCreateDisableOptimizationBit, + "AllowDerivativesBit": vulkan_const.PipelineCreateAllowDerivativesBit, + "DerivativeBit": vulkan_const.PipelineCreateDerivativeBit, + "ViewIndexFromDeviceIndexBit": vulkan_const.PipelineCreateViewIndexFromDeviceIndexBit, + "DispatchBase": vulkan_const.PipelineCreateDispatchBase, + "DeferCompileBitNvx": vulkan_const.PipelineCreateDeferCompileBitNvx, +} +StringVkImageTiling = map[string]GPUImageTiling{ + "Optimal": GPUImageTilingOptimal, + "Linear": GPUImageTilingLinear, + "DrmFormatModifier": GPUImageTilingDrmFormatModifier, +} +StringVkFilter = map[string]GPUFilter{ + "Nearest": GPUFilterNearest, + "Linear": GPUFilterLinear, + "CubicImg": GPUFilterCubicImg, +} +StringVkImageUsageFlagBits = map[string]GPUImageUsageFlags{ + "TransferSrcBit": GPUImageUsageTransferSrcBit, + "TransferDstBit": GPUImageUsageTransferDstBit, + "SampledBit": GPUImageUsageSampledBit, + "StorageBit": GPUImageUsageStorageBit, + "ColorAttachmentBit": GPUImageUsageColorAttachmentBit, + "DepthStencilAttachmentBit": GPUImageUsageDepthStencilAttachmentBit, + "TransientAttachmentBit": GPUImageUsageTransientAttachmentBit, + "InputAttachmentBit": GPUImageUsageInputAttachmentBit, + "ShadingRateImageBitNv": GPUImageUsageShadingRateImageBitNv, +} +StringVkMemoryPropertyFlagBits = map[string]GPUMemoryPropertyFlags{ + "DeviceLocalBit": GPUMemoryPropertyDeviceLocalBit, + "HostVisibleBit": GPUMemoryPropertyHostVisibleBit, + "HostCoherentBit": GPUMemoryPropertyHostCoherentBit, + "HostCachedBit": GPUMemoryPropertyHostCachedBit, + "LazilyAllocatedBit": GPUMemoryPropertyLazilyAllocatedBit, + "ProtectedBit": GPUMemoryPropertyProtectedBit, +} +StringVkImageAspectFlagBits = map[string]GPUImageAspectFlags{ + "ColorBit": GPUImageAspectColorBit, + "DepthBit": GPUImageAspectDepthBit, + "StencilBit": GPUImageAspectStencilBit, + "MetadataBit": GPUImageAspectMetadataBit, + "Plane0Bit": GPUImageAspectPlane0Bit, + "Plane1Bit": GPUImageAspectPlane1Bit, + "Plane2Bit": GPUImageAspectPlane2Bit, + "MemoryPlane0Bit": GPUImageAspectMemoryPlane0Bit, + "MemoryPlane1Bit": GPUImageAspectMemoryPlane1Bit, + "MemoryPlane2Bit": GPUImageAspectMemoryPlane2Bit, + "MemoryPlane3Bit": GPUImageAspectMemoryPlane3Bit, +} +StringVkMap = map[string]any{ + "StringVkFormat": StringVkFormat, + "StringVkBlendFactor": StringVkBlendFactor, + "StringVkBlendOp": StringVkBlendOp, + "StringVkLogicOp": StringVkLogicOp, + "StringVkCompareOp": StringVkCompareOp, + "StringVkStencilOp": StringVkStencilOp, + "StringVkPrimitiveTopology": StringVkPrimitiveTopology, + "StringVkPolygonMode": StringVkPolygonMode, + "StringVkCullModeFlagBits": StringVkCullModeFlagBits, + "StringVkFrontFace": StringVkFrontFace, + "StringVkSampleCountFlagBits": StringVkSampleCountFlagBits, + "StringVkPatchControlPoints": StringVkPatchControlPoints, + "StringVkAttachmentLoadOp": StringVkAttachmentLoadOp, + "StringVkAttachmentStoreOp": StringVkAttachmentStoreOp, + "StringVkImageLayout": StringVkImageLayout, + "StringVkPipelineStageFlagBits": StringVkPipelineStageFlagBits, + "StringVkAccessFlagBits": StringVkAccessFlagBits, + "StringVkPipelineBindPoint": StringVkPipelineBindPoint, + "StringVkDependencyFlagBits": StringVkDependencyFlagBits, + "StringVkColorComponentFlagBits": StringVkColorComponentFlagBits, + "StringVkPipelineCreateFlagBits": StringVkPipelineCreateFlagBits, + "StringVkImageTiling": StringVkImageTiling, + "StringVkFilter": StringVkFilter, + "StringVkImageUsageFlagBits": StringVkImageUsageFlagBits, + "StringVkMemoryPropertyFlagBits": StringVkMemoryPropertyFlagBits, + "StringVkImageAspectFlagBits": StringVkImageAspectFlagBits, +} +``` + +) + +## Functions + + +### func SetupLightMaterials(materialCache *MaterialCache) error + +### func TextureKeys(textures []*Texture) []string + +### func VertexFaceNormal(verts [3]Vertex) matrix.Vec3 + + +## Types + + +### type BoneTransform struct { + +```go +Id int32 +Transform matrix.Transform +Skin matrix.Mat4 +``` + +} + +### type CommandRecorder struct { + +```go +// Has unexported fields. +``` + +} + +### func NewCommandRecorder(device *GPUDevice) (CommandRecorder, error) + + +### func (c *CommandRecorder) Begin() + + +### func (c *CommandRecorder) Destroy(device *GPUDevice) + + +### func (c *CommandRecorder) End() + + +### func (c *CommandRecorder) Reset() + + +### type CommandRecorderSecondary struct { + +```go +CommandRecorder +``` + + +```go +// Has unexported fields. +``` + +} + +### func NewCommandRecorderSecondary(device *GPUDevice, rp *RenderPass, subpassIdx int) (CommandRecorderSecondary, error) + + +### func (c *CommandRecorderSecondary) Begin(viewport vk.Viewport, scissor vk.Rect2D) + + +### type ComputeShaderBuffer struct { + +```go +ShaderBuffer +Shader *Shader +``` + + +```go +// Has unexported fields. +``` + +} + +### func (b *ComputeShaderBuffer) Initialize(device *GPUDevice, size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags) error + + +### func (b *ComputeShaderBuffer) WriteDescriptors(device *GPUDevice) + + +### type ComputeTask struct { + +```go +Shader *Shader +DescriptorSets []GPUDescriptorSet +WorkGroups [3]uint32 +``` + +} + +### type DescriptorSetLayoutStructure struct { + +```go +Types []DescriptorSetLayoutStructureType +``` + +} + +### type DescriptorSetLayoutStructureType struct { + +```go +Type vulkan_const.DescriptorType +Flags vulkan_const.ShaderStageFlagBits +Count, Binding uint32 +``` + +} + +### type DrawInstance interface { + +```go +Base() *ShaderDataBase +SkinningHeader() *SkinnedShaderDataHeader +Destroy() +IsDestroyed() bool +Activate() +Deactivate() +IsInView() bool +Size() int +SetModel(model matrix.Mat4) +UpdateModel(viewCuller ViewCuller, container collision.AABB) +DataPointer() unsafe.Pointer +// Returns true if it should write the data, otherwise false +UpdateBoundData() bool +BoundDataPointer() unsafe.Pointer +InstanceBoundDataSize() int +``` + + +```go +SelectLights(lights LightsForRender) +``` + + +```go +// Has unexported methods. +``` + +} + +### func ReflectDuplicateDrawInstance(target DrawInstance) DrawInstance + + +### type DrawInstanceGroup struct { + +```go +Mesh *Mesh +InstanceDriverData +MaterialInstance *Material +``` + + +```go +Instances []DrawInstance +``` + + +```go +// Has unexported fields. +``` + +} + +### func NewDrawInstanceGroup(mesh *Mesh, dataSize int, viewCuller ViewCuller) DrawInstanceGroup + + +### func (d *DrawInstanceGroup) AddInstance(instance DrawInstance) + + +### func (d *DrawInstanceGroup) AlterPadding(blockSize int) + + +### func (d *DrawInstanceGroup) AnyVisible() bool + + +### func (d *DrawInstanceGroup) Clear() + + +### func (d *DrawInstanceGroup) Destroy(device *GPUDevice) + + +### func (d *DrawInstanceGroup) IsEmpty() bool + + +### func (d *DrawInstanceGroup) IsReady() bool + + +### func (d *DrawInstanceGroup) TotalSize() int + + +### func (d *DrawInstanceGroup) UpdateData(device *GPUDevice, frame int, lights LightsForRender) + + +### func (d *DrawInstanceGroup) VisibleCount() int + + +### func (d *DrawInstanceGroup) VisibleSize() int + + +### type Drawing struct { + +```go +// Material defines the visual appearance and render pass for the drawing. +Material *Material +// Mesh contains the geometry to be rendered. +Mesh *Mesh +// ShaderData holds per‑instance data for the shader (e.g., uniforms). +ShaderData DrawInstance +// Transform specifies the transform this drawing follows. +Transform *matrix.Transform +// Sort determines the draw order within a render pass. +Sort int +// ViewCuller optionally culls the drawing based on the view frustum. +ViewCuller ViewCuller +``` + +} +```go + Drawing represents a renderable entity in the engine. It bundles together + the material, mesh, shader instance data, transform, sorting order, and an + optional view culler used during rendering. +``` + + +### func (d *Drawing) IsValid() bool + +```go + IsValid reports whether the Drawing is properly configured for rendering. + A Drawing is considered valid if it has a non-nil Material. This check is + used before submitting the drawing to the render pipeline. +``` + + +### type Drawings struct { + +```go +// Has unexported fields. +``` + +} + +### func NewDrawings() Drawings + + +### func (d *Drawings) AddDrawing(drawing Drawing) + + +### func (d *Drawings) AddDrawings(drawings []Drawing) + + +### func (d *Drawings) Clear() + + +### func (d *Drawings) Destroy(device *GPUDevice) + + +### func (d *Drawings) HasDrawings() bool + + +### func (d *Drawings) PreparePending(shadowCascades uint8) + + +### func (d *Drawings) Render(device *GPUDevice, lights LightsForRender) + + +### type FontBaseline int + + +### type FontCache struct { + +```go +FaceMutex sync.RWMutex +// Has unexported fields. +``` + +} + +### func NewFontCache(device *GPUDevice, assetDb assets.Database) FontCache + + +### func (cache *FontCache) Destroy() + + +### func (cache *FontCache) EMSize(face FontFace) float32 + + +### func (cache *FontCache) Init(caches RenderCaches) error + + +### func (cache *FontCache) LineCountWithin(face FontFace, text string, scale, maxWidth float32) int + + +### func (cache *FontCache) MeasureCharacter(face string, r rune, pixelSize float32) matrix.Vec2 + + +### func (cache *FontCache) MeasureString(face FontFace, text string, scale float32) float32 + + +### func (cache *FontCache) MeasureStringWithin(face FontFace, text string, scale, maxWidth float32, lineHeight float32) matrix.Vec2 + + +### func (cache *FontCache) PointOffsetWithin(face FontFace, text string, point matrix.Vec2, scale, maxWidth float32) int + + +### func (cache *FontCache) PreloadFace(face FontFace) + + +### func (cache *FontCache) RenderMeshes(caches RenderCaches, + +```go +text string, x, y, z, scale, maxWidth float32, fgColor, bgColor matrix.Color, +justify FontJustify, baseline FontBaseline, rootScale matrix.Vec3, instanced, +is3D bool, face FontFace, lineHeight float32, cam *cameras.Container) []Drawing +``` + + +### func (cache *FontCache) StringRectsWithinNew(face FontFace, text string, scale, maxWidth float32) []matrix.Vec4 + + +### func (cache *FontCache) TransparentMaterial(target *Material) *Material + + +### type FontFace string + + +### func (f FontFace) AsBold() FontFace + + +### func (f FontFace) AsExtraBold() FontFace + + +### func (f FontFace) AsItalic() FontFace + + +### func (f FontFace) AsLight() FontFace + + +### func (f FontFace) AsMedium() FontFace + + +### func (f FontFace) AsRegular() FontFace + + +### func (f FontFace) AsSemiBold() FontFace + + +### func (f FontFace) Base() FontFace + + +### func (f FontFace) IsBold() bool + + +### func (f FontFace) IsExtraBold() bool + + +### func (f FontFace) IsItalic() bool + + +### func (f FontFace) RemoveBold() FontFace + + +### func (f FontFace) RemoveItalic() FontFace + + +### type FontJustify int + + +### type FuncPipeline func(device *GPUDevice, shader *Shader, shaderStages []vk.PipelineShaderStageCreateInfo) bool + + +### type GPUAccessFlags uint32 + + +### const ( + +```go +GPUAccessIndirectCommandReadBit GPUAccessFlags = (1 << iota) +GPUAccessIndexReadBit +GPUAccessVertexAttributeReadBit +GPUAccessUniformReadBit +GPUAccessInputAttachmentReadBit +GPUAccessShaderReadBit +GPUAccessShaderWriteBit +GPUAccessColorAttachmentReadBit +GPUAccessColorAttachmentWriteBit +GPUAccessDepthStencilAttachmentReadBit +GPUAccessDepthStencilAttachmentWriteBit +GPUAccessTransferReadBit +GPUAccessTransferWriteBit +GPUAccessHostReadBit +GPUAccessHostWriteBit +GPUAccessMemoryReadBit +GPUAccessMemoryWriteBit +GPUAccessTransformFeedbackWriteBit +GPUAccessTransformFeedbackCounterReadBit +GPUAccessTransformFeedbackCounterWriteBit +GPUAccessConditionalRenderingReadBit +GPUAccessCommandProcessReadBitNvx +GPUAccessCommandProcessWriteBitNvx +GPUAccessColorAttachmentReadNoncoherentBit +GPUAccessShadingRateImageReadBitNv +GPUAccessAccelerationStructureReadBitNvx +GPUAccessAccelerationStructureWriteBitNvx +``` + +) +### type GPUApplication struct { + +```go +Name string +Version GPUApplicationVersion +Instances []*GPUApplicationInstance +``` + +} + +### func (g *GPUApplication) ApplicationVersion() (major int, minor int, patch int) + + +### func (g *GPUApplication) CreateInstance(window RenderingContainer, assets assets.Database) (*GPUApplicationInstance, error) + + +### func (g *GPUApplication) Destroy() + + +### func (g *GPUApplication) EngineVersion() (major int, minor int, patch int) + + +### func (g *GPUApplication) FirstInstance() *GPUApplicationInstance + + +### func (g *GPUApplication) Instance(index int) (*GPUApplicationInstance, bool) + + +### func (g *GPUApplication) IsValid() bool + + +### func (g *GPUApplication) Setup(name string, version GPUApplicationVersion) + + +### type GPUApplicationInstance struct { + +```go +GPUInstance +Surface GPUSurface +Devices []GPUDevice +``` + + +```go +// Has unexported fields. +``` + +} + +### func (g *GPUApplicationInstance) Destroy() + + +### func (g *GPUApplicationInstance) FinalizeLogicalDeviceSetup() + + +### func (g *GPUApplicationInstance) Initialize(window RenderingContainer, app *GPUApplication, assets assets.Database) error + + +### func (g *GPUApplicationInstance) PhysicalDevice() *GPUPhysicalDevice + + +### func (g *GPUApplicationInstance) PrimaryDevice() *GPUDevice + + +### func (g *GPUApplicationInstance) SelectPhysicalDevice(method func(options []GPUPhysicalDevice) int) error + + +### func (g *GPUApplicationInstance) SetupCaches(caches RenderCaches, width, height int32) error + + +### func (g *GPUApplicationInstance) SetupLogicalDevice(index int) error + + +### type GPUApplicationVersion struct { + +```go +Major int +Minor int +Patch int +``` + +} + +### type GPUAttachmentLoadOp uint8 + + +### const ( + +```go +GPUAttachmentLoadOpLoad GPUAttachmentLoadOp = iota +GPUAttachmentLoadOpClear +GPUAttachmentLoadOpDontCare +``` + +) +### type GPUAttachmentStoreOp uint8 + + +### const ( + +```go +GPUAttachmentStoreOpStore GPUAttachmentStoreOp = iota +GPUAttachmentStoreOpDontCare +``` + +) +### type GPUBuffer struct{ GPUHandle } + + +### type GPUBufferUsageFlags uint16 + + +### const ( + +```go +GPUBufferUsageTransferSrcBit GPUBufferUsageFlags = (1 << iota) +GPUBufferUsageTransferDstBit +GPUBufferUsageUniformTexelBufferBit +GPUBufferUsageStorageTexelBufferBit +GPUBufferUsageUniformBufferBit +GPUBufferUsageStorageBufferBit +GPUBufferUsageIndexBufferBit +GPUBufferUsageVertexBufferBit +GPUBufferUsageIndirectBufferBit +GPUBufferUsageTransformFeedbackBufferBit +GPUBufferUsageTransformFeedbackCounterBufferBit +GPUBufferUsageConditionalRenderingBit +GPUBufferUsageRaytracingBitNvx +``` + +) +### type GPUColorSpace int32 + + +### const ( + +```go +GPUColorSpaceSrgbNonlinear GPUColorSpace = iota +GPUColorSpaceDisplayP3Nonlinear +GPUColorSpaceExtendedSrgbLinear +GPUColorSpaceDciP3Linear +GPUColorSpaceDciP3Nonlinear +GPUColorSpaceBt709Linear +GPUColorSpaceBt709Nonlinear +GPUColorSpaceBt2020Linear +GPUColorSpaceHdr10St2084 +GPUColorSpaceDolbyvision +GPUColorSpaceHdr10Hlg +GPUColorSpaceAdobergbLinear +GPUColorSpaceAdobergbNonlinear +GPUColorSpacePassThrough +GPUColorSpaceExtendedSrgbNonlinear +``` + +) +### type GPUCompositeAlphaFlags int32 + + +### const ( + +```go +GPUCompositeAlphaOpaqueBit GPUCompositeAlphaFlags = (1 << iota) +GPUCompositeAlphaPreMultipliedBit +GPUCompositeAlphaPostMultipliedBit +GPUCompositeAlphaInheritBit +``` + +) +### type GPUDescriptorImageInfo struct { + +```go +Sampler GPUSampler +ImageView GPUImageView +ImageLayout GPUImageLayout +``` + +} + +### type GPUDescriptorPool struct{ GPUHandle } + + +### type GPUDescriptorSet struct{ GPUHandle } + + +### type GPUDescriptorSetLayout struct{ GPUHandle } + + +### type GPUDevice struct { + +```go +PhysicalDevice GPUPhysicalDevice +LogicalDevice GPULogicalDevice +Painter GPUPainter +``` + + +```go +// Has unexported fields. +``` + +} + +### func (g *GPUDevice) BlitTargets(passes []*RenderPass) + + +### func (g *GPUDevice) CopyBuffer(srcBuffer GPUBuffer, dstBuffer GPUBuffer, size uintptr) + + +### func (g *GPUDevice) CopyBufferToImage(buffer GPUBuffer, image GPUImage, width, height uint32, layerCount int) + + +### func (g *GPUDevice) CreateBuffer(size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags) (GPUBuffer, GPUDeviceMemory, error) + + +### func (g *GPUDevice) CreateFrameBuffer(renderPass *RenderPass, attachments []GPUImageView, width, height int32) (GPUFrameBuffer, error) + + +### func (g *GPUDevice) CreateImage(id *TextureId, properties GPUMemoryPropertyFlags, req GPUImageCreateRequest) error + + +### func (g *GPUDevice) CreateIndexBuffer(indices []uint32) (GPUBuffer, GPUDeviceMemory, error) + + +### func (g *GPUDevice) CreateMesh(mesh *Mesh, verts []Vertex, indices []uint32) + + +### func (g *GPUDevice) CreateShader(shader *Shader, assetDB assets.Database) error + + +### func (g *GPUDevice) CreateSwapChain(window RenderingContainer, inst *GPUApplicationInstance) error + + +### func (g *GPUDevice) CreateTextureSampler(mipLevels uint32, filter GPUFilter) (GPUSampler, error) + + +### func (g *GPUDevice) CreateVertexBuffer(verts []Vertex) (GPUBuffer, GPUDeviceMemory, error) + + +### func (g *GPUDevice) DestroyBuffer(buffer GPUBuffer) + + +### func (g *GPUDevice) DestroyFrameBuffer(frameBuffer GPUFrameBuffer) + + +### func (g *GPUDevice) DestroyShaderHandle(id ShaderId) + + +### func (g *GPUDevice) Draw(renderPass *RenderPass, drawings []ShaderDraw, lights LightsForRender, shadows []TextureId) + + +### func (g *GPUDevice) FreeMemory(memory GPUDeviceMemory) + + +### func (g *GPUDevice) GenerateMipMaps(texId *TextureId, imageFormat GPUFormat, texWidth, texHeight, mipLevels uint32, filter GPUFilter) error + + +### func (g *GPUDevice) MapMemory(memory GPUDeviceMemory, offset uintptr, size uintptr, flags GPUMemoryFlags, out *unsafe.Pointer) error + + +### func (g *GPUDevice) Memcopy(dst unsafe.Pointer, src []byte) int + + +### func (g *GPUDevice) MeshIsReady(mesh Mesh) bool + + +### func (g *GPUDevice) QueueCompute(buffer *ComputeShaderBuffer) + + +### func (g *GPUDevice) ReadyFrame(inst *GPUApplicationInstance, window RenderingContainer, camera cameras.Camera, uiCamera cameras.Camera, lights LightsForRender, runtime float32) bool + + +### func (g *GPUDevice) SetupTexture(texture *Texture, data *TextureData) error + + +### func (g *GPUDevice) SwapFrame(window RenderingContainer, inst *GPUApplicationInstance, width, height int32) bool + + +### func (g *GPUDevice) TextureRead(texture *Texture) ([]byte, error) + + +### func (g *GPUDevice) TextureReadPixel(texture *Texture, x, y int) matrix.Color + + +### func (g *GPUDevice) TextureWritePixels(texture *Texture, requests []GPUImageWriteRequest) + + +### func (g *GPUDevice) TransitionImageLayout(vt *TextureId, newLayout GPUImageLayout, aspectMask GPUImageAspectFlags, newAccess GPUAccessFlags, cmd *CommandRecorder) + + +### func (g *GPUDevice) UnmapMemory(memory GPUDeviceMemory) + + +### func (g *GPUDevice) WriteBufferToImageRegion(image GPUImage, requests []GPUImageWriteRequest) error + + +### type GPUDeviceMemory struct{ GPUHandle } + + +### type GPUFence struct{ GPUHandle } + + +### type GPUFilter uint8 + + +### const ( + +```go +GPUFilterNearest GPUFilter = iota +GPUFilterLinear +GPUFilterCubicImg +``` + +) +### type GPUFormat int32 + + +### const ( + +```go +GPUFormatUndefined GPUFormat = iota +GPUFormatR4g4UnormPack8 +GPUFormatR4g4b4a4UnormPack16 +GPUFormatB4g4r4a4UnormPack16 +GPUFormatR5g6b5UnormPack16 +GPUFormatB5g6r5UnormPack16 +GPUFormatR5g5b5a1UnormPack16 +GPUFormatB5g5r5a1UnormPack16 +GPUFormatA1r5g5b5UnormPack16 +GPUFormatR8Unorm +GPUFormatR8Snorm +GPUFormatR8Uscaled +GPUFormatR8Sscaled +GPUFormatR8Uint +GPUFormatR8Sint +GPUFormatR8Srgb +GPUFormatR8g8Unorm +GPUFormatR8g8Snorm +GPUFormatR8g8Uscaled +GPUFormatR8g8Sscaled +GPUFormatR8g8Uint +GPUFormatR8g8Sint +GPUFormatR8g8Srgb +GPUFormatR8g8b8Unorm +GPUFormatR8g8b8Snorm +GPUFormatR8g8b8Uscaled +GPUFormatR8g8b8Sscaled +GPUFormatR8g8b8Uint +GPUFormatR8g8b8Sint +GPUFormatR8g8b8Srgb +GPUFormatB8g8r8Unorm +GPUFormatB8g8r8Snorm +GPUFormatB8g8r8Uscaled +GPUFormatB8g8r8Sscaled +GPUFormatB8g8r8Uint +GPUFormatB8g8r8Sint +GPUFormatB8g8r8Srgb +GPUFormatR8g8b8a8Unorm +GPUFormatR8g8b8a8Snorm +GPUFormatR8g8b8a8Uscaled +GPUFormatR8g8b8a8Sscaled +GPUFormatR8g8b8a8Uint +GPUFormatR8g8b8a8Sint +GPUFormatR8g8b8a8Srgb +GPUFormatB8g8r8a8Unorm +GPUFormatB8g8r8a8Snorm +GPUFormatB8g8r8a8Uscaled +GPUFormatB8g8r8a8Sscaled +GPUFormatB8g8r8a8Uint +GPUFormatB8g8r8a8Sint +GPUFormatB8g8r8a8Srgb +GPUFormatA8b8g8r8UnormPack32 +GPUFormatA8b8g8r8SnormPack32 +GPUFormatA8b8g8r8UscaledPack32 +GPUFormatA8b8g8r8SscaledPack32 +GPUFormatA8b8g8r8UintPack32 +GPUFormatA8b8g8r8SintPack32 +GPUFormatA8b8g8r8SrgbPack32 +GPUFormatA2r10g10b10UnormPack32 +GPUFormatA2r10g10b10SnormPack32 +GPUFormatA2r10g10b10UscaledPack32 +GPUFormatA2r10g10b10SscaledPack32 +GPUFormatA2r10g10b10UintPack32 +GPUFormatA2r10g10b10SintPack32 +GPUFormatA2b10g10r10UnormPack32 +GPUFormatA2b10g10r10SnormPack32 +GPUFormatA2b10g10r10UscaledPack32 +GPUFormatA2b10g10r10SscaledPack32 +GPUFormatA2b10g10r10UintPack32 +GPUFormatA2b10g10r10SintPack32 +GPUFormatR16Unorm +GPUFormatR16Snorm +GPUFormatR16Uscaled +GPUFormatR16Sscaled +GPUFormatR16Uint +GPUFormatR16Sint +GPUFormatR16Sfloat +GPUFormatR16g16Unorm +GPUFormatR16g16Snorm +GPUFormatR16g16Uscaled +GPUFormatR16g16Sscaled +GPUFormatR16g16Uint +GPUFormatR16g16Sint +GPUFormatR16g16Sfloat +GPUFormatR16g16b16Unorm +GPUFormatR16g16b16Snorm +GPUFormatR16g16b16Uscaled +GPUFormatR16g16b16Sscaled +GPUFormatR16g16b16Uint +GPUFormatR16g16b16Sint +GPUFormatR16g16b16Sfloat +GPUFormatR16g16b16a16Unorm +GPUFormatR16g16b16a16Snorm +GPUFormatR16g16b16a16Uscaled +GPUFormatR16g16b16a16Sscaled +GPUFormatR16g16b16a16Uint +GPUFormatR16g16b16a16Sint +GPUFormatR16g16b16a16Sfloat +GPUFormatR32Uint +GPUFormatR32Sint +GPUFormatR32Sfloat +GPUFormatR32g32Uint +GPUFormatR32g32Sint +GPUFormatR32g32Sfloat +GPUFormatR32g32b32Uint +GPUFormatR32g32b32Sint +GPUFormatR32g32b32Sfloat +GPUFormatR32g32b32a32Uint +GPUFormatR32g32b32a32Sint +GPUFormatR32g32b32a32Sfloat +GPUFormatR64Uint +GPUFormatR64Sint +GPUFormatR64Sfloat +GPUFormatR64g64Uint +GPUFormatR64g64Sint +GPUFormatR64g64Sfloat +GPUFormatR64g64b64Uint +GPUFormatR64g64b64Sint +GPUFormatR64g64b64Sfloat +GPUFormatR64g64b64a64Uint +GPUFormatR64g64b64a64Sint +GPUFormatR64g64b64a64Sfloat +GPUFormatB10g11r11UfloatPack32 +GPUFormatE5b9g9r9UfloatPack32 +GPUFormatD16Unorm +GPUFormatX8D24UnormPack32 +GPUFormatD32Sfloat +GPUFormatS8Uint +GPUFormatD16UnormS8Uint +GPUFormatD24UnormS8Uint +GPUFormatD32SfloatS8Uint +GPUFormatBc1RgbUnormBlock +GPUFormatBc1RgbSrgbBlock +GPUFormatBc1RgbaUnormBlock +GPUFormatBc1RgbaSrgbBlock +GPUFormatBc2UnormBlock +GPUFormatBc2SrgbBlock +GPUFormatBc3UnormBlock +GPUFormatBc3SrgbBlock +GPUFormatBc4UnormBlock +GPUFormatBc4SnormBlock +GPUFormatBc5UnormBlock +GPUFormatBc5SnormBlock +GPUFormatBc6hUfloatBlock +GPUFormatBc6hSfloatBlock +GPUFormatBc7UnormBlock +GPUFormatBc7SrgbBlock +GPUFormatEtc2R8g8b8UnormBlock +GPUFormatEtc2R8g8b8SrgbBlock +GPUFormatEtc2R8g8b8a1UnormBlock +GPUFormatEtc2R8g8b8a1SrgbBlock +GPUFormatEtc2R8g8b8a8UnormBlock +GPUFormatEtc2R8g8b8a8SrgbBlock +GPUFormatEacR11UnormBlock +GPUFormatEacR11SnormBlock +GPUFormatEacR11g11UnormBlock +GPUFormatEacR11g11SnormBlock +GPUFormatAstc4x4UnormBlock +GPUFormatAstc4x4SrgbBlock +GPUFormatAstc5x4UnormBlock +GPUFormatAstc5x4SrgbBlock +GPUFormatAstc5x5UnormBlock +GPUFormatAstc5x5SrgbBlock +GPUFormatAstc6x5UnormBlock +GPUFormatAstc6x5SrgbBlock +GPUFormatAstc6x6UnormBlock +GPUFormatAstc6x6SrgbBlock +GPUFormatAstc8x5UnormBlock +GPUFormatAstc8x5SrgbBlock +GPUFormatAstc8x6UnormBlock +GPUFormatAstc8x6SrgbBlock +GPUFormatAstc8x8UnormBlock +GPUFormatAstc8x8SrgbBlock +GPUFormatAstc10x5UnormBlock +GPUFormatAstc10x5SrgbBlock +GPUFormatAstc10x6UnormBlock +GPUFormatAstc10x6SrgbBlock +GPUFormatAstc10x8UnormBlock +GPUFormatAstc10x8SrgbBlock +GPUFormatAstc10x10UnormBlock +GPUFormatAstc10x10SrgbBlock +GPUFormatAstc12x10UnormBlock +GPUFormatAstc12x10SrgbBlock +GPUFormatAstc12x12UnormBlock +GPUFormatAstc12x12SrgbBlock +GPUFormatG8b8g8r8422Unorm +GPUFormatB8g8r8g8422Unorm +GPUFormatG8B8R83plane420Unorm +GPUFormatG8B8r82plane420Unorm +GPUFormatG8B8R83plane422Unorm +GPUFormatG8B8r82plane422Unorm +GPUFormatG8B8R83plane444Unorm +GPUFormatR10x6UnormPack16 +GPUFormatR10x6g10x6Unorm2pack16 +GPUFormatR10x6g10x6b10x6a10x6Unorm4pack16 +GPUFormatG10x6b10x6g10x6r10x6422Unorm4pack16 +GPUFormatB10x6g10x6r10x6g10x6422Unorm4pack16 +GPUFormatG10x6B10x6R10x63plane420Unorm3pack16 +GPUFormatG10x6B10x6r10x62plane420Unorm3pack16 +GPUFormatG10x6B10x6R10x63plane422Unorm3pack16 +GPUFormatG10x6B10x6r10x62plane422Unorm3pack16 +GPUFormatG10x6B10x6R10x63plane444Unorm3pack16 +GPUFormatR12x4UnormPack16 +GPUFormatR12x4g12x4Unorm2pack16 +GPUFormatR12x4g12x4b12x4a12x4Unorm4pack16 +GPUFormatG12x4b12x4g12x4r12x4422Unorm4pack16 +GPUFormatB12x4g12x4r12x4g12x4422Unorm4pack16 +GPUFormatG12x4B12x4R12x43plane420Unorm3pack16 +GPUFormatG12x4B12x4r12x42plane420Unorm3pack16 +GPUFormatG12x4B12x4R12x43plane422Unorm3pack16 +GPUFormatG12x4B12x4r12x42plane422Unorm3pack16 +GPUFormatG12x4B12x4R12x43plane444Unorm3pack16 +GPUFormatG16b16g16r16422Unorm +GPUFormatB16g16r16g16422Unorm +GPUFormatG16B16R163plane420Unorm +GPUFormatG16B16r162plane420Unorm +GPUFormatG16B16R163plane422Unorm +GPUFormatG16B16r162plane422Unorm +GPUFormatG16B16R163plane444Unorm +GPUFormatPvrtc12bppUnormBlockImg +GPUFormatPvrtc14bppUnormBlockImg +GPUFormatPvrtc22bppUnormBlockImg +GPUFormatPvrtc24bppUnormBlockImg +GPUFormatPvrtc12bppSrgbBlockImg +GPUFormatPvrtc14bppSrgbBlockImg +GPUFormatPvrtc22bppSrgbBlockImg +GPUFormatPvrtc24bppSrgbBlockImg +``` + +) +### type GPUFormatFeatureFlags int32 + + +### const ( + +```go +GPUFormatFeatureSampledImageBit GPUFormatFeatureFlags = iota +GPUFormatFeatureStorageImageBit +GPUFormatFeatureStorageImageAtomicBit +GPUFormatFeatureUniformTexelBufferBit +GPUFormatFeatureStorageTexelBufferBit +GPUFormatFeatureStorageTexelBufferAtomicBit +GPUFormatFeatureVertexBufferBit +GPUFormatFeatureColorAttachmentBit +GPUFormatFeatureColorAttachmentBlendBit +GPUFormatFeatureDepthStencilAttachmentBit +GPUFormatFeatureBlitSrcBit +GPUFormatFeatureBlitDstBit +GPUFormatFeatureSampledImageFilterLinearBit +GPUFormatFeatureTransferSrcBit +GPUFormatFeatureTransferDstBit +GPUFormatFeatureMidpointChromaSamplesBit +GPUFormatFeatureSampledImageYcbcrConversionLinearFilterBit +GPUFormatFeatureSampledImageYcbcrConversionSeparateReconstructionFilterBit +GPUFormatFeatureSampledImageYcbcrConversionChromaReconstructionExplicitBit +GPUFormatFeatureSampledImageYcbcrConversionChromaReconstructionExplicitForceableBit +GPUFormatFeatureDisjointBit +GPUFormatFeatureCositedChromaSamplesBit +GPUFormatFeatureSampledImageFilterCubicBitImg +GPUFormatFeatureSampledImageFilterMinmaxBit +``` + +) +### type GPUFormatProperties struct { + +```go +LinearTilingFeatures GPUFormatFeatureFlags +OptimalTilingFeatures GPUFormatFeatureFlags +BufferFeatures GPUFormatFeatureFlags +``` + +} + +### type GPUFrameBuffer struct{ GPUHandle } + + +### type GPUHandle struct { + +```go +// Has unexported fields. +``` + +} + +### func (g *GPUHandle) HandleAddr() unsafe.Pointer + + +### func (g *GPUHandle) IsValid() bool + + +### func (g *GPUHandle) Reset() + + +### type GPUImage struct{ GPUHandle } + + +### type GPUImageAspectFlags uint16 + + +### const ( + +```go +GPUImageAspectColorBit GPUImageAspectFlags = (1 << iota) +GPUImageAspectDepthBit +GPUImageAspectStencilBit +GPUImageAspectMetadataBit +GPUImageAspectPlane0Bit +GPUImageAspectPlane1Bit +GPUImageAspectPlane2Bit +GPUImageAspectMemoryPlane0Bit +GPUImageAspectMemoryPlane1Bit +GPUImageAspectMemoryPlane2Bit +GPUImageAspectMemoryPlane3Bit +``` + +) +### type GPUImageCreateFlags uint16 + + +### const ( + +```go +GPUImageCreateSparseBindingBit GPUImageCreateFlags = (1 << iota) +GPUImageCreateSparseResidencyBit +GPUImageCreateSparseAliasedBit +GPUImageCreateMutableFormatBit +GPUImageCreateCubeCompatibleBit +GPUImageCreateAliasBit +GPUImageCreateSplitInstanceBindRegionsBit +GPUImageCreate2dArrayCompatibleBit +GPUImageCreateBlockTexelViewCompatibleBit +GPUImageCreateExtendedUsageBit +GPUImageCreateProtectedBit +GPUImageCreateDisjointBit +GPUImageCreateCornerSampledBitNv +GPUImageCreateSampleLocationsCompatibleDepthBit +``` + +) +### type GPUImageCreateRequest struct { + +```go +Flags GPUImageCreateFlags +ImageType GPUImageType +Format GPUFormat +Extent matrix.Vec3i +MipLevels uint32 +ArrayLayers uint32 +Samples GPUSampleCountFlags +Tiling GPUImageTiling +Usage GPUImageUsageFlags +``` + +} + +### type GPUImageLayout uint16 + + +### const ( + +```go +GPUImageLayoutUndefined GPUImageLayout = iota +GPUImageLayoutGeneral +GPUImageLayoutColorAttachmentOptimal +GPUImageLayoutDepthStencilAttachmentOptimal +GPUImageLayoutDepthStencilReadOnlyOptimal +GPUImageLayoutShaderReadOnlyOptimal +GPUImageLayoutTransferSrcOptimal +GPUImageLayoutTransferDstOptimal +GPUImageLayoutPreinitialized +GPUImageLayoutDepthReadOnlyStencilAttachmentOptimal +GPUImageLayoutDepthAttachmentStencilReadOnlyOptimal +GPUImageLayoutPresentSrc +GPUImageLayoutSharedPresent +GPUImageLayoutShadingRateOptimalNv +``` + +) +### type GPUImageTiling uint8 + + +### const ( + +```go +GPUImageTilingOptimal GPUImageTiling = iota +GPUImageTilingLinear +GPUImageTilingDrmFormatModifier +``` + +) +### type GPUImageType uint8 + + +### const ( + +```go +GPUImageType1d GPUImageType = iota +GPUImageType2d +GPUImageType3d +``` + +) +### type GPUImageUsageFlags int32 + + +### const ( + +```go +GPUImageUsageTransferSrcBit GPUImageUsageFlags = (1 << iota) +GPUImageUsageTransferDstBit +GPUImageUsageSampledBit +GPUImageUsageStorageBit +GPUImageUsageColorAttachmentBit +GPUImageUsageDepthStencilAttachmentBit +GPUImageUsageTransientAttachmentBit +GPUImageUsageInputAttachmentBit +GPUImageUsageShadingRateImageBitNv +``` + +) +### type GPUImageView struct{ GPUHandle } + + +### type GPUImageViewType uint8 + + +### const ( + +```go +GPUImageViewType1d GPUImageViewType = iota +GPUImageViewType2d +GPUImageViewType3d +GPUImageViewTypeCube +GPUImageViewType1dArray +GPUImageViewType2dArray +GPUImageViewTypeCubeArray +``` + +) +### type GPUImageWriteRequest struct { + +```go +Region matrix.Vec4i +Pixels []byte +``` + +} + +### type GPUInstance struct { + +```go +// Has unexported fields. +``` + +} + +### func (g *GPUInstance) Destroy() + + +### func (g *GPUInstance) IsValid() bool + + +### func (g *GPUInstance) Setup(window RenderingContainer, app *GPUApplication) error + + +### type GPULight struct { + +```go +Matrix [cubeMapSides]matrix.Mat4 +Position matrix.Vec3 +``` + + +```go +Direction matrix.Vec3 +// Has unexported fields. +``` + +} + +### type GPULightInfo struct { + +```go +Position matrix.Vec3 +Intensity float32 +Direction matrix.Vec3 +Cutoff float32 +Ambient matrix.Vec3 +OuterCutoff float32 +Diffuse matrix.Vec3 +Constant float32 +Specular matrix.Vec3 +Linear float32 +Quadratic float32 +NearPlane float32 +FarPlane float32 +Type int32 +// Has unexported fields. +``` + +} + +### type GPULogicalDevice struct { + +```go +GPUHandle +``` + + +```go +SwapChain GPUSwapChain +``` + + +```go +// Has unexported fields. +``` + +} + +### func (g *GPULogicalDevice) CreateImageView(id *TextureId, aspectFlags GPUImageAspectFlags, viewType GPUImageViewType) error + + +### func (g *GPULogicalDevice) Destroy() + + +### func (g *GPULogicalDevice) DestroyFence(fence *GPUFence) + + +### func (g *GPULogicalDevice) DestroyGroup(group *DrawInstanceGroup) + + +### func (g *GPULogicalDevice) DestroySemaphore(semaphore *GPUSemaphore) + + +### func (g *GPULogicalDevice) FreeTexture(texId *TextureId) + + +### func (g *GPULogicalDevice) ImageMemoryRequirements(image GPUImage) GPUMemoryRequirements + + +### func (g *GPULogicalDevice) RemakeSwapChain(window RenderingContainer, inst *GPUApplicationInstance, device *GPUDevice) error + + +### func (g *GPULogicalDevice) Setup(inst *GPUApplicationInstance, physicalDevice *GPUPhysicalDevice) error + + +### func (g *GPULogicalDevice) SetupBufferDestroyer(device *GPUDevice) + + +### func (g *GPULogicalDevice) WaitForFences(fences []GPUFence) + + +### func (g *GPULogicalDevice) WaitForRender(device *GPUDevice) + + +### func (g *GPULogicalDevice) WaitIdle() + + +### type GPUMemoryFlags uint16 + + +### const ( + +```go +GPUMemoryMapPlacedBit GPUMemoryFlags = (1 << iota) +``` + +) +### type GPUMemoryHeap struct { + +```go +Size uintptr +Flags GPUMemoryHeapFlags +``` + +} + +### type GPUMemoryHeapFlags uint8 + + +### const ( + +```go +GPUMemoryHeapDeviceLocalBit GPUMemoryHeapFlags = (1 << iota) +GPUMemoryHeapMultiInstanceBit +``` + +) +### type GPUMemoryPropertyFlags uint8 + + +### const ( + +```go +GPUMemoryPropertyDeviceLocalBit GPUMemoryPropertyFlags = (1 << iota) +GPUMemoryPropertyHostVisibleBit +GPUMemoryPropertyHostCoherentBit +GPUMemoryPropertyHostCachedBit +GPUMemoryPropertyLazilyAllocatedBit +GPUMemoryPropertyProtectedBit +``` + +) +### type GPUMemoryRequirements struct { + +```go +Size uintptr +Alignment uintptr +MemoryTypeBits uint32 +``` + +} + +### type GPUMemoryType struct { + +```go +PropertyFlags GPUMemoryPropertyFlags +HeapIndex uint32 +``` + +} + +### type GPUPainter struct { + +```go +// Has unexported fields. +``` + +} + +### func (g *GPUPainter) DestroyDescriptorPools(device *GPUDevice) + + +### type GPUPhysicalDevice struct { + +```go +Features GPUPhysicalDeviceFeatures +Properties GPUPhysicalDeviceProperties +QueueFamilies []GPUQueueFamily +Extensions []GPUPhysicalDeviceExtension +SurfaceFormats []GPUSurfaceFormat +PresentModes []GPUPresentMode +SurfaceCapabilities GPUSurfaceCapabilities +// Has unexported fields. +``` + +} + +### func ListPhysicalGpuDevices(inst *GPUApplicationInstance) ([]GPUPhysicalDevice, error) + + +### func (g *GPUPhysicalDevice) FindComputeFamiliy() GPUQueueFamily + + +### func (g *GPUPhysicalDevice) FindGraphicsFamiliy() GPUQueueFamily + + +### func (g *GPUPhysicalDevice) FindMemoryType(typeFilter uint32, properties GPUMemoryPropertyFlags) int + + +### func (g *GPUPhysicalDevice) FindPresentFamily() GPUQueueFamily + + +### func (g *GPUPhysicalDevice) FindSupportedFormat(candidates []GPUFormat, tiling GPUImageTiling, features GPUFormatFeatureFlags) GPUFormat + + +### func (g *GPUPhysicalDevice) FormatIsTileable(format GPUFormat, tiling GPUImageTiling) bool + + +### func (g *GPUPhysicalDevice) FormatProperties(format GPUFormat) GPUFormatProperties + + +### func (g *GPUPhysicalDevice) IsExtensionSupported(extension string) bool + + +### func (g *GPUPhysicalDevice) IsValid() bool + + +### func (g *GPUPhysicalDevice) MaxUsableSampleCount() GPUSampleCountFlags + + +### func (g *GPUPhysicalDevice) PadBufferSize(size uintptr) uintptr + + +### func (g *GPUPhysicalDevice) RefreshSurfaceCapabilities(surface unsafe.Pointer) + + +### type GPUPhysicalDeviceExtension struct { + +```go +Name string +Version uint32 +``` + +} + +### type GPUPhysicalDeviceFeatures struct { + +```go +RobustBufferAccess bool +FullDrawIndexUint32 bool +ImageCubeArray bool +IndependentBlend bool +GeometryShader bool +TessellationShader bool +SampleRateShading bool +DualSrcBlend bool +LogicOp bool +MultiDrawIndirect bool +DrawIndirectFirstInstance bool +DepthClamp bool +DepthBiasClamp bool +FillModeNonSolid bool +DepthBounds bool +WideLines bool +LargePoints bool +AlphaToOne bool +MultiViewport bool +SamplerAnisotropy bool +TextureCompressionETC2 bool +TextureCompressionASTC_LDR bool +TextureCompressionBC bool +OcclusionQueryPrecise bool +PipelineStatisticsQuery bool +VertexPipelineStoresAndAtomics bool +FragmentStoresAndAtomics bool +ShaderTessellationAndGeometryPointSize bool +ShaderImageGatherExtended bool +ShaderStorageImageExtendedFormats bool +ShaderStorageImageMultisample bool +ShaderStorageImageReadWithoutFormat bool +ShaderStorageImageWriteWithoutFormat bool +ShaderUniformBufferArrayDynamicIndexing bool +ShaderSampledImageArrayDynamicIndexing bool +ShaderStorageBufferArrayDynamicIndexing bool +ShaderStorageImageArrayDynamicIndexing bool +ShaderClipDistance bool +ShaderCullDistance bool +ShaderFloat64 bool +ShaderInt64 bool +ShaderInt16 bool +ShaderResourceResidency bool +ShaderResourceMinLod bool +SparseBinding bool +SparseResidencyBuffer bool +SparseResidencyImage2D bool +SparseResidencyImage3D bool +SparseResidency2Samples bool +SparseResidency4Samples bool +SparseResidency8Samples bool +SparseResidency16Samples bool +SparseResidencyAliased bool +VariableMultisampleRate bool +InheritedQueries bool +``` + +} + +### type GPUPhysicalDeviceLimits struct { + +```go +MaxImageDimension1D uint32 +MaxImageDimension2D uint32 +MaxImageDimension3D uint32 +MaxImageDimensionCube uint32 +MaxImageArrayLayers uint32 +MaxTexelBufferElements uint32 +MaxUniformBufferRange uint32 +MaxStorageBufferRange uint32 +MaxPushConstantsSize uint32 +MaxMemoryAllocationCount uint32 +MaxSamplerAllocationCount uint32 +BufferImageGranularity uintptr +SparseAddressSpaceSize uintptr +MaxBoundDescriptorSets uint32 +MaxPerStageDescriptorSamplers uint32 +MaxPerStageDescriptorUniformBuffers uint32 +MaxPerStageDescriptorStorageBuffers uint32 +MaxPerStageDescriptorSampledImages uint32 +MaxPerStageDescriptorStorageImages uint32 +MaxPerStageDescriptorInputAttachments uint32 +MaxPerStageResources uint32 +MaxDescriptorSetSamplers uint32 +MaxDescriptorSetUniformBuffers uint32 +MaxDescriptorSetUniformBuffersDynamic uint32 +MaxDescriptorSetStorageBuffers uint32 +MaxDescriptorSetStorageBuffersDynamic uint32 +MaxDescriptorSetSampledImages uint32 +MaxDescriptorSetStorageImages uint32 +MaxDescriptorSetInputAttachments uint32 +MaxVertexInputAttributes uint32 +MaxVertexInputBindings uint32 +MaxVertexInputAttributeOffset uint32 +MaxVertexInputBindingStride uint32 +MaxVertexOutputComponents uint32 +MaxTessellationGenerationLevel uint32 +MaxTessellationPatchSize uint32 +MaxTessellationControlPerVertexInputComponents uint32 +MaxTessellationControlPerVertexOutputComponents uint32 +MaxTessellationControlPerPatchOutputComponents uint32 +MaxTessellationControlTotalOutputComponents uint32 +MaxTessellationEvaluationInputComponents uint32 +MaxTessellationEvaluationOutputComponents uint32 +MaxGeometryShaderInvocations uint32 +MaxGeometryInputComponents uint32 +MaxGeometryOutputComponents uint32 +MaxGeometryOutputVertices uint32 +MaxGeometryTotalOutputComponents uint32 +MaxFragmentInputComponents uint32 +MaxFragmentOutputAttachments uint32 +MaxFragmentDualSrcAttachments uint32 +MaxFragmentCombinedOutputResources uint32 +MaxComputeSharedMemorySize uint32 +MaxComputeWorkGroupCount [3]uint32 +MaxComputeWorkGroupInvocations uint32 +MaxComputeWorkGroupSize [3]uint32 +SubPixelPrecisionBits uint32 +SubTexelPrecisionBits uint32 +MipmapPrecisionBits uint32 +MaxDrawIndexedIndexValue uint32 +MaxDrawIndirectCount uint32 +MaxSamplerLodBias float32 +MaxSamplerAnisotropy float32 +MaxViewports uint32 +MaxViewportDimensions [2]uint32 +ViewportBoundsRange [2]float32 +ViewportSubPixelBits uint32 +MinMemoryMapAlignment uint +MinTexelBufferOffsetAlignment uintptr +MinUniformBufferOffsetAlignment uintptr +MinStorageBufferOffsetAlignment uintptr +MinTexelOffset int32 +MaxTexelOffset uint32 +MinTexelGatherOffset int32 +MaxTexelGatherOffset uint32 +MinInterpolationOffset float32 +MaxInterpolationOffset float32 +SubPixelInterpolationOffsetBits uint32 +MaxFramebufferWidth uint32 +MaxFramebufferHeight uint32 +MaxFramebufferLayers uint32 +FramebufferColorSampleCounts GPUSampleCountFlags +FramebufferDepthSampleCounts GPUSampleCountFlags +FramebufferStencilSampleCounts GPUSampleCountFlags +FramebufferNoAttachmentsSampleCounts GPUSampleCountFlags +MaxColorAttachments uint32 +SampledImageColorSampleCounts GPUSampleCountFlags +SampledImageIntegerSampleCounts GPUSampleCountFlags +SampledImageDepthSampleCounts GPUSampleCountFlags +SampledImageStencilSampleCounts GPUSampleCountFlags +StorageImageSampleCounts GPUSampleCountFlags +MaxSampleMaskWords uint32 +TimestampComputeAndGraphics bool +TimestampPeriod float32 +MaxClipDistances uint32 +MaxCullDistances uint32 +MaxCombinedClipAndCullDistances uint32 +DiscreteQueuePriorities uint32 +PointSizeRange [2]float32 +LineWidthRange [2]float32 +PointSizeGranularity float32 +LineWidthGranularity float32 +StrictLines bool +StandardSampleLocations bool +OptimalBufferCopyOffsetAlignment uintptr +OptimalBufferCopyRowPitchAlignment uintptr +NonCoherentAtomSize uintptr +``` + +} + +### type GPUPhysicalDeviceMemoryProperties struct { + +```go +MemoryTypes []GPUMemoryType +MemoryHeaps []GPUMemoryHeap +``` + +} + +### type GPUPhysicalDeviceProperties struct { + +```go +ApiVersion uint32 +DriverVersion uint32 +VendorID uint32 +DeviceID uint32 +DeviceType GPUPhysicalDeviceType +DeviceName string +PipelineCacheUUID string +Limits GPUPhysicalDeviceLimits +SparseProperties GPUPhysicalDeviceSparseProperties +``` + +} + +### type GPUPhysicalDeviceSparseProperties struct { + +```go +ResidencyStandard2DBlockShape bool +ResidencyStandard2DMultisampleBlockShape bool +ResidencyStandard3DBlockShape bool +ResidencyAlignedMipSize bool +ResidencyNonResidentStrict bool +``` + +} + +### type GPUPhysicalDeviceType uint8 + + +### const ( + +```go +GPUPhysicalDeviceTypeOther GPUPhysicalDeviceType = iota +GPUPhysicalDeviceTypeIntegratedGpu +GPUPhysicalDeviceTypeDiscreteGpu +GPUPhysicalDeviceTypeVirtualGpu +GPUPhysicalDeviceTypeCpu +``` + +) +### type GPUPipeline struct{ GPUHandle } + + +### type GPUPipelineLayout struct{ GPUHandle } + + +### type GPUPipelineStageFlags uint32 + + +### const ( + +```go +GPUPipelineStageTopOfPipeBit GPUPipelineStageFlags = (1 << iota) +GPUPipelineStageDrawIndirectBit +GPUPipelineStageVertexInputBit +GPUPipelineStageVertexShaderBit +GPUPipelineStageTessellationControlShaderBit +GPUPipelineStageTessellationEvaluationShaderBit +GPUPipelineStageGeometryShaderBit +GPUPipelineStageFragmentShaderBit +GPUPipelineStageEarlyFragmentTestsBit +GPUPipelineStageLateFragmentTestsBit +GPUPipelineStageColorAttachmentOutputBit +GPUPipelineStageComputeShaderBit +GPUPipelineStageTransferBit +GPUPipelineStageBottomOfPipeBit +GPUPipelineStageHostBit +GPUPipelineStageAllGraphicsBit +GPUPipelineStageAllCommandsBit +GPUPipelineStageTransformFeedbackBit +GPUPipelineStageConditionalRenderingBit +GPUPipelineStageCommandProcessBitNvx +GPUPipelineStageShadingRateImageBitNv +GPUPipelineStageRaytracingBitNvx +GPUPipelineStageTaskShaderBitNv +GPUPipelineStageMeshShaderBitNv +``` + +) +### type GPUPresentMode int32 + + +### const ( + +```go +GPUPresentModeImmediate GPUPresentMode = iota +GPUPresentModeMailbox +GPUPresentModeFifo +GPUPresentModeFifoRelaxed +GPUPresentModeSharedDemandRefresh +GPUPresentModeSharedContinuousRefresh +``` + +) +### type GPUQueue struct{ GPUHandle } + + +### type GPUQueueFamily struct { + +```go +Index int +MinImageTransferGranularity matrix.Vec3i +IsGraphics bool +IsCompute bool +IsTransfer bool +IsSparseBinding bool +IsProtected bool +HasPresentSupport bool +``` + +} + +### func InvalidGPUQueueFamily() GPUQueueFamily + + +### func (g GPUQueueFamily) IsValid() bool + + +### type GPUResult int32 + + +### type GPUSampleCountFlags uint8 + + +### const ( + +```go +GPUSampleCount1Bit GPUSampleCountFlags = (1 << iota) +GPUSampleCount2Bit +GPUSampleCount4Bit +GPUSampleCount8Bit +GPUSampleCount16Bit +GPUSampleCount32Bit +GPUSampleCount64Bit +GPUSampleSwapChainCount +``` + +) +### type GPUSampler struct{ GPUHandle } + + +### type GPUSemaphore struct{ GPUHandle } + + +### type GPUShaderModule struct{ GPUHandle } + + +### type GPUSurface struct { + +```go +// Has unexported fields. +``` + +} + +### func (g *GPUSurface) Create(instance *GPUInstance, window RenderingContainer) error + + +### func (g *GPUSurface) Destroy(inst *GPUApplicationInstance) + + +### type GPUSurfaceCapabilities struct { + +```go +MinImageCount uint32 +MaxImageCount uint32 +CurrentExtent matrix.Vec2i +MinImageExtent matrix.Vec2i +MaxImageExtent matrix.Vec2i +MaxImageArrayLayers uint32 +SupportedTransforms GPUSurfaceTransformFlags +CurrentTransform GPUSurfaceTransformFlags +SupportedCompositeAlpha GPUCompositeAlphaFlags +SupportedUsageFlags GPUImageUsageFlags +``` + +} + +### type GPUSurfaceFormat struct { + +```go +Format GPUFormat +ColorSpace GPUColorSpace +``` + +} + +### type GPUSurfaceTransformFlags int32 + + +### const ( + +```go +GPUSurfaceTransformIdentityBit GPUSurfaceTransformFlags = (1 << iota) +GPUSurfaceTransformRotate90Bit +GPUSurfaceTransformRotate180Bit +GPUSurfaceTransformRotate270Bit +GPUSurfaceTransformHorizontalMirrorBit +GPUSurfaceTransformHorizontalMirrorRotate90Bit +GPUSurfaceTransformHorizontalMirrorRotate180Bit +GPUSurfaceTransformHorizontalMirrorRotate270Bit +GPUSurfaceTransformInheritBit +``` + +) +### type GPUSwapChain struct { + +```go +GPUHandle +Images []TextureId +Extent matrix.Vec2i +Depth TextureId +Color TextureId +FrameBuffers []GPUFrameBuffer +``` + + +```go +// Has unexported fields. +``` + +} + +### func (g *GPUSwapChain) CopyAndReset() GPUSwapChain + + +### func (g *GPUSwapChain) CreateColor(device *GPUDevice) error + + +### func (g *GPUSwapChain) CreateDepth(device *GPUDevice) error + + +### func (g *GPUSwapChain) CreateFrameBuffer(device *GPUDevice) error + + +### func (g *GPUSwapChain) Destroy(device *GPUDevice) + + +### func (g *GPUSwapChain) SelectExtent(window RenderingContainer, device *GPUPhysicalDevice) matrix.Vec2i + + +### func (g *GPUSwapChain) SelectPresentMode(device *GPUPhysicalDevice) GPUPresentMode + + +### func (g *GPUSwapChain) SelectSurfaceFormat(device *GPUPhysicalDevice) GPUSurfaceFormat + + +### func (g *GPUSwapChain) Setup(window RenderingContainer, inst *GPUApplicationInstance, device *GPUDevice) error + + +### func (g *GPUSwapChain) SetupImageViews(device *GPUDevice) error + + +### func (g *GPUSwapChain) SetupRenderPass(device *GPUDevice, assets assets.Database) error + + +### func (g *GPUSwapChain) SetupSyncObjects(device *GPUDevice) error + + +### type GPUSwapChainSupportDetails struct { + +```go +// Has unexported fields. +``` + +} + +### type GlobalShaderData struct { + +```go +View matrix.Mat4 +Projection matrix.Mat4 +UIView matrix.Mat4 +UIProjection matrix.Mat4 +CameraPosition matrix.Vec4 +UICameraPosition matrix.Vec3 +Time float32 +ScreenSize matrix.Vec2 +CascadeCount int32 +``` + + +```go +CascadePlaneDistances [4]float32 +VertLights [MaxLocalLights]GPULight +LightInfos [MaxLocalLights]GPULightInfo +// Has unexported fields. +``` + +} + +### type InstanceCopyData struct { + +```go +// Has unexported fields. +``` + +} + +### func InstanceCopyDataNew(padding int) InstanceCopyData + + +### type InstanceDriverData struct { + +```go +// Has unexported fields. +``` + +} + +### type InstanceGroupSkinningData struct { + +} + +### type Light struct { + +```go +// Has unexported fields. +``` + +} + +### func NewLight(device *GPUDevice, assetDb assets.Database, materialCache *MaterialCache, lightType LightType) Light + + +### func (l *Light) Direction(followcam cameras.Camera) matrix.Vec3 + + +### func (l *Light) FrameDirty() bool + + +### func (l *Light) IsValid() bool + + +### func (l *Light) ResetFrameDirty() bool + + +### func (l *Light) SetAmbient(ambient matrix.Vec3) + + +### func (l *Light) SetCastsShadows(castsShadows bool) + + +### func (l *Light) SetConstant(constant float32) + + +### func (l *Light) SetCutoff(cutoff float32) + + +### func (l *Light) SetDiffuse(diffuse matrix.Vec3) + + +### func (l *Light) SetDirection(dir matrix.Vec3) + + +### func (l *Light) SetIntensity(intensity float32) + + +### func (l *Light) SetLinear(linear float32) + + +### func (l *Light) SetOuterCutoff(outerCutoff float32) + + +### func (l *Light) SetPosition(position matrix.Vec3) + + +### func (l *Light) SetQuadratic(quadratic float32) + + +### func (l *Light) SetSpecular(specular matrix.Vec3) + + +### func (l *Light) Type() LightType + + +### func (l *Light) WorldSpace(followcam cameras.Camera) matrix.Vec3 + + +### type LightShadowShaderData struct { + +```go +ShaderDataBase +LightIndex int32 +``` + +} + +### func (t LightShadowShaderData) Size() int + + +### type LightType int + + +### type LightsForRender struct { + +```go +Lights []Light +HasChanges bool +``` + +} + +### type Material struct { + +```go +Id string +``` + + +```go +Shader *Shader +Textures []*Texture +Instances map[string]*Material +Root weak.Pointer[Material] +PrepassMaterial weak.Pointer[Material] +``` + + +```go +IsLit bool +ReceivesShadows bool +CastsShadows bool +// Has unexported fields. +``` + +} + +### func (m *Material) CreateInstance(textures []*Texture) *Material + + +### func (m *Material) Destroy(device *GPUDevice) + + +### func (m *Material) HasTransparentSuffix() bool + + +### func (m *Material) RenderPass() *RenderPass + + +### func (m *Material) SelectRoot() *Material + + +### type MaterialCache struct { + +```go +// Has unexported fields. +``` + +} + +### func NewMaterialCache(device *GPUDevice, assetDatabase assets.Database) MaterialCache + + +### func (m *MaterialCache) AddMaterial(material *Material) *Material + + +### func (m *MaterialCache) Destroy() + + +### func (m *MaterialCache) FindMaterial(key string) (*Material, bool) + + +### func (m *MaterialCache) Material(key string) (*Material, error) + + +### type MaterialData struct { + +```go +Shader string `options:""` // Blank = fallback +RenderPass string `options:""` // Blank = fallback +ShaderPipeline string `options:"" label:"Pipeline"` // Blank = fallback +Textures []MaterialTextureData +PrepassMaterial string +IsLit bool +ReceivesShadows bool +CastsShadows bool +``` + +} + +### func (d *MaterialData) Compile(assets assets.Database, device *GPUDevice) (*Material, error) + + +### func (d *MaterialData) CompileExt(assets assets.Database, device *GPUDevice, copyShader bool) (*Material, error) + + +### type MaterialTextureData struct { + +```go +Label string `static:"true"` +Texture string `content:"Texture"` +Filter string `options:"StringVkFilter"` +``` + +} + +### func (d *MaterialTextureData) FilterToVK() TextureFilter + + +### type Mesh struct { + +```go +MeshId MeshId +``` + + +```go +// Has unexported fields. +``` + +} + +### func NewMesh(key string, verts []Vertex, indexes []uint32) *Mesh + + +### func NewMeshArrow(cache *MeshCache, shaftLength, shaftRadius, tipHeight, tipRadius float32, segments int) *Mesh + + +### func NewMeshCapsule(cache *MeshCache, radius, height float32, segments, rings int) *Mesh + +```go + NewMeshCapsule creates a capsule mesh (cylinder with hemispherical ends) + with the specified radius and height. The capsule is aligned along the + Y-axis, with hemispheres at y=height/2 and y=-height/2. segments controls + the number of subdivisions around the circumference, rings controls the + number of rings per hemisphere. +``` + + +### func NewMeshCircleWire(cache *MeshCache, radius float32, segments int) *Mesh + +```go + NewMeshCircleWire creates a wireframe circle (line loop) mesh. + It follows the same pattern as the other wireframe mesh generators (e.g. + NewMeshWireCube, NewMeshWireSphereLatLon, etc.). +``` + + +### func NewMeshCone(cache *MeshCache, height, baseRadius float32, segments int, capped bool) *Mesh + + +### func NewMeshCube(cache *MeshCache) *Mesh + + +### func NewMeshCubeInverse(cache *MeshCache) *Mesh + + +### func NewMeshCylinder(cache *MeshCache, height, radius float32, segments int, capped bool) *Mesh + + +### func NewMeshFrustum(cache *MeshCache, key string, inverseProjection matrix.Mat4) *Mesh + + +### func NewMeshFrustumBox(cache *MeshCache, inverseProjection matrix.Mat4) *Mesh + + +### func NewMeshGrid(cache *MeshCache, key string, points []matrix.Vec3, vertColor matrix.Color) *Mesh + + +### func NewMeshLine(cache *MeshCache, key string, p0, p1 matrix.Vec3, vertColor matrix.Color) *Mesh + + +### func NewMeshOffsetQuad(cache *MeshCache, key string, sideOffsets matrix.Vec4) *Mesh + + +### func NewMeshPlane(cache *MeshCache) *Mesh + + +### func NewMeshPoint(cache *MeshCache, key string, position matrix.Vec3, vertColor matrix.Color) *Mesh + + +### func NewMeshQuad(cache *MeshCache) *Mesh + + +### func NewMeshQuadAnchored(anchor QuadPivot, cache *MeshCache) *Mesh + + +### func NewMeshScreenQuad(cache *MeshCache) *Mesh + + +### func NewMeshSkyboxCube(cache *MeshCache) *Mesh + + +### func NewMeshSphere(cache *MeshCache, radius float32, latitudeBands, longitudeBands int) *Mesh + + +### func NewMeshTexturableCube(cache *MeshCache) *Mesh + + +### func NewMeshTriangle(cache *MeshCache) *Mesh + + +### func NewMeshUnitQuad(cache *MeshCache) *Mesh + + +### func NewMeshWireCone(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh + + +### func NewMeshWireCube(cache *MeshCache, key string, vertColor matrix.Color) *Mesh + + +### func NewMeshWireCylinder(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh + + +### func NewMeshWireQuad(cache *MeshCache, key string, vertColor matrix.Color) *Mesh + + +### func NewMeshWireSphere(cache *MeshCache, radius float32, latitudeBands, longitudeBands int) *Mesh + + +### func (m Mesh) Bounds() collision.AABB + + +### func (m *Mesh) DelayedCreate(device *GPUDevice) + + +### func (m Mesh) IsReady() bool + + +### func (m Mesh) Key() string + + +### func (m *Mesh) SetKey(key string) + + +### type MeshCache struct { + +```go +// Has unexported fields. +``` + +} + +### func NewMeshCache(device *GPUDevice, assetDatabase assets.Database) MeshCache + + +### func (m *MeshCache) AddMesh(mesh *Mesh) *Mesh + +```go + Try to add the mesh to the cache, if it already exists, return the existing + mesh +``` + + +### func (m *MeshCache) CreatePending() + + +### func (m *MeshCache) Destroy() + + +### func (m *MeshCache) FindMesh(key string) (*Mesh, bool) + + +### func (m *MeshCache) Mesh(key string, verts []Vertex, indexes []uint32) *Mesh + + +### func (m *MeshCache) RemoveMesh(key string) + + +### type MeshCleanup struct { + +```go +// Has unexported fields. +``` + +} + +### type MeshCullMode = int + + +### const ( + +```go +MeshCullModeBack MeshCullMode = iota +MeshCullModeFront +MeshCullModeNone +``` + +) +### type MeshDrawMode = int + + +### const ( + +```go +MeshDrawModePoints MeshDrawMode = iota +MeshDrawModeLines +MeshDrawModeTriangles +MeshDrawModePatches +``` + +) +### type MeshId struct { + +```go +// Has unexported fields. +``` + +} + +### func (m MeshId) IsValid() bool + + +### type PointShadow struct { + +```go +Point matrix.Vec2 // X,Z +Radius float32 +Strength float32 +``` + +} + +### type QuadPivot = int32 + + +### type RenderCaches interface { + +```go +ShaderCache() *ShaderCache +TextureCache() *TextureCache +MeshCache() *MeshCache +FontCache() *FontCache +MaterialCache() *MaterialCache +AssetDatabase() assets.Database +``` + +} + +### type RenderPass struct { + +```go +Handle vk.RenderPass +Buffer GPUFrameBuffer +``` + + +```go +// Has unexported fields. +``` + +} + +### func NewRenderPass(device *GPUDevice, setup *RenderPassDataCompiled) (*RenderPass, error) + + +### func (p *RenderPass) Destroy(device *GPUDevice) + + +### func (r *RenderPass) ExecuteSecondaryCommands() + + +### func (r *RenderPass) Height() int + + +### func (r *RenderPass) IsShadowPass() bool + + +### func (p *RenderPass) Recontstruct(device *GPUDevice) error + + +### func (r *RenderPass) SelectOutputAttachment(device *GPUDevice) *Texture + + +### func (r *RenderPass) SelectOutputAttachmentWithSuffix(suffix string) (*Texture, bool) + + +### func (r *RenderPass) Texture(index int) *Texture + + +### func (r *RenderPass) Width() int + + +### type RenderPassAttachmentDescription struct { + +```go +Format string `options:"StringVkFormat"` +Samples string `options:"StringVkSampleCountFlagBits"` +LoadOp string `options:"StringVkAttachmentLoadOp"` +StoreOp string `options:"StringVkAttachmentStoreOp"` +StencilLoadOp string `options:"StringVkAttachmentLoadOp"` +StencilStoreOp string `options:"StringVkAttachmentStoreOp"` +InitialLayout string `options:"StringVkImageLayout"` +FinalLayout string `options:"StringVkImageLayout"` +Image RenderPassAttachmentImage +``` + +} + +### func (ad *RenderPassAttachmentDescription) FinalLayoutToVK() GPUImageLayout + + +### func (ad *RenderPassAttachmentDescription) FormatToVK(device *GPUDevice) GPUFormat + + +### func (ad *RenderPassAttachmentDescription) InitialLayoutToVK() GPUImageLayout + + +### func (ad *RenderPassAttachmentDescription) LoadOpToVK() GPUAttachmentLoadOp + + +### func (ad *RenderPassAttachmentDescription) SamplesToVK(device *GPUPhysicalDevice) GPUSampleCountFlags + + +### func (ad *RenderPassAttachmentDescription) StencilLoadOpToVK() GPUAttachmentLoadOp + + +### func (ad *RenderPassAttachmentDescription) StencilStoreOpToVK() GPUAttachmentStoreOp + + +### func (ad *RenderPassAttachmentDescription) StoreOpToVK() GPUAttachmentStoreOp + + +### type RenderPassAttachmentDescriptionCompiled struct { + +```go +Format GPUFormat +Samples GPUSampleCountFlags +LoadOp GPUAttachmentLoadOp +StoreOp GPUAttachmentStoreOp +StencilLoadOp GPUAttachmentLoadOp +StencilStoreOp GPUAttachmentStoreOp +InitialLayout GPUImageLayout +FinalLayout GPUImageLayout +Image RenderPassAttachmentImageCompiled +``` + +} + +### func (p *RenderPassAttachmentDescriptionCompiled) IsDepthFormat() bool + + +### type RenderPassAttachmentImage struct { + +```go +Name string +ExistingImage string +MipLevels uint32 +LayerCount uint32 +Tiling string `options:"StringVkImageTiling"` +Filter string `options:"StringVkFilter"` +Usage []string `options:"StringVkImageUsageFlagBits"` +MemoryProperty []string `options:"StringVkMemoryPropertyFlagBits"` +Aspect []string `options:"StringVkImageAspectFlagBits"` +Access []string `options:"StringVkAccessFlagBits"` +Clear RenderPassAttachmentImageClear `tip:"AttachmentImageClear"` +``` + +} + +### func (ai *RenderPassAttachmentImage) AccessToVK() GPUAccessFlags + + +### func (ai *RenderPassAttachmentImage) AspectToVK() GPUImageAspectFlags + + +### func (ai *RenderPassAttachmentImage) FilterToVK() GPUFilter + + +### func (img *RenderPassAttachmentImage) IsInvalid() bool + + +### func (ai *RenderPassAttachmentImage) MemoryPropertyToVK() GPUMemoryPropertyFlags + + +### func (ai *RenderPassAttachmentImage) TilingToVK() GPUImageTiling + + +### func (ai *RenderPassAttachmentImage) UsageToVK() GPUImageUsageFlags + + +### type RenderPassAttachmentImageClear struct { + +```go +R float32 +G float32 +B float32 +A float32 +Depth float32 +Stencil uint32 +``` + +} + +### type RenderPassAttachmentImageCompiled struct { + +```go +Name string +ExistingImage string +MipLevels uint32 +LayerCount uint32 +Tiling GPUImageTiling +Filter GPUFilter +Usage GPUImageUsageFlags +MemoryProperty GPUMemoryPropertyFlags +Aspect GPUImageAspectFlags +Access GPUAccessFlags +``` + +} + +### func (img *RenderPassAttachmentImageCompiled) IsInvalid() bool + + +### type RenderPassAttachmentReference struct { + +```go +Attachment uint32 +Layout string `options:"StringVkImageLayout"` +``` + +} + +### func (ad *RenderPassAttachmentReference) LayoutToVK() GPUImageLayout + + +### type RenderPassAttachmentReferenceCompiled struct { + +```go +Attachment uint32 +Layout vulkan_const.ImageLayout +``` + +} + +### type RenderPassData struct { + +```go +Name string +Sort int +AttachmentDescriptions []RenderPassAttachmentDescription +SubpassDescriptions []RenderPassSubpassDescription +SubpassDependencies []RenderPassSubpassDependency +Width int +Height int +SkipCombine bool +``` + +} + +### func NewRenderPassData(src string) (RenderPassData, error) + + +### func (d *RenderPassData) Compile(device *GPUDevice) RenderPassDataCompiled + + +### type RenderPassDataCompiled struct { + +```go +Name string +Sort int +Width int +Height int +AttachmentDescriptions []RenderPassAttachmentDescriptionCompiled +SubpassDescriptions []RenderPassSubpassDescriptionCompiled +SubpassDependencies []RenderPassSubpassDependencyCompiled +ImageClears []vk.ClearValue +Subpass []RenderPassSubpassDataCompiled +SkipCombine bool +``` + +} + +### func (r *RenderPassDataCompiled) ConstructRenderPass(device *GPUDevice) (*RenderPass, error) + + +### type RenderPassGroup struct { + +```go +// Has unexported fields. +``` + +} + +### type RenderPassSubpass struct { + +```go +// Has unexported fields. +``` + +} + +### type RenderPassSubpassData struct { + +```go +Shader string `options:""` +ShaderPipeline string `options:""` +SampledImages []RenderPassSubpassImageData +``` + +} + +### type RenderPassSubpassDataCompiled struct { + +```go +Shader string +ShaderPipeline string +SampledImages []int +``` + +} + +### type RenderPassSubpassDependency struct { + +```go +SrcSubpass int64 +DstSubpass int64 +SrcStageMask []string `options:"StringVkPipelineStageFlagBits"` +DstStageMask []string `options:"StringVkPipelineStageFlagBits"` +SrcAccessMask []string `options:"StringVkAccessFlagBits"` +DstAccessMask []string `options:"StringVkAccessFlagBits"` +DependencyFlags []string `options:"StringVkDependencyFlagBits"` +``` + +} + +### func (sd *RenderPassSubpassDependency) DependencyFlagsToVK() vk.DependencyFlags + + +### func (sd *RenderPassSubpassDependency) DstAccessMaskToVK() GPUAccessFlags + + +### func (sd *RenderPassSubpassDependency) DstStageMaskToVK() vk.PipelineStageFlags + + +### func (sd *RenderPassSubpassDependency) SrcAccessMaskToVK() GPUAccessFlags + + +### func (sd *RenderPassSubpassDependency) SrcStageMaskToVK() vk.PipelineStageFlags + + +### type RenderPassSubpassDependencyCompiled struct { + +```go +SrcSubpass uint32 +DstSubpass uint32 +SrcStageMask vk.PipelineStageFlags +DstStageMask vk.PipelineStageFlags +SrcAccessMask vk.AccessFlags +DstAccessMask vk.AccessFlags +DependencyFlags vk.DependencyFlags +``` + +} + +### type RenderPassSubpassDescription struct { + +```go +PipelineBindPoint string `options:"StringVkPipelineBindPoint"` +ColorAttachmentReferences []RenderPassAttachmentReference +InputAttachmentReferences []RenderPassAttachmentReference +ResolveAttachments []RenderPassAttachmentReference +DepthStencilAttachment []RenderPassAttachmentReference // 1 max +PreserveAttachments []uint32 // TODO +Subpass RenderPassSubpassData +``` + +} + +### func (ad *RenderPassSubpassDescription) PipelineBindPointToVK() vulkan_const.PipelineBindPoint + + +### type RenderPassSubpassDescriptionCompiled struct { + +```go +PipelineBindPoint vulkan_const.PipelineBindPoint +ColorAttachmentReferences []RenderPassAttachmentReferenceCompiled +InputAttachmentReferences []RenderPassAttachmentReferenceCompiled +ResolveAttachments []RenderPassAttachmentReferenceCompiled +DepthStencilAttachment []RenderPassAttachmentReferenceCompiled // 1 max +PreserveAttachments []uint32 // TODO +``` + +} + +### type RenderPassSubpassImageData struct { + +```go +SampledImage string +``` + +} + +### type RenderingContainer interface { + +```go +GetDrawableSize() (int32, int32) +GetInstanceExtensions() []string +PlatformWindow() unsafe.Pointer +PlatformInstance() unsafe.Pointer +``` + +} + +### type Shader struct { + +```go +RenderId ShaderId +``` + + +```go +Material MaterialData +DriverData ShaderDriverData +``` + + +```go +Type ShaderType +// Has unexported fields. +``` + +} + +### func NewShader(shaderData ShaderDataCompiled) *Shader + + +### func (s *Shader) AddSubShader(key string, shader *Shader) + + +### func (s *Shader) DelayedCreate(device *GPUDevice, assetDatabase assets.Database) + + +### func (s *Shader) Reload(shaderData ShaderDataCompiled) + + +### func (s *Shader) RemoveSubShader(key string) + + +### func (s *Shader) ShaderDataName() string + + +### func (s *Shader) SubShader(key string) *Shader + + +### type ShaderBuffer struct { + +```go +// Has unexported fields. +``` + +} + +### type ShaderCache struct { + +```go +// Has unexported fields. +``` + +} + +### func NewShaderCache(device *GPUDevice, assetDatabase assets.Database) ShaderCache + + +### func (s *ShaderCache) AddShader(shader *Shader) + + +### func (s *ShaderCache) CreatePending() + + +### func (s *ShaderCache) Destroy() + + +### func (s *ShaderCache) ReloadShader(shaderData ShaderDataCompiled) + + +### func (s *ShaderCache) Shader(shaderData ShaderDataCompiled) (shader *Shader, isNew bool) + + +### type ShaderCleanup struct { + +```go +// Has unexported fields. +``` + +} + +### type ShaderData struct { + +```go +Name string +EnableDebug bool +Vertex string `options:""` +VertexFlags string `tip:"CompileFlags"` +Fragment string `options:""` +FragmentFlags string `tip:"CompileFlags"` +Geometry string `options:""` +GeometryFlags string `tip:"CompileFlags"` +TessellationControl string `options:""` +TessellationControlFlags string `tip:"CompileFlags"` +TessellationEvaluation string `options:""` +TessellationEvaluationFlags string `tip:"CompileFlags"` +Compute string `options:""` +ComputeFlags string `tip:"CompileFlags"` +LayoutGroups []ShaderLayoutGroup `visible:"false"` +SamplerLabels []string +VertexSpv string +FragmentSpv string +GeometrySpv string +TessellationControlSpv string +TessellationEvaluationSpv string +ComputeSpv string +``` + +} + +### func (d *ShaderData) Compile() ShaderDataCompiled + + +### type ShaderDataBase struct { + +```go +InitModel matrix.Mat4 +// Has unexported fields. +``` + +} + +### func NewShaderDataBase() ShaderDataBase + + +### func (s *ShaderDataBase) Activate() + + +### func (s *ShaderDataBase) Base() *ShaderDataBase + + +### func (s *ShaderDataBase) BoundDataPointer() unsafe.Pointer + + +### func (s *ShaderDataBase) CancelDestroy() + + +### func (s *ShaderDataBase) DataPointer() unsafe.Pointer + + +### func (s *ShaderDataBase) Deactivate() + + +### func (s *ShaderDataBase) Destroy() + + +### func (s *ShaderDataBase) InstanceBoundDataSize() int + + +### func (s *ShaderDataBase) IsDestroyed() bool + + +### func (s *ShaderDataBase) IsInView() bool + + +### func (s *ShaderDataBase) Model() matrix.Mat4 + + +### func (s *ShaderDataBase) ModelPtr() *matrix.Mat4 + + +### func (s *ShaderDataBase) SelectLights(lights LightsForRender) + + +### func (s *ShaderDataBase) SetModel(model matrix.Mat4) + + +### func (s *ShaderDataBase) Setup() + + +### func (s *ShaderDataBase) SkinningHeader() *SkinnedShaderDataHeader + + +### func (s *ShaderDataBase) Transform() *matrix.Transform + + +### func (s *ShaderDataBase) UpdateBoundData() bool + + +### func (s *ShaderDataBase) UpdateModel(viewCuller ViewCuller, container collision.AABB) + + +### type ShaderDataCombine struct { + +```go +ShaderDataBase +Color matrix.Color +``` + +} + +### func (t ShaderDataCombine) Size() int + + +### type ShaderDataCompiled struct { + +```go +Name string +Vertex string +Fragment string +Geometry string +TessellationControl string +TessellationEvaluation string +Compute string +LayoutGroups []ShaderLayoutGroup +SamplerLabels []string +``` + +} + +### func (s *ShaderDataCompiled) IsCompute() bool + + +### func (s *ShaderDataCompiled) SelectLayout(stage string) *ShaderLayoutGroup + + +### func (sd *ShaderDataCompiled) Stride() uint32 + + +### func (sd *ShaderDataCompiled) ToAttributeDescription(locationStart uint32) []vk.VertexInputAttributeDescription + + +### func (sd *ShaderDataCompiled) ToDescriptorSetLayoutStructure() DescriptorSetLayoutStructure + + +### func (sd *ShaderDataCompiled) WorkGroups() [3]uint32 + + +### type ShaderDraw struct { + +```go +// Has unexported fields. +``` + +} + +### func NewShaderDraw(material *Material) ShaderDraw + + +### func (s *ShaderDraw) AddInstanceGroup(group DrawInstanceGroup) + + +### func (s *ShaderDraw) Clear() + + +### func (s *ShaderDraw) Destroy(device *GPUDevice) + + +### func (s *ShaderDraw) Filter(filter func(*DrawInstanceGroup) bool) []*DrawInstanceGroup + + +### type ShaderDriverData struct { + +```go +DescriptorSetLayoutStructure +Stride uint32 +AttributeDescriptions []vk.VertexInputAttributeDescription +``` + +} + +### func NewShaderDriverData() ShaderDriverData + + +### type ShaderId struct { + +```go +// Has unexported fields. +``` + +} + +### func (s ShaderId) IsValid() bool + + +### type ShaderLayout struct { + +```go +Location int // -1 if not set +Binding int // -1 if not set +Count int // 1 if not set +Set int // -1 if not set +InputAttachment int // -1 if not set +Type string // float, vec3, mat4, etc. +Name string +Source string // in, out, uniform, buffer +Fields []ShaderLayoutStructField +``` + +} + +### func (l *ShaderLayout) Capacity() int + + +### func (l *ShaderLayout) DescriptorType() vulkan_const.DescriptorType + + +### func (l *ShaderLayout) FullName() string + + +### func (l *ShaderLayout) IsBuffer() bool + + +### func (l *ShaderLayout) Stride() int + + +### type ShaderLayoutGroup struct { + +```go +Type string +WorkGroups [3]uint32 +Layouts []ShaderLayout +``` + +} + +### func (g *ShaderLayoutGroup) DescriptorFlag() vulkan_const.ShaderStageFlagBits + + +### type ShaderLayoutStructField struct { + +```go +Type string // float, vec3, mat4, etc. +Name string +``` + +} + +### type ShaderPipelineColorBlend struct { + +```go +LogicOpEnable bool +LogicOp string `options:"StringVkLogicOp"` +BlendConstants0 float32 `tip:"BlendConstants"` +BlendConstants1 float32 `tip:"BlendConstants"` +BlendConstants2 float32 `tip:"BlendConstants"` +BlendConstants3 float32 `tip:"BlendConstants"` +``` + +} + +### func (s *ShaderPipelineColorBlend) LogicOpToVK() vulkan_const.LogicOp + + +### type ShaderPipelineColorBlendAttachments struct { + +```go +BlendEnable bool +SrcColorBlendFactor string `options:"StringVkBlendFactor"` +DstColorBlendFactor string `options:"StringVkBlendFactor"` +ColorBlendOp string `options:"StringVkBlendOp"` +SrcAlphaBlendFactor string `options:"StringVkBlendFactor"` +DstAlphaBlendFactor string `options:"StringVkBlendFactor"` +AlphaBlendOp string `options:"StringVkBlendOp"` +ColorWriteMask []string `options:"StringVkColorComponentFlagBits"` +``` + +} + +### func (a *ShaderPipelineColorBlendAttachments) AlphaBlendOpToVK() vulkan_const.BlendOp + + +### func (a *ShaderPipelineColorBlendAttachments) BlendEnableToVK() vk.Bool32 + + +### func (a *ShaderPipelineColorBlendAttachments) ColorBlendOpToVK() vulkan_const.BlendOp + + +### func (a *ShaderPipelineColorBlendAttachments) ColorWriteMaskToVK() vulkan_const.ColorComponentFlagBits + + +### func (a *ShaderPipelineColorBlendAttachments) DstAlphaBlendFactorToVK() vulkan_const.BlendFactor + + +### func (a *ShaderPipelineColorBlendAttachments) DstColorBlendFactorToVK() vulkan_const.BlendFactor + + +### func (a *ShaderPipelineColorBlendAttachments) ListAlphaBlendOp() []string + + +### func (a *ShaderPipelineColorBlendAttachments) ListColorBlendOp() []string + + +### func (a *ShaderPipelineColorBlendAttachments) ListDstAlphaBlendFactor() []string + + +### func (a *ShaderPipelineColorBlendAttachments) ListDstColorBlendFactor() []string + + +### func (a *ShaderPipelineColorBlendAttachments) ListSrcAlphaBlendFactor() []string + + +### func (a *ShaderPipelineColorBlendAttachments) ListSrcColorBlendFactor() []string + + +### func (a *ShaderPipelineColorBlendAttachments) SrcAlphaBlendFactorToVK() vulkan_const.BlendFactor + + +### func (a *ShaderPipelineColorBlendAttachments) SrcColorBlendFactorToVK() vulkan_const.BlendFactor + + +### type ShaderPipelineColorBlendAttachmentsCompiled struct { + +```go +BlendEnable vk.Bool32 +SrcColorBlendFactor vulkan_const.BlendFactor +DstColorBlendFactor vulkan_const.BlendFactor +ColorBlendOp vulkan_const.BlendOp +SrcAlphaBlendFactor vulkan_const.BlendFactor +DstAlphaBlendFactor vulkan_const.BlendFactor +AlphaBlendOp vulkan_const.BlendOp +ColorWriteMask vk.ColorComponentFlags +``` + +} + +### type ShaderPipelineColorBlendCompiled struct { + +```go +LogicOpEnable vk.Bool32 +LogicOp vulkan_const.LogicOp +BlendConstants [4]float32 +``` + +} + +### type ShaderPipelineData struct { + +```go +Name string +InputAssembly ShaderPipelineInputAssembly +Rasterization ShaderPipelinePipelineRasterization +Multisample ShaderPipelinePipelineMultisample +ColorBlend ShaderPipelineColorBlend +ColorBlendAttachments []ShaderPipelineColorBlendAttachments +DepthStencil ShaderPipelineDepthStencil +Tessellation ShaderPipelineTessellation +GraphicsPipeline ShaderPipelineGraphicsPipeline +PushConstant ShaderPipelinePushConstant +``` + +} + +### func (s *ShaderPipelineData) AlphaToCoverageEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) AlphaToOneEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) BackStencilOpStateToVK() vk.StencilOpState + + +### func (s *ShaderPipelineData) BlendConstants() [4]float32 + + +### func (d *ShaderPipelineData) Compile(device *GPUPhysicalDevice) ShaderPipelineDataCompiled + + +### func (s *ShaderPipelineData) DepthBiasEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) DepthBoundsTestEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) DepthClampEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) DepthTestEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) DepthWriteEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) FrontStencilOpStateToVK() vk.StencilOpState + +```go + TODO: This and the BackStencilOpStateToVK are duplicates because of a bad + structure setup, please fix later +``` + + +### func (s ShaderPipelineData) ListBackCompareOp() []string + + +### func (s ShaderPipelineData) ListBackDepthFailOp() []string + + +### func (s ShaderPipelineData) ListBackFailOp() []string + + +### func (s ShaderPipelineData) ListBackPassOp() []string + + +### func (s ShaderPipelineData) ListBlendFactor() []string + + +### func (s ShaderPipelineData) ListBlendOp() []string + + +### func (s ShaderPipelineData) ListCullMode() []string + + +### func (s ShaderPipelineData) ListDepthCompareOp() []string + + +### func (s ShaderPipelineData) ListFrontCompareOp() []string + + +### func (s ShaderPipelineData) ListFrontDepthFailOp() []string + + +### func (s ShaderPipelineData) ListFrontFace() []string + + +### func (s ShaderPipelineData) ListFrontFailOp() []string + + +### func (s ShaderPipelineData) ListFrontPassOp() []string + + +### func (s ShaderPipelineData) ListLogicOp() []string + + +### func (s ShaderPipelineData) ListPatchControlPoints() []string + + +### func (s ShaderPipelineData) ListPolygonMode() []string + + +### func (s ShaderPipelineData) ListRasterizationSamples() []string + + +### func (s ShaderPipelineData) ListTopology() []string + + +### func (s *ShaderPipelineData) LogicOpEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) PrimitiveRestartToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) RasterizerDiscardEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) SampleShadingEnableToVK() vk.Bool32 + + +### func (s *ShaderPipelineData) StencilTestEnableToVK() vk.Bool32 + + +### type ShaderPipelineDataCompiled struct { + +```go +Name string +InputAssembly ShaderPipelineInputAssemblyCompiled +Rasterization ShaderPipelinePipelineRasterizationCompiled +Multisample ShaderPipelinePipelineMultisampleCompiled +ColorBlend ShaderPipelineColorBlendCompiled +ColorBlendAttachments []ShaderPipelineColorBlendAttachmentsCompiled +DepthStencil ShaderPipelineDepthStencilCompiled +Tessellation ShaderPipelineTessellationCompiled +GraphicsPipeline ShaderPipelineGraphicsPipelineCompiled +PushConstant ShaderPipelinePushConstantCompiled +``` + +} + +### func (s *ShaderPipelineDataCompiled) ConstructPipeline(device *GPUDevice, shader *Shader, renderPass *RenderPass, stages []vk.PipelineShaderStageCreateInfo) bool + + +### type ShaderPipelineDepthStencil struct { + +```go +DepthTestEnable bool +DepthWriteEnable bool +DepthCompareOp string `options:"StringVkCompareOp"` +DepthBoundsTestEnable bool +StencilTestEnable bool +FrontFailOp string `options:"StringVkStencilOp" tip:"FailOp"` +FrontPassOp string `options:"StringVkStencilOp" tip:"PassOp"` +FrontDepthFailOp string `options:"StringVkStencilOp" tip:"DepthFailOp"` +FrontCompareOp string `options:"StringVkCompareOp" tip:"CompareOp"` +FrontCompareMask uint32 `tip:"CompareMask"` +FrontWriteMask uint32 `tip:"WriteMask"` +FrontReference uint32 `tip:"Reference"` +BackFailOp string `options:"StringVkStencilOp" tip:"FailOp"` +BackPassOp string `options:"StringVkStencilOp" tip:"PassOp"` +BackDepthFailOp string `options:"StringVkStencilOp" tip:"DepthFailOp"` +BackCompareOp string `options:"StringVkCompareOp" tip:"CompareOp"` +BackCompareMask uint32 `tip:"CompareMask"` +BackWriteMask uint32 `tip:"WriteMask"` +BackReference uint32 `tip:"Reference"` +MinDepthBounds float32 +MaxDepthBounds float32 +``` + +} + +### type ShaderPipelineDepthStencilCompiled struct { + +```go +DepthTestEnable vk.Bool32 +DepthWriteEnable vk.Bool32 +DepthCompareOp vulkan_const.CompareOp +DepthBoundsTestEnable vk.Bool32 +StencilTestEnable vk.Bool32 +Front vk.StencilOpState +Back vk.StencilOpState +MinDepthBounds float32 +MaxDepthBounds float32 +``` + +} + +### type ShaderPipelineGraphicsPipeline struct { + +```go +Subpass uint32 +PipelineCreateFlags []string `options:"StringVkPipelineCreateFlagBits"` +``` + +} + +### func (s *ShaderPipelineGraphicsPipeline) PipelineCreateFlagsToVK() vk.PipelineCreateFlags + + +### type ShaderPipelineGraphicsPipelineCompiled struct { + +```go +Subpass uint32 +PipelineCreateFlags vk.PipelineCreateFlags +``` + +} + +### type ShaderPipelineInputAssembly struct { + +```go +Topology string `options:"StringVkPrimitiveTopology"` +PrimitiveRestart bool +``` + +} + +### func (s *ShaderPipelineInputAssembly) TopologyToVK() vulkan_const.PrimitiveTopology + + +### type ShaderPipelineInputAssemblyCompiled struct { + +```go +Topology vulkan_const.PrimitiveTopology +PrimitiveRestart vk.Bool32 +``` + +} + +### type ShaderPipelinePipelineMultisample struct { + +```go +RasterizationSamples string `options:"StringVkSampleCountFlagBits"` +SampleShadingEnable bool +MinSampleShading float32 +AlphaToCoverageEnable bool +AlphaToOneEnable bool +``` + +} + +### func (s *ShaderPipelinePipelineMultisample) RasterizationSamplesToVK(device *GPUPhysicalDevice) GPUSampleCountFlags + + +### type ShaderPipelinePipelineMultisampleCompiled struct { + +```go +RasterizationSamples vulkan_const.SampleCountFlagBits +SampleShadingEnable vk.Bool32 +MinSampleShading float32 +AlphaToCoverageEnable vk.Bool32 +AlphaToOneEnable vk.Bool32 +``` + +} + +### type ShaderPipelinePipelineRasterization struct { + +```go +DepthClampEnable bool +RasterizerDiscardEnable bool +PolygonMode string `options:"StringVkPolygonMode"` +CullMode string `options:"StringVkCullModeFlagBits"` +FrontFace string `options:"StringVkFrontFace"` +DepthBiasEnable bool +DepthBiasConstantFactor float32 +DepthBiasClamp float32 +DepthBiasSlopeFactor float32 +LineWidth float32 +``` + +} + +### func (s *ShaderPipelinePipelineRasterization) CullModeToVK() vulkan_const.CullModeFlagBits + + +### func (s *ShaderPipelinePipelineRasterization) FrontFaceToVK() vulkan_const.FrontFace + + +### func (s *ShaderPipelinePipelineRasterization) PolygonModeToVK() vulkan_const.PolygonMode + + +### type ShaderPipelinePipelineRasterizationCompiled struct { + +```go +DepthClampEnable vk.Bool32 +DiscardEnable vk.Bool32 +PolygonMode vulkan_const.PolygonMode +CullMode vk.CullModeFlags +FrontFace vulkan_const.FrontFace +DepthBiasEnable vk.Bool32 +DepthBiasConstantFactor float32 +DepthBiasClamp float32 +DepthBiasSlopeFactor float32 +LineWidth float32 +``` + +} + +### type ShaderPipelinePushConstant struct { + +```go +Size uint32 +StageFlags []string `options:"StringVkAccessFlagBits"` +``` + +} + +### func (s *ShaderPipelinePushConstant) ShaderStageFlagsToVK() vk.ShaderStageFlags + + +### type ShaderPipelinePushConstantCompiled struct { + +```go +Size uint32 +StageFlags vk.ShaderStageFlags +``` + +} + +### type ShaderPipelineTessellation struct { + +```go +PatchControlPoints string `options:"StringVkPatchControlPoints"` +``` + +} + +### func (s *ShaderPipelineTessellation) PatchControlPointsToVK() uint32 + + +### type ShaderPipelineTessellationCompiled struct { + +```go +PatchControlPoints uint32 +``` + +} + +### type ShaderType int + + +### const ( + +```go +ShaderTypeGraphics ShaderType = iota +ShaderTypeCompute +``` + +) +### type SkinnedShaderDataHeader struct { + +```go +// Has unexported fields. +``` + +} + +### func (h *SkinnedShaderDataHeader) BoneByIndex(index int) *BoneTransform + + +### func (h *SkinnedShaderDataHeader) CreateBones(ids []int32) + + +### func (h *SkinnedShaderDataHeader) FindBone(id int32) *BoneTransform + + +### func (h *SkinnedShaderDataHeader) HasBones() bool + + +### func (h *SkinnedShaderDataHeader) SkinNamedDataInstanceSize() int + + +### func (h *SkinnedShaderDataHeader) SkinNamedDataPointer() unsafe.Pointer + + +### func (h *SkinnedShaderDataHeader) SkinUpdateNamedData() bool + + +### type TextShaderData struct { + +```go +ShaderDataBase +UVs matrix.Vec4 +FgColor matrix.Color +BgColor matrix.Color +Scissor matrix.Vec4 +PxRange matrix.Vec2 +``` + +} + +### func (s TextShaderData) Size() int + + +### type Texture struct { + +```go +Key string +TexturePixelCache []byte +RenderId TextureId +Channels int +Filter int +MipLevels int +Width int +Height int +CacheInvalid bool +``` + + +```go +// Has unexported fields. +``` + +} + +### func NewTexture(assetDb assets.Database, key string, filter TextureFilter) (*Texture, error) + + +### func NewTextureFromImage(key string, data []byte, filter TextureFilter) (*Texture, error) + + +### func NewTextureFromMemory(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error) + + +### func (t *Texture) DelayedCreate(device *GPUDevice) + + +### func (t *Texture) ReadAllPixels(app *GPUApplication) ([]byte, error) + + +### func (t *Texture) ReadPendingDataForTransparency() bool + + +### func (t *Texture) ReadPixel(app *GPUApplication, x, y int) matrix.Color + + +### func (t *Texture) Reload(assetDb assets.Database) error + + +### func (t *Texture) SetPendingDataDimensions(dim TextureDimensions) + + +### func (t Texture) Size() matrix.Vec2 + + +### func (t *Texture) WritePixels(device *GPUDevice, requests []GPUImageWriteRequest) + + +### type TextureCache struct { + +```go +// Has unexported fields. +``` + +} + +### func NewTextureCache(device *GPUDevice, assetDatabase assets.Database) TextureCache + + +### func (t *TextureCache) CreatePending() + + +### func (t *TextureCache) Destroy() + + +### func (t *TextureCache) ForceRemoveTexture(key string, filter TextureFilter) + + +### func (t *TextureCache) InsertRawTexture(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error) + + +### func (t *TextureCache) InsertTexture(tex *Texture) + + +### func (t *TextureCache) ReloadTexture(textureKey string, filter TextureFilter) error + + +### func (t *TextureCache) Texture(textureKey string, filter TextureFilter) (*Texture, error) + + +### type TextureCleanup struct { + +```go +// Has unexported fields. +``` + +} + +### type TextureColorFormat int + + +### const ( + +```go +TextureColorFormatRgbaUnorm TextureColorFormat = iota +TextureColorFormatRgbUnorm +TextureColorFormatRgbaSrgb +TextureColorFormatRgbSrgb +TextureColorFormatLuminance +``` + +) +### type TextureData struct { + +```go +Mem []byte +InternalFormat TextureInputType +Format TextureColorFormat +Type TextureMemType +Width int +Height int +InputType TextureFileFormat +Dimensions TextureDimensions +``` + +} + +### func ReadRawTextureData(mem []byte, inputType TextureFileFormat) TextureData + + +### func TexturePixelsFromAsset(assetDb assets.Database, key string) (TextureData, error) + + +### type TextureDimensions = int + + +### const ( + +```go +TextureDimensions2 TextureDimensions = iota +TextureDimensions1 +TextureDimensions3 +TextureDimensionsCube +``` + +) +### type TextureFileFormat = int + + +### const ( + +```go +TextureFileFormatAstc TextureFileFormat = iota +TextureFileFormatPng +TextureFileFormatRaw +``` + +) +### type TextureFilter = int + + +### const ( + +```go +TextureFilterLinear TextureFilter = iota +TextureFilterNearest +TextureFilterMax +``` + +) +### type TextureId struct { + +```go +Image GPUImage +Memory GPUDeviceMemory +View GPUImageView +Sampler GPUSampler +Format GPUFormat +MipLevels uint32 +Layout GPUImageLayout +Access GPUAccessFlags +Samples GPUSampleCountFlags +Width int +Height int +LayerCount int +``` + +} + +### func (t TextureId) IsValid() bool + + +### type TextureInputType int + + +### const ( + +```go +TextureInputTypeCompressedRgbaAstc4x4 TextureInputType = iota +TextureInputTypeCompressedRgbaAstc5x4 +TextureInputTypeCompressedRgbaAstc5x5 +TextureInputTypeCompressedRgbaAstc6x5 +TextureInputTypeCompressedRgbaAstc6x6 +TextureInputTypeCompressedRgbaAstc8x5 +TextureInputTypeCompressedRgbaAstc8x6 +TextureInputTypeCompressedRgbaAstc8x8 +TextureInputTypeCompressedRgbaAstc10x5 +TextureInputTypeCompressedRgbaAstc10x6 +TextureInputTypeCompressedRgbaAstc10x8 +TextureInputTypeCompressedRgbaAstc10x10 +TextureInputTypeCompressedRgbaAstc12x10 +TextureInputTypeCompressedRgbaAstc12x12 +TextureInputTypeRgba8 +TextureInputTypeRgb8 +TextureInputTypeLuminance +``` + +) +### type TextureMemType = int + + +### const ( + +```go +TextureMemTypeUnsignedByte TextureMemType = iota +``` + +) +### type Vertex struct { + +```go +Position matrix.Vec3 +Normal matrix.Vec3 +Tangent matrix.Vec4 +UV0 matrix.Vec2 +Color matrix.Color +JointIds matrix.Vec4i +JointWeights matrix.Vec4 +MorphTarget matrix.Vec3 +``` + +} + +### func MeshPlaneData() ([]Vertex, []uint32) + + +### func MeshQuadData() ([]Vertex, []uint32) + + +### type ViewCuller interface { + +```go +IsInView(box collision.AABB) bool +ViewChanged() bool +``` + +} + + diff --git a/docs/api/root.md b/docs/api/root.md new file mode 100644 index 000000000..7e0ccba3e --- /dev/null +++ b/docs/api/root.md @@ -0,0 +1,27 @@ +# Package root + +**Import path:** `kaijuengine.com` + + + +## Types + + +### type Game struct { + +```go +// Has unexported fields. +``` + +} + +### func (Game) ContentDatabase() (assets.Database, error) + + +### func (g *Game) Launch(host *engine.Host) + + +### func (Game) PluginRegistry() []reflect.Type + + + diff --git a/src/tools/gendocs.go b/src/tools/gendocs.go new file mode 100644 index 000000000..30cc61128 --- /dev/null +++ b/src/tools/gendocs.go @@ -0,0 +1,233 @@ +package main + +import ( + "bufio" + "fmt" + "os" + "os/exec" + "path/filepath" + "strings" +) + +type DocGenerator struct { + sourceDir string + outputDir string + packages []string +} + +func NewDocGenerator() *DocGenerator { + return &DocGenerator{ + sourceDir: "src", + outputDir: "./docs/api", + packages: []string{ + ".", "bootstrap", "engine", "matrix", "klib", "rendering", + "platform/windowing", "platform/hid", "platform/audio", + "platform/filesystem", "engine/ui", "registry/shader_data_registry", "debug", + }, + } +} + +func main() { + generator := NewDocGenerator() + generator.Generate() +} + +func (g *DocGenerator) Generate() { + fmt.Printf("Generating docs from: %s\n", g.sourceDir) + + if err := os.MkdirAll(g.outputDir, 0755); err != nil { + fmt.Printf("Error creating output dir: %v\n", err) + os.Exit(1) + } + + g.generateIndex() + + successCount := 0 + for _, pkg := range g.packages { + fmt.Printf("Processing: %s... ", pkg) + if g.generatePackageDoc(pkg) { + fmt.Println("✓") + successCount++ + } else { + fmt.Println("✗") + } + } + + fmt.Printf("Generated! %d/%d packages processed.\n", successCount, len(g.packages)) +} + +func (g *DocGenerator) generateIndex() { + indexPath := filepath.Join(g.outputDir, "index.md") + file, err := os.Create(indexPath) + if err != nil { + return + } + defer file.Close() + + writer := bufio.NewWriter(file) + defer writer.Flush() + + writer.WriteString("# Kaiju Engine API Documentation\n\n") + writer.WriteString("Auto-generated using go doc.\n\n") + + categories := g.categorizePackages() + for title, pkgs := range categories { + if len(pkgs) == 0 { + continue + } + writer.WriteString(fmt.Sprintf("## %s\n\n", title)) + for _, pkg := range pkgs { + link := g.getPackageLink(pkg) + displayName := g.getDisplayName(pkg) + writer.WriteString(fmt.Sprintf("- [%s](%s)\n", displayName, link)) + } + writer.WriteString("\n") + } +} + +func (g *DocGenerator) categorizePackages() map[string][]string { + categories := map[string][]string{ + "Core": {}, + "Engine": {}, + "Platform": {}, + "Rendering": {}, + "Other": {}, + } + + for _, pkg := range g.packages { + switch { + case g.isCorePackage(pkg): + categories["Core"] = append(categories["Core"], pkg) + case strings.HasPrefix(pkg, "engine"): + categories["Engine"] = append(categories["Engine"], pkg) + case strings.HasPrefix(pkg, "platform"): + categories["Platform"] = append(categories["Platform"], pkg) + case g.isRenderingPackage(pkg): + categories["Rendering"] = append(categories["Rendering"], pkg) + default: + categories["Other"] = append(categories["Other"], pkg) + } + } + + return categories +} + +func (g *DocGenerator) isCorePackage(pkg string) bool { + return pkg == "." || pkg == "bootstrap" || pkg == "matrix" || pkg == "klib" +} + +func (g *DocGenerator) isRenderingPackage(pkg string) bool { + return strings.HasPrefix(pkg, "rendering") || strings.HasPrefix(pkg, "registry") +} + +func (g *DocGenerator) getPackageLink(pkg string) string { + if pkg == "." { + return "root.md" + } + return strings.ReplaceAll(pkg, "/", "_") + ".md" +} + +func (g *DocGenerator) getDisplayName(pkg string) string { + if pkg == "." { + return "root" + } + return pkg +} + +func (g *DocGenerator) generatePackageDoc(pkg string) bool { + output, err := g.executeGoDoc(pkg) + if err != nil { + return false + } + + filename := g.getPackageLink(pkg) + filePath := filepath.Join(g.outputDir, filename) + + file, err := os.Create(filePath) + if err != nil { + return false + } + defer file.Close() + + writer := bufio.NewWriter(file) + defer writer.Flush() + + g.writePackageHeader(writer, pkg) + g.convertDocToMarkdown(writer, string(output)) + + return true +} + +func (g *DocGenerator) executeGoDoc(pkg string) ([]byte, error) { + relativePkg := "./" + pkg + if pkg == "." { + relativePkg = "." + } + + cmd := exec.Command("go", "doc", "-all", relativePkg) + cmd.Dir = g.sourceDir + return cmd.Output() +} + +func (g *DocGenerator) writePackageHeader(writer *bufio.Writer, pkg string) { + displayName := g.getDisplayName(pkg) + writer.WriteString(fmt.Sprintf("# Package %s\n\n", displayName)) + + importPath := "kaijuengine.com" + if pkg != "." { + importPath += "/" + pkg + } + writer.WriteString(fmt.Sprintf("**Import path:** `%s`\n\n", importPath)) +} + +func (g *DocGenerator) convertDocToMarkdown(writer *bufio.Writer, output string) { + lines := strings.Split(output, "\n") + inCodeBlock := false + + for _, line := range lines { + if strings.HasPrefix(line, "package ") { + continue + } + + if g.isCodeLine(line) { + if !inCodeBlock { + writer.WriteString("```go\n") + inCodeBlock = true + } + writer.WriteString(strings.TrimPrefix(line, "\t") + "\n") + } else { + if inCodeBlock { + writer.WriteString("```\n\n") + inCodeBlock = false + } + g.writeFormattedLine(writer, line) + } + } + + if inCodeBlock { + writer.WriteString("```\n") + } +} + +func (g *DocGenerator) isCodeLine(line string) bool { + return strings.HasPrefix(line, "\t") || (len(line) > 0 && strings.HasPrefix(line, " ")) +} + +func (g *DocGenerator) writeFormattedLine(writer *bufio.Writer, line string) { + if g.isHeaderLine(line) { + writer.WriteString(fmt.Sprintf("## %s\n\n", strings.Title(strings.ToLower(line)))) + } else if g.isDeclarationLine(line) { + writer.WriteString("### " + line + "\n\n") + } else { + writer.WriteString(line + "\n") + } +} + +func (g *DocGenerator) isHeaderLine(line string) bool { + return line != "" && strings.ToUpper(line) == line && !strings.Contains(line, " ") && len(line) > 1 +} + +func (g *DocGenerator) isDeclarationLine(line string) bool { + return strings.HasPrefix(line, "func ") || strings.HasPrefix(line, "type ") || + strings.HasPrefix(line, "var ") || strings.HasPrefix(line, "const ") +} From 958f832503fb2f28b575a2f0c6fed1cff9ad7860 Mon Sep 17 00:00:00 2001 From: JrSchmidtt Date: Fri, 20 Mar 2026 12:52:28 -0300 Subject: [PATCH 2/2] Refactor documentation generation tool and update API documentation --- .vscode/launch.json | 14 + .vscode/tasks.json | 19 + docs/api/bootstrap.md | 68 +- docs/api/debug.md | 104 +- docs/api/editor.md | 480 ++ docs/api/engine.md | 984 ++- docs/api/engine_ui.md | 1087 --- docs/api/framework.md | 417 + docs/api/index.md | 30 +- docs/api/klib.md | 1017 ++- docs/api/matrix.md | 5738 +++++++++++-- docs/api/platform_audio.md | 116 - docs/api/platform_filesystem.md | 178 - docs/api/platform_hid.md | 665 -- docs/api/platform_windowing.md | 357 - docs/api/plugins.md | 67 + docs/api/registry_shader_data_registry.md | 245 - docs/api/rendering.md | 9253 ++++++++++++++------- docs/api/root.md | 46 +- src/tools/gendocs.go | 307 +- 20 files changed, 14348 insertions(+), 6844 deletions(-) create mode 100644 docs/api/editor.md delete mode 100644 docs/api/engine_ui.md create mode 100644 docs/api/framework.md delete mode 100644 docs/api/platform_audio.md delete mode 100644 docs/api/platform_filesystem.md delete mode 100644 docs/api/platform_hid.md delete mode 100644 docs/api/platform_windowing.md create mode 100644 docs/api/plugins.md delete mode 100644 docs/api/registry_shader_data_registry.md diff --git a/.vscode/launch.json b/.vscode/launch.json index c25a0ec40..e718f4aa4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -60,6 +60,20 @@ "CGO_ENABLED": "1" }, "console": "integratedTerminal", + "showLog": true, + "preLaunchTask": "Install gomarkdoc" + }, { + "name": "Install Dependencies and Generate Docs", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/src/tools/install_and_generate_docs.go", + "args": ["${workspaceFolder}/src"], + "cwd": "${workspaceFolder}", + "env": { + "CGO_ENABLED": "1" + }, + "console": "integratedTerminal", "showLog": true }, { "name": "Copy Headers", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 838aea778..2b94028be 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -54,6 +54,25 @@ }, "problemMatcher": [], "detail": "Generate API documentation using go doc" + }, { + "label": "Install gomarkdoc", + "type": "shell", + "command": "go", + "args": [ + "install", + "github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest" + ], + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": [], + "detail": "Install gomarkdoc dependency" } ] } \ No newline at end of file diff --git a/docs/api/bootstrap.md b/docs/api/bootstrap.md index 4083df5bf..98fe3c0b7 100644 --- a/docs/api/bootstrap.md +++ b/docs/api/bootstrap.md @@ -1,51 +1,51 @@ -# Package bootstrap + -**Import path:** `kaijuengine.com/bootstrap` +# bootstrap +```go +import "kaijuengine.com/bootstrap" +``` +## Index -## Functions - - -### func Main(game GameInterface, platformState any) - - -## Types +- [func Main\(game GameInterface, platformState any\)](<#Main>) +- [type GameInterface](<#GameInterface>) -### type GameInterface interface { + +## func [Main]() ```go -// Launch is used to bootstrap a game, the game should fill out this -// function's details to initialize itself. No updates are provided by the -// engine, so it is on the the implementing code to take care of registering -// any udpates with the supplied host. -Launch(*engine.Host) +func Main(game GameInterface, platformState any) ``` -```go -// PluginRegistry is used to expose types to be exported for use in Lua. -// Any type returned here will have it's members and functions mapped to -// be called by Lua. You can run the engine with the command line argument -// "generate=pluginapi" to dump a Lua API file and ensure your exposed -// types have been correctly inserted. -PluginRegistry() []reflect.Type -``` + +## type [GameInterface]() -```go -// ContentDatabase must return the database interface for the engine to use -// when it is trying to access content. You can use exsiting types that -// implement [assets.Database], or you can create your own. -ContentDatabase() (assets.Database, error) -``` +GameInterface is the primary interface to implement in order to bootstrap a game/application. -} ```go - GameInterface is the primary interface to implement in order to bootstrap a - game/application. +type GameInterface interface { + // Launch is used to bootstrap a game, the game should fill out this + // function's details to initialize itself. No updates are provided by the + // engine, so it is on the the implementing code to take care of registering + // any udpates with the supplied host. + Launch(*engine.Host) + + // PluginRegistry is used to expose types to be exported for use in Lua. + // Any type returned here will have it's members and functions mapped to + // be called by Lua. You can run the engine with the command line argument + // "generate=pluginapi" to dump a Lua API file and ensure your exposed + // types have been correctly inserted. + PluginRegistry() []reflect.Type + + // ContentDatabase must return the database interface for the engine to use + // when it is trying to access content. You can use exsiting types that + // implement [assets.Database], or you can create your own. + ContentDatabase() (assets.Database, error) +} ``` - - +Generated by [gomarkdoc]() diff --git a/docs/api/debug.md b/docs/api/debug.md index 9901f8486..350008ac3 100644 --- a/docs/api/debug.md +++ b/docs/api/debug.md @@ -1,34 +1,112 @@ -# Package debug + -**Import path:** `kaijuengine.com/debug` +# debug +```go +import "kaijuengine.com/debug" +``` + +## Index + +- [Variables](<#variables>) +- [func Assert\(res bool, msg string\)](<#Assert>) +- [func Ensure\(res bool\)](<#Ensure>) +- [func EnsureMsg\(res bool, msg string\)](<#EnsureMsg>) +- [func EnsureNotError\(err error\)](<#EnsureNotError>) +- [func EnsureNotNil\(target any\)](<#EnsureNotNil>) +- [func Halt\(msg string\)](<#Halt>) +- [func Log\(msg string, args ...any\)](<#Log>) +- [func Throw\(message string\)](<#Throw>) +- [func ThrowNotImplemented\(todo string\)](<#ThrowNotImplemented>) ## Variables + + +```go +var NotImplementedError = errors.New("not implemented") +``` + + +## func [Assert]() + +```go +func Assert(res bool, msg string) +``` + + + + +## func [Ensure]() + +```go +func Ensure(res bool) +``` + + + + +## func [EnsureMsg]() + +```go +func EnsureMsg(res bool, msg string) +``` + + + + +## func [EnsureNotError]() + +```go +func EnsureNotError(err error) +``` + + + + +## func [EnsureNotNil]() + +```go +func EnsureNotNil(target any) +``` + + + + +## func [Halt]() + +```go +func Halt(msg string) +``` -### var NotImplementedError = errors.New("not implemented") -## Functions + +## func [Log]() +```go +func Log(msg string, args ...any) +``` -### func Assert(res bool, msg string) -### func Ensure(res bool) -### func EnsureMsg(res bool, msg string) + +## func [Throw]() -### func EnsureNotError(err error) +```go +func Throw(message string) +``` -### func EnsureNotNil(target any) -### func Halt(msg string) -### func Log(msg string, args ...any) + +## func [ThrowNotImplemented]() -### func Throw(message string) +```go +func ThrowNotImplemented(todo string) +``` -### func ThrowNotImplemented(todo string) +Generated by [gomarkdoc]() diff --git a/docs/api/editor.md b/docs/api/editor.md new file mode 100644 index 000000000..e9974f675 --- /dev/null +++ b/docs/api/editor.md @@ -0,0 +1,480 @@ + + +# editor + +```go +import "kaijuengine.com/editor" +``` + +## Index + +- [Constants](<#constants>) +- [func RegisterPlugin\(key string, plugin editor\_plugin.EditorPlugin\)](<#RegisterPlugin>) +- [type Editor](<#Editor>) + - [func \(ed \*Editor\) BlurInterface\(\)](<#Editor.BlurInterface>) + - [func \(ed \*Editor\) Build\(buildMode project.GameBuildMode\)](<#Editor.Build>) + - [func \(ed \*Editor\) BuildAndRun\(buildMode project.GameBuildMode\)](<#Editor.BuildAndRun>) + - [func \(ed \*Editor\) BuildAndRunCurrentStage\(\)](<#Editor.BuildAndRunCurrentStage>) + - [func \(ed \*Editor\) Cache\(\) \*content\_database.Cache](<#Editor.Cache>) + - [func \(ed \*Editor\) ContentPreviewer\(\) \*content\_previews.ContentPreviewer](<#Editor.ContentPreviewer>) + - [func \(ed \*Editor\) ContentWorkspaceSelected\(\)](<#Editor.ContentWorkspaceSelected>) + - [func \(ed \*Editor\) CreateHtmlUiFile\(name string\)](<#Editor.CreateHtmlUiFile>) + - [func \(ed \*Editor\) CreateNewCamera\(\)](<#Editor.CreateNewCamera>) + - [func \(ed \*Editor\) CreateNewEntity\(\)](<#Editor.CreateNewEntity>) + - [func \(ed \*Editor\) CreateNewLight\(\)](<#Editor.CreateNewLight>) + - [func \(ed \*Editor\) CreateNewStage\(\)](<#Editor.CreateNewStage>) + - [func \(ed \*Editor\) CreatePluginProject\(path string\)](<#Editor.CreatePluginProject>) + - [func \(ed \*Editor\) Events\(\) \*editor\_events.EditorEvents](<#Editor.Events>) + - [func \(ed \*Editor\) FocusInterface\(\)](<#Editor.FocusInterface>) + - [func \(ed \*Editor\) History\(\) \*memento.History](<#Editor.History>) + - [func \(ed \*Editor\) Host\(\) \*engine.Host](<#Editor.Host>) + - [func \(ed \*Editor\) IsInputFocused\(\) bool](<#Editor.IsInputFocused>) + - [func \(ed \*Editor\) OpenCodeEditor\(\)](<#Editor.OpenCodeEditor>) + - [func \(ed \*Editor\) OpenStageInStageWorkspace\(id string\)](<#Editor.OpenStageInStageWorkspace>) + - [func \(ed \*Editor\) Project\(\) \*project.Project](<#Editor.Project>) + - [func \(ed \*Editor\) ProjectFileSystem\(\) \*project\_file\_system.FileSystem](<#Editor.ProjectFileSystem>) + - [func \(ed \*Editor\) RecompileWithPlugins\(plugins \[\]editor\_plugin.PluginInfo, onComplete func\(err error\)\) error](<#Editor.RecompileWithPlugins>) + - [func \(ed \*Editor\) SaveCurrentStage\(\)](<#Editor.SaveCurrentStage>) + - [func \(ed \*Editor\) SaveCurrentStageWithCallback\(cb func\(bool\)\)](<#Editor.SaveCurrentStageWithCallback>) + - [func \(ed \*Editor\) Settings\(\) \*editor\_settings.Settings](<#Editor.Settings>) + - [func \(ed \*Editor\) SettingsWorkspaceSelected\(\)](<#Editor.SettingsWorkspaceSelected>) + - [func \(ed \*Editor\) ShadingWorkspace\(\) \*shading\_workspace.ShadingWorkspace](<#Editor.ShadingWorkspace>) + - [func \(ed \*Editor\) ShadingWorkspaceSelected\(\)](<#Editor.ShadingWorkspaceSelected>) + - [func \(ed \*Editor\) ShowReferences\(id string\)](<#Editor.ShowReferences>) + - [func \(ed \*Editor\) StageView\(\) \*editor\_stage\_view.StageView](<#Editor.StageView>) + - [func \(ed \*Editor\) StageWorkspaceSelected\(\)](<#Editor.StageWorkspaceSelected>) + - [func \(ed \*Editor\) UIWorkspaceSelected\(\)](<#Editor.UIWorkspaceSelected>) + - [func \(ed \*Editor\) UpdateSettings\(\)](<#Editor.UpdateSettings>) + - [func \(ed \*Editor\) VfxWorkspace\(\) \*vfx\_workspace.VfxWorkspace](<#Editor.VfxWorkspace>) + - [func \(ed \*Editor\) VfxWorkspaceSelected\(\)](<#Editor.VfxWorkspaceSelected>) + - [func \(ed \*Editor\) ViewHtmlUi\(id string\)](<#Editor.ViewHtmlUi>) +- [type EditorGame](<#EditorGame>) + - [func \(EditorGame\) ContentDatabase\(\) \(assets.Database, error\)](<#EditorGame.ContentDatabase>) + - [func \(EditorGame\) Launch\(host \*engine.Host\)](<#EditorGame.Launch>) + - [func \(EditorGame\) PluginRegistry\(\) \[\]reflect.Type](<#EditorGame.PluginRegistry>) +- [type WorkspaceState](<#WorkspaceState>) + + +## Constants + + + +```go +const ( + WorkspaceStateNone = WorkspaceState(iota) + WorkspaceStateStage + WorkspaceStateContent + WorkspaceStateShading + WorkspaceStateVfx + WorkspaceStateUI + WorkspaceStateSettings +) +``` + + + +```go +const EditorVersion float64 = 0.0013 +``` + + +## func [RegisterPlugin]() + +```go +func RegisterPlugin(key string, plugin editor_plugin.EditorPlugin) +``` + + + + +## type [Editor]() + +Editor is the entry point structure for the entire editor. It acts as the delegate to the various systems and holds the primary members that make up the bulk of the editor identity. + +The design goal of the editor is different than that of the \[engine.Host\], as it is not intended to be passed around for access to the system. Instead it will supply interface functions that are needed to the systems that it holds internally. + +```go +type Editor struct { + // contains filtered or unexported fields +} +``` + + +### func \(\*Editor\) [BlurInterface]() + +```go +func (ed *Editor) BlurInterface() +``` + +FocusInterface is responsible for disabling the input on the various interfaces that are currently presented to the developer. This primarily includes the menu bar, status bar, and whichever workspace is active. + + +### func \(\*Editor\) [Build]() + +```go +func (ed *Editor) Build(buildMode project.GameBuildMode) +``` + + + + +### func \(\*Editor\) [BuildAndRun]() + +```go +func (ed *Editor) BuildAndRun(buildMode project.GameBuildMode) +``` + + + + +### func \(\*Editor\) [BuildAndRunCurrentStage]() + +```go +func (ed *Editor) BuildAndRunCurrentStage() +``` + + + + +### func \(\*Editor\) [Cache]() + +```go +func (ed *Editor) Cache() *content_database.Cache +``` + + + + +### func \(\*Editor\) [ContentPreviewer]() + +```go +func (ed *Editor) ContentPreviewer() *content_previews.ContentPreviewer +``` + + + + +### func \(\*Editor\) [ContentWorkspaceSelected]() + +```go +func (ed *Editor) ContentWorkspaceSelected() +``` + +ContentWorkspaceSelected will inform the editor that the developer has changed to the content workspace. This is an exposed function to meet the interface needs of \[menu\_bar.MenuBarHandler\]. + + +### func \(\*Editor\) [CreateHtmlUiFile]() + +```go +func (ed *Editor) CreateHtmlUiFile(name string) +``` + + + + +### func \(\*Editor\) [CreateNewCamera]() + +```go +func (ed *Editor) CreateNewCamera() +``` + + + + +### func \(\*Editor\) [CreateNewEntity]() + +```go +func (ed *Editor) CreateNewEntity() +``` + + + + +### func \(\*Editor\) [CreateNewLight]() + +```go +func (ed *Editor) CreateNewLight() +``` + + + + +### func \(\*Editor\) [CreateNewStage]() + +```go +func (ed *Editor) CreateNewStage() +``` + + + + +### func \(\*Editor\) [CreatePluginProject]() + +```go +func (ed *Editor) CreatePluginProject(path string) +``` + + + + +### func \(\*Editor\) [Events]() + +```go +func (ed *Editor) Events() *editor_events.EditorEvents +``` + + + + +### func \(\*Editor\) [FocusInterface]() + +```go +func (ed *Editor) FocusInterface() +``` + +FocusInterface is responsible for enabling the input on the various interfaces that are currently presented to the developer. This primarily includes the menu bar, status bar, and whichever workspace is active. + + +### func \(\*Editor\) [History]() + +```go +func (ed *Editor) History() *memento.History +``` + + + + +### func \(\*Editor\) [Host]() + +```go +func (ed *Editor) Host() *engine.Host +``` + + + + +### func \(\*Editor\) [IsInputFocused]() + +```go +func (ed *Editor) IsInputFocused() bool +``` + + + + +### func \(\*Editor\) [OpenCodeEditor]() + +```go +func (ed *Editor) OpenCodeEditor() +``` + +OpenCodeEditor will run a command specified in CodeEditor settings entry directly to the project top level folder. This is an exposed function to meet the interface needs of \[menu\_bar.MenuBarHandler\]. func \(ed \*Editor\) OpenVSCodeProject\(\) \{ + + +### func \(\*Editor\) [OpenStageInStageWorkspace]() + +```go +func (ed *Editor) OpenStageInStageWorkspace(id string) +``` + + + + +### func \(\*Editor\) [Project]() + +```go +func (ed *Editor) Project() *project.Project +``` + + + + +### func \(\*Editor\) [ProjectFileSystem]() + +```go +func (ed *Editor) ProjectFileSystem() *project_file_system.FileSystem +``` + + + + +### func \(\*Editor\) [RecompileWithPlugins]() + +```go +func (ed *Editor) RecompileWithPlugins(plugins []editor_plugin.PluginInfo, onComplete func(err error)) error +``` + + + + +### func \(\*Editor\) [SaveCurrentStage]() + +```go +func (ed *Editor) SaveCurrentStage() +``` + +SaveCurrentStage will save the currently open stage file. This is an exposed function to meet the interface needs of \[menu\_bar.MenuBarHandler\]. + + +### func \(\*Editor\) [SaveCurrentStageWithCallback]() + +```go +func (ed *Editor) SaveCurrentStageWithCallback(cb func(bool)) +``` + + + + +### func \(\*Editor\) [Settings]() + +```go +func (ed *Editor) Settings() *editor_settings.Settings +``` + + + + +### func \(\*Editor\) [SettingsWorkspaceSelected]() + +```go +func (ed *Editor) SettingsWorkspaceSelected() +``` + +SettingsWorkspaceSelected will inform the editor that the developer has changed to the settings workspace. This is an exposed function to meet the interface needs of \[menu\_bar.MenuBarHandler\]. + + +### func \(\*Editor\) [ShadingWorkspace]() + +```go +func (ed *Editor) ShadingWorkspace() *shading_workspace.ShadingWorkspace +``` + + + + +### func \(\*Editor\) [ShadingWorkspaceSelected]() + +```go +func (ed *Editor) ShadingWorkspaceSelected() +``` + +ShadingWorkspaceSelected will inform the editor that the developer has changed to the shading workspace. This is an exposed function to meet the interface needs of \[menu\_bar.MenuBarHandler\]. + + +### func \(\*Editor\) [ShowReferences]() + +```go +func (ed *Editor) ShowReferences(id string) +``` + + + + +### func \(\*Editor\) [StageView]() + +```go +func (ed *Editor) StageView() *editor_stage_view.StageView +``` + + + + +### func \(\*Editor\) [StageWorkspaceSelected]() + +```go +func (ed *Editor) StageWorkspaceSelected() +``` + +StageWorkspaceSelected will inform the editor that the developer has changed to the stage workspace. This is an exposed function to meet the interface needs of \[menu\_bar.MenuBarHandler\]. + + +### func \(\*Editor\) [UIWorkspaceSelected]() + +```go +func (ed *Editor) UIWorkspaceSelected() +``` + +UIWorkspaceSelected will inform the editor that the developer has changed to the ui workspace. This is an exposed function to meet the interface needs of \[menu\_bar.MenuBarHandler\]. + + +### func \(\*Editor\) [UpdateSettings]() + +```go +func (ed *Editor) UpdateSettings() +``` + + + + +### func \(\*Editor\) [VfxWorkspace]() + +```go +func (ed *Editor) VfxWorkspace() *vfx_workspace.VfxWorkspace +``` + + + + +### func \(\*Editor\) [VfxWorkspaceSelected]() + +```go +func (ed *Editor) VfxWorkspaceSelected() +``` + + + + +### func \(\*Editor\) [ViewHtmlUi]() + +```go +func (ed *Editor) ViewHtmlUi(id string) +``` + + + + +## type [EditorGame]() + +EditorGame satisfies \[bootstrap.GameInterface\] and will allow the engine to bootstrap the editor \(as it would a game\). + +```go +type EditorGame struct{} +``` + + +### func \(EditorGame\) [ContentDatabase]() + +```go +func (EditorGame) ContentDatabase() (assets.Database, error) +``` + + + + +### func \(EditorGame\) [Launch]() + +```go +func (EditorGame) Launch(host *engine.Host) +``` + + + + +### func \(EditorGame\) [PluginRegistry]() + +```go +func (EditorGame) PluginRegistry() []reflect.Type +``` + + + + +## type [WorkspaceState]() + + + +```go +type WorkspaceState = uint8 +``` + +Generated by [gomarkdoc]() diff --git a/docs/api/engine.md b/docs/api/engine.md index 60479ff3f..70b7b98f4 100644 --- a/docs/api/engine.md +++ b/docs/api/engine.md @@ -1,878 +1,1154 @@ -# Package engine - -**Import path:** `kaijuengine.com/engine` - + + +# engine + +```go +import "kaijuengine.com/engine" +``` + +## Index + +- [Constants](<#constants>) +- [Variables](<#variables>) +- [func LoadLaunchParams\(\)](<#LoadLaunchParams>) +- [func ReflectValueFromJson\(v any, f reflect.Value\)](<#ReflectValueFromJson>) +- [func RegisterEntityData\(value EntityData\) error](<#RegisterEntityData>) +- [type Entity](<#Entity>) + - [func NewEntity\(workGroup \*concurrent.WorkGroup\) \*Entity](<#NewEntity>) + - [func \(e \*Entity\) Activate\(\)](<#Entity.Activate>) + - [func \(e \*Entity\) AddNamedData\(key string, data any\)](<#Entity.AddNamedData>) + - [func \(e \*Entity\) ChildAt\(idx int\) \*Entity](<#Entity.ChildAt>) + - [func \(e \*Entity\) ChildCount\(\) int](<#Entity.ChildCount>) + - [func \(e \*Entity\) Copy\(other \*Entity\)](<#Entity.Copy>) + - [func \(e \*Entity\) Deactivate\(\)](<#Entity.Deactivate>) + - [func \(e \*Entity\) DestroyShaderData\(\)](<#Entity.DestroyShaderData>) + - [func \(e \*Entity\) Duplicate\(workGroup \*concurrent.WorkGroup\) \*Entity](<#Entity.Duplicate>) + - [func \(e \*Entity\) FindByName\(name string\) \*Entity](<#Entity.FindByName>) + - [func \(e \*Entity\) ForceCleanup\(\)](<#Entity.ForceCleanup>) + - [func \(e \*Entity\) HasChildRecursive\(child \*Entity\) bool](<#Entity.HasChildRecursive>) + - [func \(e \*Entity\) HasChildren\(\) bool](<#Entity.HasChildren>) + - [func \(e \*Entity\) HasParent\(parent \*Entity\) bool](<#Entity.HasParent>) + - [func \(e \*Entity\) Id\(\) EntityId](<#Entity.Id>) + - [func \(e \*Entity\) IndexOfChild\(child \*Entity\) int](<#Entity.IndexOfChild>) + - [func \(e \*Entity\) Init\(workGroup \*concurrent.WorkGroup\)](<#Entity.Init>) + - [func \(e \*Entity\) IsActive\(\) bool](<#Entity.IsActive>) + - [func \(e \*Entity\) IsDestroyed\(\) bool](<#Entity.IsDestroyed>) + - [func \(e \*Entity\) IsRoot\(\) bool](<#Entity.IsRoot>) + - [func \(e \*Entity\) Name\(\) string](<#Entity.Name>) + - [func \(e \*Entity\) NamedData\(key string\) \[\]any](<#Entity.NamedData>) + - [func \(e \*Entity\) RemoveNamedData\(key string, data any\)](<#Entity.RemoveNamedData>) + - [func \(e \*Entity\) RemoveNamedDataByName\(key string\)](<#Entity.RemoveNamedDataByName>) + - [func \(e \*Entity\) Root\(\) \*Entity](<#Entity.Root>) + - [func \(e \*Entity\) SetActive\(isActive bool\)](<#Entity.SetActive>) + - [func \(e \*Entity\) SetChildrenOrdered\(\)](<#Entity.SetChildrenOrdered>) + - [func \(e \*Entity\) SetChildrenUnordered\(\)](<#Entity.SetChildrenUnordered>) + - [func \(e \*Entity\) SetName\(name string\)](<#Entity.SetName>) + - [func \(e \*Entity\) SetParent\(newParent \*Entity\)](<#Entity.SetParent>) + - [func \(e \*Entity\) ShaderData\(\) rendering.DrawInstance](<#Entity.ShaderData>) + - [func \(e \*Entity\) StoreShaderData\(sd rendering.DrawInstance\)](<#Entity.StoreShaderData>) +- [type EntityData](<#EntityData>) +- [type EntityId](<#EntityId>) +- [type FrameId](<#FrameId>) +- [type Host](<#Host>) + - [func NewHost\(name string, logStream \*logging.LogStream, assetDb assets.Database\) \*Host](<#NewHost>) + - [func \(host \*Host\) AssetDatabase\(\) assets.Database](<#Host.AssetDatabase>) + - [func \(host \*Host\) Audio\(\) \*audio.Audio](<#Host.Audio>) + - [func \(host \*Host\) Close\(\)](<#Host.Close>) + - [func \(host \*Host\) CollisionManager\(\) \*collision\_system.Manager](<#Host.CollisionManager>) + - [func \(h \*Host\) Deadline\(\) \(time.Time, bool\)](<#Host.Deadline>) + - [func \(host \*Host\) DestroyEntity\(entity \*Entity\)](<#Host.DestroyEntity>) + - [func \(h \*Host\) Done\(\) \<\-chan struct\{\}](<#Host.Done>) + - [func \(h \*Host\) Err\(\) error](<#Host.Err>) + - [func \(host \*Host\) FontCache\(\) \*rendering.FontCache](<#Host.FontCache>) + - [func \(host \*Host\) Frame\(\) FrameId](<#Host.Frame>) + - [func \(host \*Host\) Game\(\) any](<#Host.Game>) + - [func \(host \*Host\) ImportPlugins\(path string\) error](<#Host.ImportPlugins>) + - [func \(host \*Host\) Initialize\(width, height, x, y int, platformState any\) error](<#Host.Initialize>) + - [func \(host \*Host\) InitializeAudio\(\) \(err error\)](<#Host.InitializeAudio>) + - [func \(host \*Host\) InitializeRenderer\(\) error](<#Host.InitializeRenderer>) + - [func \(host \*Host\) Lighting\(\) \*lighting.LightingInformation](<#Host.Lighting>) + - [func \(host \*Host\) MaterialCache\(\) \*rendering.MaterialCache](<#Host.MaterialCache>) + - [func \(host \*Host\) MeshCache\(\) \*rendering.MeshCache](<#Host.MeshCache>) + - [func \(host \*Host\) Name\(\) string](<#Host.Name>) + - [func \(host \*Host\) Physics\(\) \*StagePhysics](<#Host.Physics>) + - [func \(host \*Host\) Plugins\(\) \[\]\*plugins.LuaVM](<#Host.Plugins>) + - [func \(host \*Host\) PrimaryCamera\(\) cameras.Camera](<#Host.PrimaryCamera>) + - [func \(host \*Host\) Render\(\)](<#Host.Render>) + - [func \(host \*Host\) RunAfterFrames\(wait int, call func\(\)\)](<#Host.RunAfterFrames>) + - [func \(host \*Host\) RunAfterNextUIClean\(call func\(\)\)](<#Host.RunAfterNextUIClean>) + - [func \(host \*Host\) RunAfterTime\(wait time.Duration, call func\(\)\)](<#Host.RunAfterTime>) + - [func \(host \*Host\) RunBeforeRender\(call func\(\)\)](<#Host.RunBeforeRender>) + - [func \(host \*Host\) RunNextFrame\(call func\(\)\)](<#Host.RunNextFrame>) + - [func \(host \*Host\) RunOnMainThread\(call func\(\)\)](<#Host.RunOnMainThread>) + - [func \(host \*Host\) Runtime\(\) float64](<#Host.Runtime>) + - [func \(h \*Host\) SetFrameRateLimit\(fps int64\)](<#Host.SetFrameRateLimit>) + - [func \(host \*Host\) SetGame\(game any\)](<#Host.SetGame>) + - [func \(host \*Host\) ShaderCache\(\) \*rendering.ShaderCache](<#Host.ShaderCache>) + - [func \(host \*Host\) StartPhysics\(\)](<#Host.StartPhysics>) + - [func \(host \*Host\) Teardown\(\)](<#Host.Teardown>) + - [func \(host \*Host\) TextureCache\(\) \*rendering.TextureCache](<#Host.TextureCache>) + - [func \(host \*Host\) Threads\(\) \*concurrent.Threads](<#Host.Threads>) + - [func \(host \*Host\) UICamera\(\) cameras.Camera](<#Host.UICamera>) + - [func \(host \*Host\) UIThreads\(\) \*concurrent.Threads](<#Host.UIThreads>) + - [func \(host \*Host\) Update\(deltaTime float64\)](<#Host.Update>) + - [func \(h \*Host\) Value\(key any\) any](<#Host.Value>) + - [func \(h \*Host\) WaitForFrameRate\(\)](<#Host.WaitForFrameRate>) + - [func \(host \*Host\) WorkGroup\(\) \*concurrent.WorkGroup](<#Host.WorkGroup>) +- [type LaunchParameters](<#LaunchParameters>) +- [type StagePhysics](<#StagePhysics>) + - [func \(p \*StagePhysics\) AddEntity\(entity \*Entity, body \*physics.RigidBody\)](<#StagePhysics.AddEntity>) + - [func \(p \*StagePhysics\) Destroy\(\)](<#StagePhysics.Destroy>) + - [func \(p \*StagePhysics\) FindCollision\(hit physics.CollisionHit\) \(\*StagePhysicsEntry, bool\)](<#StagePhysics.FindCollision>) + - [func \(p \*StagePhysics\) IsActive\(\) bool](<#StagePhysics.IsActive>) + - [func \(p \*StagePhysics\) Start\(\)](<#StagePhysics.Start>) + - [func \(p \*StagePhysics\) Update\(threads \*concurrent.Threads, deltaTime float64\)](<#StagePhysics.Update>) + - [func \(p \*StagePhysics\) World\(\) \*physics.World](<#StagePhysics.World>) +- [type StagePhysicsEntry](<#StagePhysicsEntry>) +- [type UpdateId](<#UpdateId>) + - [func \(u \*UpdateId\) IsValid\(\) bool](<#UpdateId.IsValid>) +- [type Updater](<#Updater>) + - [func NewConcurrentUpdater\(threads \*concurrent.Threads\) Updater](<#NewConcurrentUpdater>) + - [func NewUpdater\(\) Updater](<#NewUpdater>) + - [func \(u \*Updater\) AddUpdate\(update func\(float64\)\) UpdateId](<#Updater.AddUpdate>) + - [func \(u \*Updater\) Destroy\(\)](<#Updater.Destroy>) + - [func \(u \*Updater\) IsConcurrent\(\) bool](<#Updater.IsConcurrent>) + - [func \(u \*Updater\) RemoveUpdate\(id \*UpdateId\)](<#Updater.RemoveUpdate>) + - [func \(u \*Updater\) Update\(deltaTime float64\)](<#Updater.Update>) ## Constants - -### const ( + ```go -DefaultWindowWidth = 1280 -DefaultWindowHeight = 720 +const ( + DefaultWindowWidth = 1280 + DefaultWindowHeight = 720 +) ``` -) -### const InvalidFrameId = math.MaxUint64 +InvalidFrameId can be used to indicate that a frame id is invalid ```go - InvalidFrameId can be used to indicate that a frame id is invalid +const InvalidFrameId = math.MaxUint64 ``` - - ## Variables + -### var DebugEntityDataRegistry = map[string]EntityData{} +```go +var DebugEntityDataRegistry = map[string]EntityData{} +``` -### var LaunchParams = LaunchParameters{} + +```go +var LaunchParams = LaunchParameters{} +``` -## Functions + +## func [LoadLaunchParams]() +```go +func LoadLaunchParams() +``` -### func LoadLaunchParams() -### func ReflectValueFromJson(v any, f reflect.Value) -### func RegisterEntityData(value EntityData) error + +## func [ReflectValueFromJson]() +```go +func ReflectValueFromJson(v any, f reflect.Value) +``` -## Types -### type Entity struct { + +## func [RegisterEntityData]() ```go -Transform matrix.Transform -Parent *Entity -Children []*Entity +func RegisterEntityData(value EntityData) error ``` -```go -OnDestroy events.Event -OnDestroyRequested events.Event -OnActivate events.Event -OnDeactivate events.Event -``` + +## type [Entity]() + +Entity is a struct that represents an arbitrary object in the host system. It contains a 3D transformation and can be a parent of, or a child to, other entities. Entities can also contain arbitrary named data to make it easier to access data that is specific to the entity. + +Child entities are unordered by default, you'll need to call \#Entity.SetChildrenOrdered to make them ordered. It is recommended to leave children unordered unless you have a specific reason to order them. ```go -// Has unexported fields. -``` +type Entity struct { + Transform matrix.Transform + Parent *Entity + Children []*Entity + OnDestroy events.Event + OnDestroyRequested events.Event + OnActivate events.Event + OnDeactivate events.Event + // contains filtered or unexported fields } -```go - Entity is a struct that represents an arbitrary object in the host system. - It contains a 3D transformation and can be a parent of, or a child to, - other entities. Entities can also contain arbitrary named data to make it - easier to access data that is specific to the entity. ``` + +### func [NewEntity]() ```go - Child entities are unordered by default, you'll need to call - #Entity.SetChildrenOrdered to make them ordered. It is recommended to leave - children unordered unless you have a specific reason to order them. +func NewEntity(workGroup *concurrent.WorkGroup) *Entity ``` +NewEntity creates a new \#Entity struct and returns it -### func NewEntity(workGroup *concurrent.WorkGroup) *Entity + +### func \(\*Entity\) [Activate]() ```go - NewEntity creates a new #Entity struct and returns it +func (e *Entity) Activate() ``` +Activate will set an active flag on the entity that can be queried with \#Entity.IsActive. It will also set the active flag on all children of the entity. If the entity is already active, this function will do nothing. -### func (e *Entity) Activate() + +### func \(\*Entity\) [AddNamedData]() ```go - Activate will set an active flag on the entity that can be queried with - #Entity.IsActive. It will also set the active flag on all children of the - entity. If the entity is already active, this function will do nothing. +func (e *Entity) AddNamedData(key string, data any) ``` +AddNamedData allows you to add arbitrary data to the entity that can be accessed by a string key. This is useful for storing data that is specific to the entity. + +Named data is stored in a map of slices, so you can add multiple pieces of data to the same key. It is recommended to compile the data into a single structure so the slice length is 1, but sometimes that's not reasonable. -### func (e *Entity) AddNamedData(key string, data any) + +### func \(\*Entity\) [ChildAt]() ```go - AddNamedData allows you to add arbitrary data to the entity that can be - accessed by a string key. This is useful for storing data that is specific - to the entity. +func (e *Entity) ChildAt(idx int) *Entity ``` +ChildAt returns the child entity at the specified index + + +### func \(\*Entity\) [ChildCount]() ```go - Named data is stored in a map of slices, so you can add multiple pieces of - data to the same key. It is recommended to compile the data into a single - structure so the slice length is 1, but sometimes that's not reasonable. +func (e *Entity) ChildCount() int ``` +ChildCount returns the number of children the entity has -### func (e *Entity) ChildAt(idx int) *Entity + +### func \(\*Entity\) [Copy]() ```go - ChildAt returns the child entity at the specified index +func (e *Entity) Copy(other *Entity) ``` -### func (e *Entity) ChildCount() int + + +### func \(\*Entity\) [Deactivate]() ```go - ChildCount returns the number of children the entity has +func (e *Entity) Deactivate() ``` +Deactivate will set an active flag on the entity that can be queried with \#Entity.IsActive. It will also set the active flag on all children of the entity. If the entity is already inactive, this function will do nothing. -### func (e *Entity) Copy(other *Entity) + +### func \(\*Entity\) [DestroyShaderData]() +```go +func (e *Entity) DestroyShaderData() +``` -### func (e *Entity) Deactivate() + + + +### func \(\*Entity\) [Duplicate]() ```go - Deactivate will set an active flag on the entity that can be queried with - #Entity.IsActive. It will also set the active flag on all children of the - entity. If the entity is already inactive, this function will do nothing. +func (e *Entity) Duplicate(workGroup *concurrent.WorkGroup) *Entity ``` -### func (e *Entity) DestroyShaderData() + +### func \(\*Entity\) [FindByName]() -### func (e *Entity) Duplicate(workGroup *concurrent.WorkGroup) *Entity +```go +func (e *Entity) FindByName(name string) *Entity +``` +FindByName will search the entity and the tree of children for the first entity with the specified name. If no entity is found, nil will be returned. -### func (e *Entity) FindByName(name string) *Entity + +### func \(\*Entity\) [ForceCleanup]() ```go - FindByName will search the entity and the tree of children for the first - entity with the specified name. If no entity is found, nil will be returned. +func (e *Entity) ForceCleanup() ``` +ForceCleanup will force the full cleanup of the entity, typically this is to be called in very specific scenarios and not directly in game code. Unless there is a good reason \(like this entity no longer bein gin the host\). -### func (e *Entity) ForceCleanup() + +### func \(\*Entity\) [HasChildRecursive]() ```go - ForceCleanup will force the full cleanup of the entity, typically this is to - be called in very specific scenarios and not directly in game code. Unless - there is a good reason (like this entity no longer bein gin the host). +func (e *Entity) HasChildRecursive(child *Entity) bool ``` -### func (e *Entity) HasChildRecursive(child *Entity) bool - -### func (e *Entity) HasChildren() bool + +### func \(\*Entity\) [HasChildren]() ```go - HasChildren returns true if the entity has any children +func (e *Entity) HasChildren() bool ``` +HasChildren returns true if the entity has any children -### func (e *Entity) HasParent(parent *Entity) bool + +### func \(\*Entity\) [HasParent]() ```go - HasParent will loop through each parent and determine if any of them is the - parent Entity supplied. If so, then it will return true, false otherwise. +func (e *Entity) HasParent(parent *Entity) bool ``` +HasParent will loop through each parent and determine if any of them is the parent Entity supplied. If so, then it will return true, false otherwise. -### func (e *Entity) Id() EntityId + +### func \(\*Entity\) [Id]() ```go - ID returns the unique identifier of the entity. The Id is only valid for - entities that are not generated through template instantiation. The Id may - also be stripped during game runtime if the entity is never externally - referenced by any other part of the system. +func (e *Entity) Id() EntityId ``` +ID returns the unique identifier of the entity. The Id is only valid for entities that are not generated through template instantiation. The Id may also be stripped during game runtime if the entity is never externally referenced by any other part of the system. -### func (e *Entity) IndexOfChild(child *Entity) int + +### func \(\*Entity\) [IndexOfChild]() +```go +func (e *Entity) IndexOfChild(child *Entity) int +``` -### func (e *Entity) Init(workGroup *concurrent.WorkGroup) -### func (e *Entity) IsActive() bool + +### func \(\*Entity\) [Init]() ```go - IsActive will return true if the entity is active, false otherwise +func (e *Entity) Init(workGroup *concurrent.WorkGroup) ``` -### func (e *Entity) IsDestroyed() bool + + +### func \(\*Entity\) [IsActive]() ```go - IsDestroyed will return true if the entity is destroyed, false otherwise +func (e *Entity) IsActive() bool ``` +IsActive will return true if the entity is active, false otherwise -### func (e *Entity) IsRoot() bool + +### func \(\*Entity\) [IsDestroyed]() ```go - IsRoot returns true if the entity is the root entity in the hierarchy +func (e *Entity) IsDestroyed() bool ``` +IsDestroyed will return true if the entity is destroyed, false otherwise -### func (e *Entity) Name() string + +### func \(\*Entity\) [IsRoot]() ```go - Name returns the name of the entity +func (e *Entity) IsRoot() bool ``` +IsRoot returns true if the entity is the root entity in the hierarchy -### func (e *Entity) NamedData(key string) []any + +### func \(\*Entity\) [Name]() ```go - NamedData will return the data associated with the specified key. If the key - does not exist, nil will be returned. +func (e *Entity) Name() string ``` +Name returns the name of the entity -### func (e *Entity) RemoveNamedData(key string, data any) + +### func \(\*Entity\) [NamedData]() ```go - RemoveNamedData will remove the specified data from the entity's named data - map. If the key does not exist, this function will do nothing. +func (e *Entity) NamedData(key string) []any ``` +NamedData will return the data associated with the specified key. If the key does not exist, nil will be returned. + + +### func \(\*Entity\) [RemoveNamedData]() ```go - *This will remove the entire slice and all of it's data* +func (e *Entity) RemoveNamedData(key string, data any) ``` +RemoveNamedData will remove the specified data from the entity's named data map. If the key does not exist, this function will do nothing. + +\*This will remove the entire slice and all of it's data\* -### func (e *Entity) RemoveNamedDataByName(key string) + +### func \(\*Entity\) [RemoveNamedDataByName]() ```go - RemoveNamedDataByName will remove all of the stored named data that matches - the given key on the entity +func (e *Entity) RemoveNamedDataByName(key string) ``` +RemoveNamedDataByName will remove all of the stored named data that matches the given key on the entity -### func (e *Entity) Root() *Entity + +### func \(\*Entity\) [Root]() ```go - Root will return the root entity of the entity's hierarchy +func (e *Entity) Root() *Entity ``` +Root will return the root entity of the entity's hierarchy -### func (e *Entity) SetActive(isActive bool) + +### func \(\*Entity\) [SetActive]() ```go - SetActive will set the active flag on the entity that can be queried with - #Entity.IsActive. It will also set the active flag on all children of the - entity. If the entity is already active, this function will do nothing. +func (e *Entity) SetActive(isActive bool) ``` +SetActive will set the active flag on the entity that can be queried with \#Entity.IsActive. It will also set the active flag on all children of the entity. If the entity is already active, this function will do nothing. -### func (e *Entity) SetChildrenOrdered() + +### func \(\*Entity\) [SetChildrenOrdered]() ```go - SetChildrenOrdered sets the children of the entity to be ordered +func (e *Entity) SetChildrenOrdered() ``` +SetChildrenOrdered sets the children of the entity to be ordered -### func (e *Entity) SetChildrenUnordered() + +### func \(\*Entity\) [SetChildrenUnordered]() ```go - SetChildrenUnordered sets the children of the entity to be unordered +func (e *Entity) SetChildrenUnordered() ``` +SetChildrenUnordered sets the children of the entity to be unordered -### func (e *Entity) SetName(name string) + +### func \(\*Entity\) [SetName]() ```go - SetName sets the name of the entity +func (e *Entity) SetName(name string) ``` +SetName sets the name of the entity -### func (e *Entity) SetParent(newParent *Entity) + +### func \(\*Entity\) [SetParent]() ```go - SetParent will set the parent of the entity. If the entity already has - a parent, it will be removed from the parent's children list. If the new - parent is nil, the entity will be removed from the hierarchy and will become - the root entity. If the new parent is not nil, the entity will be added to - the new parent's children list. If the new parent is not active, the entity - will be deactivated as well. +func (e *Entity) SetParent(newParent *Entity) ``` +SetParent will set the parent of the entity. If the entity already has a parent, it will be removed from the parent's children list. If the new parent is nil, the entity will be removed from the hierarchy and will become the root entity. If the new parent is not nil, the entity will be added to the new parent's children list. If the new parent is not active, the entity will be deactivated as well. + +This will also handle the transformation parenting internally + + +### func \(\*Entity\) [ShaderData]() ```go - This will also handle the transformation parenting internally +func (e *Entity) ShaderData() rendering.DrawInstance ``` -### func (e *Entity) ShaderData() rendering.DrawInstance + +### func \(\*Entity\) [StoreShaderData]() -### func (e *Entity) StoreShaderData(sd rendering.DrawInstance) +```go +func (e *Entity) StoreShaderData(sd rendering.DrawInstance) +``` -### type EntityData interface { -```go -Init(entity *Entity, host *Host) -``` + +## type [EntityData]() -} -### type EntityId string ```go - EntityId is a string that represents a unique identifier for an entity. - The identifier is only valid for entities that are not generated through - template instantiation. The identifier may also be stripped during game - runtime if the entity is never externally referenced by any other part of - the system. +type EntityData interface { + Init(entity *Entity, host *Host) +} ``` + +## type [EntityId]() -### type FrameId = uint64 +EntityId is a string that represents a unique identifier for an entity. The identifier is only valid for entities that are not generated through template instantiation. The identifier may also be stripped during game runtime if the entity is never externally referenced by any other part of the system. ```go - FrameId is a unique identifier for a frame +type EntityId string ``` + +## type [FrameId]() -### type Host struct { +FrameId is a unique identifier for a frame ```go -Window *windowing.Window -LogStream *logging.LogStream +type FrameId = uint64 ``` + +## type [Host]() + +Host is the mediator to the entire runtime for the game/editor. It is the main entry point for the game loop and is responsible for managing all entities, the window, and the rendering context. The host can be used to create and manage entities, call update functions on the main thread, and access various caches and resources. + +The host is expected to be passed around quite often throughout the program. It is designed to remove things like service locators, singletons, and other global state. You can have multiple hosts in a program to isolate things like windows and game state. ```go -Cameras hostCameras +type Host struct { + Window *windowing.Window + LogStream *logging.LogStream + + Cameras hostCameras + + Drawings rendering.Drawings + + Closing bool + UIUpdater Updater + UILateUpdater Updater + Updater Updater + LateUpdater Updater + + OnClose events.Event + CloseSignal chan struct{} + // contains filtered or unexported fields +} ``` + +### func [NewHost]() ```go -Drawings rendering.Drawings +func NewHost(name string, logStream *logging.LogStream, assetDb assets.Database) *Host ``` +NewHost creates a new host with the given name and log stream. The log stream is the log handler that is used by the slog package functions. A Host that is created through NewHost has no function until \#Host.Initialize is called. + +This is primarily called from \#host\_container/New + + +### func \(\*Host\) [AssetDatabase]() ```go -Closing bool -UIUpdater Updater -UILateUpdater Updater -Updater Updater -LateUpdater Updater +func (host *Host) AssetDatabase() assets.Database ``` +AssetDatabase returns the asset database for the host + + +### func \(\*Host\) [Audio]() ```go -OnClose events.Event -CloseSignal chan struct{} +func (host *Host) Audio() *audio.Audio ``` +Audio returns the audio system for the host + + +### func \(\*Host\) [Close]() ```go -// Has unexported fields. +func (host *Host) Close() ``` -} +Close will set the closing flag to true and signal the host to clean up resources and close the window. + + +### func \(\*Host\) [CollisionManager]() + ```go - Host is the mediator to the entire runtime for the game/editor. It is the - main entry point for the game loop and is responsible for managing all - entities, the window, and the rendering context. The host can be used to - create and manage entities, call update functions on the main thread, - and access various caches and resources. +func (host *Host) CollisionManager() *collision_system.Manager ``` +CollisionManager returns the collision manager for this host + + +### func \(\*Host\) [Deadline]() ```go - The host is expected to be passed around quite often throughout the program. - It is designed to remove things like service locators, singletons, and other - global state. You can have multiple hosts in a program to isolate things - like windows and game state. +func (h *Host) Deadline() (time.Time, bool) ``` +Deadline is here to fulfil context.Context and will return zero and false -### func NewHost(name string, logStream *logging.LogStream, assetDb assets.Database) *Host + +### func \(\*Host\) [DestroyEntity]() ```go - NewHost creates a new host with the given name and log stream. The log - stream is the log handler that is used by the slog package functions. A Host - that is created through NewHost has no function until #Host.Initialize is - called. +func (host *Host) DestroyEntity(entity *Entity) ``` +DestroyEntity marks the given entity for destruction. The entity will be cleaned up at the beginning of the next frame. + + +### func \(\*Host\) [Done]() ```go - This is primarily called from #host_container/New +func (h *Host) Done() <-chan struct{} ``` +Done is here to fulfil context.Context and will cose the CloseSignal channel -### func (host *Host) AssetDatabase() assets.Database + +### func \(\*Host\) [Err]() ```go - AssetDatabase returns the asset database for the host +func (h *Host) Err() error ``` +Err is here to fulfil context.Context and will return nil or context.Canceled -### func (host *Host) Audio() *audio.Audio + +### func \(\*Host\) [FontCache]() ```go - Audio returns the audio system for the host +func (host *Host) FontCache() *rendering.FontCache ``` +FontCache returns the font cache for the host -### func (host *Host) Close() + +### func \(\*Host\) [Frame]() ```go - Close will set the closing flag to true and signal the host to clean up - resources and close the window. +func (host *Host) Frame() FrameId ``` +Frame will return the current frame id -### func (host *Host) CollisionManager() *collision_system.Manager + +### func \(\*Host\) [Game]() ```go - CollisionManager returns the collision manager for this host +func (host *Host) Game() any ``` +Game will return the primary game mediator for the running application. In the editor, this would be \*\[editor.Editor\], in the running game, this will be the \*game\_host.GameHost structure that is generated by the editor and filled out by the developer. -### func (h *Host) Deadline() (time.Time, bool) + +### func \(\*Host\) [ImportPlugins]() ```go - Deadline is here to fulfil context.Context and will return zero and false +func (host *Host) ImportPlugins(path string) error ``` +ImportPlugins will read all of the plugins that are in the specified folder and prepare them for execution. -### func (host *Host) DestroyEntity(entity *Entity) + +### func \(\*Host\) [Initialize]() ```go - DestroyEntity marks the given entity for destruction. The entity will be - cleaned up at the beginning of the next frame. +func (host *Host) Initialize(width, height, x, y int, platformState any) error ``` +Initializes the various systems and caches that are mediated through the host. This includes the window, the shader cache, the texture cache, the mesh cache, and the font cache, and the camera systems. -### func (h *Host) Done() <-chan struct{} + +### func \(\*Host\) [InitializeAudio]() ```go - Done is here to fulfil context.Context and will cose the CloseSignal channel +func (host *Host) InitializeAudio() (err error) ``` -### func (h *Host) Err() error + + +### func \(\*Host\) [InitializeRenderer]() ```go - Err is here to fulfil context.Context and will return nil or - context.Canceled +func (host *Host) InitializeRenderer() error ``` -### func (host *Host) FontCache() *rendering.FontCache + + +### func \(\*Host\) [Lighting]() ```go - FontCache returns the font cache for the host +func (host *Host) Lighting() *lighting.LightingInformation ``` +Lighting returns a pointer to the internal lighting information -### func (host *Host) Frame() FrameId + +### func \(\*Host\) [MaterialCache]() ```go - Frame will return the current frame id +func (host *Host) MaterialCache() *rendering.MaterialCache ``` +MaterialCache returns the font cache for the host -### func (host *Host) Game() any + +### func \(\*Host\) [MeshCache]() ```go - Game will return the primary game mediator for the running application. - In the editor, this would be *[editor.Editor], in the running game, this - will be the *game_host.GameHost structure that is generated by the editor - and filled out by the developer. +func (host *Host) MeshCache() *rendering.MeshCache ``` +MeshCache returns the mesh cache for the host -### func (host *Host) ImportPlugins(path string) error + +### func \(\*Host\) [Name]() ```go - ImportPlugins will read all of the plugins that are in the specified folder - and prepare them for execution. +func (host *Host) Name() string ``` +Name returns the name of the host -### func (host *Host) Initialize(width, height, x, y int, platformState any) error + +### func \(\*Host\) [Physics]() ```go - Initializes the various systems and caches that are mediated through the - host. This includes the window, the shader cache, the texture cache, - the mesh cache, and the font cache, and the camera systems. +func (host *Host) Physics() *StagePhysics ``` +Physics returns the stage physics system -### func (host *Host) InitializeAudio() (err error) - + +### func \(\*Host\) [Plugins]() -### func (host *Host) InitializeRenderer() error +```go +func (host *Host) Plugins() []*plugins.LuaVM +``` +Plugins returns all of the loaded plugins for the host -### func (host *Host) Lighting() *lighting.LightingInformation + +### func \(\*Host\) [PrimaryCamera]() ```go - Lighting returns a pointer to the internal lighting information +func (host *Host) PrimaryCamera() cameras.Camera ``` -### func (host *Host) MaterialCache() *rendering.MaterialCache + + +### func \(\*Host\) [Render]() ```go - MaterialCache returns the font cache for the host +func (host *Host) Render() ``` +Render will render the scene. This starts by preparing any drawings that are pending. It also creates any pending shaders, textures, and meshes before the start of the render. The frame is then readied, buffers swapped, and any transformations that are dirty on entities are then cleaned. -### func (host *Host) MeshCache() *rendering.MeshCache + +### func \(\*Host\) [RunAfterFrames]() ```go - MeshCache returns the mesh cache for the host +func (host *Host) RunAfterFrames(wait int, call func()) ``` +RunAfterFrames will call the given function after the given number of frames have passed from the current frame -### func (host *Host) Name() string + +### func \(\*Host\) [RunAfterNextUIClean]() ```go - Name returns the name of the host +func (host *Host) RunAfterNextUIClean(call func()) ``` +RunAfterNextUIClean will run the given function on the next frame. -### func (host *Host) Physics() *StagePhysics + +### func \(\*Host\) [RunAfterTime]() ```go - Physics returns the stage physics system +func (host *Host) RunAfterTime(wait time.Duration, call func()) ``` +RunAfterTime will call the given function after the given number of time has passed from the current frame -### func (host *Host) Plugins() []*plugins.LuaVM + +### func \(\*Host\) [RunBeforeRender]() ```go - Plugins returns all of the loaded plugins for the host +func (host *Host) RunBeforeRender(call func()) ``` -### func (host *Host) PrimaryCamera() cameras.Camera - -### func (host *Host) Render() + +### func \(\*Host\) [RunNextFrame]() ```go - Render will render the scene. This starts by preparing any drawings that - are pending. It also creates any pending shaders, textures, and meshes - before the start of the render. The frame is then readied, buffers swapped, - and any transformations that are dirty on entities are then cleaned. +func (host *Host) RunNextFrame(call func()) ``` +RunNextFrame will run the given function on the next frame. This is the same as calling RunAfterFrames\(0, func\(\)\{\}\) -### func (host *Host) RunAfterFrames(wait int, call func()) + +### func \(\*Host\) [RunOnMainThread]() ```go - RunAfterFrames will call the given function after the given number of frames - have passed from the current frame +func (host *Host) RunOnMainThread(call func()) ``` -### func (host *Host) RunAfterNextUIClean(call func()) + + +### func \(\*Host\) [Runtime]() ```go - RunAfterNextUIClean will run the given function on the next frame. +func (host *Host) Runtime() float64 ``` +Runtime will return how long the host has been running in seconds -### func (host *Host) RunAfterTime(wait time.Duration, call func()) + +### func \(\*Host\) [SetFrameRateLimit]() ```go - RunAfterTime will call the given function after the given number of time has - passed from the current frame +func (h *Host) SetFrameRateLimit(fps int64) ``` +SetFrameRateLimit will set the frame rate limit for the host. If the frame rate is set to 0, then the frame rate limit will be removed. -### func (host *Host) RunBeforeRender(call func()) +If a frame rate is set, then the host will block until the desired frame rate is reached before continuing the update loop. - -### func (host *Host) RunNextFrame(call func()) + +### func \(\*Host\) [SetGame]() ```go - RunNextFrame will run the given function on the next frame. This is the same - as calling RunAfterFrames(0, func(){}) +func (host *Host) SetGame(game any) ``` +SetGame is to be called by the engine in most cases. It is called by the editor when it first starts up to setup the editor game binding. For a game generated by the editor, it will be called when the game is bootstrapped and provide the \*game\_host.GameHost structure. You can call this function at any time you want, but you really only should need to for special cases. -### func (host *Host) RunOnMainThread(call func()) - - -### func (host *Host) Runtime() float64 + +### func \(\*Host\) [ShaderCache]() ```go - Runtime will return how long the host has been running in seconds +func (host *Host) ShaderCache() *rendering.ShaderCache ``` +ShaderCache returns the shader cache for the host -### func (h *Host) SetFrameRateLimit(fps int64) + +### func \(\*Host\) [StartPhysics]() ```go - SetFrameRateLimit will set the frame rate limit for the host. If the frame - rate is set to 0, then the frame rate limit will be removed. +func (host *Host) StartPhysics() ``` + + +### func \(\*Host\) [Teardown]() + ```go - If a frame rate is set, then the host will block until the desired frame - rate is reached before continuing the update loop. +func (host *Host) Teardown() ``` +Teardown will destroy the host and all of its resources. This will also execute the OnClose event. This will also signal the CloseSignal channel. -### func (host *Host) SetGame(game any) + +### func \(\*Host\) [TextureCache]() ```go - SetGame is to be called by the engine in most cases. It is called by the - editor when it first starts up to setup the editor game binding. For a game - generated by the editor, it will be called when the game is bootstrapped and - provide the *game_host.GameHost structure. You can call this function at any - time you want, but you really only should need to for special cases. +func (host *Host) TextureCache() *rendering.TextureCache ``` +TextureCache returns the texture cache for the host -### func (host *Host) ShaderCache() *rendering.ShaderCache + +### func \(\*Host\) [Threads]() ```go - ShaderCache returns the shader cache for the host +func (host *Host) Threads() *concurrent.Threads ``` +Threads returns the long\-running threads for this instance of host -### func (host *Host) StartPhysics() - - -### func (host *Host) Teardown() + +### func \(\*Host\) [UICamera]() ```go - Teardown will destroy the host and all of its resources. This will also - execute the OnClose event. This will also signal the CloseSignal channel. +func (host *Host) UICamera() cameras.Camera ``` -### func (host *Host) TextureCache() *rendering.TextureCache + + +### func \(\*Host\) [UIThreads]() ```go - TextureCache returns the texture cache for the host +func (host *Host) UIThreads() *concurrent.Threads ``` +UIThreads returns the long\-running threads for the UI -### func (host *Host) Threads() *concurrent.Threads + +### func \(\*Host\) [Update]() ```go - Threads returns the long-running threads for this instance of host +func (host *Host) Update(deltaTime float64) ``` +Update is the main update loop for the host. This will poll the window for events, update the entities, and render the scene. This will also check if the window has been closed or crashed and set the closing flag accordingly. + +The update order is FrameRunner \-\> Update \-\> LateUpdate \-\> EndUpdate: -### func (host *Host) UICamera() cameras.Camera +\[\-\] FrameRunner: Functions added to RunAfterFrames \[\-\] UIUpdate: Functions added to UIUpdater \[\-\] UILateUpdate: Functions added to UILateUpdater \[\-\] Update: Functions added to Updater \[\-\] LateUpdate: Functions added to LateUpdater \[\-\] EndUpdate: Internal functions for preparing for the next frame +Any destroyed entities will also be ticked for their cleanup. This will also tick the editor entities for cleanup. -### func (host *Host) UIThreads() *concurrent.Threads + +### func \(\*Host\) [Value]() ```go - UIThreads returns the long-running threads for the UI +func (h *Host) Value(key any) any ``` +Value is here to fulfil context.Context and will always return nil -### func (host *Host) Update(deltaTime float64) + +### func \(\*Host\) [WaitForFrameRate]() ```go - Update is the main update loop for the host. This will poll the window for - events, update the entities, and render the scene. This will also check if - the window has been closed or crashed and set the closing flag accordingly. +func (h *Host) WaitForFrameRate() ``` +WaitForFrameRate will block until the desired frame rate limit is reached -```go - The update order is FrameRunner -> Update -> LateUpdate -> EndUpdate: -``` - + +### func \(\*Host\) [WorkGroup]() ```go - [-] FrameRunner: Functions added to RunAfterFrames [-] UIUpdate: Functions - added to UIUpdater [-] UILateUpdate: Functions added to UILateUpdater - [-] Update: Functions added to Updater [-] LateUpdate: Functions added to - LateUpdater [-] EndUpdate: Internal functions for preparing for the next - frame +func (host *Host) WorkGroup() *concurrent.WorkGroup ``` +WorkGroup returns the work group for this instance of host -```go - Any destroyed entities will also be ticked for their cleanup. This will also - tick the editor entities for cleanup. -``` + +## type [LaunchParameters]() -### func (h *Host) Value(key any) any ```go - Value is here to fulfil context.Context and will always return nil +type LaunchParameters struct { + Generate string + StartStage string + Trace bool + RecordPGO bool + AutoTest bool +} ``` + +## type [StagePhysics]() + -### func (h *Host) WaitForFrameRate() ```go - WaitForFrameRate will block until the desired frame rate limit is reached +type StagePhysics struct { + // contains filtered or unexported fields +} ``` - -### func (host *Host) WorkGroup() *concurrent.WorkGroup + +### func \(\*StagePhysics\) [AddEntity]() ```go - WorkGroup returns the work group for this instance of host +func (p *StagePhysics) AddEntity(entity *Entity, body *physics.RigidBody) ``` -### type LaunchParameters struct { + + +### func \(\*StagePhysics\) [Destroy]() ```go -Generate string -StartStage string -Trace bool -RecordPGO bool -AutoTest bool +func (p *StagePhysics) Destroy() ``` -} -### type StagePhysics struct { + + +### func \(\*StagePhysics\) [FindCollision]() ```go -// Has unexported fields. +func (p *StagePhysics) FindCollision(hit physics.CollisionHit) (*StagePhysicsEntry, bool) ``` -} - -### func (p *StagePhysics) AddEntity(entity *Entity, body *physics.RigidBody) -### func (p *StagePhysics) Destroy() + +### func \(\*StagePhysics\) [IsActive]() +```go +func (p *StagePhysics) IsActive() bool +``` -### func (p *StagePhysics) FindCollision(hit physics.CollisionHit) (*StagePhysicsEntry, bool) -### func (p *StagePhysics) IsActive() bool + +### func \(\*StagePhysics\) [Start]() +```go +func (p *StagePhysics) Start() +``` -### func (p *StagePhysics) Start() -### func (p *StagePhysics) Update(threads *concurrent.Threads, deltaTime float64) + +### func \(\*StagePhysics\) [Update]() +```go +func (p *StagePhysics) Update(threads *concurrent.Threads, deltaTime float64) +``` -### func (p *StagePhysics) World() *physics.World -### type StagePhysicsEntry struct { + +### func \(\*StagePhysics\) [World]() ```go -Entity *Entity -Body *physics.RigidBody +func (p *StagePhysics) World() *physics.World ``` -} - -### type UpdateId int -### func (u *UpdateId) IsValid() bool + +## type [StagePhysicsEntry]() -### type Updater struct { ```go -// Has unexported fields. +type StagePhysicsEntry struct { + Entity *Entity + Body *physics.RigidBody +} ``` -} + +## type [UpdateId]() + + + ```go - Updater is a struct that stores update functions to be called when the - #Updater.Update function is called. This simply goes through the list from - top to bottom and calls each function. +type UpdateId int ``` + +### func \(\*UpdateId\) [IsValid]() ```go - *Note that update functions are unordered, so don't rely on the order* +func (u *UpdateId) IsValid() bool ``` -### func NewConcurrentUpdater(threads *concurrent.Threads) Updater -```go - NewConcurrentUpdater creates a new concurrent #Updater struct and returns it -``` + +## type [Updater]() +Updater is a struct that stores update functions to be called when the \#Updater.Update function is called. This simply goes through the list from top to bottom and calls each function. -### func NewUpdater() Updater +\*Note that update functions are unordered, so don't rely on the order\* ```go - NewUpdater creates a new #Updater struct and returns it +type Updater struct { + // contains filtered or unexported fields +} ``` - -### func (u *Updater) AddUpdate(update func(float64)) UpdateId + +### func [NewConcurrentUpdater]() ```go - AddUpdate adds an update function to the list of updates to be called when - the #Updater.Update function is called. It returns the id of the update - function that was added so that it can be removed later. +func NewConcurrentUpdater(threads *concurrent.Threads) Updater ``` +NewConcurrentUpdater creates a new concurrent \#Updater struct and returns it + + +### func [NewUpdater]() ```go - The update function is added to a back-buffer so it will not begin updating - until the next call to #Updater.Update. +func NewUpdater() Updater ``` +NewUpdater creates a new \#Updater struct and returns it -### func (u *Updater) Destroy() + +### func \(\*Updater\) [AddUpdate]() ```go - Destroy cleans up the updater and should be called when the updater is no - longer needed. It will close the pending and complete channels and clear the - updates map. +func (u *Updater) AddUpdate(update func(float64)) UpdateId ``` +AddUpdate adds an update function to the list of updates to be called when the \#Updater.Update function is called. It returns the id of the update function that was added so that it can be removed later. + +The update function is added to a back\-buffer so it will not begin updating until the next call to \#Updater.Update. -### func (u *Updater) IsConcurrent() bool + +### func \(\*Updater\) [Destroy]() ```go - IsConcurrent will return if this updater is a concurrent updater +func (u *Updater) Destroy() ``` +Destroy cleans up the updater and should be called when the updater is no longer needed. It will close the pending and complete channels and clear the updates map. -### func (u *Updater) RemoveUpdate(id *UpdateId) + +### func \(\*Updater\) [IsConcurrent]() ```go - RemoveUpdate removes an update function from the list of updates to be - called when the #Updater.Update function is called. It takes the id of the - update function that was returned when the update function was added. +func (u *Updater) IsConcurrent() bool ``` +IsConcurrent will return if this updater is a concurrent updater + + +### func \(\*Updater\) [RemoveUpdate]() ```go - The update function is removed from a back-buffer so it will not be removed - until the next call to #Updater.Update. +func (u *Updater) RemoveUpdate(id *UpdateId) ``` +RemoveUpdate removes an update function from the list of updates to be called when the \#Updater.Update function is called. It takes the id of the update function that was returned when the update function was added. + +The update function is removed from a back\-buffer so it will not be removed until the next call to \#Updater.Update. -### func (u *Updater) Update(deltaTime float64) + +### func \(\*Updater\) [Update]() ```go - Update calls all of the update functions that have been added to the - updater. It takes a deltaTime parameter that is the approximate amount of - time since the last call to #Updater.Update. +func (u *Updater) Update(deltaTime float64) ``` +Update calls all of the update functions that have been added to the updater. It takes a deltaTime parameter that is the approximate amount of time since the last call to \#Updater.Update. - +Generated by [gomarkdoc]() diff --git a/docs/api/engine_ui.md b/docs/api/engine_ui.md deleted file mode 100644 index 7667748bc..000000000 --- a/docs/api/engine_ui.md +++ /dev/null @@ -1,1087 +0,0 @@ -# Package engine/ui - -**Import path:** `kaijuengine.com/engine/ui` - - - -## Constants - - -### const ( - -```go -EventTypeInvalid = EventType(iota) -EventTypeEnter -EventTypeMove -EventTypeExit -EventTypeClick -EventTypeRightClick -EventTypeDoubleClick -EventTypeDown -EventTypeUp -EventTypeRightDown -EventTypeRightUp -EventTypeMiss -EventTypeDragStart -EventTypeDrop -EventTypeDropEnter -EventTypeDropExit -EventTypeDragEnd -EventTypeScroll -EventTypeRebuild -EventTypeDestroy -EventTypeFocus -EventTypeBlur -EventTypeSubmit -EventTypeChange -EventTypeRender -EventTypeKeyDown -EventTypeKeyUp -EventTypeEnd -``` - -) -### const ( - -```go -InputTypeDefault = iota -InputTypeText -InputTypeNumber -InputTypePhone -InputTypeDatetime -``` - -) -### const ( - -```go -PositioningStatic = Positioning(iota) -PositioningAbsolute -PositioningFixed -PositioningRelative -PositioningSticky -``` - -) -### const ( - -```go -PanelScrollDirectionNone = 0x00 -PanelScrollDirectionVertical = 0x01 -PanelScrollDirectionHorizontal = 0x02 -PanelScrollDirectionBoth = 0x03 -``` - -) -### const ( - -```go -BorderStyleNone = iota -BorderStyleHidden -BorderStyleDotted -BorderStyleDashed -BorderStyleSolid -BorderStyleDouble -BorderStyleGroove -BorderStyleRidge -BorderStyleInset -BorderStyleOutset -``` - -) -### const ( - -```go -ContentFitNone = iota -ContentFitWidth -ContentFitHeight -ContentFitBoth -``` - -) -### const ( - -```go -OverflowScroll = iota -OverflowVisible -OverflowHidden -``` - -) -### const ( - -```go -DirtyTypeNone = iota -DirtyTypeLayout -DirtyTypeResize -DirtyTypeGenerated -DirtyTypeColorChange -DirtyTypeScissor -DirtyTypeParent -DirtyTypeParentLayout -DirtyTypeParentResize -DirtyTypeParentGenerated -DirtyTypeParentReGenerated -DirtyTypeParentColorChange -DirtyTypeParentScissor -``` - -) -### const ( - -```go -ElementTypeLabel = ElementType(iota) -ElementTypePanel -ElementTypeButton -ElementTypeCheckbox -ElementTypeImage -ElementTypeInput -ElementTypeProgressBar -ElementTypeSelect -ElementTypeSlider -``` - -) -### const ( - -```go -EntityDataName = "ui" -``` - -) -### const ( - -```go -LabelFontSize = 14.0 -``` - -) - -## Variables - - -### var UIScrollSpeed float32 = 20 - - -## Types - - -### type BasicStylizer struct { - -```go -Parent weak.Pointer[UI] -``` - -} - -### type BorderStyle = int32 - - -### type Button Panel - - -### func (b *Button) Base() *UI - - -### func (b *Button) ButtonData() *buttonData - - -### func (b *Button) Init(texture *rendering.Texture, text string) - - -### func (b *Button) Label() *Label - - -### func (b *Button) SetColor(color matrix.Color) - - -### type Checkbox Panel - - -### func (cb *Checkbox) Base() *UI - - -### func (cb *Checkbox) CheckboxData() *checkboxData - - -### func (cb *Checkbox) Init() - - -### func (cb *Checkbox) IsChecked() bool - - -### func (cb *Checkbox) SetChecked(isChecked bool) - - -### func (cb *Checkbox) SetCheckedWithoutEvent(isChecked bool) - - -### type ContentFit = int32 - - -### type DirtyType = int - - -### type ElementType = uint8 - - -### type EventType = int - - -### type Group struct { - -```go -// Has unexported fields. -``` - -} - -### func (group *Group) Attach(host *engine.Host) - - -### func (group *Group) Detach(host *engine.Host) - - -### func (group *Group) HasRequests() bool - - -### func (group *Group) IsFocusedOnInput() bool - - -### func (g *Group) SetThreaded() - - -### type Image Panel - - -### func (s *Image) Base() *UI - - -### func (img *Image) Frame() int - - -### func (s *Image) ImageData() *imageData - - -### func (s *Image) Init(texture *rendering.Texture) - - -### func (s *Image) InitFlipbook(framesPerSecond float32, textures []*rendering.Texture) - - -### func (s *Image) InitSpriteSheet(framesPerSecond float32, texture *rendering.Texture, jsonStr string) - - -### func (img *Image) PlayAnimation() - - -### func (img *Image) SetFlipBookAnimation(framesPerSecond float32, textures ...*rendering.Texture) - - -### func (img *Image) SetFrame(index int) - - -### func (img *Image) SetFrameRate(framesPerSecond float32) - - -### func (img *Image) SetSpriteSheet(framesPerSecond float32, texture *rendering.Texture, jsonStr string) - - -### func (img *Image) SetTexture(texture *rendering.Texture) - - -### func (img *Image) StopAnimation() - - -### type Input Panel - - -### func (input *Input) Base() *UI - - -### func (input *Input) Focus() - - -### func (input *Input) Init(placeholderText string) - - -### func (input *Input) InputData() *inputData - - -### func (input *Input) InsertText(text string) - - -### func (input *Input) IsFocused() bool - - -### func (input *Input) RemoveFocus() - - -### func (input *Input) SelectAll() - - -### func (input *Input) SetBGColor(newColor matrix.Color) - - -### func (input *Input) SetCursorColor(newColor matrix.Color) - - -### func (input *Input) SetCursorOffset(offset int) - - -### func (input *Input) SetDescription(text string) - - -### func (input *Input) SetFGColor(newColor matrix.Color) - - -### func (input *Input) SetFontFace(face rendering.FontFace) - - -### func (input *Input) SetFontSize(fontSize float32) - - -### func (input *Input) SetFontStyle(style string) - - -### func (input *Input) SetFontWeight(weight string) - - -### func (input *Input) SetNextFocusedInput(next *Input) - - -### func (input *Input) SetPlaceholder(text string) - - -### func (input *Input) SetSelectColor(newColor matrix.Color) - - -### func (input *Input) SetText(text string) - - -### func (input *Input) SetTextWithoutEvent(text string) - - -### func (input *Input) SetTitle(text string) - - -### func (input *Input) SetType(inputType InputType) - - -### func (input *Input) Text() string - - -### type InputType = int32 - - -### type Label UI - - -### func (l *Label) Base() *UI - - -### func (label *Label) BoldRange(start, end int) - - -### func (label *Label) CalculateMaxWidth() float32 - - -### func (label *Label) Clone(to *Label) - - -### func (label *Label) ColorRange(start, end int, newColor, bgColor matrix.Color) - - -### func (label *Label) EnforceBGColor(color matrix.Color) - - -### func (label *Label) EnforceFGColor(color matrix.Color) - - -### func (label *Label) FontFace() rendering.FontFace - - -### func (label *Label) FontSize() float32 - - -### func (label *Label) Hide() - - -### func (label *Label) Init(text string) - - -### func (l *Label) LabelData() *labelData - - -### func (label *Label) LineHeight() float32 - - -### func (label *Label) MaxWidth() float32 - - -### func (label *Label) Measure() matrix.Vec2 - - -### func (label *Label) SetBGColor(newColor matrix.Color) - - -### func (label *Label) SetBaseline(baseline rendering.FontBaseline) - - -### func (label *Label) SetColor(newColor matrix.Color) - - -### func (label *Label) SetFontFace(face rendering.FontFace) - - -### func (label *Label) SetFontSize(size float32) - - -### func (label *Label) SetFontStyle(style string) - - -### func (label *Label) SetFontWeight(weight string) - - -### func (label *Label) SetJustify(justify rendering.FontJustify) - - -### func (label *Label) SetLineHeight(height float32) - - -### func (label *Label) SetMaxWidth(maxWidth float32) - - -### func (label *Label) SetText(text string) - - -### func (label *Label) SetWidthAutoHeight(width float32) - - -### func (label *Label) SetWrap(wrapText bool) - - -### func (label *Label) Show() - - -### func (label *Label) Text() string - - -### func (label *Label) UnEnforceBGColor() - - -### func (label *Label) UnEnforceFGColor() - - -### type Layout struct { - -```go -Stylizer LayoutStylizer -// Has unexported fields. -``` - -} - -### func (l *Layout) Border() matrix.Vec4 - - -### func (l *Layout) CalcOffset() matrix.Vec2 - - -### func (l *Layout) ClearStyles() - - -### func (l *Layout) ContentSize() matrix.Vec2 - - -### func (l *Layout) InnerOffset() matrix.Vec4 - - -### func (l *Layout) LocalInnerOffset() matrix.Vec4 - - -### func (l *Layout) Margin() matrix.Vec4 - - -### func (l *Layout) Offset() matrix.Vec2 - - -### func (l *Layout) Padding() matrix.Vec4 - - -### func (l *Layout) PixelSize() matrix.Vec2 - - -### func (l *Layout) Positioning() Positioning - - -### func (l *Layout) Scale(width, height float32) bool - - -### func (l *Layout) ScaleHeight(height float32) bool - - -### func (l *Layout) ScaleWidth(width float32) bool - - -### func (l *Layout) SetBorder(left, top, right, bottom float32) - - -### func (l *Layout) SetInnerOffset(left, top, right, bottom float32) - - -### func (l *Layout) SetInnerOffsetBottom(offset float32) - - -### func (l *Layout) SetInnerOffsetLeft(offset float32) - - -### func (l *Layout) SetInnerOffsetRight(offset float32) - - -### func (l *Layout) SetInnerOffsetTop(offset float32) - - -### func (l *Layout) SetLocalInnerOffset(left, top, right, bottom float32) - - -### func (l *Layout) SetMargin(left, top, right, bottom float32) - - -### func (l *Layout) SetOffset(x, y float32) - - -### func (l *Layout) SetOffsetX(x float32) - - -### func (l *Layout) SetOffsetY(y float32) - - -### func (l *Layout) SetPadding(left, top, right, bottom float32) - - -### func (l *Layout) SetPositioning(pos Positioning) - - -### func (l *Layout) SetRowLayoutOffset(offset matrix.Vec2) - - -### func (l *Layout) SetZ(z float32) - - -### func (l *Layout) Ui() *UI - - -### func (l *Layout) Z() float32 - - -### type LayoutStylizer interface { - -```go -ProcessStyle(layout *Layout) []error -``` - -} - -### type LeftStylizer struct{ BasicStylizer } - - -### func (s LeftStylizer) ProcessStyle(layout *Layout) []error - - -### type Manager struct { - -```go -Host *engine.Host -Group Group -``` - - -```go -// Has unexported fields. -``` - -} - -### func (man *Manager) Add() *UI - - -### func (man *Manager) Clear() - - -### func (man *Manager) DisableUpdate() - - -### func (man *Manager) EnableUpdate() - - -### func (man *Manager) Hovered() []*UI - - -### func (man *Manager) Init(host *engine.Host) - - -### func (man *Manager) IsUpdateDisabled() bool - - -### func (man *Manager) Remove(ui *UI) - - -### func (man *Manager) Reserve(additionalElements int) - - -### type Overflow = int - - -### type Panel UI - - -### func FirstPanelOnEntity(entity *engine.Entity) *Panel - - -### func (p *Panel) AddChild(target *UI) - - -### func (p *Panel) AllowClickThrough() - - -### func (p *Panel) Background() *rendering.Texture - - -### func (p *Panel) Base() *UI - - -### func (p *Panel) BorderColor() [4]matrix.Color - - -### func (p *Panel) BorderSize() matrix.Vec4 - - -### func (p *Panel) BorderStyle() [4]BorderStyle - - -### func (p *Panel) Child(index int) *UI - - -### func (p *Panel) Color() matrix.Color - - -### func (p *Panel) DisableDragScroll() - - -### func (p *Panel) DontFitContent() - - -### func (p *Panel) DontFitContentHeight() - - -### func (p *Panel) DontFitContentWidth() - - -### func (p *Panel) EnableDragScroll() - - -### func (p *Panel) EnforceColor(color matrix.Color) - - -### func (p *Panel) FitContent() - - -### func (p *Panel) FitContentHeight() - - -### func (p *Panel) FitContentWidth() - - -### func (p *Panel) FittingContent() bool - - -### func (p *Panel) FittingContentHeight() bool - - -### func (p *Panel) FittingContentWidth() bool - - -### func (p *Panel) Freeze() - - -### func (p *Panel) HasBackground() bool - - -### func (p *Panel) HasEnforcedColor() bool - - -### func (panel *Panel) Init(texture *rendering.Texture, elmType ElementType) - - -### func (p *Panel) InsertChild(target *UI, idx int) - - -### func (p *Panel) IsFrozen() bool - - -### func (p *Panel) IsScrolling() bool - - -### func (p *Panel) MaxScroll() matrix.Vec2 - - -### func (p *Panel) Overflow() Overflow - - -### func (p *Panel) PanelData() *panelData - - -### func (p *Panel) RemoveBackground() - - -### func (p *Panel) RemoveChild(target *UI) - - -### func (p *Panel) ResetScroll() - - -### func (p *Panel) ScrollDirection() PanelScrollDirection - - -### func (p *Panel) ScrollToChild(child *UI) - - -### func (p *Panel) ScrollX() float32 - - -### func (p *Panel) ScrollY() float32 - - -### func (p *Panel) SetBackground(tex *rendering.Texture) - - -### func (p *Panel) SetBorderColor(left, top, right, bottom matrix.Color) - - -### func (p *Panel) SetBorderRadius(topLeft, topRight, bottomRight, bottomLeft float32) - - -### func (p *Panel) SetBorderRadiusBottomLeft(r float32) - - -### func (p *Panel) SetBorderRadiusBottomRight(r float32) - - -### func (p *Panel) SetBorderRadiusTopLeft(r float32) - - -### func (p *Panel) SetBorderRadiusTopRight(r float32) - - -### func (p *Panel) SetBorderSize(left, top, right, bottom float32) - - -### func (p *Panel) SetBorderStyle(left, top, right, bottom BorderStyle) - - -### func (p *Panel) SetColor(bgColor matrix.Color) - - -### func (p *Panel) SetMaterial(mat *rendering.Material) - - -### func (p *Panel) SetOverflow(overflow Overflow) - - -### func (p *Panel) SetScrollDirection(direction PanelScrollDirection) - - -### func (p *Panel) SetScrollX(value float32) - - -### func (p *Panel) SetScrollY(value float32) - - -### func (p *Panel) SetUseBlending(useBlending bool) - - -### func (p *Panel) UnEnforceColor() - - -### func (p *Panel) UnFreeze() - - -### type PanelScrollDirection = int32 - - -### type Positioning = int - - -### type ProgressBar Panel - - -### func (p *ProgressBar) Base() *UI - - -### func (p *ProgressBar) Init(fgTexture, bgTexture *rendering.Texture) - - -### func (b *ProgressBar) SetBGColor(bgColor matrix.Color) - - -### func (b *ProgressBar) SetFGColor(fgColor matrix.Color) - - -### func (b *ProgressBar) SetValue(value float32) - - -### func (b ProgressBar) Value() float32 - - -### type RightStylizer struct{ BasicStylizer } - - -### func (s RightStylizer) ProcessStyle(layout *Layout) []error - - -### type Select Panel - - -### func (s *Select) AddOption(name, value string) - - -### func (s *Select) Base() *UI - - -### func (s *Select) ClearOptions() - - -### func (s *Select) Init(text string, options []SelectOption) - - -### func (s *Select) Name() string - - -### func (s *Select) PickOption(index int) - - -### func (s *Select) PickOptionByLabel(label string) - - -### func (s *Select) PickOptionByLabelWithoutEvent(label string) - - -### func (s *Select) PickOptionWithoutEvent(index int) bool - - -### func (s *Select) SelectData() *selectData - - -### func (s *Select) SetColor(newColor matrix.Color) - - -### func (s *Select) SetOptionsColor(newColor matrix.Color) - - -### func (s *Select) Value() string - - -### type SelectOption struct { - -```go -Name string -Value string -// Has unexported fields. -``` - -} - -### type ShaderData struct { - -```go -rendering.ShaderDataBase -UVs matrix.Vec4 -FgColor matrix.Color -BgColor matrix.Color -Scissor matrix.Vec4 -Size2D matrix.Vec4 -BorderRadius matrix.Vec4 -BorderSize matrix.Vec4 -BorderColor [4]matrix.Color -BorderLen matrix.Vec2 -``` - -} - -### func (s ShaderData) Size() int - - -### type Slider Panel - - -### func (s *Slider) Base() *UI - - -### func (slider *Slider) Delta() float32 - - -### func (s *Slider) Init() - - -### func (slider *Slider) SetBGColor(bgColor matrix.Color) - - -### func (slider *Slider) SetFGColor(fgColor matrix.Color) - - -### func (slider *Slider) SetValue(value float32) - - -### func (slider *Slider) SetValueWithoutEvent(value float32) - - -### func (s *Slider) SliderData() *sliderData - - -### func (slider *Slider) Value() float32 - - -### type StretchCenterStylizer struct{ BasicStylizer } - - -### func (s StretchCenterStylizer) ProcessStyle(layout *Layout) []error - - -### type StretchHeightStylizer struct{ BasicStylizer } - - -### func (s StretchHeightStylizer) ProcessStyle(layout *Layout) []error - - -### type StretchWidthStylizer struct{ BasicStylizer } - - -### func (s StretchWidthStylizer) ProcessStyle(layout *Layout) []error - - -### type TriangleStylizer RightStylizer - - -### func (t TriangleStylizer) ProcessStyle(layout *Layout) []error - - -### type UI struct { - -```go -// Has unexported fields. -``` - -} - -### func AllOnEntity(entity *engine.Entity) []*UI - - -### func FirstOnEntity(entity *engine.Entity) *UI - - -### func (ui *UI) AddEvent(evtType EventType, evt func()) events.Id - - -### func (ui *UI) Clean() - - -### func (ui *UI) Clone(parent *engine.Entity) *UI - - -### func (ui *UI) Entity() *engine.Entity - - -### func (ui *UI) Event(evtType EventType) *events.Event - - -### func (ui *UI) ExecuteEvent(evtType EventType) bool - - -### func (ui *UI) FindByName(name string) *UI - - -### func (ui *UI) GenerateScissor() - - -### func (ui *UI) Hide() - - -### func (ui *UI) Host() *engine.Host - - -### func (ui *UI) IsActive() bool - - -### func (ui *UI) IsDown() bool - - -### func (ui *UI) IsInFrontOf(other *UI) bool - - -### func (ui *UI) IsType(elmType ElementType) bool - - -### func (ui *UI) IsValid() bool - - -### func (ui *UI) Layout() *Layout - - -### func (ui *UI) RemoveEvent(evtType EventType, evtId events.Id) - - -### func (ui *UI) SetDirty(dirtyType DirtyType) - - -### func (ui *UI) SetDontClean(val bool) - - -### func (ui *UI) ShaderData() *ShaderData - - -### func (ui *UI) Show() - - -### func (u *UI) ToButton() *Button - - -### func (u *UI) ToCheckbox() *Checkbox - - -### func (u *UI) ToImage() *Image - - -### func (u *UI) ToInput() *Input - - -### func (u *UI) ToLabel() *Label - - -### func (u *UI) ToPanel() *Panel - - -### func (u *UI) ToProgressBar() *ProgressBar - - -### func (u *UI) ToSelect() *Select - - -### func (u *UI) ToSlider() *Slider - - -### func (ui *UI) Type() ElementType - - -### func (ui *UI) Update(deltaTime float64) - - -### type UIElementData interface { - -```go -// Has unexported methods. -``` - -} - - diff --git a/docs/api/framework.md b/docs/api/framework.md new file mode 100644 index 000000000..9337a4a0c --- /dev/null +++ b/docs/api/framework.md @@ -0,0 +1,417 @@ + + +# framework + +```go +import "kaijuengine.com/framework" +``` + +## Index + +- [func CreateDrawingFromMeshUnlit\(host \*engine.Host, mesh \*rendering.Mesh, textures \[\]\*rendering.Texture\) \(rendering.Drawing, error\)](<#CreateDrawingFromMeshUnlit>) +- [func CreateDrawingFromMeshUnlitTransparent\(host \*engine.Host, mesh \*rendering.Mesh, textures \[\]\*rendering.Texture\) \(rendering.Drawing, error\)](<#CreateDrawingFromMeshUnlitTransparent>) +- [func RegisterDrawingSpecification\(spec DrawingSpecification\)](<#RegisterDrawingSpecification>) +- [func SpawnTemplate\(id string, host \*engine.Host, parent \*engine.Entity\) \(\*engine.Entity, error\)](<#SpawnTemplate>) +- [func SpawnTemplateWithTransform\(id string, host \*engine.Host, parent \*engine.Entity, pos, rot, scale matrix.Vec3\) \(\*engine.Entity, error\)](<#SpawnTemplateWithTransform>) +- [type DrawingSpecCreateInfo](<#DrawingSpecCreateInfo>) +- [type DrawingSpecification](<#DrawingSpecification>) + - [func FindDrawingSpecification\(name string\) DrawingSpecification](<#FindDrawingSpecification>) + - [func \(s DrawingSpecification\) CreateDrawings\(host \*engine.Host, info DrawingSpecCreateInfo\) \(ModelDrawingSlice, error\)](<#DrawingSpecification.CreateDrawings>) + - [func \(s DrawingSpecification\) IsValid\(\) bool](<#DrawingSpecification.IsValid>) +- [type DrawingSpecificationRenderInfo](<#DrawingSpecificationRenderInfo>) +- [type EncryptedInt32](<#EncryptedInt32>) + - [func \(e \*EncryptedInt32\) Add\(amount int32\)](<#EncryptedInt32.Add>) + - [func \(e \*EncryptedInt32\) Decrement\(\)](<#EncryptedInt32.Decrement>) + - [func \(e \*EncryptedInt32\) Decrypt\(\)](<#EncryptedInt32.Decrypt>) + - [func \(e \*EncryptedInt32\) Encrypt\(\)](<#EncryptedInt32.Encrypt>) + - [func \(e \*EncryptedInt32\) Increment\(\)](<#EncryptedInt32.Increment>) + - [func \(e \*EncryptedInt32\) SetValue\(value int32\)](<#EncryptedInt32.SetValue>) + - [func \(e \*EncryptedInt32\) Subtract\(amount int32\)](<#EncryptedInt32.Subtract>) + - [func \(e EncryptedInt32\) Value\(\) int32](<#EncryptedInt32.Value>) +- [type ModelDrawing](<#ModelDrawing>) +- [type ModelDrawingSlice](<#ModelDrawingSlice>) + - [func CreateDrawingsBasic\(host \*engine.Host, res load\_result.Result\) \(ModelDrawingSlice, error\)](<#CreateDrawingsBasic>) + - [func CreateDrawingsPBR\(host \*engine.Host, res load\_result.Result\) \(ModelDrawingSlice, error\)](<#CreateDrawingsPBR>) + - [func CreateDrawingsUnlit\(host \*engine.Host, res load\_result.Result\) \(ModelDrawingSlice, error\)](<#CreateDrawingsUnlit>) + - [func CreateDrawingsUnlitTransparent\(host \*engine.Host, res load\_result.Result\) \(ModelDrawingSlice, error\)](<#CreateDrawingsUnlitTransparent>) + - [func \(s ModelDrawingSlice\) AllDrawings\(\) \[\]rendering.Drawing](<#ModelDrawingSlice.AllDrawings>) + - [func \(s ModelDrawingSlice\) AllForNode\(node \*load\_result.Node\) \[\]ModelDrawing](<#ModelDrawingSlice.AllForNode>) +- [type SkinAnimation](<#SkinAnimation>) + - [func NewSkinAnimation\(anim kaiju\_mesh.KaijuMeshAnimation\) SkinAnimation](<#NewSkinAnimation>) + - [func \(a \*SkinAnimation\) CurrentFrame\(\) SkinAnimationFrame](<#SkinAnimation.CurrentFrame>) + - [func \(a \*SkinAnimation\) FindNextFrameForBone\(boneId int32, pathType kaiju\_mesh.AnimationPathType\) \(SkinAnimationFrame, bool\)](<#SkinAnimation.FindNextFrameForBone>) + - [func \(a \*SkinAnimation\) Interpolate\(from, to SkinAnimationFrame\) \[4\]float32](<#SkinAnimation.Interpolate>) + - [func \(a \*SkinAnimation\) IsValid\(\) bool](<#SkinAnimation.IsValid>) + - [func \(a \*SkinAnimation\) NextFrame\(\) SkinAnimationFrame](<#SkinAnimation.NextFrame>) + - [func \(a \*SkinAnimation\) Update\(deltaTime float64\)](<#SkinAnimation.Update>) +- [type SkinAnimationFrame](<#SkinAnimationFrame>) + + + +## func [CreateDrawingFromMeshUnlit]() + +```go +func CreateDrawingFromMeshUnlit(host *engine.Host, mesh *rendering.Mesh, textures []*rendering.Texture) (rendering.Drawing, error) +``` + + + + +## func [CreateDrawingFromMeshUnlitTransparent]() + +```go +func CreateDrawingFromMeshUnlitTransparent(host *engine.Host, mesh *rendering.Mesh, textures []*rendering.Texture) (rendering.Drawing, error) +``` + + + + +## func [RegisterDrawingSpecification]() + +```go +func RegisterDrawingSpecification(spec DrawingSpecification) +``` + + + + +## func [SpawnTemplate]() + +```go +func SpawnTemplate(id string, host *engine.Host, parent *engine.Entity) (*engine.Entity, error) +``` + +SpawnTemplate loads an entity template asset identified by \`id\` from the host's asset database, deserializes it into a \`stages.EntityDescription\` \(using JSON on desktop debug builds or the archive deserializer in other builds\), and creates a new entity configured from that description. If \`parent\` is non\-nil the new entity will be parented to it. The created entity is initialized via \`stages.SetupEntityFromDescription\` and returned, or an error is returned if the asset cannot be read or deserialized. + + +## func [SpawnTemplateWithTransform]() + +```go +func SpawnTemplateWithTransform(id string, host *engine.Host, parent *engine.Entity, pos, rot, scale matrix.Vec3) (*engine.Entity, error) +``` + +SpawnTemplateWithTransform loads an entity template asset identified by \`id\`, creates a new entity from that template \(optionally parented to \`parent\`\), then sets the entity's transform to the provided position, rotation and scale. It is a thin wrapper around \`SpawnTemplate\` that applies the transform before returning the created entity or any encountered error. + +Parameters: + +- id: template asset id to load from the host's asset database +- host: the engine host used to create the entity and read assets +- parent: optional parent entity to attach the new entity to +- pos, rot, scale: transform components applied to the new entity + +Returns the newly created entity or a non\-nil error if the template could not be read or deserialized. + + +## type [DrawingSpecCreateInfo]() + + + +```go +type DrawingSpecCreateInfo struct { + LoadedMesh load_result.Result + Meshes []*rendering.Mesh + Textures []*rendering.Texture + SkipMatSearch bool +} +``` + + +## type [DrawingSpecification]() + + + +```go +type DrawingSpecification struct { + Name string + RenderInfo []DrawingSpecificationRenderInfo +} +``` + + +### func [FindDrawingSpecification]() + +```go +func FindDrawingSpecification(name string) DrawingSpecification +``` + + + + +### func \(DrawingSpecification\) [CreateDrawings]() + +```go +func (s DrawingSpecification) CreateDrawings(host *engine.Host, info DrawingSpecCreateInfo) (ModelDrawingSlice, error) +``` + + + + +### func \(DrawingSpecification\) [IsValid]() + +```go +func (s DrawingSpecification) IsValid() bool +``` + + + + +## type [DrawingSpecificationRenderInfo]() + + + +```go +type DrawingSpecificationRenderInfo struct { + Material string + DataFactory func() rendering.DrawInstance +} +``` + + +## type [EncryptedInt32]() + + + +```go +type EncryptedInt32 struct { + RawValue int32 + // contains filtered or unexported fields +} +``` + + +### func \(\*EncryptedInt32\) [Add]() + +```go +func (e *EncryptedInt32) Add(amount int32) +``` + + + + +### func \(\*EncryptedInt32\) [Decrement]() + +```go +func (e *EncryptedInt32) Decrement() +``` + + + + +### func \(\*EncryptedInt32\) [Decrypt]() + +```go +func (e *EncryptedInt32) Decrypt() +``` + + + + +### func \(\*EncryptedInt32\) [Encrypt]() + +```go +func (e *EncryptedInt32) Encrypt() +``` + + + + +### func \(\*EncryptedInt32\) [Increment]() + +```go +func (e *EncryptedInt32) Increment() +``` + + + + +### func \(\*EncryptedInt32\) [SetValue]() + +```go +func (e *EncryptedInt32) SetValue(value int32) +``` + + + + +### func \(\*EncryptedInt32\) [Subtract]() + +```go +func (e *EncryptedInt32) Subtract(amount int32) +``` + + + + +### func \(EncryptedInt32\) [Value]() + +```go +func (e EncryptedInt32) Value() int32 +``` + + + + +## type [ModelDrawing]() + + + +```go +type ModelDrawing struct { + Node *load_result.Node + MeshName string + Drawing rendering.Drawing +} +``` + + +## type [ModelDrawingSlice]() + + + +```go +type ModelDrawingSlice []ModelDrawing +``` + + +### func [CreateDrawingsBasic]() + +```go +func CreateDrawingsBasic(host *engine.Host, res load_result.Result) (ModelDrawingSlice, error) +``` + + + + +### func [CreateDrawingsPBR]() + +```go +func CreateDrawingsPBR(host *engine.Host, res load_result.Result) (ModelDrawingSlice, error) +``` + + + + +### func [CreateDrawingsUnlit]() + +```go +func CreateDrawingsUnlit(host *engine.Host, res load_result.Result) (ModelDrawingSlice, error) +``` + + + + +### func [CreateDrawingsUnlitTransparent]() + +```go +func CreateDrawingsUnlitTransparent(host *engine.Host, res load_result.Result) (ModelDrawingSlice, error) +``` + + + + +### func \(ModelDrawingSlice\) [AllDrawings]() + +```go +func (s ModelDrawingSlice) AllDrawings() []rendering.Drawing +``` + + + + +### func \(ModelDrawingSlice\) [AllForNode]() + +```go +func (s ModelDrawingSlice) AllForNode(node *load_result.Node) []ModelDrawing +``` + + + + +## type [SkinAnimation]() + + + +```go +type SkinAnimation struct { + Animation kaiju_mesh.KaijuMeshAnimation + // contains filtered or unexported fields +} +``` + + +### func [NewSkinAnimation]() + +```go +func NewSkinAnimation(anim kaiju_mesh.KaijuMeshAnimation) SkinAnimation +``` + + + + +### func \(\*SkinAnimation\) [CurrentFrame]() + +```go +func (a *SkinAnimation) CurrentFrame() SkinAnimationFrame +``` + + + + +### func \(\*SkinAnimation\) [FindNextFrameForBone]() + +```go +func (a *SkinAnimation) FindNextFrameForBone(boneId int32, pathType kaiju_mesh.AnimationPathType) (SkinAnimationFrame, bool) +``` + + + + +### func \(\*SkinAnimation\) [Interpolate]() + +```go +func (a *SkinAnimation) Interpolate(from, to SkinAnimationFrame) [4]float32 +``` + + + + +### func \(\*SkinAnimation\) [IsValid]() + +```go +func (a *SkinAnimation) IsValid() bool +``` + + + + +### func \(\*SkinAnimation\) [NextFrame]() + +```go +func (a *SkinAnimation) NextFrame() SkinAnimationFrame +``` + + + + +### func \(\*SkinAnimation\) [Update]() + +```go +func (a *SkinAnimation) Update(deltaTime float64) +``` + + + + +## type [SkinAnimationFrame]() + + + +```go +type SkinAnimationFrame struct { + Key *kaiju_mesh.AnimKeyFrame + Bone *kaiju_mesh.AnimBone + AbsTime float64 +} +``` + +Generated by [gomarkdoc]() diff --git a/docs/api/index.md b/docs/api/index.md index 387593291..79f1c404a 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1,32 +1,26 @@ -# Kaiju Engine API Documentation +# API Documentation -Auto-generated using go doc. - -## Other - -- [debug](debug.md) +Auto-generated documentation using gomarkdoc. ## Core -- [root](root.md) - [bootstrap](bootstrap.md) -- [matrix](matrix.md) -- [klib](klib.md) ## Engine - [engine](engine.md) -- [engine/ui](engine_ui.md) - -## Platform - -- [platform/windowing](platform_windowing.md) -- [platform/hid](platform_hid.md) -- [platform/audio](platform_audio.md) -- [platform/filesystem](platform_filesystem.md) ## Rendering - [rendering](rendering.md) -- [registry/shader_data_registry](registry_shader_data_registry.md) + +## Other + +- [framework](framework.md) +- [klib](klib.md) +- [Root Package](root.md) +- [debug](debug.md) +- [editor](editor.md) +- [matrix](matrix.md) +- [plugins](plugins.md) diff --git a/docs/api/klib.md b/docs/api/klib.md index 2d5bb833e..09e5c8543 100644 --- a/docs/api/klib.md +++ b/docs/api/klib.md @@ -1,327 +1,1074 @@ -# Package klib + -**Import path:** `kaijuengine.com/klib` +# klib +```go +import "kaijuengine.com/klib" +``` + +## Index + +- [Constants](<#constants>) +- [Variables](<#variables>) +- [func AppendUnique\[T comparable\]\(slice \[\]T, values ...T\) \[\]T](<#AppendUnique>) +- [func BinaryRead\(r io.Reader, data any\) error](<#BinaryRead>) +- [func BinaryReadInt\(r io.Reader\) \(int32, error\)](<#BinaryReadInt>) +- [func BinaryReadLen\(r io.Reader\) \(int32, error\)](<#BinaryReadLen>) +- [func BinaryReadString\(r io.Reader\) \(string, error\)](<#BinaryReadString>) +- [func BinaryReadStringSlice\(r io.Reader\) \(\[\]string, error\)](<#BinaryReadStringSlice>) +- [func BinaryReadVar\[T any\]\(r io.Reader\) \(T, error\)](<#BinaryReadVar>) +- [func BinaryReadVarSlice\[T any\]\(r io.Reader\) \(\[\]T, error\)](<#BinaryReadVarSlice>) +- [func BinaryWrite\(w io.Writer, data any\) error](<#BinaryWrite>) +- [func BinaryWriteInt\(w io.Writer, value int\) error](<#BinaryWriteInt>) +- [func BinaryWriteMap\[K comparable, V any\]\(w io.Writer, data map\[K\]V\) error](<#BinaryWriteMap>) +- [func BinaryWriteMapLen\[K comparable, V any\]\(w io.Writer, data map\[K\]V\) error](<#BinaryWriteMapLen>) +- [func BinaryWriteSlice\[T any\]\(w io.Writer, data \[\]T\) error](<#BinaryWriteSlice>) +- [func BinaryWriteSliceLen\[T any\]\(w io.Writer, data \[\]T\) error](<#BinaryWriteSliceLen>) +- [func BinaryWriteString\(w io.Writer, str string\) error](<#BinaryWriteString>) +- [func BinaryWriteStringSlice\(w io.Writer, data \[\]string\) error](<#BinaryWriteStringSlice>) +- [func ByteArrayToString\(byteArray \[\]byte\) string](<#ByteArrayToString>) +- [func ByteCountToString\(bytes uint64\) string](<#ByteCountToString>) +- [func ByteSliceToFloat32Slice\(data \[\]byte\) \[\]float32](<#ByteSliceToFloat32Slice>) +- [func ByteSliceToUInt16Slice\(data \[\]byte\) \[\]uint16](<#ByteSliceToUInt16Slice>) +- [func CapitalizeFirst\(s string\) string](<#CapitalizeFirst>) +- [func Check\(outError \*error, newError error\) bool](<#Check>) +- [func CheckAll\(res bool\)](<#CheckAll>) +- [func Clamp\[T cmp.Ordered\]\(current, minimum, maximum T\) T](<#Clamp>) +- [func ClampAbs\[T Signed\]\(value, minimum T\) T](<#ClampAbs>) +- [func CleanNumString\(v string\) string](<#CleanNumString>) +- [func Contains\[T comparable\]\(slice \[\]T, item T\) bool](<#Contains>) +- [func ConvertByteSliceType\[T any\]\(slice \[\]byte\) \[\]T](<#ConvertByteSliceType>) +- [func Decrypt\(encryptedData \[\]byte, key \[\]byte\) \(\[\]byte, error\)](<#Decrypt>) +- [func DelayCall\(d time.Duration, f func\(\), ctx context.Context\)](<#DelayCall>) +- [func Encrypt\(rawData \[\]byte, key \[\]byte\) \(\[\]byte, error\)](<#Encrypt>) +- [func ErrorIs\[T error\]\(err error\) bool](<#ErrorIs>) +- [func ExeExtension\(\) string](<#ExeExtension>) +- [func ExtractFromSlice\[T, S any\]\(s \[\]S, expression func\(idx int\) T\) \[\]T](<#ExtractFromSlice>) +- [func FindFirstZeroInByteArray\(arr \[\]byte\) int](<#FindFirstZeroInByteArray>) +- [func FloatEquals\[T Float\]\(a, b T\) bool](<#FloatEquals>) +- [func FormatFloatToNDecimals\[T float32 | float64\]\(f T, decimals int\) string](<#FormatFloatToNDecimals>) +- [func InterfaceUnderlyingPointer\[T any\]\(s T\) unsafe.Pointer](<#InterfaceUnderlyingPointer>) +- [func IsMobile\(\) bool](<#IsMobile>) +- [func JsonDecode\[T any\]\(decoder \*json.Decoder, container \*T\) error](<#JsonDecode>) +- [func MM2PX\[T Number\]\(pixels, mm, targetMM T\) T](<#MM2PX>) +- [func MapJoin\[T comparable, U any\]\(a, b map\[T\]U\) map\[T\]U](<#MapJoin>) +- [func MapKeys\[T comparable, U any\]\(m map\[T\]U\) \[\]T](<#MapKeys>) +- [func MapKeysSorted\[T cmp.Ordered, U any\]\(m map\[T\]U\) \[\]T](<#MapKeysSorted>) +- [func MapValues\[T comparable, U any\]\(m map\[T\]U\) \[\]U](<#MapValues>) +- [func Memcpy\(dst unsafe.Pointer, src unsafe.Pointer, size uint64\)](<#Memcpy>) +- [func Must\(err error\)](<#Must>) +- [func MustReturn\[T any\]\(ret T, err error\) T](<#MustReturn>) +- [func MustReturn2\[T, U any\]\(ret1 T, ret2 U, err error\) \(T, U\)](<#MustReturn2>) +- [func NotYetImplemented\(issueId int\)](<#NotYetImplemented>) +- [func OpenWebsite\(url string\)](<#OpenWebsite>) +- [func PrintStack\(\)](<#PrintStack>) +- [func ReadRootFile\(fs \*os.Root, filePath string\) \(\[\]byte, error\)](<#ReadRootFile>) +- [func RemakeSlice\[S any\]\(s \[\]S\) \[\]S](<#RemakeSlice>) +- [func RemoveNils\[S any\]\(slice \[\]\*S\) \[\]\*S](<#RemoveNils>) +- [func RemoveUnordered\[T any\]\(slice \[\]T, idx int\) \[\]T](<#RemoveUnordered>) +- [func ReplaceStringRecursive\(s string, old string, new string\) string](<#ReplaceStringRecursive>) +- [func Should\(err error\) bool](<#Should>) +- [func ShouldReturn\[T any\]\(ret T, err error\) T](<#ShouldReturn>) +- [func Shuffle\[T any\]\(slice \[\]T, rng \*rand.Rand\)](<#Shuffle>) +- [func ShuffleRandom\[T any\]\(slice \[\]T\)](<#ShuffleRandom>) +- [func SizedStructToByteArray\(s unsafe.Pointer, size int\) \[\]byte](<#SizedStructToByteArray>) +- [func SliceMove\[S any\]\(s \[\]S, from, to int\)](<#SliceMove>) +- [func SliceSetCap\[S any\]\(s \[\]S, amount int\) \[\]S](<#SliceSetCap>) +- [func SliceSetLen\[S any\]\(s \[\]S, newLen int\) \[\]S](<#SliceSetLen>) +- [func SlicesAreTheSame\[S comparable\]\(a \[\]S, b \[\]S\) bool](<#SlicesAreTheSame>) +- [func SlicesRemoveElement\[S comparable\]\(s \[\]S, e S\) \[\]S](<#SlicesRemoveElement>) +- [func SortDirEntries\(entries \[\]os.DirEntry\) \[\]os.DirEntry](<#SortDirEntries>) +- [func StringValueCompare\(a, b string\) int](<#StringValueCompare>) +- [func StringsContainsCaseInsensitive\(s \[\]string, value string\) bool](<#StringsContainsCaseInsensitive>) +- [func StripFloatStringZeros\(fString string\) string](<#StripFloatStringZeros>) +- [func StructSliceToByteArray\[T any\]\(s \[\]T\) \[\]byte](<#StructSliceToByteArray>) +- [func StructToByteArray\[T any\]\(s T\) \[\]byte](<#StructToByteArray>) +- [func TickerWait\(interval, limit time.Duration, condition func\(\) bool\) bool](<#TickerWait>) +- [func ToSnakeCase\(str string\) string](<#ToSnakeCase>) +- [func Trace\(message string\)](<#Trace>) +- [func TraceString\(message string\) string](<#TraceString>) +- [func TraceStrings\(message string, skip int\) \[\]string](<#TraceStrings>) +- [func WipeSlice\[S any\]\(s \[\]S\) \[\]S](<#WipeSlice>) +- [func WriteRootFile\(fs \*os.Root, filePath string, data \[\]byte\) error](<#WriteRootFile>) +- [type Complex](<#Complex>) +- [type ErrorList](<#ErrorList>) + - [func NewErrorList\(\) ErrorList](<#NewErrorList>) + - [func \(e \*ErrorList\) AddAny\(err error\)](<#ErrorList.AddAny>) + - [func \(e \*ErrorList\) Any\(\) bool](<#ErrorList.Any>) + - [func \(e \*ErrorList\) First\(\) error](<#ErrorList.First>) +- [type Float](<#Float>) +- [type Integer](<#Integer>) +- [type Number](<#Number>) +- [type Ordered](<#Ordered>) +- [type Serializable](<#Serializable>) +- [type Set](<#Set>) + - [func NewSet\[T comparable\]\(\) Set\[T\]](<#NewSet>) + - [func \(s Set\[T\]\) Add\(val T\)](<#Set[T].Add>) + - [func \(s Set\[T\]\) Contains\(val T\) bool](<#Set[T].Contains>) + - [func \(s Set\[T\]\) MarshalJSON\(\) \(\[\]byte, error\)](<#Set[T].MarshalJSON>) + - [func \(s Set\[T\]\) Remove\(val T\)](<#Set[T].Remove>) + - [func \(s Set\[T\]\) ToSlice\(\) \[\]T](<#Set[T].ToSlice>) + - [func \(s \*Set\[T\]\) UnmarshalJSON\(data \[\]byte\) error](<#Set[T].UnmarshalJSON>) +- [type Signed](<#Signed>) +- [type SignedInteger](<#SignedInteger>) +- [type Unsigned](<#Unsigned>) ## Constants + + +```go +const ( + ISO8601 = "2006-01-02T15:04:05Z" +) +``` -### const ( +## Variables + + ```go -ISO8601 = "2006-01-02T15:04:05Z" +var OpenWebsiteAndroidFunc func(url string) +``` + + +## func [AppendUnique]() + +```go +func AppendUnique[T comparable](slice []T, values ...T) []T +``` + + + + +## func [BinaryRead]() + +```go +func BinaryRead(r io.Reader, data any) error +``` + + + + +## func [BinaryReadInt]() + +```go +func BinaryReadInt(r io.Reader) (int32, error) +``` + + + + +## func [BinaryReadLen]() + +```go +func BinaryReadLen(r io.Reader) (int32, error) +``` + + + + +## func [BinaryReadString]() + +```go +func BinaryReadString(r io.Reader) (string, error) +``` + + + + +## func [BinaryReadStringSlice]() + +```go +func BinaryReadStringSlice(r io.Reader) ([]string, error) +``` + + + + +## func [BinaryReadVar]() + +```go +func BinaryReadVar[T any](r io.Reader) (T, error) +``` + + + + +## func [BinaryReadVarSlice]() + +```go +func BinaryReadVarSlice[T any](r io.Reader) ([]T, error) ``` -) -## Variables + +## func [BinaryWrite]() -### var OpenWebsiteAndroidFunc func(url string) +```go +func BinaryWrite(w io.Writer, data any) error +``` -## Functions + +## func [BinaryWriteInt]() -### func AppendUnique[T comparable](slice []T, values ...T) []T +```go +func BinaryWriteInt(w io.Writer, value int) error +``` -### func BinaryRead(r io.Reader, data any) error -### func BinaryReadInt(r io.Reader) (int32, error) -### func BinaryReadLen(r io.Reader) (int32, error) + +## func [BinaryWriteMap]() -### func BinaryReadString(r io.Reader) (string, error) +```go +func BinaryWriteMap[K comparable, V any](w io.Writer, data map[K]V) error +``` -### func BinaryReadStringSlice(r io.Reader) ([]string, error) -### func BinaryReadVar[T any](r io.Reader) (T, error) -### func BinaryReadVarSlice[T any](r io.Reader) ([]T, error) + +## func [BinaryWriteMapLen]() -### func BinaryWrite(w io.Writer, data any) error +```go +func BinaryWriteMapLen[K comparable, V any](w io.Writer, data map[K]V) error +``` -### func BinaryWriteInt(w io.Writer, value int) error -### func BinaryWriteMap[K comparable, V any](w io.Writer, data map[K]V) error -### func BinaryWriteMapLen[K comparable, V any](w io.Writer, data map[K]V) error + +## func [BinaryWriteSlice]() -### func BinaryWriteSlice[T any](w io.Writer, data []T) error +```go +func BinaryWriteSlice[T any](w io.Writer, data []T) error +``` -### func BinaryWriteSliceLen[T any](w io.Writer, data []T) error -### func BinaryWriteString(w io.Writer, str string) error -### func BinaryWriteStringSlice(w io.Writer, data []string) error + +## func [BinaryWriteSliceLen]() -### func ByteArrayToString(byteArray []byte) string +```go +func BinaryWriteSliceLen[T any](w io.Writer, data []T) error +``` -### func ByteCountToString(bytes uint64) string -### func ByteSliceToFloat32Slice(data []byte) []float32 -### func ByteSliceToUInt16Slice(data []byte) []uint16 + +## func [BinaryWriteString]() -### func CapitalizeFirst(s string) string +```go +func BinaryWriteString(w io.Writer, str string) error +``` -### func Check(outError *error, newError error) bool -### func CheckAll(res bool) -### func Clamp[T cmp.Ordered](current, minimum, maximum T) T + +## func [BinaryWriteStringSlice]() -### func ClampAbs[T Signed](value, minimum T) T +```go +func BinaryWriteStringSlice(w io.Writer, data []string) error +``` -### func CleanNumString(v string) string -### func Contains[T comparable](slice []T, item T) bool -### func ConvertByteSliceType[T any](slice []byte) []T + +## func [ByteArrayToString]() -### func Decrypt(encryptedData []byte, key []byte) ([]byte, error) +```go +func ByteArrayToString(byteArray []byte) string +``` -### func DelayCall(d time.Duration, f func(), ctx context.Context) -### func Encrypt(rawData []byte, key []byte) ([]byte, error) -### func ErrorIs[T error](err error) bool + +## func [ByteCountToString]() -### func ExeExtension() string +```go +func ByteCountToString(bytes uint64) string +``` -### func ExtractFromSlice[T, S any](s []S, expression func(idx int) T) []T -### func FindFirstZeroInByteArray(arr []byte) int -### func FloatEquals[T Float](a, b T) bool + +## func [ByteSliceToFloat32Slice]() -### func FormatFloatToNDecimals[T float32 | float64](f T, decimals int) string +```go +func ByteSliceToFloat32Slice(data []byte) []float32 +``` -### func InterfaceUnderlyingPointer[T any](s T) unsafe.Pointer -### func IsMobile() bool -### func JsonDecode[T any](decoder *json.Decoder, container *T) error + +## func [ByteSliceToUInt16Slice]() -### func MM2PX[T Number](pixels, mm, targetMM T) T +```go +func ByteSliceToUInt16Slice(data []byte) []uint16 +``` -### func MapJoin[T comparable, U any](a, b map[T]U) map[T]U -### func MapKeys[T comparable, U any](m map[T]U) []T -### func MapKeysSorted[T cmp.Ordered, U any](m map[T]U) []T + +## func [CapitalizeFirst]() -### func MapValues[T comparable, U any](m map[T]U) []U +```go +func CapitalizeFirst(s string) string +``` -### func Memcpy(dst unsafe.Pointer, src unsafe.Pointer, size uint64) -### func Must(err error) -### func MustReturn[T any](ret T, err error) T + +## func [Check]() -### func MustReturn2[T, U any](ret1 T, ret2 U, err error) (T, U) +```go +func Check(outError *error, newError error) bool +``` -### func NotYetImplemented(issueId int) -### func OpenWebsite(url string) -### func PrintStack() + +## func [CheckAll]() + +```go +func CheckAll(res bool) +``` -### func ReadRootFile(fs *os.Root, filePath string) ([]byte, error) -### func RemakeSlice[S any](s []S) []S -### func RemoveNils[S any](slice []*S) []*S + +## func [Clamp]() -### func RemoveUnordered[T any](slice []T, idx int) []T +```go +func Clamp[T cmp.Ordered](current, minimum, maximum T) T +``` -### func ReplaceStringRecursive(s string, old string, new string) string -### func Should(err error) bool -### func ShouldReturn[T any](ret T, err error) T + +## func [ClampAbs]() + +```go +func ClampAbs[T Signed](value, minimum T) T +``` + -### func Shuffle[T any](slice []T, rng *rand.Rand) -### func ShuffleRandom[T any](slice []T) + +## func [CleanNumString]() -### func SizedStructToByteArray(s unsafe.Pointer, size int) []byte +```go +func CleanNumString(v string) string +``` -### func SliceMove[S any](s []S, from, to int) -### func SliceSetCap[S any](s []S, amount int) []S -### func SliceSetLen[S any](s []S, newLen int) []S + +## func [Contains]() -### func SlicesAreTheSame[S comparable](a []S, b []S) bool +```go +func Contains[T comparable](slice []T, item T) bool +``` -### func SlicesRemoveElement[S comparable](s []S, e S) []S -### func SortDirEntries(entries []os.DirEntry) []os.DirEntry -### func StringValueCompare(a, b string) int + +## func [ConvertByteSliceType]() ```go - StringValueCompare compares two strings as integers or floats if possible, - otherwise compares as strings +func ConvertByteSliceType[T any](slice []byte) []T ``` -### func StringsContainsCaseInsensitive(s []string, value string) bool -### func StripFloatStringZeros(fString string) string + +## func [Decrypt]() -### func StructSliceToByteArray[T any](s []T) []byte +```go +func Decrypt(encryptedData []byte, key []byte) ([]byte, error) +``` -### func StructToByteArray[T any](s T) []byte -### func TickerWait(interval, limit time.Duration, condition func() bool) bool -### func ToSnakeCase(str string) string + +## func [DelayCall]() -### func Trace(message string) +```go +func DelayCall(d time.Duration, f func(), ctx context.Context) +``` -### func TraceString(message string) string -### func TraceStrings(message string, skip int) []string -### func WipeSlice[S any](s []S) []S + +## func [Encrypt]() ```go - WipeSlice will clear out the slice before returning [:0]. The purpose - for this is that if there are pointers held within the slice, they hold - their references for as long as they are within the capacity of the slice. - Due to this, pointers are not collected by the GC unless actually wiped out - from the slice. +func Encrypt(rawData []byte, key []byte) ([]byte, error) ``` -### func WriteRootFile(fs *os.Root, filePath string, data []byte) error + +## func [ErrorIs]() -## Types +```go +func ErrorIs[T error](err error) bool +``` -### type Complex interface { + + +## func [ExeExtension]() ```go -~complex64 | ~complex128 +func ExeExtension() string ``` -} -### type ErrorList struct { + + +## func [ExtractFromSlice]() ```go -Errors []error +func ExtractFromSlice[T, S any](s []S, expression func(idx int) T) []T ``` -} -### func NewErrorList() ErrorList + +## func [FindFirstZeroInByteArray]() -### func (e *ErrorList) AddAny(err error) +```go +func FindFirstZeroInByteArray(arr []byte) int +``` -### func (e *ErrorList) Any() bool + +## func [FloatEquals]() + +```go +func FloatEquals[T Float](a, b T) bool +``` -### func (e *ErrorList) First() error -### type Float interface { + +## func [FormatFloatToNDecimals]() ```go -~float32 | ~float64 +func FormatFloatToNDecimals[T float32 | float64](f T, decimals int) string ``` -} -### type Integer interface { + + +## func [InterfaceUnderlyingPointer]() + +```go +func InterfaceUnderlyingPointer[T any](s T) unsafe.Pointer +``` + + + + +## func [IsMobile]() + +```go +func IsMobile() bool +``` + + + + +## func [JsonDecode]() + +```go +func JsonDecode[T any](decoder *json.Decoder, container *T) error +``` + + + + +## func [MM2PX]() + +```go +func MM2PX[T Number](pixels, mm, targetMM T) T +``` + + + + +## func [MapJoin]() + +```go +func MapJoin[T comparable, U any](a, b map[T]U) map[T]U +``` + + + + +## func [MapKeys]() + +```go +func MapKeys[T comparable, U any](m map[T]U) []T +``` + + + + +## func [MapKeysSorted]() + +```go +func MapKeysSorted[T cmp.Ordered, U any](m map[T]U) []T +``` + + + + +## func [MapValues]() + +```go +func MapValues[T comparable, U any](m map[T]U) []U +``` + + + + +## func [Memcpy]() + +```go +func Memcpy(dst unsafe.Pointer, src unsafe.Pointer, size uint64) +``` + + + + +## func [Must]() + +```go +func Must(err error) +``` + + + + +## func [MustReturn]() + +```go +func MustReturn[T any](ret T, err error) T +``` + + + + +## func [MustReturn2]() + +```go +func MustReturn2[T, U any](ret1 T, ret2 U, err error) (T, U) +``` + + + + +## func [NotYetImplemented]() + +```go +func NotYetImplemented(issueId int) +``` + + + + +## func [OpenWebsite]() + +```go +func OpenWebsite(url string) +``` + + + + +## func [PrintStack]() + +```go +func PrintStack() +``` + + + + +## func [ReadRootFile]() + +```go +func ReadRootFile(fs *os.Root, filePath string) ([]byte, error) +``` + + + + +## func [RemakeSlice]() + +```go +func RemakeSlice[S any](s []S) []S +``` + + + + +## func [RemoveNils]() + +```go +func RemoveNils[S any](slice []*S) []*S +``` + + + + +## func [RemoveUnordered]() + +```go +func RemoveUnordered[T any](slice []T, idx int) []T +``` + + + + +## func [ReplaceStringRecursive]() + +```go +func ReplaceStringRecursive(s string, old string, new string) string +``` + + + + +## func [Should]() + +```go +func Should(err error) bool +``` + + + + +## func [ShouldReturn]() + +```go +func ShouldReturn[T any](ret T, err error) T +``` + + + + +## func [Shuffle]() + +```go +func Shuffle[T any](slice []T, rng *rand.Rand) +``` + + + + +## func [ShuffleRandom]() + +```go +func ShuffleRandom[T any](slice []T) +``` + + + + +## func [SizedStructToByteArray]() + +```go +func SizedStructToByteArray(s unsafe.Pointer, size int) []byte +``` + + + + +## func [SliceMove]() + +```go +func SliceMove[S any](s []S, from, to int) +``` + + + + +## func [SliceSetCap]() + +```go +func SliceSetCap[S any](s []S, amount int) []S +``` + + + + +## func [SliceSetLen]() + +```go +func SliceSetLen[S any](s []S, newLen int) []S +``` + + + + +## func [SlicesAreTheSame]() + +```go +func SlicesAreTheSame[S comparable](a []S, b []S) bool +``` + + + + +## func [SlicesRemoveElement]() ```go -SignedInteger | Unsigned +func SlicesRemoveElement[S comparable](s []S, e S) []S ``` + + + +## func [SortDirEntries]() + +```go +func SortDirEntries(entries []os.DirEntry) []os.DirEntry +``` + + + + +## func [StringValueCompare]() + +```go +func StringValueCompare(a, b string) int +``` + +StringValueCompare compares two strings as integers or floats if possible, otherwise compares as strings + + +## func [StringsContainsCaseInsensitive]() + +```go +func StringsContainsCaseInsensitive(s []string, value string) bool +``` + + + + +## func [StripFloatStringZeros]() + +```go +func StripFloatStringZeros(fString string) string +``` + + + + +## func [StructSliceToByteArray]() + +```go +func StructSliceToByteArray[T any](s []T) []byte +``` + + + + +## func [StructToByteArray]() + +```go +func StructToByteArray[T any](s T) []byte +``` + + + + +## func [TickerWait]() + +```go +func TickerWait(interval, limit time.Duration, condition func() bool) bool +``` + + + + +## func [ToSnakeCase]() + +```go +func ToSnakeCase(str string) string +``` + + + + +## func [Trace]() + +```go +func Trace(message string) +``` + + + + +## func [TraceString]() + +```go +func TraceString(message string) string +``` + + + + +## func [TraceStrings]() + +```go +func TraceStrings(message string, skip int) []string +``` + + + + +## func [WipeSlice]() + +```go +func WipeSlice[S any](s []S) []S +``` + +WipeSlice will clear out the slice before returning \[:0\]. The purpose for this is that if there are pointers held within the slice, they hold their references for as long as they are within the capacity of the slice. Due to this, pointers are not collected by the GC unless actually wiped out from the slice. + + +## func [WriteRootFile]() + +```go +func WriteRootFile(fs *os.Root, filePath string, data []byte) error +``` + + + + +## type [Complex]() + + + +```go +type Complex interface { + // contains filtered or unexported methods +} +``` + + +## type [ErrorList]() + + + +```go +type ErrorList struct { + Errors []error } +``` + + +### func [NewErrorList]() + +```go +func NewErrorList() ErrorList +``` + -### type Number interface { + + +### func \(\*ErrorList\) [AddAny]() + +```go +func (e *ErrorList) AddAny(err error) +``` + + + + +### func \(\*ErrorList\) [Any]() ```go -Integer | Float | Complex +func (e *ErrorList) Any() bool ``` + + + +### func \(\*ErrorList\) [First]() + +```go +func (e *ErrorList) First() error +``` + + + + +## type [Float]() + + + +```go +type Float interface { + // contains filtered or unexported methods } +``` + + +## type [Integer]() + -### type Ordered interface { ```go -Integer | Float | ~string +type Integer interface { + // contains filtered or unexported methods +} ``` + +## type [Number]() + + + +```go +type Number interface { + // contains filtered or unexported methods } +``` + + +## type [Ordered]() + -### type Serializable interface { ```go -Serialize(stream io.Writer) -Deserialize(stream io.Reader) +type Ordered interface { + // contains filtered or unexported methods +} ``` + +## type [Serializable]() + + + +```go +type Serializable interface { + Serialize(stream io.Writer) + Deserialize(stream io.Reader) } +``` + + +## type [Set]() + + + +```go +type Set[T comparable] map[T]struct{} +``` -### type Set[T comparable] map[T]struct{} + +### func [NewSet]() +```go +func NewSet[T comparable]() Set[T] +``` -### func NewSet[T comparable]() Set[T] -### func (s Set[T]) Add(val T) + +### func \(Set\[T\]\) [Add]() +```go +func (s Set[T]) Add(val T) +``` -### func (s Set[T]) Contains(val T) bool -### func (s Set[T]) MarshalJSON() ([]byte, error) + +### func \(Set\[T\]\) [Contains]() + +```go +func (s Set[T]) Contains(val T) bool +``` + -### func (s Set[T]) Remove(val T) + +### func \(Set\[T\]\) [MarshalJSON]() +```go +func (s Set[T]) MarshalJSON() ([]byte, error) +``` -### func (s Set[T]) ToSlice() []T -### func (s *Set[T]) UnmarshalJSON(data []byte) error + +### func \(Set\[T\]\) [Remove]() ```go - UnmarshalJSON decodes a JSON array into the set +func (s Set[T]) Remove(val T) ``` -### type Signed interface { + + +### func \(Set\[T\]\) [ToSlice]() ```go -SignedInteger | Float +func (s Set[T]) ToSlice() []T ``` -} -### type SignedInteger interface { + + +### func \(\*Set\[T\]\) [UnmarshalJSON]() ```go -~int | ~int8 | ~int16 | ~int32 | ~int64 +func (s *Set[T]) UnmarshalJSON(data []byte) error ``` -} +UnmarshalJSON decodes a JSON array into the set + + +## type [Signed]() + -### type Unsigned interface { ```go -~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr +type Signed interface { + // contains filtered or unexported methods +} ``` + +## type [SignedInteger]() + + + +```go +type SignedInteger interface { + // contains filtered or unexported methods } +``` + + +## type [Unsigned]() + + +```go +type Unsigned interface { + // contains filtered or unexported methods +} +``` +Generated by [gomarkdoc]() diff --git a/docs/api/matrix.md b/docs/api/matrix.md index 9aa06a9aa..9d85a548b 100644 --- a/docs/api/matrix.md +++ b/docs/api/matrix.md @@ -1,1970 +1,6314 @@ -# Package matrix + -**Import path:** `kaijuengine.com/matrix` +# matrix +```go +import "kaijuengine.com/matrix" +``` +## Index + +- [Constants](<#constants>) +- [func AbsInt\(a int\) int](<#AbsInt>) +- [func Approx\(a, b Float\) bool](<#Approx>) +- [func ApproxTo\(a, b, tolerance Float\) bool](<#ApproxTo>) +- [func IsInf\(x Float, sign int\) bool](<#IsInf>) +- [func IsNaN\(x Float\) bool](<#IsNaN>) +- [func Mat4Approx\(a, b Mat4\) bool](<#Mat4Approx>) +- [func Mat4ApproxTo\(a, b Mat4, delta Float\) bool](<#Mat4ApproxTo>) +- [func QuaternionApprox\(a, b Quaternion\) bool](<#QuaternionApprox>) +- [func Vec2Approx\(a, b Vec2\) bool](<#Vec2Approx>) +- [func Vec2ApproxTo\(a, b Vec2, delta Float\) bool](<#Vec2ApproxTo>) +- [func Vec2Nearly\(a, b Vec2\) bool](<#Vec2Nearly>) +- [func Vec2Roughly\(a, b Vec2\) bool](<#Vec2Roughly>) +- [func Vec3Approx\(a, b Vec3\) bool](<#Vec3Approx>) +- [func Vec3ApproxTo\(a, b Vec3, delta Float\) bool](<#Vec3ApproxTo>) +- [func Vec4Approx\(a, b Vec4\) bool](<#Vec4Approx>) +- [func Vec4ApproxTo\(a, b Vec4, delta Float\) bool](<#Vec4ApproxTo>) +- [func Vec4Roughly\(a, b Vec4\) bool](<#Vec4Roughly>) +- [type Color](<#Color>) + - [func ColorAqua\(\) Color](<#ColorAqua>) + - [func ColorAquamarine\(\) Color](<#ColorAquamarine>) + - [func ColorAzure\(\) Color](<#ColorAzure>) + - [func ColorBeige\(\) Color](<#ColorBeige>) + - [func ColorBisque\(\) Color](<#ColorBisque>) + - [func ColorBlack\(\) Color](<#ColorBlack>) + - [func ColorBlanchedAlmond\(\) Color](<#ColorBlanchedAlmond>) + - [func ColorBlue\(\) Color](<#ColorBlue>) + - [func ColorBlueViolet\(\) Color](<#ColorBlueViolet>) + - [func ColorBrown\(\) Color](<#ColorBrown>) + - [func ColorBurlyWood\(\) Color](<#ColorBurlyWood>) + - [func ColorCadetBlue\(\) Color](<#ColorCadetBlue>) + - [func ColorChartreuse\(\) Color](<#ColorChartreuse>) + - [func ColorChocolate\(\) Color](<#ColorChocolate>) + - [func ColorClear\(\) Color](<#ColorClear>) + - [func ColorCoral\(\) Color](<#ColorCoral>) + - [func ColorCornSilk\(\) Color](<#ColorCornSilk>) + - [func ColorCornflowerBlue\(\) Color](<#ColorCornflowerBlue>) + - [func ColorCrimson\(\) Color](<#ColorCrimson>) + - [func ColorCyan\(\) Color](<#ColorCyan>) + - [func ColorDarkBG\(\) Color](<#ColorDarkBG>) + - [func ColorDarkBlue\(\) Color](<#ColorDarkBlue>) + - [func ColorDarkCyan\(\) Color](<#ColorDarkCyan>) + - [func ColorDarkGoldenrod\(\) Color](<#ColorDarkGoldenrod>) + - [func ColorDarkGray\(\) Color](<#ColorDarkGray>) + - [func ColorDarkGreen\(\) Color](<#ColorDarkGreen>) + - [func ColorDarkKhaki\(\) Color](<#ColorDarkKhaki>) + - [func ColorDarkMagenta\(\) Color](<#ColorDarkMagenta>) + - [func ColorDarkModeGrayBG\(\) Color](<#ColorDarkModeGrayBG>) + - [func ColorDarkModeGrayFG\(\) Color](<#ColorDarkModeGrayFG>) + - [func ColorDarkOliveGreen\(\) Color](<#ColorDarkOliveGreen>) + - [func ColorDarkOrange\(\) Color](<#ColorDarkOrange>) + - [func ColorDarkOrchid\(\) Color](<#ColorDarkOrchid>) + - [func ColorDarkRed\(\) Color](<#ColorDarkRed>) + - [func ColorDarkSalmon\(\) Color](<#ColorDarkSalmon>) + - [func ColorDarkSeaGreen\(\) Color](<#ColorDarkSeaGreen>) + - [func ColorDarkSlateBlue\(\) Color](<#ColorDarkSlateBlue>) + - [func ColorDarkSlateGray\(\) Color](<#ColorDarkSlateGray>) + - [func ColorDarkTurquoise\(\) Color](<#ColorDarkTurquoise>) + - [func ColorDarkViolet\(\) Color](<#ColorDarkViolet>) + - [func ColorDeepPink\(\) Color](<#ColorDeepPink>) + - [func ColorDeepSkyBlue\(\) Color](<#ColorDeepSkyBlue>) + - [func ColorDimGray\(\) Color](<#ColorDimGray>) + - [func ColorDodgerBlue\(\) Color](<#ColorDodgerBlue>) + - [func ColorFirebrick\(\) Color](<#ColorFirebrick>) + - [func ColorFloralWhite\(\) Color](<#ColorFloralWhite>) + - [func ColorForestGreen\(\) Color](<#ColorForestGreen>) + - [func ColorFromColor8\(c Color8\) Color](<#ColorFromColor8>) + - [func ColorFromHexString\(str string\) \(Color, error\)](<#ColorFromHexString>) + - [func ColorFromVec3\(v Vec3\) Color](<#ColorFromVec3>) + - [func ColorFromVec4\(v Vec4\) Color](<#ColorFromVec4>) + - [func ColorFuchsia\(\) Color](<#ColorFuchsia>) + - [func ColorGainsboro\(\) Color](<#ColorGainsboro>) + - [func ColorGhostWhite\(\) Color](<#ColorGhostWhite>) + - [func ColorGold\(\) Color](<#ColorGold>) + - [func ColorGoldenrod\(\) Color](<#ColorGoldenrod>) + - [func ColorGray\(\) Color](<#ColorGray>) + - [func ColorGreen\(\) Color](<#ColorGreen>) + - [func ColorGreenYellow\(\) Color](<#ColorGreenYellow>) + - [func ColorHoneydew\(\) Color](<#ColorHoneydew>) + - [func ColorHotPink\(\) Color](<#ColorHotPink>) + - [func ColorIndianRed\(\) Color](<#ColorIndianRed>) + - [func ColorIndigo\(\) Color](<#ColorIndigo>) + - [func ColorIvory\(\) Color](<#ColorIvory>) + - [func ColorKhaki\(\) Color](<#ColorKhaki>) + - [func ColorLavender\(\) Color](<#ColorLavender>) + - [func ColorLavenderBlush\(\) Color](<#ColorLavenderBlush>) + - [func ColorLawnGreen\(\) Color](<#ColorLawnGreen>) + - [func ColorLemonChiffon\(\) Color](<#ColorLemonChiffon>) + - [func ColorLightBlue\(\) Color](<#ColorLightBlue>) + - [func ColorLightCoral\(\) Color](<#ColorLightCoral>) + - [func ColorLightCyan\(\) Color](<#ColorLightCyan>) + - [func ColorLightGoldenrodYellow\(\) Color](<#ColorLightGoldenrodYellow>) + - [func ColorLightGreen\(\) Color](<#ColorLightGreen>) + - [func ColorLightGrey\(\) Color](<#ColorLightGrey>) + - [func ColorLightPink\(\) Color](<#ColorLightPink>) + - [func ColorLightSalmon\(\) Color](<#ColorLightSalmon>) + - [func ColorLightSeaGreen\(\) Color](<#ColorLightSeaGreen>) + - [func ColorLightSkyBlue\(\) Color](<#ColorLightSkyBlue>) + - [func ColorLightSlateGray\(\) Color](<#ColorLightSlateGray>) + - [func ColorLightSteelBlue\(\) Color](<#ColorLightSteelBlue>) + - [func ColorLightYellow\(\) Color](<#ColorLightYellow>) + - [func ColorLime\(\) Color](<#ColorLime>) + - [func ColorLimeGreen\(\) Color](<#ColorLimeGreen>) + - [func ColorLinen\(\) Color](<#ColorLinen>) + - [func ColorMagenta\(\) Color](<#ColorMagenta>) + - [func ColorMaroon\(\) Color](<#ColorMaroon>) + - [func ColorMediumAquamarine\(\) Color](<#ColorMediumAquamarine>) + - [func ColorMediumBlue\(\) Color](<#ColorMediumBlue>) + - [func ColorMediumOrchid\(\) Color](<#ColorMediumOrchid>) + - [func ColorMediumPurple\(\) Color](<#ColorMediumPurple>) + - [func ColorMediumSeaGreen\(\) Color](<#ColorMediumSeaGreen>) + - [func ColorMediumSlateBlue\(\) Color](<#ColorMediumSlateBlue>) + - [func ColorMediumSpringGreen\(\) Color](<#ColorMediumSpringGreen>) + - [func ColorMediumTurquoise\(\) Color](<#ColorMediumTurquoise>) + - [func ColorMediumVioletRed\(\) Color](<#ColorMediumVioletRed>) + - [func ColorMidnightBlue\(\) Color](<#ColorMidnightBlue>) + - [func ColorMintCream\(\) Color](<#ColorMintCream>) + - [func ColorMistyRose\(\) Color](<#ColorMistyRose>) + - [func ColorMix\(lhs, rhs Color, amount Float\) Color](<#ColorMix>) + - [func ColorMoccasin\(\) Color](<#ColorMoccasin>) + - [func ColorNavajoWhite\(\) Color](<#ColorNavajoWhite>) + - [func ColorNavy\(\) Color](<#ColorNavy>) + - [func ColorOldLace\(\) Color](<#ColorOldLace>) + - [func ColorOlive\(\) Color](<#ColorOlive>) + - [func ColorOliveDrab\(\) Color](<#ColorOliveDrab>) + - [func ColorOrange\(\) Color](<#ColorOrange>) + - [func ColorOrangeRed\(\) Color](<#ColorOrangeRed>) + - [func ColorOrchid\(\) Color](<#ColorOrchid>) + - [func ColorPaleGoldenrod\(\) Color](<#ColorPaleGoldenrod>) + - [func ColorPaleGreen\(\) Color](<#ColorPaleGreen>) + - [func ColorPaleTurquoise\(\) Color](<#ColorPaleTurquoise>) + - [func ColorPaleVioletred\(\) Color](<#ColorPaleVioletred>) + - [func ColorPapayaWhip\(\) Color](<#ColorPapayaWhip>) + - [func ColorPeachPuff\(\) Color](<#ColorPeachPuff>) + - [func ColorPeru\(\) Color](<#ColorPeru>) + - [func ColorPink\(\) Color](<#ColorPink>) + - [func ColorPlum\(\) Color](<#ColorPlum>) + - [func ColorPowderBlue\(\) Color](<#ColorPowderBlue>) + - [func ColorPurple\(\) Color](<#ColorPurple>) + - [func ColorRGBAInt\(r, g, b, a int\) Color](<#ColorRGBAInt>) + - [func ColorRGBInt\(r, g, b int\) Color](<#ColorRGBInt>) + - [func ColorRed\(\) Color](<#ColorRed>) + - [func ColorRosyBrown\(\) Color](<#ColorRosyBrown>) + - [func ColorRoyalBlue\(\) Color](<#ColorRoyalBlue>) + - [func ColorSaddleBrown\(\) Color](<#ColorSaddleBrown>) + - [func ColorSalmon\(\) Color](<#ColorSalmon>) + - [func ColorSandyBrown\(\) Color](<#ColorSandyBrown>) + - [func ColorSeaGreen\(\) Color](<#ColorSeaGreen>) + - [func ColorSeashell\(\) Color](<#ColorSeashell>) + - [func ColorSienna\(\) Color](<#ColorSienna>) + - [func ColorSilver\(\) Color](<#ColorSilver>) + - [func ColorSky\(\) Color](<#ColorSky>) + - [func ColorSkyBlue\(\) Color](<#ColorSkyBlue>) + - [func ColorSlateBlue\(\) Color](<#ColorSlateBlue>) + - [func ColorSlateGray\(\) Color](<#ColorSlateGray>) + - [func ColorSlateGrey\(\) Color](<#ColorSlateGrey>) + - [func ColorSnow\(\) Color](<#ColorSnow>) + - [func ColorSpringGreen\(\) Color](<#ColorSpringGreen>) + - [func ColorSteelBlue\(\) Color](<#ColorSteelBlue>) + - [func ColorTan\(\) Color](<#ColorTan>) + - [func ColorTeal\(\) Color](<#ColorTeal>) + - [func ColorThistle\(\) Color](<#ColorThistle>) + - [func ColorTomato\(\) Color](<#ColorTomato>) + - [func ColorTransparent\(\) Color](<#ColorTransparent>) + - [func ColorTurquoise\(\) Color](<#ColorTurquoise>) + - [func ColorViolet\(\) Color](<#ColorViolet>) + - [func ColorWheat\(\) Color](<#ColorWheat>) + - [func ColorWhite\(\) Color](<#ColorWhite>) + - [func ColorWhiteSmoke\(\) Color](<#ColorWhiteSmoke>) + - [func ColorYellow\(\) Color](<#ColorYellow>) + - [func ColorYellowGreen\(\) Color](<#ColorYellowGreen>) + - [func ColorZero\(\) Color](<#ColorZero>) + - [func NewColor\(r, g, b, a Float\) Color](<#NewColor>) + - [func \(c Color\) A\(\) Float](<#Color.A>) + - [func \(c Color\) AsColor8\(\) Color8](<#Color.AsColor8>) + - [func \(c Color\) B\(\) Float](<#Color.B>) + - [func \(lhs Color\) Equals\(rhs Color\) bool](<#Color.Equals>) + - [func \(c Color\) G\(\) Float](<#Color.G>) + - [func \(c Color\) Hex\(\) string](<#Color.Hex>) + - [func \(c \*Color\) Inverted\(\) Color](<#Color.Inverted>) + - [func \(c Color\) IsZero\(\) bool](<#Color.IsZero>) + - [func \(c \*Color\) MultiplyAssign\(other Color\)](<#Color.MultiplyAssign>) + - [func \(c \*Color\) PA\(\) \*Float](<#Color.PA>) + - [func \(c \*Color\) PB\(\) \*Float](<#Color.PB>) + - [func \(c \*Color\) PG\(\) \*Float](<#Color.PG>) + - [func \(c \*Color\) PR\(\) \*Float](<#Color.PR>) + - [func \(c Color\) R\(\) Float](<#Color.R>) + - [func \(c Color\) RGBA\(\) \(Float, Float, Float, Float\)](<#Color.RGBA>) + - [func \(c Color\) ScaleWithoutAlpha\(scale Float\) Color](<#Color.ScaleWithoutAlpha>) + - [func \(c \*Color\) SetA\(a Float\)](<#Color.SetA>) + - [func \(c \*Color\) SetB\(b Float\)](<#Color.SetB>) + - [func \(c \*Color\) SetG\(g Float\)](<#Color.SetG>) + - [func \(c \*Color\) SetR\(r Float\)](<#Color.SetR>) +- [type Color8](<#Color8>) + - [func Color8FromBytes\(bytes \[\]byte\) Color8](<#Color8FromBytes>) + - [func Color8FromColor\(c Color\) Color8](<#Color8FromColor>) + - [func Color8FromHexString\(str string\) \(Color8, error\)](<#Color8FromHexString>) + - [func NewColor8\(r, g, b, a uint8\) Color8](<#NewColor8>) + - [func \(c Color8\) A\(\) uint8](<#Color8.A>) + - [func \(c Color8\) AsColor\(\) Color](<#Color8.AsColor>) + - [func \(c Color8\) B\(\) uint8](<#Color8.B>) + - [func \(c Color8\) Equal\(rhs Color8\) bool](<#Color8.Equal>) + - [func \(c Color8\) G\(\) uint8](<#Color8.G>) + - [func \(c Color8\) Hex\(\) string](<#Color8.Hex>) + - [func \(c \*Color8\) PA\(\) \*uint8](<#Color8.PA>) + - [func \(c \*Color8\) PB\(\) \*uint8](<#Color8.PB>) + - [func \(c \*Color8\) PG\(\) \*uint8](<#Color8.PG>) + - [func \(c \*Color8\) PR\(\) \*uint8](<#Color8.PR>) + - [func \(c Color8\) R\(\) uint8](<#Color8.R>) + - [func \(c Color8\) RGBA\(\) \(uint8, uint8, uint8, uint8\)](<#Color8.RGBA>) + - [func \(c \*Color8\) SetA\(a uint8\)](<#Color8.SetA>) + - [func \(c \*Color8\) SetB\(b uint8\)](<#Color8.SetB>) + - [func \(c \*Color8\) SetG\(g uint8\)](<#Color8.SetG>) + - [func \(c \*Color8\) SetR\(r uint8\)](<#Color8.SetR>) + - [func \(lhs Color8\) Similar\(rhs Color8, tolerance uint8\) bool](<#Color8.Similar>) + - [func \(c Color8\) ToUintRaw\(\) uint32](<#Color8.ToUintRaw>) +- [type ColorComponent](<#ColorComponent>) +- [type Float](<#Float>) + - [func Abs\(x Float\) Float](<#Abs>) + - [func Acos\(x Float\) Float](<#Acos>) + - [func Asin\(x Float\) Float](<#Asin>) + - [func Atan\(x Float\) Float](<#Atan>) + - [func Atan2\(y Float, x Float\) Float](<#Atan2>) + - [func Ceil\(x Float\) Float](<#Ceil>) + - [func Clamp\(current, minimum, maximum Float\) Float](<#Clamp>) + - [func Cos\(x Float\) Float](<#Cos>) + - [func Deg2Rad\(degree Float\) Float](<#Deg2Rad>) + - [func Floor\(x Float\) Float](<#Floor>) + - [func Inf\(sign int\) Float](<#Inf>) + - [func Lerp\(v0, v1, t Float\) Float](<#Lerp>) + - [func Log2\(x Float\) Float](<#Log2>) + - [func Max\(a Float, b Float\) Float](<#Max>) + - [func Min\(a Float, b Float\) Float](<#Min>) + - [func Mod\(x Float, y Float\) Float](<#Mod>) + - [func NaN\(\) Float](<#NaN>) + - [func Pow\(x Float, y Float\) Float](<#Pow>) + - [func Rad2Deg\(radian Float\) Float](<#Rad2Deg>) + - [func Round\(x Float\) Float](<#Round>) + - [func Sin\(x Float\) Float](<#Sin>) + - [func Sqrt\(x Float\) Float](<#Sqrt>) + - [func Tan\(x Float\) Float](<#Tan>) + - [func Vec2Dot\(v, other Vec2\) Float](<#Vec2Dot>) + - [func Vec3Dot\(v, other Vec3\) Float](<#Vec3Dot>) + - [func Vec4Dot\(a, b Vec4\) Float](<#Vec4Dot>) +- [type Mat3](<#Mat3>) + - [func Mat3FromMat4\(m Mat4\) Mat3](<#Mat3FromMat4>) + - [func Mat3Identity\(\) Mat3](<#Mat3Identity>) + - [func Mat3Zero\(\) Mat3](<#Mat3Zero>) + - [func NewMat3\(\) Mat3](<#NewMat3>) + - [func \(m Mat3\) ColumnVector\(col int\) Vec3](<#Mat3.ColumnVector>) + - [func \(m Mat3\) Multiply\(rhs Mat3\) Mat3](<#Mat3.Multiply>) + - [func \(m \*Mat3\) MultiplyAssign\(rhs Mat3\)](<#Mat3.MultiplyAssign>) + - [func \(m Mat3\) MultiplyVec3\(v Vec3\) Vec3](<#Mat3.MultiplyVec3>) + - [func \(m \*Mat3\) Reset\(\)](<#Mat3.Reset>) + - [func \(m Mat3\) RowVector\(row int\) Vec3](<#Mat3.RowVector>) + - [func \(m Mat3\) ToMat4\(\) Mat4](<#Mat3.ToMat4>) + - [func \(m Mat3\) Transpose\(\) Mat3](<#Mat3.Transpose>) +- [type Mat4](<#Mat4>) + - [func Mat4FromSlice\(a \[\]Float\) Mat4](<#Mat4FromSlice>) + - [func Mat4Identity\(\) Mat4](<#Mat4Identity>) + - [func Mat4LookAt\(eye, center, up Vec3\) Mat4](<#Mat4LookAt>) + - [func Mat4Multiply\(a, b Mat4\) Mat4](<#Mat4Multiply>) + - [func Mat4Zero\(\) Mat4](<#Mat4Zero>) + - [func NewMat4\(\) Mat4](<#NewMat4>) + - [func \(m \*Mat4\) AddAssign\(rhs Mat4\)](<#Mat4.AddAssign>) + - [func \(m Mat4\) At\(rowIndex, colIndex int\) Float](<#Mat4.At>) + - [func \(m Mat4\) ColumnVector\(col int\) Vec4](<#Mat4.ColumnVector>) + - [func \(m Mat4\) Equals\(other Mat4\) bool](<#Mat4.Equals>) + - [func \(m Mat4\) ExtractPosition\(\) Vec3](<#Mat4.ExtractPosition>) + - [func \(m Mat4\) ExtractRotation\(\) Quaternion](<#Mat4.ExtractRotation>) + - [func \(m Mat4\) ExtractScale\(\) Vec3](<#Mat4.ExtractScale>) + - [func \(m Mat4\) Forward\(\) Vec3](<#Mat4.Forward>) + - [func \(m \*Mat4\) Inverse\(\)](<#Mat4.Inverse>) + - [func \(m Mat4\) Inverted\(\) Mat4](<#Mat4.Inverted>) + - [func \(m Mat4\) IsIdentity\(\) bool](<#Mat4.IsIdentity>) + - [func \(m \*Mat4\) LookAt\(eye, center, up Vec3\)](<#Mat4.LookAt>) + - [func \(m \*Mat4\) Mat3\(\) Mat3](<#Mat4.Mat3>) + - [func \(m Mat4\) Mat4ProjToVulkan\(\) Mat4](<#Mat4.Mat4ProjToVulkan>) + - [func \(m Mat4\) Mat4Project\(pos Vec3, viewport Vec4\) Vec3](<#Mat4.Mat4Project>) + - [func \(m Mat4\) Mat4UnProject\(p Vec3, invViewProj Mat4, viewport Vec4\) Vec3](<#Mat4.Mat4UnProject>) + - [func \(a \*Mat4\) MultiplyAssign\(b Mat4\)](<#Mat4.MultiplyAssign>) + - [func \(m \*Mat4\) NegateAssign\(\)](<#Mat4.NegateAssign>) + - [func \(m \*Mat4\) Orthographic\(left, right, bottom, top, near, far Float\)](<#Mat4.Orthographic>) + - [func \(m \*Mat4\) Perspective\(fovy, aspect, nearVal, farVal Float\)](<#Mat4.Perspective>) + - [func \(m \*Mat4\) Reset\(\)](<#Mat4.Reset>) + - [func \(m Mat4\) Right\(\) Vec3](<#Mat4.Right>) + - [func \(m \*Mat4\) Rotate\(rotate Vec3\)](<#Mat4.Rotate>) + - [func \(m \*Mat4\) RotateAngles\(axis Vec3, angle Float\)](<#Mat4.RotateAngles>) + - [func \(m \*Mat4\) RotateX\(angles Float\)](<#Mat4.RotateX>) + - [func \(m \*Mat4\) RotateY\(angles Float\)](<#Mat4.RotateY>) + - [func \(m \*Mat4\) RotateZ\(angles Float\)](<#Mat4.RotateZ>) + - [func \(m Mat4\) RowVector\(row int\) Vec4](<#Mat4.RowVector>) + - [func \(m \*Mat4\) Scale\(scale Vec3\)](<#Mat4.Scale>) + - [func \(m \*Mat4\) SetTranslation\(translation Vec3\)](<#Mat4.SetTranslation>) + - [func \(m \*Mat4\) SubtractAssign\(rhs Mat4\)](<#Mat4.SubtractAssign>) + - [func \(m Mat4\) ToQuaternion\(\) Quaternion](<#Mat4.ToQuaternion>) + - [func \(m Mat4\) TransformPoint\(point Vec3\) Vec3](<#Mat4.TransformPoint>) + - [func \(m \*Mat4\) Translate\(translation Vec3\)](<#Mat4.Translate>) + - [func \(m Mat4\) Transpose\(\) Mat4](<#Mat4.Transpose>) + - [func \(m \*Mat4\) TransposeAssign\(\)](<#Mat4.TransposeAssign>) + - [func \(m Mat4\) Up\(\) Vec3](<#Mat4.Up>) + - [func \(m \*Mat4\) Zero\(\)](<#Mat4.Zero>) +- [type Quaternion](<#Quaternion>) + - [func NewQuaternion\(w, x, y, z Float\) Quaternion](<#NewQuaternion>) + - [func QuatAngleBetween\(lhs, rhs Vec3\) Quaternion](<#QuatAngleBetween>) + - [func QuaternionAxisAngle\(axis Vec3, angle Float\) Quaternion](<#QuaternionAxisAngle>) + - [func QuaternionFromArray\(xyzw \[4\]Float\) Quaternion](<#QuaternionFromArray>) + - [func QuaternionFromEuler\(v Vec3\) Quaternion](<#QuaternionFromEuler>) + - [func QuaternionFromMat4\(m Mat4\) Quaternion](<#QuaternionFromMat4>) + - [func QuaternionFromSlice\(xyzw \[\]Float\) Quaternion](<#QuaternionFromSlice>) + - [func QuaternionFromVec4\(v Vec4\) Quaternion](<#QuaternionFromVec4>) + - [func QuaternionFromXYZW\(xyzw \[4\]Float\) Quaternion](<#QuaternionFromXYZW>) + - [func QuaternionFromXYZWSlice\(xyzw \[\]Float\) Quaternion](<#QuaternionFromXYZWSlice>) + - [func QuaternionIdentity\(\) Quaternion](<#QuaternionIdentity>) + - [func QuaternionLerp\(from, to Quaternion, factor Float\) Quaternion](<#QuaternionLerp>) + - [func QuaternionLookAt\(from, to Vec3\) Quaternion](<#QuaternionLookAt>) + - [func QuaternionSlerp\(from, to Quaternion, factor Float\) Quaternion](<#QuaternionSlerp>) + - [func \(q \*Quaternion\) AddAssign\(rhs Quaternion\)](<#Quaternion.AddAssign>) + - [func \(q \*Quaternion\) Conjugate\(\)](<#Quaternion.Conjugate>) + - [func \(q \*Quaternion\) Inverse\(\)](<#Quaternion.Inverse>) + - [func \(q Quaternion\) IsZero\(\) bool](<#Quaternion.IsZero>) + - [func \(q Quaternion\) Multiply\(rhs Quaternion\) Quaternion](<#Quaternion.Multiply>) + - [func \(q \*Quaternion\) MultiplyAssign\(rhs Quaternion\)](<#Quaternion.MultiplyAssign>) + - [func \(q Quaternion\) MultiplyVec3\(rhs Vec3\) Vec3](<#Quaternion.MultiplyVec3>) + - [func \(q Quaternion\) Normal\(\) Quaternion](<#Quaternion.Normal>) + - [func \(q \*Quaternion\) Normalize\(\)](<#Quaternion.Normalize>) + - [func \(q Quaternion\) ToEuler\(\) Vec3](<#Quaternion.ToEuler>) + - [func \(q Quaternion\) ToMat4\(\) Mat4](<#Quaternion.ToMat4>) + - [func \(q Quaternion\) W\(\) Float](<#Quaternion.W>) + - [func \(q Quaternion\) X\(\) Float](<#Quaternion.X>) + - [func \(q Quaternion\) Y\(\) Float](<#Quaternion.Y>) + - [func \(q Quaternion\) Z\(\) Float](<#Quaternion.Z>) +- [type QuaternionComponent](<#QuaternionComponent>) +- [type Transform](<#Transform>) + - [func \(t \*Transform\) AddPosition\(add Vec3\)](<#Transform.AddPosition>) + - [func \(t \*Transform\) AddRotation\(add Vec3\)](<#Transform.AddRotation>) + - [func \(t \*Transform\) AddScale\(add Vec3\)](<#Transform.AddScale>) + - [func \(t \*Transform\) ContainsPoint\(point Vec3\) bool](<#Transform.ContainsPoint>) + - [func \(t \*Transform\) ContainsPoint2D\(point Vec2\) bool](<#Transform.ContainsPoint2D>) + - [func \(t \*Transform\) Copy\(other Transform\)](<#Transform.Copy>) + - [func \(t \*Transform\) Forward\(\) Vec3](<#Transform.Forward>) + - [func \(t \*Transform\) Initialize\(workGroup \*concurrent.WorkGroup\)](<#Transform.Initialize>) + - [func \(t \*Transform\) InverseWorldMatrix\(\) Mat4](<#Transform.InverseWorldMatrix>) + - [func \(t \*Transform\) IsDirty\(\) bool](<#Transform.IsDirty>) + - [func \(t \*Transform\) LocalPosition\(\) Vec3](<#Transform.LocalPosition>) + - [func \(t \*Transform\) LookAt\(point Vec3\)](<#Transform.LookAt>) + - [func \(t \*Transform\) Matrix\(\) Mat4](<#Transform.Matrix>) + - [func \(t \*Transform\) Parent\(\) \*Transform](<#Transform.Parent>) + - [func \(t \*Transform\) Position\(\) Vec3](<#Transform.Position>) + - [func \(t \*Transform\) ResetDirty\(\)](<#Transform.ResetDirty>) + - [func \(t \*Transform\) Right\(\) Vec3](<#Transform.Right>) + - [func \(t \*Transform\) Rotation\(\) Vec3](<#Transform.Rotation>) + - [func \(t \*Transform\) Scale\(\) Vec3](<#Transform.Scale>) + - [func \(t \*Transform\) ScaleWithoutChildren\(scale Vec3\)](<#Transform.ScaleWithoutChildren>) + - [func \(t \*Transform\) SetChildrenOrdered\(\)](<#Transform.SetChildrenOrdered>) + - [func \(t \*Transform\) SetChildrenUnordered\(\)](<#Transform.SetChildrenUnordered>) + - [func \(t \*Transform\) SetDirty\(\)](<#Transform.SetDirty>) + - [func \(t \*Transform\) SetLocalPosition\(position Vec3\)](<#Transform.SetLocalPosition>) + - [func \(t \*Transform\) SetParent\(parent \*Transform\)](<#Transform.SetParent>) + - [func \(t \*Transform\) SetPosition\(position Vec3\)](<#Transform.SetPosition>) + - [func \(t \*Transform\) SetRotation\(rotation Vec3\)](<#Transform.SetRotation>) + - [func \(t \*Transform\) SetScale\(scale Vec3\)](<#Transform.SetScale>) + - [func \(t \*Transform\) SetWorldPosition\(position Vec3\)](<#Transform.SetWorldPosition>) + - [func \(t \*Transform\) SetWorldRotation\(rotation Vec3\)](<#Transform.SetWorldRotation>) + - [func \(t \*Transform\) SetWorldScale\(scale Vec3\)](<#Transform.SetWorldScale>) + - [func \(t \*Transform\) SetupRawTransform\(\)](<#Transform.SetupRawTransform>) + - [func \(t \*Transform\) Up\(\) Vec3](<#Transform.Up>) + - [func \(t \*Transform\) WorldMatrix\(\) Mat4](<#Transform.WorldMatrix>) + - [func \(t \*Transform\) WorldPosition\(\) Vec3](<#Transform.WorldPosition>) + - [func \(t \*Transform\) WorldRotation\(\) Vec3](<#Transform.WorldRotation>) + - [func \(t \*Transform\) WorldScale\(\) Vec3](<#Transform.WorldScale>) + - [func \(t \*Transform\) WorldTransform\(\) \(Vec3, Vec3, Vec3\)](<#Transform.WorldTransform>) +- [type Vec2](<#Vec2>) + - [func NewVec2\(x, y Float\) Vec2](<#NewVec2>) + - [func Vec2Down\(\) Vec2](<#Vec2Down>) + - [func Vec2FromArray\(a \[2\]Float\) Vec2](<#Vec2FromArray>) + - [func Vec2FromSlice\(a \[\]Float\) Vec2](<#Vec2FromSlice>) + - [func Vec2FromString\(str string\) Vec2](<#Vec2FromString>) + - [func Vec2Half\(\) Vec2](<#Vec2Half>) + - [func Vec2Largest\(\) Vec2](<#Vec2Largest>) + - [func Vec2Left\(\) Vec2](<#Vec2Left>) + - [func Vec2Lerp\(from, to Vec2, t Float\) Vec2](<#Vec2Lerp>) + - [func Vec2Max\(a, b Vec2\) Vec2](<#Vec2Max>) + - [func Vec2MaxAbs\(a, b Vec2\) Vec2](<#Vec2MaxAbs>) + - [func Vec2Min\(a, b Vec2\) Vec2](<#Vec2Min>) + - [func Vec2MinAbs\(a, b Vec2\) Vec2](<#Vec2MinAbs>) + - [func Vec2One\(\) Vec2](<#Vec2One>) + - [func Vec2Right\(\) Vec2](<#Vec2Right>) + - [func Vec2Up\(\) Vec2](<#Vec2Up>) + - [func Vec2Zero\(\) Vec2](<#Vec2Zero>) + - [func \(v Vec2\) Abs\(\) Vec2](<#Vec2.Abs>) + - [func \(v Vec2\) Add\(other Vec2\) Vec2](<#Vec2.Add>) + - [func \(v \*Vec2\) AddAssign\(other Vec2\)](<#Vec2.AddAssign>) + - [func \(v Vec2\) Angle\(other Vec2\) Float](<#Vec2.Angle>) + - [func \(v Vec2\) AsVec2i\(\) Vec2i](<#Vec2.AsVec2i>) + - [func \(v \*Vec2\) AsVec3\(\) Vec3](<#Vec2.AsVec3>) + - [func \(v Vec2\) Distance\(other Vec2\) Float](<#Vec2.Distance>) + - [func \(v Vec2\) Divide\(other Vec2\) Vec2](<#Vec2.Divide>) + - [func \(v \*Vec2\) DivideAssign\(other Vec2\)](<#Vec2.DivideAssign>) + - [func \(v Vec2\) Equals\(other Vec2\) bool](<#Vec2.Equals>) + - [func \(v Vec2\) Height\(\) Float](<#Vec2.Height>) + - [func \(v \*Vec2\) Inverse\(\)](<#Vec2.Inverse>) + - [func \(v Vec2\) LargestAxis\(\) Float](<#Vec2.LargestAxis>) + - [func \(v Vec2\) LargestAxisDelta\(\) Float](<#Vec2.LargestAxisDelta>) + - [func \(v Vec2\) Length\(\) Float](<#Vec2.Length>) + - [func \(v Vec2\) Multiply\(other Vec2\) Vec2](<#Vec2.Multiply>) + - [func \(v \*Vec2\) MultiplyAssign\(other Vec2\)](<#Vec2.MultiplyAssign>) + - [func \(v Vec2\) Negative\(\) Vec2](<#Vec2.Negative>) + - [func \(v Vec2\) Normal\(\) Vec2](<#Vec2.Normal>) + - [func \(v \*Vec2\) Normalize\(\)](<#Vec2.Normalize>) + - [func \(v \*Vec2\) PX\(\) \*Float](<#Vec2.PX>) + - [func \(v \*Vec2\) PY\(\) \*Float](<#Vec2.PY>) + - [func \(v Vec2\) Scale\(scalar Float\) Vec2](<#Vec2.Scale>) + - [func \(v \*Vec2\) ScaleAssign\(scalar Float\)](<#Vec2.ScaleAssign>) + - [func \(v \*Vec2\) SetHeight\(y Float\)](<#Vec2.SetHeight>) + - [func \(v \*Vec2\) SetWidth\(x Float\)](<#Vec2.SetWidth>) + - [func \(v \*Vec2\) SetX\(x Float\)](<#Vec2.SetX>) + - [func \(v \*Vec2\) SetY\(y Float\)](<#Vec2.SetY>) + - [func \(v Vec2\) Shrink\(scalar Float\) Vec2](<#Vec2.Shrink>) + - [func \(v \*Vec2\) ShrinkAssign\(scalar Float\)](<#Vec2.ShrinkAssign>) + - [func \(v Vec2\) String\(\) string](<#Vec2.String>) + - [func \(v Vec2\) Subtract\(other Vec2\) Vec2](<#Vec2.Subtract>) + - [func \(v \*Vec2\) SubtractAssign\(other Vec2\)](<#Vec2.SubtractAssign>) + - [func \(v Vec2\) Width\(\) Float](<#Vec2.Width>) + - [func \(v Vec2\) X\(\) Float](<#Vec2.X>) + - [func \(v Vec2\) XY\(\) \(Float, Float\)](<#Vec2.XY>) + - [func \(v Vec2\) Y\(\) Float](<#Vec2.Y>) +- [type Vec2i](<#Vec2i>) + - [func \(v Vec2i\) Height\(\) int32](<#Vec2i.Height>) + - [func \(v \*Vec2i\) SetHeight\(height int32\)](<#Vec2i.SetHeight>) + - [func \(v \*Vec2i\) SetWidth\(width int32\)](<#Vec2i.SetWidth>) + - [func \(v \*Vec2i\) SetX\(x int32\)](<#Vec2i.SetX>) + - [func \(v \*Vec2i\) SetY\(y int32\)](<#Vec2i.SetY>) + - [func \(v Vec2i\) Width\(\) int32](<#Vec2i.Width>) + - [func \(v Vec2i\) X\(\) int32](<#Vec2i.X>) + - [func \(v Vec2i\) Y\(\) int32](<#Vec2i.Y>) +- [type Vec3](<#Vec3>) + - [func Mat4ToScreenSpace\(pos Vec3, view, projection Mat4, viewport Vec4\) \(Vec3, bool\)](<#Mat4ToScreenSpace>) + - [func NewVec3\(x, y, z Float\) Vec3](<#NewVec3>) + - [func NewVec3XYZ\(xyz Float\) Vec3](<#NewVec3XYZ>) + - [func Vec3Abs\(v Vec3\) Vec3](<#Vec3Abs>) + - [func Vec3Backward\(\) Vec3](<#Vec3Backward>) + - [func Vec3Cross\(v, other Vec3\) Vec3](<#Vec3Cross>) + - [func Vec3Down\(\) Vec3](<#Vec3Down>) + - [func Vec3Forward\(\) Vec3](<#Vec3Forward>) + - [func Vec3FromArray\(a \[3\]Float\) Vec3](<#Vec3FromArray>) + - [func Vec3FromSlice\(a \[\]Float\) Vec3](<#Vec3FromSlice>) + - [func Vec3FromString\(str string\) Vec3](<#Vec3FromString>) + - [func Vec3Half\(\) Vec3](<#Vec3Half>) + - [func Vec3Inf\(sign int\) Vec3](<#Vec3Inf>) + - [func Vec3Largest\(\) Vec3](<#Vec3Largest>) + - [func Vec3Left\(\) Vec3](<#Vec3Left>) + - [func Vec3Lerp\(from, to Vec3, t Float\) Vec3](<#Vec3Lerp>) + - [func Vec3Max\(v ...Vec3\) Vec3](<#Vec3Max>) + - [func Vec3MaxAbs\(v ...Vec3\) Vec3](<#Vec3MaxAbs>) + - [func Vec3Min\(v ...Vec3\) Vec3](<#Vec3Min>) + - [func Vec3MinAbs\(v ...Vec3\) Vec3](<#Vec3MinAbs>) + - [func Vec3NaN\(\) Vec3](<#Vec3NaN>) + - [func Vec3One\(\) Vec3](<#Vec3One>) + - [func Vec3Right\(\) Vec3](<#Vec3Right>) + - [func Vec3Up\(\) Vec3](<#Vec3Up>) + - [func Vec3Zero\(\) Vec3](<#Vec3Zero>) + - [func \(v Vec3\) Abs\(\) Vec3](<#Vec3.Abs>) + - [func \(v Vec3\) Add\(other Vec3\) Vec3](<#Vec3.Add>) + - [func \(v \*Vec3\) AddAssign\(other Vec3\)](<#Vec3.AddAssign>) + - [func \(v \*Vec3\) AddX\(x Float\)](<#Vec3.AddX>) + - [func \(v \*Vec3\) AddY\(y Float\)](<#Vec3.AddY>) + - [func \(v \*Vec3\) AddZ\(z Float\)](<#Vec3.AddZ>) + - [func \(v Vec3\) Angle\(other Vec3\) Float](<#Vec3.Angle>) + - [func \(v Vec3\) AsAligned16\(\) \[4\]Float](<#Vec3.AsAligned16>) + - [func \(v Vec3\) AsVec2\(\) Vec2](<#Vec3.AsVec2>) + - [func \(v Vec3\) AsVec3i\(\) Vec3i](<#Vec3.AsVec3i>) + - [func \(v Vec3\) AsVec4\(\) Vec4](<#Vec3.AsVec4>) + - [func \(v Vec3\) AsVec4WithW\(w Float\) Vec4](<#Vec3.AsVec4WithW>) + - [func \(v Vec3\) Depth\(\) Float](<#Vec3.Depth>) + - [func \(v Vec3\) Distance\(other Vec3\) Float](<#Vec3.Distance>) + - [func \(v Vec3\) Divide\(other Vec3\) Vec3](<#Vec3.Divide>) + - [func \(v \*Vec3\) DivideAssign\(other Vec3\)](<#Vec3.DivideAssign>) + - [func \(v Vec3\) Equals\(other Vec3\) bool](<#Vec3.Equals>) + - [func \(v Vec3\) Height\(\) Float](<#Vec3.Height>) + - [func \(v \*Vec3\) Inverse\(\)](<#Vec3.Inverse>) + - [func \(v Vec3\) IsInf\(sign int\) bool](<#Vec3.IsInf>) + - [func \(v Vec3\) IsNaN\(\) bool](<#Vec3.IsNaN>) + - [func \(v Vec3\) IsZero\(\) bool](<#Vec3.IsZero>) + - [func \(v Vec3\) LargestAxis\(\) Float](<#Vec3.LargestAxis>) + - [func \(v Vec3\) LargestAxisDelta\(\) Float](<#Vec3.LargestAxisDelta>) + - [func \(v Vec3\) Length\(\) Float](<#Vec3.Length>) + - [func \(v Vec3\) LengthSquared\(\) Float](<#Vec3.LengthSquared>) + - [func \(v Vec3\) LongestAxis\(\) int](<#Vec3.LongestAxis>) + - [func \(v Vec3\) LongestAxisValue\(\) Float](<#Vec3.LongestAxisValue>) + - [func \(v Vec3\) Multiply\(other Vec3\) Vec3](<#Vec3.Multiply>) + - [func \(v \*Vec3\) MultiplyAssign\(other Vec3\)](<#Vec3.MultiplyAssign>) + - [func \(v Vec3\) MultiplyMat3\(rhs Mat3\) Vec3](<#Vec3.MultiplyMat3>) + - [func \(v Vec3\) Negative\(\) Vec3](<#Vec3.Negative>) + - [func \(v Vec3\) Normal\(\) Vec3](<#Vec3.Normal>) + - [func \(v \*Vec3\) Normalize\(\)](<#Vec3.Normalize>) + - [func \(v Vec3\) Orthogonal\(\) Vec3](<#Vec3.Orthogonal>) + - [func \(v \*Vec3\) PX\(\) \*Float](<#Vec3.PX>) + - [func \(v \*Vec3\) PY\(\) \*Float](<#Vec3.PY>) + - [func \(v \*Vec3\) PZ\(\) \*Float](<#Vec3.PZ>) + - [func \(v Vec3\) Scale\(scalar Float\) Vec3](<#Vec3.Scale>) + - [func \(v \*Vec3\) ScaleAssign\(scalar Float\)](<#Vec3.ScaleAssign>) + - [func \(v \*Vec3\) ScaleX\(s Float\)](<#Vec3.ScaleX>) + - [func \(v \*Vec3\) ScaleY\(s Float\)](<#Vec3.ScaleY>) + - [func \(v \*Vec3\) ScaleZ\(s Float\)](<#Vec3.ScaleZ>) + - [func \(v \*Vec3\) SetX\(x Float\)](<#Vec3.SetX>) + - [func \(v \*Vec3\) SetY\(y Float\)](<#Vec3.SetY>) + - [func \(v \*Vec3\) SetZ\(z Float\)](<#Vec3.SetZ>) + - [func \(v Vec3\) Shrink\(scalar Float\) Vec3](<#Vec3.Shrink>) + - [func \(v \*Vec3\) ShrinkAssign\(scalar Float\)](<#Vec3.ShrinkAssign>) + - [func \(v Vec3\) SignedAngle\(other Vec3, axis Vec3\) Float](<#Vec3.SignedAngle>) + - [func \(v Vec3\) SquareDistance\(b Vec3\) Float](<#Vec3.SquareDistance>) + - [func \(v Vec3\) String\(\) string](<#Vec3.String>) + - [func \(v Vec3\) Subtract\(other Vec3\) Vec3](<#Vec3.Subtract>) + - [func \(v \*Vec3\) SubtractAssign\(other Vec3\)](<#Vec3.SubtractAssign>) + - [func \(v Vec3\) Width\(\) Float](<#Vec3.Width>) + - [func \(v Vec3\) X\(\) Float](<#Vec3.X>) + - [func \(v Vec3\) XY\(\) Vec2](<#Vec3.XY>) + - [func \(v Vec3\) XYZ\(\) \(Float, Float, Float\)](<#Vec3.XYZ>) + - [func \(v Vec3\) XZ\(\) Vec2](<#Vec3.XZ>) + - [func \(v Vec3\) Y\(\) Float](<#Vec3.Y>) + - [func \(v Vec3\) Z\(\) Float](<#Vec3.Z>) +- [type Vec3MinMax](<#Vec3MinMax>) + - [func NewVec3MinMax\(\) Vec3MinMax](<#NewVec3MinMax>) +- [type Vec3i](<#Vec3i>) + - [func \(v Vec3i\) Depth\(\) int32](<#Vec3i.Depth>) + - [func \(v Vec3i\) Height\(\) int32](<#Vec3i.Height>) + - [func \(v \*Vec3i\) SetDepth\(depth int32\)](<#Vec3i.SetDepth>) + - [func \(v \*Vec3i\) SetHeight\(height int32\)](<#Vec3i.SetHeight>) + - [func \(v \*Vec3i\) SetWidth\(width int32\)](<#Vec3i.SetWidth>) + - [func \(v \*Vec3i\) SetX\(x int32\)](<#Vec3i.SetX>) + - [func \(v \*Vec3i\) SetY\(y int32\)](<#Vec3i.SetY>) + - [func \(v \*Vec3i\) SetZ\(z int32\)](<#Vec3i.SetZ>) + - [func \(v Vec3i\) Width\(\) int32](<#Vec3i.Width>) + - [func \(v Vec3i\) X\(\) int32](<#Vec3i.X>) + - [func \(v Vec3i\) Y\(\) int32](<#Vec3i.Y>) + - [func \(v Vec3i\) Z\(\) int32](<#Vec3i.Z>) +- [type Vec4](<#Vec4>) + - [func Mat4MultiplyVec4\(a Mat4, b Vec4\) Vec4](<#Mat4MultiplyVec4>) + - [func NewVec4\(x, y, z, w Float\) Vec4](<#NewVec4>) + - [func Vec4Area\(xa, ya, xb, yb Float\) Vec4](<#Vec4Area>) + - [func Vec4FromArray\(a \[4\]Float\) Vec4](<#Vec4FromArray>) + - [func Vec4FromSlice\(a \[\]Float\) Vec4](<#Vec4FromSlice>) + - [func Vec4FromString\(str string\) Vec4](<#Vec4FromString>) + - [func Vec4Half\(\) Vec4](<#Vec4Half>) + - [func Vec4Largest\(\) Vec4](<#Vec4Largest>) + - [func Vec4Lerp\(from, to Vec4, t Float\) Vec4](<#Vec4Lerp>) + - [func Vec4Max\(a, b Vec4\) Vec4](<#Vec4Max>) + - [func Vec4MaxAbs\(a, b Vec4\) Vec4](<#Vec4MaxAbs>) + - [func Vec4Min\(a, b Vec4\) Vec4](<#Vec4Min>) + - [func Vec4MinAbs\(a, b Vec4\) Vec4](<#Vec4MinAbs>) + - [func Vec4MultiplyMat4\(v Vec4, m Mat4\) Vec4](<#Vec4MultiplyMat4>) + - [func Vec4One\(\) Vec4](<#Vec4One>) + - [func Vec4Zero\(\) Vec4](<#Vec4Zero>) + - [func \(v Vec4\) Abs\(\) Vec4](<#Vec4.Abs>) + - [func \(v Vec4\) Add\(other Vec4\) Vec4](<#Vec4.Add>) + - [func \(v \*Vec4\) AddAssign\(other Vec4\)](<#Vec4.AddAssign>) + - [func \(v Vec4\) Angle\(other Vec4\) Float](<#Vec4.Angle>) + - [func \(v Vec4\) AreaContains\(x, y Float\) bool](<#Vec4.AreaContains>) + - [func \(v Vec4\) AsVec3\(\) Vec3](<#Vec4.AsVec3>) + - [func \(v Vec4\) AsVec4i\(\) Vec4i](<#Vec4.AsVec4i>) + - [func \(v Vec4\) Bottom\(\) Float](<#Vec4.Bottom>) + - [func \(v Vec4\) BoxContains\(x, y Float\) bool](<#Vec4.BoxContains>) + - [func \(v Vec4\) Distance\(other Vec4\) Float](<#Vec4.Distance>) + - [func \(v Vec4\) Divide\(other Vec4\) Vec4](<#Vec4.Divide>) + - [func \(v \*Vec4\) DivideAssign\(other Vec4\)](<#Vec4.DivideAssign>) + - [func \(v Vec4\) Equals\(other Vec4\) bool](<#Vec4.Equals>) + - [func \(v Vec4\) Height\(\) Float](<#Vec4.Height>) + - [func \(v Vec4\) Horizontal\(\) Float](<#Vec4.Horizontal>) + - [func \(v \*Vec4\) Inverse\(\)](<#Vec4.Inverse>) + - [func \(v Vec4\) LargestAxis\(\) Float](<#Vec4.LargestAxis>) + - [func \(v Vec4\) LargestAxisDelta\(\) Float](<#Vec4.LargestAxisDelta>) + - [func \(v Vec4\) Left\(\) Float](<#Vec4.Left>) + - [func \(v Vec4\) Length\(\) Float](<#Vec4.Length>) + - [func \(v Vec4\) Multiply\(other Vec4\) Vec4](<#Vec4.Multiply>) + - [func \(v \*Vec4\) MultiplyAssign\(other Vec4\)](<#Vec4.MultiplyAssign>) + - [func \(v Vec4\) Negative\(\) Vec4](<#Vec4.Negative>) + - [func \(v Vec4\) Normal\(\) Vec4](<#Vec4.Normal>) + - [func \(v \*Vec4\) Normalize\(\)](<#Vec4.Normalize>) + - [func \(v \*Vec4\) PW\(\) \*Float](<#Vec4.PW>) + - [func \(v \*Vec4\) PX\(\) \*Float](<#Vec4.PX>) + - [func \(v \*Vec4\) PY\(\) \*Float](<#Vec4.PY>) + - [func \(v \*Vec4\) PZ\(\) \*Float](<#Vec4.PZ>) + - [func \(v Vec4\) Right\(\) Float](<#Vec4.Right>) + - [func \(v Vec4\) Scale\(scalar Float\) Vec4](<#Vec4.Scale>) + - [func \(v \*Vec4\) ScaleAssign\(scalar Float\)](<#Vec4.ScaleAssign>) + - [func \(v Vec4\) ScreenAreaContains\(x, y Float\) bool](<#Vec4.ScreenAreaContains>) + - [func \(v \*Vec4\) SetBottom\(w Float\)](<#Vec4.SetBottom>) + - [func \(v \*Vec4\) SetHeight\(w Float\)](<#Vec4.SetHeight>) + - [func \(v \*Vec4\) SetLeft\(x Float\)](<#Vec4.SetLeft>) + - [func \(v \*Vec4\) SetRight\(z Float\)](<#Vec4.SetRight>) + - [func \(v \*Vec4\) SetTop\(y Float\)](<#Vec4.SetTop>) + - [func \(v \*Vec4\) SetW\(w Float\)](<#Vec4.SetW>) + - [func \(v \*Vec4\) SetWidth\(z Float\)](<#Vec4.SetWidth>) + - [func \(v \*Vec4\) SetX\(x Float\)](<#Vec4.SetX>) + - [func \(v \*Vec4\) SetY\(y Float\)](<#Vec4.SetY>) + - [func \(v \*Vec4\) SetZ\(z Float\)](<#Vec4.SetZ>) + - [func \(v Vec4\) Shrink\(scalar Float\) Vec4](<#Vec4.Shrink>) + - [func \(v \*Vec4\) ShrinkAssign\(scalar Float\)](<#Vec4.ShrinkAssign>) + - [func \(v Vec4\) String\(\) string](<#Vec4.String>) + - [func \(v Vec4\) Subtract\(other Vec4\) Vec4](<#Vec4.Subtract>) + - [func \(v \*Vec4\) SubtractAssign\(other Vec4\)](<#Vec4.SubtractAssign>) + - [func \(v Vec4\) Top\(\) Float](<#Vec4.Top>) + - [func \(v Vec4\) Vertical\(\) Float](<#Vec4.Vertical>) + - [func \(v Vec4\) W\(\) Float](<#Vec4.W>) + - [func \(v Vec4\) Width\(\) Float](<#Vec4.Width>) + - [func \(v Vec4\) X\(\) Float](<#Vec4.X>) + - [func \(v Vec4\) XYZW\(\) \(Float, Float, Float, Float\)](<#Vec4.XYZW>) + - [func \(v Vec4\) Y\(\) Float](<#Vec4.Y>) + - [func \(v Vec4\) Z\(\) Float](<#Vec4.Z>) +- [type Vec4i](<#Vec4i>) + - [func \(v Vec4i\) Height\(\) int32](<#Vec4i.Height>) + - [func \(v Vec4i\) W\(\) int32](<#Vec4i.W>) + - [func \(v Vec4i\) Width\(\) int32](<#Vec4i.Width>) + - [func \(v Vec4i\) X\(\) int32](<#Vec4i.X>) + - [func \(v Vec4i\) Y\(\) int32](<#Vec4i.Y>) + - [func \(v Vec4i\) Z\(\) int32](<#Vec4i.Z>) +- [type VectorComponent](<#VectorComponent>) -## Constants +## Constants -### const ( + ```go -Mat4Row0 = iota -Mat4Row1 -Mat4Row2 -Mat4Row3 +const ( + Mat4Row0 = iota + Mat4Row1 + Mat4Row2 + Mat4Row3 +) ``` -) -### const ( + ```go -Mat4Col0 = iota -Mat4Col1 -Mat4Col2 -Mat4Col3 +const ( + Mat4Col0 = iota + Mat4Col1 + Mat4Col2 + Mat4Col3 +) ``` + + +```go +const ( + Mat4x0y0 = x0y0 + Mat4x1y0 = x1y0 + Mat4x2y0 = x2y0 + Mat4x3y0 = x3y0 + Mat4x0y1 = x0y1 + Mat4x1y1 = x1y1 + Mat4x2y1 = x2y1 + Mat4x3y1 = x3y1 + Mat4x0y2 = x0y2 + Mat4x1y2 = x1y2 + Mat4x2y2 = x2y2 + Mat4x3y2 = x3y2 + Mat4x0y3 = x0y3 + Mat4x1y3 = x1y3 + Mat4x2y3 = x2y3 + Mat4x3y3 = x3y3 ) -### const ( - -```go -Mat4x0y0 = x0y0 -Mat4x1y0 = x1y0 -Mat4x2y0 = x2y0 -Mat4x3y0 = x3y0 -Mat4x0y1 = x0y1 -Mat4x1y1 = x1y1 -Mat4x2y1 = x2y1 -Mat4x3y1 = x3y1 -Mat4x0y2 = x0y2 -Mat4x1y2 = x1y2 -Mat4x2y2 = x2y2 -Mat4x3y2 = x3y2 -Mat4x0y3 = x0y3 -Mat4x1y3 = x1y3 -Mat4x2y3 = x2y3 -Mat4x3y3 = x3y3 ``` + + +```go +const ( + TransformWorkGroup = "transform" + TransformResetWorkGroup = "transformReset" ) -### const ( +``` + + ```go -TransformWorkGroup = "transform" -TransformResetWorkGroup = "transformReset" +const DegToRadVal = (math.Pi / 180.0) +``` + + + +```go +const FloatMax = Float(math.MaxFloat32) +``` + + + +```go +const FloatSmallestNonzero = Float(math.SmallestNonzeroFloat32) +``` + + + +```go +const RadToDegVal = (180.0 / math.Pi) +``` + + + +```go +const Roughly = 0.001 +``` + + + +```go +const Tiny = 0.0001 +``` + + +## func [AbsInt]() + +```go +func AbsInt(a int) int +``` + + + + +## func [Approx]() + +```go +func Approx(a, b Float) bool +``` + + + + +## func [ApproxTo]() + +```go +func ApproxTo(a, b, tolerance Float) bool +``` + + + + +## func [IsInf]() + +```go +func IsInf(x Float, sign int) bool +``` + + + + +## func [IsNaN]() + +```go +func IsNaN(x Float) bool +``` + + + + +## func [Mat4Approx]() + +```go +func Mat4Approx(a, b Mat4) bool +``` + + + + +## func [Mat4ApproxTo]() + +```go +func Mat4ApproxTo(a, b Mat4, delta Float) bool +``` + + + + +## func [QuaternionApprox]() + +```go +func QuaternionApprox(a, b Quaternion) bool +``` + + + + +## func [Vec2Approx]() + +```go +func Vec2Approx(a, b Vec2) bool +``` + + + + +## func [Vec2ApproxTo]() + +```go +func Vec2ApproxTo(a, b Vec2, delta Float) bool +``` + + + + +## func [Vec2Nearly]() + +```go +func Vec2Nearly(a, b Vec2) bool +``` + + + + +## func [Vec2Roughly]() + +```go +func Vec2Roughly(a, b Vec2) bool +``` + + + + +## func [Vec3Approx]() + +```go +func Vec3Approx(a, b Vec3) bool +``` + + + + +## func [Vec3ApproxTo]() + +```go +func Vec3ApproxTo(a, b Vec3, delta Float) bool +``` + + + + +## func [Vec4Approx]() + +```go +func Vec4Approx(a, b Vec4) bool +``` + + + + +## func [Vec4ApproxTo]() + +```go +func Vec4ApproxTo(a, b Vec4, delta Float) bool ``` -) -### const DegToRadVal = (math.Pi / 180.0) -### const FloatMax = Float(math.MaxFloat32) -### const FloatSmallestNonzero = Float(math.SmallestNonzeroFloat32) + +## func [Vec4Roughly]() + +```go +func Vec4Roughly(a, b Vec4) bool +``` + + + + +## type [Color]() + + + +```go +type Color Vec4 +``` + + +### func [ColorAqua]() + +```go +func ColorAqua() Color +``` + -### const RadToDegVal = (180.0 / math.Pi) -### const Roughly = 0.001 + +### func [ColorAquamarine]() -### const Tiny = 0.0001 +```go +func ColorAquamarine() Color +``` + + + + +### func [ColorAzure]() + +```go +func ColorAzure() Color +``` -## Functions + +### func [ColorBeige]() -### func AbsInt(a int) int +```go +func ColorBeige() Color +``` -### func Approx(a, b Float) bool -### func ApproxTo(a, b, tolerance Float) bool -### func IsInf(x Float, sign int) bool + +### func [ColorBisque]() -### func IsNaN(x Float) bool +```go +func ColorBisque() Color +``` -### func Mat4Approx(a, b Mat4) bool -### func Mat4ApproxTo(a, b Mat4, delta Float) bool -### func QuaternionApprox(a, b Quaternion) bool + +### func [ColorBlack]() -### func Vec2Approx(a, b Vec2) bool +```go +func ColorBlack() Color +``` -### func Vec2ApproxTo(a, b Vec2, delta Float) bool -### func Vec2Nearly(a, b Vec2) bool -### func Vec2Roughly(a, b Vec2) bool + +### func [ColorBlanchedAlmond]() -### func Vec3Approx(a, b Vec3) bool +```go +func ColorBlanchedAlmond() Color +``` -### func Vec3ApproxTo(a, b Vec3, delta Float) bool -### func Vec4Approx(a, b Vec4) bool -### func Vec4ApproxTo(a, b Vec4, delta Float) bool + +### func [ColorBlue]() -### func Vec4Roughly(a, b Vec4) bool +```go +func ColorBlue() Color +``` -## Types + +### func [ColorBlueViolet]() -### type Color Vec4 +```go +func ColorBlueViolet() Color +``` -### func ColorAqua() Color + +### func [ColorBrown]() -### func ColorAquamarine() Color +```go +func ColorBrown() Color +``` -### func ColorAzure() Color + +### func [ColorBurlyWood]() -### func ColorBeige() Color +```go +func ColorBurlyWood() Color +``` -### func ColorBisque() Color + +### func [ColorCadetBlue]() -### func ColorBlack() Color +```go +func ColorCadetBlue() Color +``` -### func ColorBlanchedAlmond() Color + +### func [ColorChartreuse]() -### func ColorBlue() Color +```go +func ColorChartreuse() Color +``` -### func ColorBlueViolet() Color + +### func [ColorChocolate]() -### func ColorBrown() Color +```go +func ColorChocolate() Color +``` -### func ColorBurlyWood() Color + +### func [ColorClear]() -### func ColorCadetBlue() Color +```go +func ColorClear() Color +``` -### func ColorChartreuse() Color + +### func [ColorCoral]() -### func ColorChocolate() Color +```go +func ColorCoral() Color +``` -### func ColorClear() Color + +### func [ColorCornSilk]() -### func ColorCoral() Color +```go +func ColorCornSilk() Color +``` -### func ColorCornSilk() Color + +### func [ColorCornflowerBlue]() -### func ColorCornflowerBlue() Color +```go +func ColorCornflowerBlue() Color +``` -### func ColorCrimson() Color + +### func [ColorCrimson]() -### func ColorCyan() Color +```go +func ColorCrimson() Color +``` -### func ColorDarkBG() Color + +### func [ColorCyan]() -### func ColorDarkBlue() Color +```go +func ColorCyan() Color +``` -### func ColorDarkCyan() Color + +### func [ColorDarkBG]() -### func ColorDarkGoldenrod() Color +```go +func ColorDarkBG() Color +``` -### func ColorDarkGray() Color + +### func [ColorDarkBlue]() -### func ColorDarkGreen() Color +```go +func ColorDarkBlue() Color +``` -### func ColorDarkKhaki() Color + +### func [ColorDarkCyan]() -### func ColorDarkMagenta() Color +```go +func ColorDarkCyan() Color +``` -### func ColorDarkModeGrayBG() Color + +### func [ColorDarkGoldenrod]() -### func ColorDarkModeGrayFG() Color +```go +func ColorDarkGoldenrod() Color +``` -### func ColorDarkOliveGreen() Color + +### func [ColorDarkGray]() -### func ColorDarkOrange() Color +```go +func ColorDarkGray() Color +``` -### func ColorDarkOrchid() Color + +### func [ColorDarkGreen]() -### func ColorDarkRed() Color +```go +func ColorDarkGreen() Color +``` -### func ColorDarkSalmon() Color + +### func [ColorDarkKhaki]() -### func ColorDarkSeaGreen() Color +```go +func ColorDarkKhaki() Color +``` -### func ColorDarkSlateBlue() Color + +### func [ColorDarkMagenta]() -### func ColorDarkSlateGray() Color +```go +func ColorDarkMagenta() Color +``` -### func ColorDarkTurquoise() Color + +### func [ColorDarkModeGrayBG]() -### func ColorDarkViolet() Color +```go +func ColorDarkModeGrayBG() Color +``` -### func ColorDeepPink() Color + +### func [ColorDarkModeGrayFG]() -### func ColorDeepSkyBlue() Color +```go +func ColorDarkModeGrayFG() Color +``` -### func ColorDimGray() Color + +### func [ColorDarkOliveGreen]() -### func ColorDodgerBlue() Color +```go +func ColorDarkOliveGreen() Color +``` -### func ColorFirebrick() Color + +### func [ColorDarkOrange]() -### func ColorFloralWhite() Color +```go +func ColorDarkOrange() Color +``` -### func ColorForestGreen() Color + +### func [ColorDarkOrchid]() -### func ColorFromColor8(c Color8) Color +```go +func ColorDarkOrchid() Color +``` -### func ColorFromHexString(str string) (Color, error) + +### func [ColorDarkRed]() -### func ColorFromVec3(v Vec3) Color +```go +func ColorDarkRed() Color +``` -### func ColorFromVec4(v Vec4) Color + +### func [ColorDarkSalmon]() -### func ColorFuchsia() Color +```go +func ColorDarkSalmon() Color +``` -### func ColorGainsboro() Color + +### func [ColorDarkSeaGreen]() -### func ColorGhostWhite() Color +```go +func ColorDarkSeaGreen() Color +``` -### func ColorGold() Color + +### func [ColorDarkSlateBlue]() -### func ColorGoldenrod() Color +```go +func ColorDarkSlateBlue() Color +``` -### func ColorGray() Color + +### func [ColorDarkSlateGray]() -### func ColorGreen() Color +```go +func ColorDarkSlateGray() Color +``` -### func ColorGreenYellow() Color + +### func [ColorDarkTurquoise]() -### func ColorHoneydew() Color +```go +func ColorDarkTurquoise() Color +``` -### func ColorHotPink() Color + +### func [ColorDarkViolet]() -### func ColorIndianRed() Color +```go +func ColorDarkViolet() Color +``` -### func ColorIndigo() Color + +### func [ColorDeepPink]() -### func ColorIvory() Color +```go +func ColorDeepPink() Color +``` -### func ColorKhaki() Color + +### func [ColorDeepSkyBlue]() -### func ColorLavender() Color +```go +func ColorDeepSkyBlue() Color +``` -### func ColorLavenderBlush() Color + +### func [ColorDimGray]() -### func ColorLawnGreen() Color +```go +func ColorDimGray() Color +``` -### func ColorLemonChiffon() Color + +### func [ColorDodgerBlue]() -### func ColorLightBlue() Color +```go +func ColorDodgerBlue() Color +``` -### func ColorLightCoral() Color + +### func [ColorFirebrick]() -### func ColorLightCyan() Color +```go +func ColorFirebrick() Color +``` -### func ColorLightGoldenrodYellow() Color + +### func [ColorFloralWhite]() -### func ColorLightGreen() Color +```go +func ColorFloralWhite() Color +``` -### func ColorLightGrey() Color + +### func [ColorForestGreen]() -### func ColorLightPink() Color +```go +func ColorForestGreen() Color +``` -### func ColorLightSalmon() Color + +### func [ColorFromColor8]() -### func ColorLightSeaGreen() Color +```go +func ColorFromColor8(c Color8) Color +``` -### func ColorLightSkyBlue() Color + +### func [ColorFromHexString]() -### func ColorLightSlateGray() Color +```go +func ColorFromHexString(str string) (Color, error) +``` -### func ColorLightSteelBlue() Color + +### func [ColorFromVec3]() -### func ColorLightYellow() Color +```go +func ColorFromVec3(v Vec3) Color +``` -### func ColorLime() Color + +### func [ColorFromVec4]() -### func ColorLimeGreen() Color +```go +func ColorFromVec4(v Vec4) Color +``` -### func ColorLinen() Color + +### func [ColorFuchsia]() -### func ColorMagenta() Color +```go +func ColorFuchsia() Color +``` -### func ColorMaroon() Color + +### func [ColorGainsboro]() -### func ColorMediumAquamarine() Color +```go +func ColorGainsboro() Color +``` -### func ColorMediumBlue() Color + +### func [ColorGhostWhite]() -### func ColorMediumOrchid() Color +```go +func ColorGhostWhite() Color +``` -### func ColorMediumPurple() Color + +### func [ColorGold]() -### func ColorMediumSeaGreen() Color +```go +func ColorGold() Color +``` -### func ColorMediumSlateBlue() Color + +### func [ColorGoldenrod]() + +```go +func ColorGoldenrod() Color +``` + + + + +### func [ColorGray]() + +```go +func ColorGray() Color +``` + + + + +### func [ColorGreen]() + +```go +func ColorGreen() Color +``` + + + + +### func [ColorGreenYellow]() + +```go +func ColorGreenYellow() Color +``` + + + + +### func [ColorHoneydew]() + +```go +func ColorHoneydew() Color +``` + + + + +### func [ColorHotPink]() + +```go +func ColorHotPink() Color +``` + + + + +### func [ColorIndianRed]() + +```go +func ColorIndianRed() Color +``` + + + + +### func [ColorIndigo]() + +```go +func ColorIndigo() Color +``` + + + + +### func [ColorIvory]() + +```go +func ColorIvory() Color +``` + + + + +### func [ColorKhaki]() + +```go +func ColorKhaki() Color +``` + + + + +### func [ColorLavender]() + +```go +func ColorLavender() Color +``` + + + + +### func [ColorLavenderBlush]() + +```go +func ColorLavenderBlush() Color +``` + + + + +### func [ColorLawnGreen]() + +```go +func ColorLawnGreen() Color +``` + + + + +### func [ColorLemonChiffon]() + +```go +func ColorLemonChiffon() Color +``` + + + + +### func [ColorLightBlue]() + +```go +func ColorLightBlue() Color +``` + + + + +### func [ColorLightCoral]() + +```go +func ColorLightCoral() Color +``` + + + + +### func [ColorLightCyan]() + +```go +func ColorLightCyan() Color +``` + + + + +### func [ColorLightGoldenrodYellow]() + +```go +func ColorLightGoldenrodYellow() Color +``` + + + + +### func [ColorLightGreen]() + +```go +func ColorLightGreen() Color +``` + + + + +### func [ColorLightGrey]() + +```go +func ColorLightGrey() Color +``` + + + + +### func [ColorLightPink]() + +```go +func ColorLightPink() Color +``` + + + + +### func [ColorLightSalmon]() + +```go +func ColorLightSalmon() Color +``` + + + + +### func [ColorLightSeaGreen]() + +```go +func ColorLightSeaGreen() Color +``` + + + + +### func [ColorLightSkyBlue]() + +```go +func ColorLightSkyBlue() Color +``` + + + + +### func [ColorLightSlateGray]() + +```go +func ColorLightSlateGray() Color +``` + + + + +### func [ColorLightSteelBlue]() + +```go +func ColorLightSteelBlue() Color +``` + + + + +### func [ColorLightYellow]() + +```go +func ColorLightYellow() Color +``` + + + + +### func [ColorLime]() + +```go +func ColorLime() Color +``` + + + + +### func [ColorLimeGreen]() + +```go +func ColorLimeGreen() Color +``` + + + + +### func [ColorLinen]() + +```go +func ColorLinen() Color +``` + + + + +### func [ColorMagenta]() + +```go +func ColorMagenta() Color +``` + + + + +### func [ColorMaroon]() + +```go +func ColorMaroon() Color +``` + + + + +### func [ColorMediumAquamarine]() + +```go +func ColorMediumAquamarine() Color +``` + + + + +### func [ColorMediumBlue]() + +```go +func ColorMediumBlue() Color +``` + + + + +### func [ColorMediumOrchid]() + +```go +func ColorMediumOrchid() Color +``` + + + + +### func [ColorMediumPurple]() + +```go +func ColorMediumPurple() Color +``` + + + + +### func [ColorMediumSeaGreen]() + +```go +func ColorMediumSeaGreen() Color +``` + + + + +### func [ColorMediumSlateBlue]() + +```go +func ColorMediumSlateBlue() Color +``` + + + + +### func [ColorMediumSpringGreen]() + +```go +func ColorMediumSpringGreen() Color +``` + + + + +### func [ColorMediumTurquoise]() + +```go +func ColorMediumTurquoise() Color +``` + + + + +### func [ColorMediumVioletRed]() + +```go +func ColorMediumVioletRed() Color +``` + + + + +### func [ColorMidnightBlue]() + +```go +func ColorMidnightBlue() Color +``` + + + + +### func [ColorMintCream]() + +```go +func ColorMintCream() Color +``` + + + + +### func [ColorMistyRose]() + +```go +func ColorMistyRose() Color +``` + + + + +### func [ColorMix]() + +```go +func ColorMix(lhs, rhs Color, amount Float) Color +``` + + + + +### func [ColorMoccasin]() + +```go +func ColorMoccasin() Color +``` + + + + +### func [ColorNavajoWhite]() + +```go +func ColorNavajoWhite() Color +``` + + + + +### func [ColorNavy]() + +```go +func ColorNavy() Color +``` + + + + +### func [ColorOldLace]() + +```go +func ColorOldLace() Color +``` + + + + +### func [ColorOlive]() + +```go +func ColorOlive() Color +``` + + + + +### func [ColorOliveDrab]() + +```go +func ColorOliveDrab() Color +``` + + + + +### func [ColorOrange]() + +```go +func ColorOrange() Color +``` + + + + +### func [ColorOrangeRed]() + +```go +func ColorOrangeRed() Color +``` + + + + +### func [ColorOrchid]() + +```go +func ColorOrchid() Color +``` + + + + +### func [ColorPaleGoldenrod]() + +```go +func ColorPaleGoldenrod() Color +``` + + + + +### func [ColorPaleGreen]() + +```go +func ColorPaleGreen() Color +``` + + + + +### func [ColorPaleTurquoise]() + +```go +func ColorPaleTurquoise() Color +``` + + + + +### func [ColorPaleVioletred]() + +```go +func ColorPaleVioletred() Color +``` + + + + +### func [ColorPapayaWhip]() + +```go +func ColorPapayaWhip() Color +``` + + + + +### func [ColorPeachPuff]() + +```go +func ColorPeachPuff() Color +``` + + + + +### func [ColorPeru]() + +```go +func ColorPeru() Color +``` + + + + +### func [ColorPink]() + +```go +func ColorPink() Color +``` + + + + +### func [ColorPlum]() + +```go +func ColorPlum() Color +``` + + + + +### func [ColorPowderBlue]() + +```go +func ColorPowderBlue() Color +``` + + + + +### func [ColorPurple]() + +```go +func ColorPurple() Color +``` + + + + +### func [ColorRGBAInt]() + +```go +func ColorRGBAInt(r, g, b, a int) Color +``` + + + + +### func [ColorRGBInt]() + +```go +func ColorRGBInt(r, g, b int) Color +``` + + + + +### func [ColorRed]() + +```go +func ColorRed() Color +``` + + + + +### func [ColorRosyBrown]() + +```go +func ColorRosyBrown() Color +``` + + + + +### func [ColorRoyalBlue]() + +```go +func ColorRoyalBlue() Color +``` + + + + +### func [ColorSaddleBrown]() + +```go +func ColorSaddleBrown() Color +``` + + + + +### func [ColorSalmon]() + +```go +func ColorSalmon() Color +``` + + + + +### func [ColorSandyBrown]() + +```go +func ColorSandyBrown() Color +``` + + + + +### func [ColorSeaGreen]() + +```go +func ColorSeaGreen() Color +``` + + + + +### func [ColorSeashell]() + +```go +func ColorSeashell() Color +``` + + + + +### func [ColorSienna]() + +```go +func ColorSienna() Color +``` + + + + +### func [ColorSilver]() + +```go +func ColorSilver() Color +``` + + + + +### func [ColorSky]() + +```go +func ColorSky() Color +``` + + + + +### func [ColorSkyBlue]() + +```go +func ColorSkyBlue() Color +``` + + + + +### func [ColorSlateBlue]() + +```go +func ColorSlateBlue() Color +``` + + + + +### func [ColorSlateGray]() + +```go +func ColorSlateGray() Color +``` + + + + +### func [ColorSlateGrey]() + +```go +func ColorSlateGrey() Color +``` + + + + +### func [ColorSnow]() + +```go +func ColorSnow() Color +``` + + + + +### func [ColorSpringGreen]() + +```go +func ColorSpringGreen() Color +``` + + + + +### func [ColorSteelBlue]() + +```go +func ColorSteelBlue() Color +``` + + + + +### func [ColorTan]() + +```go +func ColorTan() Color +``` + + + + +### func [ColorTeal]() + +```go +func ColorTeal() Color +``` + + + + +### func [ColorThistle]() + +```go +func ColorThistle() Color +``` + + + + +### func [ColorTomato]() + +```go +func ColorTomato() Color +``` + + + + +### func [ColorTransparent]() + +```go +func ColorTransparent() Color +``` + + + + +### func [ColorTurquoise]() + +```go +func ColorTurquoise() Color +``` + + + + +### func [ColorViolet]() + +```go +func ColorViolet() Color +``` + + + + +### func [ColorWheat]() + +```go +func ColorWheat() Color +``` + + + + +### func [ColorWhite]() + +```go +func ColorWhite() Color +``` + + + + +### func [ColorWhiteSmoke]() + +```go +func ColorWhiteSmoke() Color +``` + + + + +### func [ColorYellow]() + +```go +func ColorYellow() Color +``` + + + + +### func [ColorYellowGreen]() + +```go +func ColorYellowGreen() Color +``` + + + + +### func [ColorZero]() + +```go +func ColorZero() Color +``` + + + + +### func [NewColor]() + +```go +func NewColor(r, g, b, a Float) Color +``` + + + + +### func \(Color\) [A]() + +```go +func (c Color) A() Float +``` + + + + +### func \(Color\) [AsColor8]() + +```go +func (c Color) AsColor8() Color8 +``` + + + + +### func \(Color\) [B]() + +```go +func (c Color) B() Float +``` + + + + +### func \(Color\) [Equals]() + +```go +func (lhs Color) Equals(rhs Color) bool +``` + + + + +### func \(Color\) [G]() + +```go +func (c Color) G() Float +``` + + + + +### func \(Color\) [Hex]() + +```go +func (c Color) Hex() string +``` + + + + +### func \(\*Color\) [Inverted]() + +```go +func (c *Color) Inverted() Color +``` + + + + +### func \(Color\) [IsZero]() + +```go +func (c Color) IsZero() bool +``` + + + + +### func \(\*Color\) [MultiplyAssign]() + +```go +func (c *Color) MultiplyAssign(other Color) +``` + + + + +### func \(\*Color\) [PA]() + +```go +func (c *Color) PA() *Float +``` + + + + +### func \(\*Color\) [PB]() + +```go +func (c *Color) PB() *Float +``` + + + + +### func \(\*Color\) [PG]() + +```go +func (c *Color) PG() *Float +``` + + + + +### func \(\*Color\) [PR]() + +```go +func (c *Color) PR() *Float +``` + + + + +### func \(Color\) [R]() + +```go +func (c Color) R() Float +``` + + + + +### func \(Color\) [RGBA]() + +```go +func (c Color) RGBA() (Float, Float, Float, Float) +``` + + + + +### func \(Color\) [ScaleWithoutAlpha]() + +```go +func (c Color) ScaleWithoutAlpha(scale Float) Color +``` + + + + +### func \(\*Color\) [SetA]() + +```go +func (c *Color) SetA(a Float) +``` + + + + +### func \(\*Color\) [SetB]() + +```go +func (c *Color) SetB(b Float) +``` + + + + +### func \(\*Color\) [SetG]() + +```go +func (c *Color) SetG(g Float) +``` + + + + +### func \(\*Color\) [SetR]() + +```go +func (c *Color) SetR(r Float) +``` + + + + +## type [Color8]() + + + +```go +type Color8 [4]uint8 +``` + + +### func [Color8FromBytes]() + +```go +func Color8FromBytes(bytes []byte) Color8 +``` + + + + +### func [Color8FromColor]() + +```go +func Color8FromColor(c Color) Color8 +``` + + + + +### func [Color8FromHexString]() + +```go +func Color8FromHexString(str string) (Color8, error) +``` + + + + +### func [NewColor8]() + +```go +func NewColor8(r, g, b, a uint8) Color8 +``` + + + + +### func \(Color8\) [A]() + +```go +func (c Color8) A() uint8 +``` + + + + +### func \(Color8\) [AsColor]() + +```go +func (c Color8) AsColor() Color +``` + + + + +### func \(Color8\) [B]() + +```go +func (c Color8) B() uint8 +``` + + + + +### func \(Color8\) [Equal]() + +```go +func (c Color8) Equal(rhs Color8) bool +``` + + + + +### func \(Color8\) [G]() + +```go +func (c Color8) G() uint8 +``` + + + + +### func \(Color8\) [Hex]() + +```go +func (c Color8) Hex() string +``` + + + + +### func \(\*Color8\) [PA]() + +```go +func (c *Color8) PA() *uint8 +``` + + + + +### func \(\*Color8\) [PB]() + +```go +func (c *Color8) PB() *uint8 +``` + + + + +### func \(\*Color8\) [PG]() + +```go +func (c *Color8) PG() *uint8 +``` + + + + +### func \(\*Color8\) [PR]() + +```go +func (c *Color8) PR() *uint8 +``` + + + + +### func \(Color8\) [R]() + +```go +func (c Color8) R() uint8 +``` + + + + +### func \(Color8\) [RGBA]() + +```go +func (c Color8) RGBA() (uint8, uint8, uint8, uint8) +``` + + + + +### func \(\*Color8\) [SetA]() + +```go +func (c *Color8) SetA(a uint8) +``` + + + + +### func \(\*Color8\) [SetB]() + +```go +func (c *Color8) SetB(b uint8) +``` + + + + +### func \(\*Color8\) [SetG]() + +```go +func (c *Color8) SetG(g uint8) +``` + + + + +### func \(\*Color8\) [SetR]() + +```go +func (c *Color8) SetR(r uint8) +``` + + + + +### func \(Color8\) [Similar]() + +```go +func (lhs Color8) Similar(rhs Color8, tolerance uint8) bool +``` + + + + +### func \(Color8\) [ToUintRaw]() + +```go +func (c Color8) ToUintRaw() uint32 +``` + + + + +## type [ColorComponent]() + + + +```go +type ColorComponent = int +``` + + + +```go +const ( + R ColorComponent = iota + G + B + A +) +``` + + +## type [Float]() + + + +```go +type Float = float32 +``` + + +### func [Abs]() + +```go +func Abs(x Float) Float +``` + + + + +### func [Acos]() + +```go +func Acos(x Float) Float +``` + + + + +### func [Asin]() + +```go +func Asin(x Float) Float +``` + + + + +### func [Atan]() + +```go +func Atan(x Float) Float +``` + + + + +### func [Atan2]() + +```go +func Atan2(y Float, x Float) Float +``` + + + + +### func [Ceil]() + +```go +func Ceil(x Float) Float +``` + + + + +### func [Clamp]() + +```go +func Clamp(current, minimum, maximum Float) Float +``` + + + + +### func [Cos]() + +```go +func Cos(x Float) Float +``` + + + + +### func [Deg2Rad]() + +```go +func Deg2Rad(degree Float) Float +``` + + + + +### func [Floor]() + +```go +func Floor(x Float) Float +``` + + + + +### func [Inf]() + +```go +func Inf(sign int) Float +``` + + + + +### func [Lerp]() + +```go +func Lerp(v0, v1, t Float) Float +``` + + + + +### func [Log2]() + +```go +func Log2(x Float) Float +``` + + + + +### func [Max]() + +```go +func Max(a Float, b Float) Float +``` + + + + +### func [Min]() + +```go +func Min(a Float, b Float) Float +``` + + + + +### func [Mod]() + +```go +func Mod(x Float, y Float) Float +``` + + + + +### func [NaN]() + +```go +func NaN() Float +``` + + + + +### func [Pow]() + +```go +func Pow(x Float, y Float) Float +``` + + + + +### func [Rad2Deg]() + +```go +func Rad2Deg(radian Float) Float +``` + + + + +### func [Round]() + +```go +func Round(x Float) Float +``` + + + + +### func [Sin]() + +```go +func Sin(x Float) Float +``` + + + + +### func [Sqrt]() + +```go +func Sqrt(x Float) Float +``` + + + + +### func [Tan]() + +```go +func Tan(x Float) Float +``` + + + + +### func [Vec2Dot]() + +```go +func Vec2Dot(v, other Vec2) Float +``` + + + + +### func [Vec3Dot]() + +```go +func Vec3Dot(v, other Vec3) Float +``` + + + + +### func [Vec4Dot]() + +```go +func Vec4Dot(a, b Vec4) Float +``` + + + + +## type [Mat3]() + + + +```go +type Mat3 [9]Float +``` + + +### func [Mat3FromMat4]() + +```go +func Mat3FromMat4(m Mat4) Mat3 +``` + + + + +### func [Mat3Identity]() + +```go +func Mat3Identity() Mat3 +``` + + + + +### func [Mat3Zero]() + +```go +func Mat3Zero() Mat3 +``` + + + + +### func [NewMat3]() + +```go +func NewMat3() Mat3 +``` + + + + +### func \(Mat3\) [ColumnVector]() + +```go +func (m Mat3) ColumnVector(col int) Vec3 +``` + + + + +### func \(Mat3\) [Multiply]() + +```go +func (m Mat3) Multiply(rhs Mat3) Mat3 +``` + + + + +### func \(\*Mat3\) [MultiplyAssign]() + +```go +func (m *Mat3) MultiplyAssign(rhs Mat3) +``` + + + + +### func \(Mat3\) [MultiplyVec3]() + +```go +func (m Mat3) MultiplyVec3(v Vec3) Vec3 +``` + + + + +### func \(\*Mat3\) [Reset]() + +```go +func (m *Mat3) Reset() +``` + + + + +### func \(Mat3\) [RowVector]() + +```go +func (m Mat3) RowVector(row int) Vec3 +``` + + + + +### func \(Mat3\) [ToMat4]() + +```go +func (m Mat3) ToMat4() Mat4 +``` + + + + +### func \(Mat3\) [Transpose]() + +```go +func (m Mat3) Transpose() Mat3 +``` + + + + +## type [Mat4]() + + + +```go +type Mat4 [16]Float +``` + + +### func [Mat4FromSlice]() + +```go +func Mat4FromSlice(a []Float) Mat4 +``` + + + + +### func [Mat4Identity]() + +```go +func Mat4Identity() Mat4 +``` + + + + +### func [Mat4LookAt]() + +```go +func Mat4LookAt(eye, center, up Vec3) Mat4 +``` + + + + +### func [Mat4Multiply]() + +```go +func Mat4Multiply(a, b Mat4) Mat4 +``` + + + + +### func [Mat4Zero]() + +```go +func Mat4Zero() Mat4 +``` + + + + +### func [NewMat4]() + +```go +func NewMat4() Mat4 +``` + + + + +### func \(\*Mat4\) [AddAssign]() + +```go +func (m *Mat4) AddAssign(rhs Mat4) +``` + + + + +### func \(Mat4\) [At]() + +```go +func (m Mat4) At(rowIndex, colIndex int) Float +``` + + + + +### func \(Mat4\) [ColumnVector]() + +```go +func (m Mat4) ColumnVector(col int) Vec4 +``` + + + + +### func \(Mat4\) [Equals]() + +```go +func (m Mat4) Equals(other Mat4) bool +``` + + + + +### func \(Mat4\) [ExtractPosition]() + +```go +func (m Mat4) ExtractPosition() Vec3 +``` + + + + +### func \(Mat4\) [ExtractRotation]() + +```go +func (m Mat4) ExtractRotation() Quaternion +``` + + + + +### func \(Mat4\) [ExtractScale]() + +```go +func (m Mat4) ExtractScale() Vec3 +``` + + + + +### func \(Mat4\) [Forward]() + +```go +func (m Mat4) Forward() Vec3 +``` + + + + +### func \(\*Mat4\) [Inverse]() + +```go +func (m *Mat4) Inverse() +``` + + + + +### func \(Mat4\) [Inverted]() + +```go +func (m Mat4) Inverted() Mat4 +``` + + + + +### func \(Mat4\) [IsIdentity]() + +```go +func (m Mat4) IsIdentity() bool +``` + + + + +### func \(\*Mat4\) [LookAt]() + +```go +func (m *Mat4) LookAt(eye, center, up Vec3) +``` + + + + +### func \(\*Mat4\) [Mat3]() + +```go +func (m *Mat4) Mat3() Mat3 +``` + + + + +### func \(Mat4\) [Mat4ProjToVulkan]() + +```go +func (m Mat4) Mat4ProjToVulkan() Mat4 +``` + + + + +### func \(Mat4\) [Mat4Project]() + +```go +func (m Mat4) Mat4Project(pos Vec3, viewport Vec4) Vec3 +``` + + + + +### func \(Mat4\) [Mat4UnProject]() + +```go +func (m Mat4) Mat4UnProject(p Vec3, invViewProj Mat4, viewport Vec4) Vec3 +``` + + + + +### func \(\*Mat4\) [MultiplyAssign]() + +```go +func (a *Mat4) MultiplyAssign(b Mat4) +``` + + + + +### func \(\*Mat4\) [NegateAssign]() + +```go +func (m *Mat4) NegateAssign() +``` + + + + +### func \(\*Mat4\) [Orthographic]() + +```go +func (m *Mat4) Orthographic(left, right, bottom, top, near, far Float) +``` + + + + +### func \(\*Mat4\) [Perspective]() + +```go +func (m *Mat4) Perspective(fovy, aspect, nearVal, farVal Float) +``` + + + + +### func \(\*Mat4\) [Reset]() + +```go +func (m *Mat4) Reset() +``` + + + + +### func \(Mat4\) [Right]() + +```go +func (m Mat4) Right() Vec3 +``` + + + + +### func \(\*Mat4\) [Rotate]() + +```go +func (m *Mat4) Rotate(rotate Vec3) +``` + + + + +### func \(\*Mat4\) [RotateAngles]() + +```go +func (m *Mat4) RotateAngles(axis Vec3, angle Float) +``` + + + + +### func \(\*Mat4\) [RotateX]() + +```go +func (m *Mat4) RotateX(angles Float) +``` + + + + +### func \(\*Mat4\) [RotateY]() + +```go +func (m *Mat4) RotateY(angles Float) +``` + + + + +### func \(\*Mat4\) [RotateZ]() + +```go +func (m *Mat4) RotateZ(angles Float) +``` + + + + +### func \(Mat4\) [RowVector]() + +```go +func (m Mat4) RowVector(row int) Vec4 +``` + + + + +### func \(\*Mat4\) [Scale]() + +```go +func (m *Mat4) Scale(scale Vec3) +``` + + + + +### func \(\*Mat4\) [SetTranslation]() + +```go +func (m *Mat4) SetTranslation(translation Vec3) +``` + + + + +### func \(\*Mat4\) [SubtractAssign]() + +```go +func (m *Mat4) SubtractAssign(rhs Mat4) +``` + + + + +### func \(Mat4\) [ToQuaternion]() + +```go +func (m Mat4) ToQuaternion() Quaternion +``` + + + + +### func \(Mat4\) [TransformPoint]() + +```go +func (m Mat4) TransformPoint(point Vec3) Vec3 +``` + + + + +### func \(\*Mat4\) [Translate]() + +```go +func (m *Mat4) Translate(translation Vec3) +``` + + + + +### func \(Mat4\) [Transpose]() + +```go +func (m Mat4) Transpose() Mat4 +``` + + + + +### func \(\*Mat4\) [TransposeAssign]() + +```go +func (m *Mat4) TransposeAssign() +``` + + + + +### func \(Mat4\) [Up]() + +```go +func (m Mat4) Up() Vec3 +``` + + + + +### func \(\*Mat4\) [Zero]() + +```go +func (m *Mat4) Zero() +``` + + + + +## type [Quaternion]() + + + +```go +type Quaternion [4]Float +``` + + +### func [NewQuaternion]() + +```go +func NewQuaternion(w, x, y, z Float) Quaternion +``` + + + + +### func [QuatAngleBetween]() + +```go +func QuatAngleBetween(lhs, rhs Vec3) Quaternion +``` + + + + +### func [QuaternionAxisAngle]() + +```go +func QuaternionAxisAngle(axis Vec3, angle Float) Quaternion +``` + + + + +### func [QuaternionFromArray]() + +```go +func QuaternionFromArray(xyzw [4]Float) Quaternion +``` + + + + +### func [QuaternionFromEuler]() + +```go +func QuaternionFromEuler(v Vec3) Quaternion +``` + + + + +### func [QuaternionFromMat4]() + +```go +func QuaternionFromMat4(m Mat4) Quaternion +``` + + + + +### func [QuaternionFromSlice]() + +```go +func QuaternionFromSlice(xyzw []Float) Quaternion +``` + + + + +### func [QuaternionFromVec4]() + +```go +func QuaternionFromVec4(v Vec4) Quaternion +``` + + + + +### func [QuaternionFromXYZW]() + +```go +func QuaternionFromXYZW(xyzw [4]Float) Quaternion +``` + + + + +### func [QuaternionFromXYZWSlice]() + +```go +func QuaternionFromXYZWSlice(xyzw []Float) Quaternion +``` + + + + +### func [QuaternionIdentity]() + +```go +func QuaternionIdentity() Quaternion +``` + + + + +### func [QuaternionLerp]() + +```go +func QuaternionLerp(from, to Quaternion, factor Float) Quaternion +``` + + + + +### func [QuaternionLookAt]() + +```go +func QuaternionLookAt(from, to Vec3) Quaternion +``` + + + + +### func [QuaternionSlerp]() + +```go +func QuaternionSlerp(from, to Quaternion, factor Float) Quaternion +``` + + + + +### func \(\*Quaternion\) [AddAssign]() + +```go +func (q *Quaternion) AddAssign(rhs Quaternion) +``` + + + + +### func \(\*Quaternion\) [Conjugate]() + +```go +func (q *Quaternion) Conjugate() +``` + + + + +### func \(\*Quaternion\) [Inverse]() + +```go +func (q *Quaternion) Inverse() +``` + + + + +### func \(Quaternion\) [IsZero]() + +```go +func (q Quaternion) IsZero() bool +``` + + + + +### func \(Quaternion\) [Multiply]() + +```go +func (q Quaternion) Multiply(rhs Quaternion) Quaternion +``` + + + + +### func \(\*Quaternion\) [MultiplyAssign]() + +```go +func (q *Quaternion) MultiplyAssign(rhs Quaternion) +``` + + + + +### func \(Quaternion\) [MultiplyVec3]() + +```go +func (q Quaternion) MultiplyVec3(rhs Vec3) Vec3 +``` + + + + +### func \(Quaternion\) [Normal]() + +```go +func (q Quaternion) Normal() Quaternion +``` + + + + +### func \(\*Quaternion\) [Normalize]() + +```go +func (q *Quaternion) Normalize() +``` + + + + +### func \(Quaternion\) [ToEuler]() + +```go +func (q Quaternion) ToEuler() Vec3 +``` + + + + +### func \(Quaternion\) [ToMat4]() + +```go +func (q Quaternion) ToMat4() Mat4 +``` + + + + +### func \(Quaternion\) [W]() + +```go +func (q Quaternion) W() Float +``` + + + + +### func \(Quaternion\) [X]() + +```go +func (q Quaternion) X() Float +``` + + + + +### func \(Quaternion\) [Y]() + +```go +func (q Quaternion) Y() Float +``` + + + + +### func \(Quaternion\) [Z]() + +```go +func (q Quaternion) Z() Float +``` + + + + +## type [QuaternionComponent]() + + + +```go +type QuaternionComponent = int +``` + + + +```go +const ( + Qw QuaternionComponent = iota + Qx + Qy + Qz +) +``` + + +## type [Transform]() + + + +```go +type Transform struct { + // contains filtered or unexported fields +} +``` + + +### func \(\*Transform\) [AddPosition]() + +```go +func (t *Transform) AddPosition(add Vec3) +``` + + + + +### func \(\*Transform\) [AddRotation]() + +```go +func (t *Transform) AddRotation(add Vec3) +``` + + + + +### func \(\*Transform\) [AddScale]() + +```go +func (t *Transform) AddScale(add Vec3) +``` + + + + +### func \(\*Transform\) [ContainsPoint]() + +```go +func (t *Transform) ContainsPoint(point Vec3) bool +``` + + + + +### func \(\*Transform\) [ContainsPoint2D]() + +```go +func (t *Transform) ContainsPoint2D(point Vec2) bool +``` + + + + +### func \(\*Transform\) [Copy]() + +```go +func (t *Transform) Copy(other Transform) +``` + + + + +### func \(\*Transform\) [Forward]() + +```go +func (t *Transform) Forward() Vec3 +``` + + + + +### func \(\*Transform\) [Initialize]() + +```go +func (t *Transform) Initialize(workGroup *concurrent.WorkGroup) +``` + + + + +### func \(\*Transform\) [InverseWorldMatrix]() + +```go +func (t *Transform) InverseWorldMatrix() Mat4 +``` + + + + +### func \(\*Transform\) [IsDirty]() + +```go +func (t *Transform) IsDirty() bool +``` + + + + +### func \(\*Transform\) [LocalPosition]() + +```go +func (t *Transform) LocalPosition() Vec3 +``` + + + + +### func \(\*Transform\) [LookAt]() + +```go +func (t *Transform) LookAt(point Vec3) +``` + + + + +### func \(\*Transform\) [Matrix]() + +```go +func (t *Transform) Matrix() Mat4 +``` + + + + +### func \(\*Transform\) [Parent]() + +```go +func (t *Transform) Parent() *Transform +``` + + + + +### func \(\*Transform\) [Position]() + +```go +func (t *Transform) Position() Vec3 +``` + + + + +### func \(\*Transform\) [ResetDirty]() + +```go +func (t *Transform) ResetDirty() +``` + + + + +### func \(\*Transform\) [Right]() + +```go +func (t *Transform) Right() Vec3 +``` + + + + +### func \(\*Transform\) [Rotation]() + +```go +func (t *Transform) Rotation() Vec3 +``` + + + + +### func \(\*Transform\) [Scale]() + +```go +func (t *Transform) Scale() Vec3 +``` + + + + +### func \(\*Transform\) [ScaleWithoutChildren]() + +```go +func (t *Transform) ScaleWithoutChildren(scale Vec3) +``` + +ScaleWithoutChildren will scale a transform without changing the world scale of the children of this transform. That is to say, it will update all the child transform scales to return to their original world scale after scaling this transform. + + +### func \(\*Transform\) [SetChildrenOrdered]() + +```go +func (t *Transform) SetChildrenOrdered() +``` + + + + +### func \(\*Transform\) [SetChildrenUnordered]() + +```go +func (t *Transform) SetChildrenUnordered() +``` + + + + +### func \(\*Transform\) [SetDirty]() + +```go +func (t *Transform) SetDirty() +``` + + + + +### func \(\*Transform\) [SetLocalPosition]() + +```go +func (t *Transform) SetLocalPosition(position Vec3) +``` + + + + +### func \(\*Transform\) [SetParent]() + +```go +func (t *Transform) SetParent(parent *Transform) +``` + + + + +### func \(\*Transform\) [SetPosition]() + +```go +func (t *Transform) SetPosition(position Vec3) +``` + + + + +### func \(\*Transform\) [SetRotation]() + +```go +func (t *Transform) SetRotation(rotation Vec3) +``` + + + + +### func \(\*Transform\) [SetScale]() + +```go +func (t *Transform) SetScale(scale Vec3) +``` + + + + +### func \(\*Transform\) [SetWorldPosition]() + +```go +func (t *Transform) SetWorldPosition(position Vec3) +``` -### func ColorMediumSpringGreen() Color -### func ColorMediumTurquoise() Color + +### func \(\*Transform\) [SetWorldRotation]() +```go +func (t *Transform) SetWorldRotation(rotation Vec3) +``` -### func ColorMediumVioletRed() Color -### func ColorMidnightBlue() Color + +### func \(\*Transform\) [SetWorldScale]() +```go +func (t *Transform) SetWorldScale(scale Vec3) +``` -### func ColorMintCream() Color -### func ColorMistyRose() Color + +### func \(\*Transform\) [SetupRawTransform]() +```go +func (t *Transform) SetupRawTransform() +``` -### func ColorMix(lhs, rhs Color, amount Float) Color -### func ColorMoccasin() Color + +### func \(\*Transform\) [Up]() +```go +func (t *Transform) Up() Vec3 +``` -### func ColorNavajoWhite() Color -### func ColorNavy() Color + +### func \(\*Transform\) [WorldMatrix]() +```go +func (t *Transform) WorldMatrix() Mat4 +``` -### func ColorOldLace() Color -### func ColorOlive() Color + +### func \(\*Transform\) [WorldPosition]() +```go +func (t *Transform) WorldPosition() Vec3 +``` -### func ColorOliveDrab() Color -### func ColorOrange() Color + +### func \(\*Transform\) [WorldRotation]() +```go +func (t *Transform) WorldRotation() Vec3 +``` -### func ColorOrangeRed() Color -### func ColorOrchid() Color + +### func \(\*Transform\) [WorldScale]() +```go +func (t *Transform) WorldScale() Vec3 +``` -### func ColorPaleGoldenrod() Color -### func ColorPaleGreen() Color + +### func \(\*Transform\) [WorldTransform]() +```go +func (t *Transform) WorldTransform() (Vec3, Vec3, Vec3) +``` -### func ColorPaleTurquoise() Color -### func ColorPaleVioletred() Color + +## type [Vec2]() -### func ColorPapayaWhip() Color +```go +type Vec2 [2]Float +``` -### func ColorPeachPuff() Color + +### func [NewVec2]() +```go +func NewVec2(x, y Float) Vec2 +``` -### func ColorPeru() Color -### func ColorPink() Color + +### func [Vec2Down]() +```go +func Vec2Down() Vec2 +``` -### func ColorPlum() Color -### func ColorPowderBlue() Color + +### func [Vec2FromArray]() +```go +func Vec2FromArray(a [2]Float) Vec2 +``` -### func ColorPurple() Color -### func ColorRGBAInt(r, g, b, a int) Color + +### func [Vec2FromSlice]() +```go +func Vec2FromSlice(a []Float) Vec2 +``` -### func ColorRGBInt(r, g, b int) Color -### func ColorRed() Color + +### func [Vec2FromString]() +```go +func Vec2FromString(str string) Vec2 +``` -### func ColorRosyBrown() Color -### func ColorRoyalBlue() Color + +### func [Vec2Half]() +```go +func Vec2Half() Vec2 +``` -### func ColorSaddleBrown() Color -### func ColorSalmon() Color + +### func [Vec2Largest]() +```go +func Vec2Largest() Vec2 +``` -### func ColorSandyBrown() Color -### func ColorSeaGreen() Color + +### func [Vec2Left]() +```go +func Vec2Left() Vec2 +``` -### func ColorSeashell() Color -### func ColorSienna() Color + +### func [Vec2Lerp]() +```go +func Vec2Lerp(from, to Vec2, t Float) Vec2 +``` -### func ColorSilver() Color -### func ColorSky() Color + +### func [Vec2Max]() +```go +func Vec2Max(a, b Vec2) Vec2 +``` -### func ColorSkyBlue() Color -### func ColorSlateBlue() Color + +### func [Vec2MaxAbs]() +```go +func Vec2MaxAbs(a, b Vec2) Vec2 +``` -### func ColorSlateGray() Color -### func ColorSlateGrey() Color + +### func [Vec2Min]() +```go +func Vec2Min(a, b Vec2) Vec2 +``` -### func ColorSnow() Color -### func ColorSpringGreen() Color + +### func [Vec2MinAbs]() +```go +func Vec2MinAbs(a, b Vec2) Vec2 +``` -### func ColorSteelBlue() Color -### func ColorTan() Color + +### func [Vec2One]() +```go +func Vec2One() Vec2 +``` -### func ColorTeal() Color -### func ColorThistle() Color + +### func [Vec2Right]() +```go +func Vec2Right() Vec2 +``` -### func ColorTomato() Color -### func ColorTransparent() Color + +### func [Vec2Up]() +```go +func Vec2Up() Vec2 +``` -### func ColorTurquoise() Color -### func ColorViolet() Color + +### func [Vec2Zero]() +```go +func Vec2Zero() Vec2 +``` -### func ColorWheat() Color -### func ColorWhite() Color + +### func \(Vec2\) [Abs]() +```go +func (v Vec2) Abs() Vec2 +``` -### func ColorWhiteSmoke() Color -### func ColorYellow() Color + +### func \(Vec2\) [Add]() +```go +func (v Vec2) Add(other Vec2) Vec2 +``` -### func ColorYellowGreen() Color -### func ColorZero() Color + +### func \(\*Vec2\) [AddAssign]() +```go +func (v *Vec2) AddAssign(other Vec2) +``` -### func NewColor(r, g, b, a Float) Color -### func (c Color) A() Float + +### func \(Vec2\) [Angle]() +```go +func (v Vec2) Angle(other Vec2) Float +``` -### func (c Color) AsColor8() Color8 -### func (c Color) B() Float + +### func \(Vec2\) [AsVec2i]() +```go +func (v Vec2) AsVec2i() Vec2i +``` -### func (lhs Color) Equals(rhs Color) bool -### func (c Color) G() Float + +### func \(\*Vec2\) [AsVec3]() +```go +func (v *Vec2) AsVec3() Vec3 +``` -### func (c Color) Hex() string -### func (c *Color) Inverted() Color + +### func \(Vec2\) [Distance]() +```go +func (v Vec2) Distance(other Vec2) Float +``` -### func (c Color) IsZero() bool -### func (c *Color) MultiplyAssign(other Color) + +### func \(Vec2\) [Divide]() +```go +func (v Vec2) Divide(other Vec2) Vec2 +``` -### func (c *Color) PA() *Float -### func (c *Color) PB() *Float + +### func \(\*Vec2\) [DivideAssign]() +```go +func (v *Vec2) DivideAssign(other Vec2) +``` -### func (c *Color) PG() *Float -### func (c *Color) PR() *Float + +### func \(Vec2\) [Equals]() +```go +func (v Vec2) Equals(other Vec2) bool +``` -### func (c Color) R() Float -### func (c Color) RGBA() (Float, Float, Float, Float) + +### func \(Vec2\) [Height]() +```go +func (v Vec2) Height() Float +``` -### func (c Color) ScaleWithoutAlpha(scale Float) Color -### func (c *Color) SetA(a Float) + +### func \(\*Vec2\) [Inverse]() +```go +func (v *Vec2) Inverse() +``` -### func (c *Color) SetB(b Float) -### func (c *Color) SetG(g Float) + +### func \(Vec2\) [LargestAxis]() +```go +func (v Vec2) LargestAxis() Float +``` -### func (c *Color) SetR(r Float) -### type Color8 [4]uint8 + +### func \(Vec2\) [LargestAxisDelta]() +```go +func (v Vec2) LargestAxisDelta() Float +``` -### func Color8FromBytes(bytes []byte) Color8 -### func Color8FromColor(c Color) Color8 + +### func \(Vec2\) [Length]() +```go +func (v Vec2) Length() Float +``` -### func Color8FromHexString(str string) (Color8, error) -### func NewColor8(r, g, b, a uint8) Color8 + +### func \(Vec2\) [Multiply]() +```go +func (v Vec2) Multiply(other Vec2) Vec2 +``` -### func (c Color8) A() uint8 -### func (c Color8) AsColor() Color + +### func \(\*Vec2\) [MultiplyAssign]() +```go +func (v *Vec2) MultiplyAssign(other Vec2) +``` -### func (c Color8) B() uint8 -### func (c Color8) Equal(rhs Color8) bool + +### func \(Vec2\) [Negative]() +```go +func (v Vec2) Negative() Vec2 +``` -### func (c Color8) G() uint8 -### func (c Color8) Hex() string + +### func \(Vec2\) [Normal]() +```go +func (v Vec2) Normal() Vec2 +``` -### func (c *Color8) PA() *uint8 -### func (c *Color8) PB() *uint8 + +### func \(\*Vec2\) [Normalize]() +```go +func (v *Vec2) Normalize() +``` -### func (c *Color8) PG() *uint8 -### func (c *Color8) PR() *uint8 + +### func \(\*Vec2\) [PX]() +```go +func (v *Vec2) PX() *Float +``` -### func (c Color8) R() uint8 -### func (c Color8) RGBA() (uint8, uint8, uint8, uint8) + +### func \(\*Vec2\) [PY]() +```go +func (v *Vec2) PY() *Float +``` -### func (c *Color8) SetA(a uint8) -### func (c *Color8) SetB(b uint8) + +### func \(Vec2\) [Scale]() +```go +func (v Vec2) Scale(scalar Float) Vec2 +``` -### func (c *Color8) SetG(g uint8) -### func (c *Color8) SetR(r uint8) + +### func \(\*Vec2\) [ScaleAssign]() +```go +func (v *Vec2) ScaleAssign(scalar Float) +``` -### func (lhs Color8) Similar(rhs Color8, tolerance uint8) bool -### func (c Color8) ToUintRaw() uint32 + +### func \(\*Vec2\) [SetHeight]() +```go +func (v *Vec2) SetHeight(y Float) +``` -### type ColorComponent = int -### const ( + +### func \(\*Vec2\) [SetWidth]() ```go -R ColorComponent = iota -G -B -A +func (v *Vec2) SetWidth(x Float) ``` -) -### type Float = float32 - - -### func Abs(x Float) Float -### func Acos(x Float) Float + +### func \(\*Vec2\) [SetX]() +```go +func (v *Vec2) SetX(x Float) +``` -### func Asin(x Float) Float -### func Atan(x Float) Float + +### func \(\*Vec2\) [SetY]() +```go +func (v *Vec2) SetY(y Float) +``` -### func Atan2(y Float, x Float) Float -### func Ceil(x Float) Float + +### func \(Vec2\) [Shrink]() +```go +func (v Vec2) Shrink(scalar Float) Vec2 +``` -### func Clamp(current, minimum, maximum Float) Float -### func Cos(x Float) Float + +### func \(\*Vec2\) [ShrinkAssign]() +```go +func (v *Vec2) ShrinkAssign(scalar Float) +``` -### func Deg2Rad(degree Float) Float -### func Floor(x Float) Float + +### func \(Vec2\) [String]() +```go +func (v Vec2) String() string +``` -### func Inf(sign int) Float -### func Lerp(v0, v1, t Float) Float + +### func \(Vec2\) [Subtract]() +```go +func (v Vec2) Subtract(other Vec2) Vec2 +``` -### func Log2(x Float) Float -### func Max(a Float, b Float) Float + +### func \(\*Vec2\) [SubtractAssign]() +```go +func (v *Vec2) SubtractAssign(other Vec2) +``` -### func Min(a Float, b Float) Float -### func Mod(x Float, y Float) Float + +### func \(Vec2\) [Width]() +```go +func (v Vec2) Width() Float +``` -### func NaN() Float -### func Pow(x Float, y Float) Float + +### func \(Vec2\) [X]() +```go +func (v Vec2) X() Float +``` -### func Rad2Deg(radian Float) Float -### func Round(x Float) Float + +### func \(Vec2\) [XY]() +```go +func (v Vec2) XY() (Float, Float) +``` -### func Sin(x Float) Float -### func Sqrt(x Float) Float + +### func \(Vec2\) [Y]() +```go +func (v Vec2) Y() Float +``` -### func Tan(x Float) Float -### func Vec2Dot(v, other Vec2) Float + +## type [Vec2i]() -### func Vec3Dot(v, other Vec3) Float +```go +type Vec2i [2]int32 +``` -### func Vec4Dot(a, b Vec4) Float + +### func \(Vec2i\) [Height]() +```go +func (v Vec2i) Height() int32 +``` -### type Mat3 [9]Float -### func Mat3FromMat4(m Mat4) Mat3 + +### func \(\*Vec2i\) [SetHeight]() +```go +func (v *Vec2i) SetHeight(height int32) +``` -### func Mat3Identity() Mat3 -### func Mat3Zero() Mat3 + +### func \(\*Vec2i\) [SetWidth]() +```go +func (v *Vec2i) SetWidth(width int32) +``` -### func NewMat3() Mat3 -### func (m Mat3) ColumnVector(col int) Vec3 + +### func \(\*Vec2i\) [SetX]() +```go +func (v *Vec2i) SetX(x int32) +``` -### func (m Mat3) Multiply(rhs Mat3) Mat3 -### func (m *Mat3) MultiplyAssign(rhs Mat3) + +### func \(\*Vec2i\) [SetY]() +```go +func (v *Vec2i) SetY(y int32) +``` -### func (m Mat3) MultiplyVec3(v Vec3) Vec3 -### func (m *Mat3) Reset() + +### func \(Vec2i\) [Width]() +```go +func (v Vec2i) Width() int32 +``` -### func (m Mat3) RowVector(row int) Vec3 -### func (m Mat3) ToMat4() Mat4 + +### func \(Vec2i\) [X]() +```go +func (v Vec2i) X() int32 +``` -### func (m Mat3) Transpose() Mat3 -### type Mat4 [16]Float + +### func \(Vec2i\) [Y]() +```go +func (v Vec2i) Y() int32 +``` -### func Mat4FromSlice(a []Float) Mat4 -### func Mat4Identity() Mat4 + +## type [Vec3]() -### func Mat4LookAt(eye, center, up Vec3) Mat4 +```go +type Vec3 [3]Float +``` -### func Mat4Multiply(a, b Mat4) Mat4 + +### func [Mat4ToScreenSpace]() +```go +func Mat4ToScreenSpace(pos Vec3, view, projection Mat4, viewport Vec4) (Vec3, bool) +``` -### func Mat4Zero() Mat4 -### func NewMat4() Mat4 + +### func [NewVec3]() +```go +func NewVec3(x, y, z Float) Vec3 +``` -### func (m *Mat4) AddAssign(rhs Mat4) -### func (m Mat4) At(rowIndex, colIndex int) Float + +### func [NewVec3XYZ]() +```go +func NewVec3XYZ(xyz Float) Vec3 +``` -### func (m Mat4) ColumnVector(col int) Vec4 -### func (m Mat4) Equals(other Mat4) bool + +### func [Vec3Abs]() +```go +func Vec3Abs(v Vec3) Vec3 +``` -### func (m Mat4) ExtractPosition() Vec3 -### func (m Mat4) ExtractRotation() Quaternion + +### func [Vec3Backward]() +```go +func Vec3Backward() Vec3 +``` -### func (m Mat4) ExtractScale() Vec3 -### func (m Mat4) Forward() Vec3 + +### func [Vec3Cross]() +```go +func Vec3Cross(v, other Vec3) Vec3 +``` -### func (m *Mat4) Inverse() -### func (m Mat4) Inverted() Mat4 + +### func [Vec3Down]() +```go +func Vec3Down() Vec3 +``` -### func (m Mat4) IsIdentity() bool -### func (m *Mat4) LookAt(eye, center, up Vec3) + +### func [Vec3Forward]() +```go +func Vec3Forward() Vec3 +``` -### func (m *Mat4) Mat3() Mat3 -### func (m Mat4) Mat4ProjToVulkan() Mat4 + +### func [Vec3FromArray]() +```go +func Vec3FromArray(a [3]Float) Vec3 +``` -### func (m Mat4) Mat4Project(pos Vec3, viewport Vec4) Vec3 -### func (m Mat4) Mat4UnProject(p Vec3, invViewProj Mat4, viewport Vec4) Vec3 + +### func [Vec3FromSlice]() +```go +func Vec3FromSlice(a []Float) Vec3 +``` -### func (a *Mat4) MultiplyAssign(b Mat4) -### func (m *Mat4) NegateAssign() + +### func [Vec3FromString]() +```go +func Vec3FromString(str string) Vec3 +``` -### func (m *Mat4) Orthographic(left, right, bottom, top, near, far Float) -### func (m *Mat4) Perspective(fovy, aspect, nearVal, farVal Float) + +### func [Vec3Half]() +```go +func Vec3Half() Vec3 +``` -### func (m *Mat4) Reset() -### func (m Mat4) Right() Vec3 + +### func [Vec3Inf]() +```go +func Vec3Inf(sign int) Vec3 +``` -### func (m *Mat4) Rotate(rotate Vec3) -### func (m *Mat4) RotateAngles(axis Vec3, angle Float) + +### func [Vec3Largest]() +```go +func Vec3Largest() Vec3 +``` -### func (m *Mat4) RotateX(angles Float) -### func (m *Mat4) RotateY(angles Float) + +### func [Vec3Left]() +```go +func Vec3Left() Vec3 +``` -### func (m *Mat4) RotateZ(angles Float) -### func (m Mat4) RowVector(row int) Vec4 + +### func [Vec3Lerp]() +```go +func Vec3Lerp(from, to Vec3, t Float) Vec3 +``` -### func (m *Mat4) Scale(scale Vec3) -### func (m *Mat4) SetTranslation(translation Vec3) + +### func [Vec3Max]() +```go +func Vec3Max(v ...Vec3) Vec3 +``` -### func (m *Mat4) SubtractAssign(rhs Mat4) -### func (m Mat4) ToQuaternion() Quaternion + +### func [Vec3MaxAbs]() +```go +func Vec3MaxAbs(v ...Vec3) Vec3 +``` -### func (m Mat4) TransformPoint(point Vec3) Vec3 -### func (m *Mat4) Translate(translation Vec3) + +### func [Vec3Min]() +```go +func Vec3Min(v ...Vec3) Vec3 +``` -### func (m Mat4) Transpose() Mat4 -### func (m *Mat4) TransposeAssign() + +### func [Vec3MinAbs]() +```go +func Vec3MinAbs(v ...Vec3) Vec3 +``` -### func (m Mat4) Up() Vec3 -### func (m *Mat4) Zero() + +### func [Vec3NaN]() +```go +func Vec3NaN() Vec3 +``` -### type Quaternion [4]Float -### func NewQuaternion(w, x, y, z Float) Quaternion + +### func [Vec3One]() +```go +func Vec3One() Vec3 +``` -### func QuatAngleBetween(lhs, rhs Vec3) Quaternion -### func QuaternionAxisAngle(axis Vec3, angle Float) Quaternion + +### func [Vec3Right]() +```go +func Vec3Right() Vec3 +``` -### func QuaternionFromArray(xyzw [4]Float) Quaternion -### func QuaternionFromEuler(v Vec3) Quaternion + +### func [Vec3Up]() +```go +func Vec3Up() Vec3 +``` -### func QuaternionFromMat4(m Mat4) Quaternion -### func QuaternionFromSlice(xyzw []Float) Quaternion + +### func [Vec3Zero]() +```go +func Vec3Zero() Vec3 +``` -### func QuaternionFromVec4(v Vec4) Quaternion -### func QuaternionFromXYZW(xyzw [4]Float) Quaternion + +### func \(Vec3\) [Abs]() +```go +func (v Vec3) Abs() Vec3 +``` -### func QuaternionFromXYZWSlice(xyzw []Float) Quaternion -### func QuaternionIdentity() Quaternion + +### func \(Vec3\) [Add]() +```go +func (v Vec3) Add(other Vec3) Vec3 +``` -### func QuaternionLerp(from, to Quaternion, factor Float) Quaternion -### func QuaternionLookAt(from, to Vec3) Quaternion + +### func \(\*Vec3\) [AddAssign]() +```go +func (v *Vec3) AddAssign(other Vec3) +``` -### func QuaternionSlerp(from, to Quaternion, factor Float) Quaternion -### func (q *Quaternion) AddAssign(rhs Quaternion) + +### func \(\*Vec3\) [AddX]() +```go +func (v *Vec3) AddX(x Float) +``` -### func (q *Quaternion) Conjugate() -### func (q *Quaternion) Inverse() + +### func \(\*Vec3\) [AddY]() +```go +func (v *Vec3) AddY(y Float) +``` -### func (q Quaternion) IsZero() bool -### func (q Quaternion) Multiply(rhs Quaternion) Quaternion + +### func \(\*Vec3\) [AddZ]() +```go +func (v *Vec3) AddZ(z Float) +``` -### func (q *Quaternion) MultiplyAssign(rhs Quaternion) -### func (q Quaternion) MultiplyVec3(rhs Vec3) Vec3 + +### func \(Vec3\) [Angle]() +```go +func (v Vec3) Angle(other Vec3) Float +``` -### func (q Quaternion) Normal() Quaternion -### func (q *Quaternion) Normalize() + +### func \(Vec3\) [AsAligned16]() +```go +func (v Vec3) AsAligned16() [4]Float +``` -### func (q Quaternion) ToEuler() Vec3 -### func (q Quaternion) ToMat4() Mat4 + +### func \(Vec3\) [AsVec2]() +```go +func (v Vec3) AsVec2() Vec2 +``` -### func (q Quaternion) W() Float -### func (q Quaternion) X() Float + +### func \(Vec3\) [AsVec3i]() +```go +func (v Vec3) AsVec3i() Vec3i +``` -### func (q Quaternion) Y() Float -### func (q Quaternion) Z() Float + +### func \(Vec3\) [AsVec4]() +```go +func (v Vec3) AsVec4() Vec4 +``` -### type QuaternionComponent = int -### const ( + +### func \(Vec3\) [AsVec4WithW]() ```go -Qw QuaternionComponent = iota -Qx -Qy -Qz +func (v Vec3) AsVec4WithW(w Float) Vec4 ``` -) -### type Transform struct { + + + +### func \(Vec3\) [Depth]() ```go -// Has unexported fields. +func (v Vec3) Depth() Float ``` -} - -### func (t *Transform) AddPosition(add Vec3) -### func (t *Transform) AddRotation(add Vec3) + +### func \(Vec3\) [Distance]() +```go +func (v Vec3) Distance(other Vec3) Float +``` -### func (t *Transform) AddScale(add Vec3) -### func (t *Transform) ContainsPoint(point Vec3) bool + +### func \(Vec3\) [Divide]() +```go +func (v Vec3) Divide(other Vec3) Vec3 +``` -### func (t *Transform) ContainsPoint2D(point Vec2) bool -### func (t *Transform) Copy(other Transform) + +### func \(\*Vec3\) [DivideAssign]() +```go +func (v *Vec3) DivideAssign(other Vec3) +``` -### func (t *Transform) Forward() Vec3 -### func (t *Transform) Initialize(workGroup *concurrent.WorkGroup) + +### func \(Vec3\) [Equals]() +```go +func (v Vec3) Equals(other Vec3) bool +``` -### func (t *Transform) InverseWorldMatrix() Mat4 -### func (t *Transform) IsDirty() bool + +### func \(Vec3\) [Height]() +```go +func (v Vec3) Height() Float +``` -### func (t *Transform) LocalPosition() Vec3 -### func (t *Transform) LookAt(point Vec3) + +### func \(\*Vec3\) [Inverse]() +```go +func (v *Vec3) Inverse() +``` -### func (t *Transform) Matrix() Mat4 -### func (t *Transform) Parent() *Transform + +### func \(Vec3\) [IsInf]() +```go +func (v Vec3) IsInf(sign int) bool +``` -### func (t *Transform) Position() Vec3 -### func (t *Transform) ResetDirty() + +### func \(Vec3\) [IsNaN]() +```go +func (v Vec3) IsNaN() bool +``` -### func (t *Transform) Right() Vec3 -### func (t *Transform) Rotation() Vec3 + +### func \(Vec3\) [IsZero]() +```go +func (v Vec3) IsZero() bool +``` -### func (t *Transform) Scale() Vec3 -### func (t *Transform) ScaleWithoutChildren(scale Vec3) + +### func \(Vec3\) [LargestAxis]() ```go - ScaleWithoutChildren will scale a transform without changing the world scale - of the children of this transform. That is to say, it will update all the - child transform scales to return to their original world scale after scaling - this transform. +func (v Vec3) LargestAxis() Float ``` -### func (t *Transform) SetChildrenOrdered() + +### func \(Vec3\) [LargestAxisDelta]() -### func (t *Transform) SetChildrenUnordered() +```go +func (v Vec3) LargestAxisDelta() Float +``` -### func (t *Transform) SetDirty() + +### func \(Vec3\) [Length]() -### func (t *Transform) SetLocalPosition(position Vec3) +```go +func (v Vec3) Length() Float +``` -### func (t *Transform) SetParent(parent *Transform) + +### func \(Vec3\) [LengthSquared]() -### func (t *Transform) SetPosition(position Vec3) +```go +func (v Vec3) LengthSquared() Float +``` -### func (t *Transform) SetRotation(rotation Vec3) + +### func \(Vec3\) [LongestAxis]() -### func (t *Transform) SetScale(scale Vec3) +```go +func (v Vec3) LongestAxis() int +``` -### func (t *Transform) SetWorldPosition(position Vec3) + +### func \(Vec3\) [LongestAxisValue]() -### func (t *Transform) SetWorldRotation(rotation Vec3) +```go +func (v Vec3) LongestAxisValue() Float +``` -### func (t *Transform) SetWorldScale(scale Vec3) + +### func \(Vec3\) [Multiply]() -### func (t *Transform) SetupRawTransform() +```go +func (v Vec3) Multiply(other Vec3) Vec3 +``` -### func (t *Transform) Up() Vec3 + +### func \(\*Vec3\) [MultiplyAssign]() -### func (t *Transform) WorldMatrix() Mat4 +```go +func (v *Vec3) MultiplyAssign(other Vec3) +``` -### func (t *Transform) WorldPosition() Vec3 + +### func \(Vec3\) [MultiplyMat3]() -### func (t *Transform) WorldRotation() Vec3 +```go +func (v Vec3) MultiplyMat3(rhs Mat3) Vec3 +``` -### func (t *Transform) WorldScale() Vec3 + +### func \(Vec3\) [Negative]() -### func (t *Transform) WorldTransform() (Vec3, Vec3, Vec3) +```go +func (v Vec3) Negative() Vec3 +``` -### type Vec2 [2]Float + +### func \(Vec3\) [Normal]() -### func NewVec2(x, y Float) Vec2 +```go +func (v Vec3) Normal() Vec3 +``` -### func Vec2Down() Vec2 + +### func \(\*Vec3\) [Normalize]() -### func Vec2FromArray(a [2]Float) Vec2 +```go +func (v *Vec3) Normalize() +``` -### func Vec2FromSlice(a []Float) Vec2 + +### func \(Vec3\) [Orthogonal]() -### func Vec2FromString(str string) Vec2 +```go +func (v Vec3) Orthogonal() Vec3 +``` -### func Vec2Half() Vec2 + +### func \(\*Vec3\) [PX]() -### func Vec2Largest() Vec2 +```go +func (v *Vec3) PX() *Float +``` -### func Vec2Left() Vec2 + +### func \(\*Vec3\) [PY]() -### func Vec2Lerp(from, to Vec2, t Float) Vec2 +```go +func (v *Vec3) PY() *Float +``` -### func Vec2Max(a, b Vec2) Vec2 + +### func \(\*Vec3\) [PZ]() -### func Vec2MaxAbs(a, b Vec2) Vec2 +```go +func (v *Vec3) PZ() *Float +``` -### func Vec2Min(a, b Vec2) Vec2 + +### func \(Vec3\) [Scale]() -### func Vec2MinAbs(a, b Vec2) Vec2 +```go +func (v Vec3) Scale(scalar Float) Vec3 +``` -### func Vec2One() Vec2 + +### func \(\*Vec3\) [ScaleAssign]() -### func Vec2Right() Vec2 +```go +func (v *Vec3) ScaleAssign(scalar Float) +``` -### func Vec2Up() Vec2 + +### func \(\*Vec3\) [ScaleX]() -### func Vec2Zero() Vec2 +```go +func (v *Vec3) ScaleX(s Float) +``` -### func (v Vec2) Abs() Vec2 + +### func \(\*Vec3\) [ScaleY]() -### func (v Vec2) Add(other Vec2) Vec2 +```go +func (v *Vec3) ScaleY(s Float) +``` -### func (v *Vec2) AddAssign(other Vec2) + +### func \(\*Vec3\) [ScaleZ]() -### func (v Vec2) Angle(other Vec2) Float +```go +func (v *Vec3) ScaleZ(s Float) +``` -### func (v Vec2) AsVec2i() Vec2i + +### func \(\*Vec3\) [SetX]() -### func (v *Vec2) AsVec3() Vec3 +```go +func (v *Vec3) SetX(x Float) +``` -### func (v Vec2) Distance(other Vec2) Float + +### func \(\*Vec3\) [SetY]() -### func (v Vec2) Divide(other Vec2) Vec2 +```go +func (v *Vec3) SetY(y Float) +``` -### func (v *Vec2) DivideAssign(other Vec2) + +### func \(\*Vec3\) [SetZ]() -### func (v Vec2) Equals(other Vec2) bool +```go +func (v *Vec3) SetZ(z Float) +``` -### func (v Vec2) Height() Float + +### func \(Vec3\) [Shrink]() -### func (v *Vec2) Inverse() +```go +func (v Vec3) Shrink(scalar Float) Vec3 +``` -### func (v Vec2) LargestAxis() Float + +### func \(\*Vec3\) [ShrinkAssign]() -### func (v Vec2) LargestAxisDelta() Float +```go +func (v *Vec3) ShrinkAssign(scalar Float) +``` -### func (v Vec2) Length() Float + +### func \(Vec3\) [SignedAngle]() -### func (v Vec2) Multiply(other Vec2) Vec2 +```go +func (v Vec3) SignedAngle(other Vec3, axis Vec3) Float +``` +SignedAngle returns the signed angle \(in radians\) from v to other around the given axis. The sign is positive for counterclockwise rotation when looking along the axis direction. Assumes non\-zero vectors; returns 0 if v or other is zero\-length or they are equal. For best precision, normalize v, other, and axis before calling if they aren't already. -### func (v *Vec2) MultiplyAssign(other Vec2) + +### func \(Vec3\) [SquareDistance]() +```go +func (v Vec3) SquareDistance(b Vec3) Float +``` -### func (v Vec2) Negative() Vec2 -### func (v Vec2) Normal() Vec2 + +### func \(Vec3\) [String]() +```go +func (v Vec3) String() string +``` -### func (v *Vec2) Normalize() -### func (v *Vec2) PX() *Float + +### func \(Vec3\) [Subtract]() +```go +func (v Vec3) Subtract(other Vec3) Vec3 +``` -### func (v *Vec2) PY() *Float -### func (v Vec2) Scale(scalar Float) Vec2 + +### func \(\*Vec3\) [SubtractAssign]() +```go +func (v *Vec3) SubtractAssign(other Vec3) +``` -### func (v *Vec2) ScaleAssign(scalar Float) -### func (v *Vec2) SetHeight(y Float) + +### func \(Vec3\) [Width]() +```go +func (v Vec3) Width() Float +``` -### func (v *Vec2) SetWidth(x Float) -### func (v *Vec2) SetX(x Float) + +### func \(Vec3\) [X]() +```go +func (v Vec3) X() Float +``` -### func (v *Vec2) SetY(y Float) -### func (v Vec2) Shrink(scalar Float) Vec2 + +### func \(Vec3\) [XY]() +```go +func (v Vec3) XY() Vec2 +``` -### func (v *Vec2) ShrinkAssign(scalar Float) -### func (v Vec2) String() string + +### func \(Vec3\) [XYZ]() +```go +func (v Vec3) XYZ() (Float, Float, Float) +``` -### func (v Vec2) Subtract(other Vec2) Vec2 -### func (v *Vec2) SubtractAssign(other Vec2) + +### func \(Vec3\) [XZ]() +```go +func (v Vec3) XZ() Vec2 +``` -### func (v Vec2) Width() Float -### func (v Vec2) X() Float + +### func \(Vec3\) [Y]() +```go +func (v Vec3) Y() Float +``` -### func (v Vec2) XY() (Float, Float) -### func (v Vec2) Y() Float + +### func \(Vec3\) [Z]() +```go +func (v Vec3) Z() Float +``` -### type Vec2i [2]int32 -### func (v Vec2i) Height() int32 + +## type [Vec3MinMax]() -### func (v *Vec2i) SetHeight(height int32) +```go +type Vec3MinMax struct { + Min Vec3 + Max Vec3 +} +``` -### func (v *Vec2i) SetWidth(width int32) + +### func [NewVec3MinMax]() +```go +func NewVec3MinMax() Vec3MinMax +``` -### func (v *Vec2i) SetX(x int32) -### func (v *Vec2i) SetY(y int32) + +## type [Vec3i]() -### func (v Vec2i) Width() int32 +```go +type Vec3i [3]int32 +``` -### func (v Vec2i) X() int32 + +### func \(Vec3i\) [Depth]() +```go +func (v Vec3i) Depth() int32 +``` -### func (v Vec2i) Y() int32 -### type Vec3 [3]Float + +### func \(Vec3i\) [Height]() +```go +func (v Vec3i) Height() int32 +``` -### func Mat4ToScreenSpace(pos Vec3, view, projection Mat4, viewport Vec4) (Vec3, bool) -### func NewVec3(x, y, z Float) Vec3 + +### func \(\*Vec3i\) [SetDepth]() +```go +func (v *Vec3i) SetDepth(depth int32) +``` -### func NewVec3XYZ(xyz Float) Vec3 -### func Vec3Abs(v Vec3) Vec3 + +### func \(\*Vec3i\) [SetHeight]() +```go +func (v *Vec3i) SetHeight(height int32) +``` -### func Vec3Backward() Vec3 -### func Vec3Cross(v, other Vec3) Vec3 + +### func \(\*Vec3i\) [SetWidth]() +```go +func (v *Vec3i) SetWidth(width int32) +``` -### func Vec3Down() Vec3 -### func Vec3Forward() Vec3 + +### func \(\*Vec3i\) [SetX]() +```go +func (v *Vec3i) SetX(x int32) +``` -### func Vec3FromArray(a [3]Float) Vec3 -### func Vec3FromSlice(a []Float) Vec3 + +### func \(\*Vec3i\) [SetY]() +```go +func (v *Vec3i) SetY(y int32) +``` -### func Vec3FromString(str string) Vec3 -### func Vec3Half() Vec3 + +### func \(\*Vec3i\) [SetZ]() +```go +func (v *Vec3i) SetZ(z int32) +``` -### func Vec3Inf(sign int) Vec3 -### func Vec3Largest() Vec3 + +### func \(Vec3i\) [Width]() +```go +func (v Vec3i) Width() int32 +``` -### func Vec3Left() Vec3 -### func Vec3Lerp(from, to Vec3, t Float) Vec3 + +### func \(Vec3i\) [X]() +```go +func (v Vec3i) X() int32 +``` -### func Vec3Max(v ...Vec3) Vec3 -### func Vec3MaxAbs(v ...Vec3) Vec3 + +### func \(Vec3i\) [Y]() +```go +func (v Vec3i) Y() int32 +``` -### func Vec3Min(v ...Vec3) Vec3 -### func Vec3MinAbs(v ...Vec3) Vec3 + +### func \(Vec3i\) [Z]() +```go +func (v Vec3i) Z() int32 +``` -### func Vec3NaN() Vec3 -### func Vec3One() Vec3 + +## type [Vec4]() -### func Vec3Right() Vec3 +```go +type Vec4 [4]Float +``` -### func Vec3Up() Vec3 + +### func [Mat4MultiplyVec4]() +```go +func Mat4MultiplyVec4(a Mat4, b Vec4) Vec4 +``` -### func Vec3Zero() Vec3 -### func (v Vec3) Abs() Vec3 + +### func [NewVec4]() +```go +func NewVec4(x, y, z, w Float) Vec4 +``` -### func (v Vec3) Add(other Vec3) Vec3 -### func (v *Vec3) AddAssign(other Vec3) + +### func [Vec4Area]() +```go +func Vec4Area(xa, ya, xb, yb Float) Vec4 +``` -### func (v *Vec3) AddX(x Float) -### func (v *Vec3) AddY(y Float) + +### func [Vec4FromArray]() +```go +func Vec4FromArray(a [4]Float) Vec4 +``` -### func (v *Vec3) AddZ(z Float) -### func (v Vec3) Angle(other Vec3) Float + +### func [Vec4FromSlice]() +```go +func Vec4FromSlice(a []Float) Vec4 +``` -### func (v Vec3) AsAligned16() [4]Float -### func (v Vec3) AsVec2() Vec2 + +### func [Vec4FromString]() +```go +func Vec4FromString(str string) Vec4 +``` -### func (v Vec3) AsVec3i() Vec3i -### func (v Vec3) AsVec4() Vec4 + +### func [Vec4Half]() +```go +func Vec4Half() Vec4 +``` -### func (v Vec3) AsVec4WithW(w Float) Vec4 -### func (v Vec3) Depth() Float + +### func [Vec4Largest]() +```go +func Vec4Largest() Vec4 +``` -### func (v Vec3) Distance(other Vec3) Float -### func (v Vec3) Divide(other Vec3) Vec3 + +### func [Vec4Lerp]() +```go +func Vec4Lerp(from, to Vec4, t Float) Vec4 +``` -### func (v *Vec3) DivideAssign(other Vec3) -### func (v Vec3) Equals(other Vec3) bool + +### func [Vec4Max]() +```go +func Vec4Max(a, b Vec4) Vec4 +``` -### func (v Vec3) Height() Float -### func (v *Vec3) Inverse() + +### func [Vec4MaxAbs]() +```go +func Vec4MaxAbs(a, b Vec4) Vec4 +``` -### func (v Vec3) IsInf(sign int) bool -### func (v Vec3) IsNaN() bool + +### func [Vec4Min]() +```go +func Vec4Min(a, b Vec4) Vec4 +``` -### func (v Vec3) IsZero() bool -### func (v Vec3) LargestAxis() Float + +### func [Vec4MinAbs]() +```go +func Vec4MinAbs(a, b Vec4) Vec4 +``` -### func (v Vec3) LargestAxisDelta() Float -### func (v Vec3) Length() Float + +### func [Vec4MultiplyMat4]() +```go +func Vec4MultiplyMat4(v Vec4, m Mat4) Vec4 +``` -### func (v Vec3) LengthSquared() Float -### func (v Vec3) LongestAxis() int + +### func [Vec4One]() +```go +func Vec4One() Vec4 +``` -### func (v Vec3) LongestAxisValue() Float -### func (v Vec3) Multiply(other Vec3) Vec3 + +### func [Vec4Zero]() +```go +func Vec4Zero() Vec4 +``` -### func (v *Vec3) MultiplyAssign(other Vec3) -### func (v Vec3) MultiplyMat3(rhs Mat3) Vec3 + +### func \(Vec4\) [Abs]() +```go +func (v Vec4) Abs() Vec4 +``` -### func (v Vec3) Negative() Vec3 -### func (v Vec3) Normal() Vec3 + +### func \(Vec4\) [Add]() +```go +func (v Vec4) Add(other Vec4) Vec4 +``` -### func (v *Vec3) Normalize() -### func (v Vec3) Orthogonal() Vec3 + +### func \(\*Vec4\) [AddAssign]() +```go +func (v *Vec4) AddAssign(other Vec4) +``` -### func (v *Vec3) PX() *Float -### func (v *Vec3) PY() *Float + +### func \(Vec4\) [Angle]() +```go +func (v Vec4) Angle(other Vec4) Float +``` -### func (v *Vec3) PZ() *Float -### func (v Vec3) Scale(scalar Float) Vec3 + +### func \(Vec4\) [AreaContains]() +```go +func (v Vec4) AreaContains(x, y Float) bool +``` -### func (v *Vec3) ScaleAssign(scalar Float) -### func (v *Vec3) ScaleX(s Float) + +### func \(Vec4\) [AsVec3]() +```go +func (v Vec4) AsVec3() Vec3 +``` -### func (v *Vec3) ScaleY(s Float) -### func (v *Vec3) ScaleZ(s Float) + +### func \(Vec4\) [AsVec4i]() +```go +func (v Vec4) AsVec4i() Vec4i +``` -### func (v *Vec3) SetX(x Float) -### func (v *Vec3) SetY(y Float) + +### func \(Vec4\) [Bottom]() +```go +func (v Vec4) Bottom() Float +``` -### func (v *Vec3) SetZ(z Float) -### func (v Vec3) Shrink(scalar Float) Vec3 + +### func \(Vec4\) [BoxContains]() +```go +func (v Vec4) BoxContains(x, y Float) bool +``` -### func (v *Vec3) ShrinkAssign(scalar Float) -### func (v Vec3) SignedAngle(other Vec3, axis Vec3) Float + +### func \(Vec4\) [Distance]() ```go - SignedAngle returns the signed angle (in radians) from v to other around the - given axis. The sign is positive for counterclockwise rotation when looking - along the axis direction. Assumes non-zero vectors; returns 0 if v or other - is zero-length or they are equal. For best precision, normalize v, other, - and axis before calling if they aren't already. +func (v Vec4) Distance(other Vec4) Float ``` -### func (v Vec3) SquareDistance(b Vec3) Float + +### func \(Vec4\) [Divide]() -### func (v Vec3) String() string - +```go +func (v Vec4) Divide(other Vec4) Vec4 +``` -### func (v Vec3) Subtract(other Vec3) Vec3 -### func (v *Vec3) SubtractAssign(other Vec3) + +### func \(\*Vec4\) [DivideAssign]() +```go +func (v *Vec4) DivideAssign(other Vec4) +``` -### func (v Vec3) Width() Float -### func (v Vec3) X() Float + +### func \(Vec4\) [Equals]() +```go +func (v Vec4) Equals(other Vec4) bool +``` -### func (v Vec3) XY() Vec2 -### func (v Vec3) XYZ() (Float, Float, Float) + +### func \(Vec4\) [Height]() +```go +func (v Vec4) Height() Float +``` -### func (v Vec3) XZ() Vec2 -### func (v Vec3) Y() Float + +### func \(Vec4\) [Horizontal]() +```go +func (v Vec4) Horizontal() Float +``` -### func (v Vec3) Z() Float -### type Vec3MinMax struct { + +### func \(\*Vec4\) [Inverse]() ```go -Min Vec3 -Max Vec3 +func (v *Vec4) Inverse() ``` -} -### func NewVec3MinMax() Vec3MinMax + +### func \(Vec4\) [LargestAxis]() + +```go +func (v Vec4) LargestAxis() Float +``` -### type Vec3i [3]int32 -### func (v Vec3i) Depth() int32 + +### func \(Vec4\) [LargestAxisDelta]() +```go +func (v Vec4) LargestAxisDelta() Float +``` -### func (v Vec3i) Height() int32 -### func (v *Vec3i) SetDepth(depth int32) + +### func \(Vec4\) [Left]() +```go +func (v Vec4) Left() Float +``` -### func (v *Vec3i) SetHeight(height int32) -### func (v *Vec3i) SetWidth(width int32) + +### func \(Vec4\) [Length]() +```go +func (v Vec4) Length() Float +``` -### func (v *Vec3i) SetX(x int32) -### func (v *Vec3i) SetY(y int32) + +### func \(Vec4\) [Multiply]() +```go +func (v Vec4) Multiply(other Vec4) Vec4 +``` -### func (v *Vec3i) SetZ(z int32) -### func (v Vec3i) Width() int32 + +### func \(\*Vec4\) [MultiplyAssign]() +```go +func (v *Vec4) MultiplyAssign(other Vec4) +``` -### func (v Vec3i) X() int32 -### func (v Vec3i) Y() int32 + +### func \(Vec4\) [Negative]() +```go +func (v Vec4) Negative() Vec4 +``` -### func (v Vec3i) Z() int32 -### type Vec4 [4]Float + +### func \(Vec4\) [Normal]() +```go +func (v Vec4) Normal() Vec4 +``` -### func Mat4MultiplyVec4(a Mat4, b Vec4) Vec4 -### func NewVec4(x, y, z, w Float) Vec4 + +### func \(\*Vec4\) [Normalize]() +```go +func (v *Vec4) Normalize() +``` -### func Vec4Area(xa, ya, xb, yb Float) Vec4 -### func Vec4FromArray(a [4]Float) Vec4 + +### func \(\*Vec4\) [PW]() +```go +func (v *Vec4) PW() *Float +``` -### func Vec4FromSlice(a []Float) Vec4 -### func Vec4FromString(str string) Vec4 + +### func \(\*Vec4\) [PX]() +```go +func (v *Vec4) PX() *Float +``` -### func Vec4Half() Vec4 -### func Vec4Largest() Vec4 + +### func \(\*Vec4\) [PY]() +```go +func (v *Vec4) PY() *Float +``` -### func Vec4Lerp(from, to Vec4, t Float) Vec4 -### func Vec4Max(a, b Vec4) Vec4 + +### func \(\*Vec4\) [PZ]() +```go +func (v *Vec4) PZ() *Float +``` -### func Vec4MaxAbs(a, b Vec4) Vec4 -### func Vec4Min(a, b Vec4) Vec4 + +### func \(Vec4\) [Right]() +```go +func (v Vec4) Right() Float +``` -### func Vec4MinAbs(a, b Vec4) Vec4 -### func Vec4MultiplyMat4(v Vec4, m Mat4) Vec4 + +### func \(Vec4\) [Scale]() +```go +func (v Vec4) Scale(scalar Float) Vec4 +``` -### func Vec4One() Vec4 -### func Vec4Zero() Vec4 + +### func \(\*Vec4\) [ScaleAssign]() +```go +func (v *Vec4) ScaleAssign(scalar Float) +``` -### func (v Vec4) Abs() Vec4 -### func (v Vec4) Add(other Vec4) Vec4 + +### func \(Vec4\) [ScreenAreaContains]() +```go +func (v Vec4) ScreenAreaContains(x, y Float) bool +``` -### func (v *Vec4) AddAssign(other Vec4) -### func (v Vec4) Angle(other Vec4) Float + +### func \(\*Vec4\) [SetBottom]() +```go +func (v *Vec4) SetBottom(w Float) +``` -### func (v Vec4) AreaContains(x, y Float) bool -### func (v Vec4) AsVec3() Vec3 + +### func \(\*Vec4\) [SetHeight]() +```go +func (v *Vec4) SetHeight(w Float) +``` -### func (v Vec4) AsVec4i() Vec4i -### func (v Vec4) Bottom() Float + +### func \(\*Vec4\) [SetLeft]() +```go +func (v *Vec4) SetLeft(x Float) +``` -### func (v Vec4) BoxContains(x, y Float) bool -### func (v Vec4) Distance(other Vec4) Float + +### func \(\*Vec4\) [SetRight]() +```go +func (v *Vec4) SetRight(z Float) +``` -### func (v Vec4) Divide(other Vec4) Vec4 -### func (v *Vec4) DivideAssign(other Vec4) + +### func \(\*Vec4\) [SetTop]() +```go +func (v *Vec4) SetTop(y Float) +``` -### func (v Vec4) Equals(other Vec4) bool -### func (v Vec4) Height() Float + +### func \(\*Vec4\) [SetW]() +```go +func (v *Vec4) SetW(w Float) +``` -### func (v Vec4) Horizontal() Float -### func (v *Vec4) Inverse() + +### func \(\*Vec4\) [SetWidth]() +```go +func (v *Vec4) SetWidth(z Float) +``` -### func (v Vec4) LargestAxis() Float -### func (v Vec4) LargestAxisDelta() Float + +### func \(\*Vec4\) [SetX]() +```go +func (v *Vec4) SetX(x Float) +``` -### func (v Vec4) Left() Float -### func (v Vec4) Length() Float + +### func \(\*Vec4\) [SetY]() +```go +func (v *Vec4) SetY(y Float) +``` -### func (v Vec4) Multiply(other Vec4) Vec4 -### func (v *Vec4) MultiplyAssign(other Vec4) + +### func \(\*Vec4\) [SetZ]() +```go +func (v *Vec4) SetZ(z Float) +``` -### func (v Vec4) Negative() Vec4 -### func (v Vec4) Normal() Vec4 + +### func \(Vec4\) [Shrink]() +```go +func (v Vec4) Shrink(scalar Float) Vec4 +``` -### func (v *Vec4) Normalize() -### func (v *Vec4) PW() *Float + +### func \(\*Vec4\) [ShrinkAssign]() +```go +func (v *Vec4) ShrinkAssign(scalar Float) +``` -### func (v *Vec4) PX() *Float -### func (v *Vec4) PY() *Float + +### func \(Vec4\) [String]() +```go +func (v Vec4) String() string +``` -### func (v *Vec4) PZ() *Float -### func (v Vec4) Right() Float + +### func \(Vec4\) [Subtract]() +```go +func (v Vec4) Subtract(other Vec4) Vec4 +``` -### func (v Vec4) Scale(scalar Float) Vec4 -### func (v *Vec4) ScaleAssign(scalar Float) + +### func \(\*Vec4\) [SubtractAssign]() +```go +func (v *Vec4) SubtractAssign(other Vec4) +``` -### func (v Vec4) ScreenAreaContains(x, y Float) bool -### func (v *Vec4) SetBottom(w Float) + +### func \(Vec4\) [Top]() +```go +func (v Vec4) Top() Float +``` -### func (v *Vec4) SetHeight(w Float) -### func (v *Vec4) SetLeft(x Float) + +### func \(Vec4\) [Vertical]() +```go +func (v Vec4) Vertical() Float +``` -### func (v *Vec4) SetRight(z Float) -### func (v *Vec4) SetTop(y Float) + +### func \(Vec4\) [W]() +```go +func (v Vec4) W() Float +``` -### func (v *Vec4) SetW(w Float) -### func (v *Vec4) SetWidth(z Float) + +### func \(Vec4\) [Width]() +```go +func (v Vec4) Width() Float +``` -### func (v *Vec4) SetX(x Float) -### func (v *Vec4) SetY(y Float) + +### func \(Vec4\) [X]() +```go +func (v Vec4) X() Float +``` -### func (v *Vec4) SetZ(z Float) -### func (v Vec4) Shrink(scalar Float) Vec4 + +### func \(Vec4\) [XYZW]() +```go +func (v Vec4) XYZW() (Float, Float, Float, Float) +``` -### func (v *Vec4) ShrinkAssign(scalar Float) -### func (v Vec4) String() string + +### func \(Vec4\) [Y]() +```go +func (v Vec4) Y() Float +``` -### func (v Vec4) Subtract(other Vec4) Vec4 -### func (v *Vec4) SubtractAssign(other Vec4) + +### func \(Vec4\) [Z]() +```go +func (v Vec4) Z() Float +``` -### func (v Vec4) Top() Float -### func (v Vec4) Vertical() Float + +## type [Vec4i]() -### func (v Vec4) W() Float +```go +type Vec4i [4]int32 +``` -### func (v Vec4) Width() Float + +### func \(Vec4i\) [Height]() +```go +func (v Vec4i) Height() int32 +``` -### func (v Vec4) X() Float -### func (v Vec4) XYZW() (Float, Float, Float, Float) + +### func \(Vec4i\) [W]() +```go +func (v Vec4i) W() int32 +``` -### func (v Vec4) Y() Float -### func (v Vec4) Z() Float + +### func \(Vec4i\) [Width]() +```go +func (v Vec4i) Width() int32 +``` -### type Vec4i [4]int32 -### func (v Vec4i) Height() int32 + +### func \(Vec4i\) [X]() +```go +func (v Vec4i) X() int32 +``` -### func (v Vec4i) W() int32 -### func (v Vec4i) Width() int32 + +### func \(Vec4i\) [Y]() +```go +func (v Vec4i) Y() int32 +``` -### func (v Vec4i) X() int32 -### func (v Vec4i) Y() int32 + +### func \(Vec4i\) [Z]() +```go +func (v Vec4i) Z() int32 +``` -### func (v Vec4i) Z() int32 -### type VectorComponent = int + +## type [VectorComponent]() -### const ( ```go -Vx VectorComponent = iota -Vy -Vz -Vw +type VectorComponent = int ``` + + +```go +const ( + Vx VectorComponent = iota + Vy + Vz + Vw ) +``` +Generated by [gomarkdoc]() diff --git a/docs/api/platform_audio.md b/docs/api/platform_audio.md deleted file mode 100644 index bbae15c1d..000000000 --- a/docs/api/platform_audio.md +++ /dev/null @@ -1,116 +0,0 @@ -# Package platform/audio - -**Import path:** `kaijuengine.com/platform/audio` - - - -## Constants - - -### const InvalidVoiceHandle = VoiceHandle(0) - - -## Types - - -### type Audio struct { - -```go -// Has unexported fields. -``` - -} - -### func New() (*Audio, error) - - -### func (a *Audio) IsMusicMuted() bool - - -### func (a *Audio) IsSoundMuted() bool - - -### func (a *Audio) IsValidVoiceHandle(handle VoiceHandle) bool - - -### func (a *Audio) LoadMusic(adb assets.Database, key string) (*AudioClip, error) - - -### func (a *Audio) LoadSound(adb assets.Database, key string) (*AudioClip, error) - - -### func (a *Audio) MusicById(id string) (*AudioClip, bool) - - -### func (a *Audio) MusicVolume() float32 - - -### func (a *Audio) MuteMusic() - - -### func (a *Audio) MuteSounds() - - -### func (a *Audio) Play(clip *AudioClip) VoiceHandle - - -### func (a *Audio) PlayMusic(key string) (*AudioClip, VoiceHandle) - - -### func (a *Audio) PlaySound(key string) (*AudioClip, VoiceHandle) - - -### func (a *Audio) Seek(handle VoiceHandle, seconds float64) bool - - -### func (a *Audio) SetLooping(handle VoiceHandle, looping bool) - - -### func (a *Audio) SetMusicVolume(volume float32) - - -### func (a *Audio) SetSoundVolume(volume float32) - - -### func (a *Audio) SoundById(id string) (*AudioClip, bool) - - -### func (a *Audio) SoundVolume() float32 - - -### func (a *Audio) Stop(handle VoiceHandle) - - -### func (a *Audio) StopSource(clip *AudioClip) - - -### func (a *Audio) UnloadClip(clip *AudioClip) - - -### func (a *Audio) UnmuteMusic() - - -### func (a *Audio) UnmuteSounds() - - -### type AudioClip struct { - -```go -// Has unexported fields. -``` - -} - -### func (c *AudioClip) Length() float64 - - -### type SoloudHandle = *C.Soloud - - -### type SoloudWav = *C.Wav - - -### type VoiceHandle = uint32 - - - diff --git a/docs/api/platform_filesystem.md b/docs/api/platform_filesystem.md deleted file mode 100644 index 5ea934727..000000000 --- a/docs/api/platform_filesystem.md +++ /dev/null @@ -1,178 +0,0 @@ -# Package platform/filesystem - -**Import path:** `kaijuengine.com/platform/filesystem` - - - -## Functions - - -### func CopyDirectory(src, dst string) error - -```go - CopyDirectory copies the directory at the source path to the destination - path. -``` - - -### func CopyFile(src, dst string) error - -```go - CopyFile copies the file from the source path to the destination path. - If the destination file already exists, an error will be returned. -``` - - -### func CopyFileOverwrite(src, dst string) error - -```go - CopyFileOverwrite copies the file from the source path to the destination - path. If the destination file already exists, it will be truncated. -``` - - -### func CopyGoSourceFile(src, dst string) error - -```go - CopyGoSourceFile copies go specific source code from the source path to the - destination path. If the destination file already exists, an error will be - returned. This function is used to ensure that the generated files have the - correct header. -``` - - -### func CreateDirectory(path string) error - -```go - CreateDirectory creates a directory at the specified path with full - permissions. -``` - - -### func DeleteDirectory(path string) error - -```go - DeleteDirectory deletes the directory at the specified path. -``` - - -### func DirectoryExists(path string) bool - -```go - DirectoryExists returns true if the directory exists at the specified path. -``` - - -### func FileExists(path string) bool - -```go - FileExists returns true if the file exists at the specified path. -``` - - -### func GameDirectory() (string, error) - -```go - GameDirectory will attempt to find the default directory for the application - to store and load it's data to and from -``` - - -### func ImageDirectory() (string, error) - -```go - ImageDirectory will attempt to find the default user directory where images - are stored. This function is OS specific. -``` - - -### func KnownDirectories() map[string]string - -```go - KnownDirectories returns a list of known, common directories on the current - computer. On windows this is things like Photos, Documents, etc. -``` - - -### func ListFilesRecursive(path string) ([]string, error) - -```go - ListFilesRecursive returns a list of all files in the specified, it walks - through all of the subdirectories as well. -``` - - -### func ListFoldersRecursive(path string) ([]string, error) - -```go - ListFoldersRecursive returns a list of all directories in the specified, - it walks through all of the subdirectories as well. -``` - - -### func ListRecursive(path string) ([]string, error) - -```go - ListRecursive returns a list of all files and directories in the specified, - it walks through all of the subdirectories as well. -``` - - -### func OpenFileBrowserToFolder(path string) error - -### func OpenFileDialogWindow(startPath string, extensions []DialogExtension, ok func(path string), cancel func(), windowHandle unsafe.Pointer) error - -### func OpenSaveFileDialogWindow(startPath string, fileName string, extensions []DialogExtension, ok func(path string), cancel func(), windowHandle unsafe.Pointer) error - -### func ReadFile(path string) ([]byte, error) - -```go - ReadFile reads the binary data from the file at the specified path. If the - file does not exist, an error will be returned. -``` - - -### func ReadTextFile(path string) (string, error) - -```go - ReadTextFile reads the text data from the file at the specified path. - If the file does not exist, an error will be returned. -``` - - -### func Unzip(src, dest string) error - -### func WriteFile(path string, data []byte) error - -```go - WriteFile writes the binary data to the file at the specified path. - This will use permissions 0644 for the file. If the file already exists, - it will be overwritten. -``` - - -### func WriteTextFile(path string, data string) error - -```go - WriteTextFile writes the text data to the file at the specified path. - This will use permissions 0644 for the file. If the file already exists, - it will be overwritten. -``` - - -### func Zip(srcDir, outFile string, skipFiles, skipFolders, skipExtensions []string) error - - -## Types - - -### type DialogExtension struct { - -```go -Name string -Extension string -``` - -} - - diff --git a/docs/api/platform_hid.md b/docs/api/platform_hid.md deleted file mode 100644 index c018a3607..000000000 --- a/docs/api/platform_hid.md +++ /dev/null @@ -1,665 +0,0 @@ -# Package platform/hid - -**Import path:** `kaijuengine.com/platform/hid` - - - -## Constants - - -### const ( - -```go -ControllerButtonUp = iota -ControllerButtonDown -ControllerButtonLeft -ControllerButtonRight -ControllerButtonStart -ControllerButtonSelect -ControllerButtonLeftStick -ControllerButtonRightStick -ControllerButtonLeftBumper -ControllerButtonRightBumper -ControllerButtonEx1 // TODO: Name this correctly -ControllerButtonEx2 // TODO: Name this correctly -ControllerButtonA -ControllerButtonB -ControllerButtonX -ControllerButtonY -ControllerButtonMax -``` - -) -### const ( - -```go -ControllerAxisLeftVertical = iota -ControllerAxisLeftHorizontal -ControllerAxisRightVertical -ControllerAxisRightHorizontal -ControllerAxisLeftTrigger -ControllerAxisRightTrigger -ControllerAxisMax -``` - -) -### const ( - -```go -MouseButtonLeft = iota -MouseButtonMiddle -MouseButtonRight -MouseButtonX1 -MouseButtonX2 -MouseButtonLast -``` - -) -### const ( - -```go -MouseRelease = iota -MousePress -MouseRepeat -MouseInvalid = -1 -MouseButtonStateInvalid = -1 -``` - -) -### const ( - -```go -ControllerMaxDevices = 8 -``` - -) -```go - Based off XBOX controller -``` - - -### const ( - -```go -MaxTouchPointersAvailable = 10 -``` - -) - -## Types - - -### type Controller struct { - -```go -// Has unexported fields. -``` - -} - -### func NewController() Controller - -```go - NewController creates a new controller. This is called automatically by the - system and should not be called by the end-developer -``` - - -### func (c *Controller) Available(id int) bool - -```go - Available returns true if the controller is available. This is called - automatically by the system and should not be called by the end-developer -``` - - -### func (c *Controller) Axis(id, stick int) float32 - -```go - Axis returns the axis value for the given controller and stick -``` - - -### func (c *Controller) Connected(id int) - -```go - Connected returns true if the controller is connected. This is called - automatically by the system and should not be called by the end-developer -``` - - -### func (c *Controller) Disconnected(id int) - -```go - Disconnected returns true if the controller is disconnected. This is called - automatically by the system and should not be called by the end-developer -``` - - -### func (c *Controller) EndUpdate() - -```go - EndUpdate is called at the end of the frame. It updates the state of each - controller for the next frame. This is called automatically by the system - and should not be called by the end-developer -``` - - -### func (c *Controller) IsButtonDown(id, button int) bool - -```go - IsButtonDown returns true if the button is down -``` - - -### func (c *Controller) IsButtonHeld(id, button int) bool - -```go - IsButtonHeld returns true if the button is held -``` - - -### func (c *Controller) IsButtonUp(id, button int) bool - -```go - IsButtonUp returns true if the button is up -``` - - -### func (c *Controller) Reset() - -```go - Reset will completely wipe the state of all controllers -``` - - -### func (c *Controller) SetAxis(id, stick int, axis float32) - -```go - SetAxis sets the axis on the given controller. This is called automatically - by the system and should not be called by the end-developer -``` - - -### func (c *Controller) SetButtonDown(id, button int) - -```go - SetButtonDown sets the button down on the given controller. This is called - automatically by the system and should not be called by the end-developer -``` - - -### func (c *Controller) SetButtonUp(id, button int) - -```go - SetButtonUp sets the button up on the given controller. This is called - automatically by the system and should not be called by the end-developer -``` - - -### type ControllerDevice struct { - -```go -// Has unexported fields. -``` - -} - -### type Cursor struct { - -```go -// Has unexported fields. -``` - -} - -### func NewCursor(mouse *Mouse, touch *Touch, stylus *Stylus) Cursor - - -### func (c *Cursor) Held() bool - - -### func (c *Cursor) Moved() bool - - -### func (c *Cursor) Poll() - - -### func (c *Cursor) Position() matrix.Vec2 - - -### func (c *Cursor) Pressed() bool - - -### func (c *Cursor) Released() bool - - -### func (c *Cursor) ScreenPosition() matrix.Vec2 - - -### func (c *Cursor) UIPosition(uiSize, windowSize matrix.Vec2) matrix.Vec2 - - -### type KeyCallbackId int - - -### type KeyState = uint8 - - -### const ( - -```go -KeyStateIdle KeyState = iota -KeyStateDown -KeyStateHeld -KeyStateUp -KeyStatePressedAndReleased -KeyStateToggled -``` - -) -### type Keyboard struct { - -```go -// Has unexported fields. -``` - -} - -### func NewKeyboard() Keyboard - - -### func (k *Keyboard) AddKeyCallback(cb func(keyId int, keyState KeyState)) KeyCallbackId - - -### func (k *Keyboard) EndUpdate() - - -### func (k *Keyboard) GetKeyLastClicked(keyId int) time.Time - - -### func (k Keyboard) HasAlt() bool - - -### func (k Keyboard) HasCtrl() bool - - -### func (k Keyboard) HasModifier() bool - - -### func (k Keyboard) HasShift() bool - - -### func (k Keyboard) IsToggleKey(key KeyboardKey) bool - - -### func (k Keyboard) IsToggleKeyOn(key KeyboardKey) bool - - -### func (k Keyboard) KeyDown(key KeyboardKey) bool - - -### func (k Keyboard) KeyHeld(key KeyboardKey) bool - - -### func (k *Keyboard) KeyToRune(key KeyboardKey) rune - - -### func (k Keyboard) KeyUp(key KeyboardKey) bool - - -### func (k *Keyboard) RemoveKeyCallback(id KeyCallbackId) - - -### func (k *Keyboard) Reset() - - -### func (k *Keyboard) SetKeyDown(key KeyboardKey) - - -### func (k *Keyboard) SetKeyDownUp(key KeyboardKey) - - -### func (k *Keyboard) SetKeyUp(key KeyboardKey) - - -### func (k *Keyboard) SetToggleKeyState(key KeyboardKey, state KeyState) - - -### func (k *Keyboard) ToggleKey(key KeyboardKey) - - -### type KeyboardKey = int - - -### const ( - -```go -KeyBoardKeyInvalid KeyboardKey = -1 + iota -KeyboardKeyLeftAlt -KeyboardKeyRightAlt -KeyboardKeyLeftCtrl -KeyboardKeyRightCtrl -KeyboardKeyLeftShift -KeyboardKeyRightShift -KeyboardKeyA -KeyboardKeyB -KeyboardKeyC -KeyboardKeyD -KeyboardKeyE -KeyboardKeyF -KeyboardKeyG -KeyboardKeyH -KeyboardKeyI -KeyboardKeyJ -KeyboardKeyK -KeyboardKeyL -KeyboardKeyM -KeyboardKeyN -KeyboardKeyO -KeyboardKeyP -KeyboardKeyQ -KeyboardKeyR -KeyboardKeyS -KeyboardKeyT -KeyboardKeyU -KeyboardKeyV -KeyboardKeyW -KeyboardKeyX -KeyboardKeyY -KeyboardKeyZ -KeyboardKeyLeft -KeyboardKeyUp -KeyboardKeyRight -KeyboardKeyDown -KeyboardKeyEscape -KeyboardKeyTab -KeyboardKeySpace -KeyboardKeyBackspace -KeyboardKeyBackQuote -KeyboardKeyDelete -KeyboardKeyReturn -KeyboardKeyEnter -KeyboardKeyComma -KeyboardKeyPeriod -KeyboardKeyBackSlash -KeyboardKeyForwardSlash -KeyboardKeyOpenBracket -KeyboardKeyCloseBracket -KeyboardKeySemicolon -KeyboardKeyQuote -KeyboardKeyEqual -KeyboardKeyMinus -KeyboardKey0 -KeyboardKey1 -KeyboardKey2 -KeyboardKey3 -KeyboardKey4 -KeyboardKey5 -KeyboardKey6 -KeyboardKey7 -KeyboardKey8 -KeyboardKey9 -KeyboardNumKey0 -KeyboardNumKey1 -KeyboardNumKey2 -KeyboardNumKey3 -KeyboardNumKey4 -KeyboardNumKey5 -KeyboardNumKey6 -KeyboardNumKey7 -KeyboardNumKey8 -KeyboardNumKey9 -KeyboardNumKeyDivide -KeyboardNumKeyMultiply -KeyboardNumKeyAdd -KeyboardNumKeySubtract -KeyboardNumKeyPeriod -KeyboardKeyF1 -KeyboardKeyF2 -KeyboardKeyF3 -KeyboardKeyF4 -KeyboardKeyF5 -KeyboardKeyF6 -KeyboardKeyF7 -KeyboardKeyF8 -KeyboardKeyF9 -KeyboardKeyF10 -KeyboardKeyF11 -KeyboardKeyF12 -KeyboardKeyCapsLock -KeyboardKeyScrollLock -KeyboardKeyNumLock -KeyboardKeyPrintScreen -KeyboardKeyPause -KeyboardKeyInsert -KeyboardKeyHome -KeyboardKeyPageUp -KeyboardKeyPageDown -KeyboardKeyEnd -KeyboardKeyMaximum -``` - -) -### func ToKeyboardKey(nativeKey int) KeyboardKey - - -### type Mouse struct { - -```go -X, Y float32 -SX, SY float32 -CX, CY float32 -ScrollX, ScrollY float32 -``` - - -```go -// Has unexported fields. -``` - -} - -### func NewMouse() Mouse - - -### func (m Mouse) ButtonChanged() bool - - -### func (m Mouse) ButtonState(index int) int - - -### func (m Mouse) CenteredPosition() matrix.Vec2 - - -### func (m *Mouse) EndUpdate() - - -### func (m *Mouse) ForceHeld(index int) - - -### func (m Mouse) Held(index int) bool - - -### func (m Mouse) Moved() bool - - -### func (m Mouse) Position() matrix.Vec2 - - -### func (m Mouse) Pressed(index int) bool - - -### func (m Mouse) Released(index int) bool - - -### func (m *Mouse) Reset() - - -### func (m Mouse) ScreenPosition() matrix.Vec2 - - -### func (m Mouse) Scroll() matrix.Vec2 - - -### func (m Mouse) Scrolled() bool - - -### func (m *Mouse) SetDown(index int) - - -### func (m *Mouse) SetPosition(x, y, windowWidth, windowHeight float32) - - -### func (m *Mouse) SetScroll(x, y float32) - - -### func (m *Mouse) SetUp(index int) - - -### type Stylus struct { - -```go -X float32 -Y float32 -SX float32 -SY float32 -Pressure float32 -Distance float32 -// Has unexported fields. -``` - -} - -### func NewStylus() Stylus - - -### func (s *Stylus) ActionState() int - - -### func (s *Stylus) EndUpdate() - - -### func (s *Stylus) Held() bool - - -### func (s *Stylus) IsActive() bool - - -### func (s *Stylus) Moved() bool - - -### func (s *Stylus) Pressed() bool - - -### func (s *Stylus) Released() bool - - -### func (s *Stylus) Reset() - - -### func (s *Stylus) Set(x, y, pressure, distance, windowHeight float32) - - -### func (s *Stylus) SetActionState(state StylusActionState) - - -### type StylusActionState = int - - -### const ( - -```go -StylusActionNone StylusActionState = iota -StylusActionHoverEnter -StylusActionHoverMove -StylusActionHoverExit -StylusActionDown -StylusActionMove -StylusActionUp -StylusActionHeld -StylusActionHover -``` - -) -### type Touch struct { - -```go -Pointers []*TouchPointer -Pool [MaxTouchPointersAvailable]TouchPointer -``` - -} - -### func NewTouch() Touch - - -### func (t *Touch) Cancel() - - -### func (t *Touch) Cancelled() bool - - -### func (t *Touch) EndUpdate() - - -### func (t *Touch) Held() bool - - -### func (t *Touch) Moved() bool - - -### func (t *Touch) Pointer(index int) *TouchPointer - - -### func (t *Touch) Pressed() bool - - -### func (t *Touch) Released() bool - - -### func (t *Touch) Reset() - - -### func (t *Touch) SetDown(id int64, x, y, windowHeight float32) - - -### func (t *Touch) SetMoved(id int64, x, y, windowHeight float32) - - -### func (t *Touch) SetPressure(id int64, pressure float32) - - -### func (t *Touch) SetUp(id int64, x, y, windowHeight float32) - - -### type TouchAction = int - - -### const ( - -```go -TouchActionNone TouchAction = -1 -TouchActionDown TouchAction = internalTouchActionDown -TouchActionUp TouchAction = internalTouchActionUp -TouchActionMove TouchAction = internalTouchActionMove -TouchActionCancel TouchAction = -2 -TouchActionHeld TouchAction = -3 -``` - -) -### type TouchPointer struct { - -```go -Pressure float32 -X float32 -Y float32 -SX float32 -SY float32 -State TouchAction -Id int64 -``` - -} - - diff --git a/docs/api/platform_windowing.md b/docs/api/platform_windowing.md deleted file mode 100644 index 63c5e9744..000000000 --- a/docs/api/platform_windowing.md +++ /dev/null @@ -1,357 +0,0 @@ -# Package platform/windowing - -**Import path:** `kaijuengine.com/platform/windowing` - - - -## Functions - - -### func DPI2PX(pixels, mm, targetMM int) int - -### func DPI2PXF(pixels, mm, targetMM float64) float64 - -### func HasDragData() bool - -### func SetDragData(data DragDataTarget) - -### func UpdateDragData(sender *Window, x, y int) - -### func UpdateDragDrop(sender *Window, x, y int) - - -## Types - - -### type ControllerStateWindowEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type DragDataTarget interface { - -```go -DragUpdate() -``` - -} - -### var ( - -```go -OnDragStop events.Event -``` - -) -### func DragData() DragDataTarget - - -### type FileSearch struct { - -```go -Title string -Extension string -``` - -} - -### type KeyboardButtonWindowEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type MouseButtonWindowEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type MouseMoveWindowEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type MouseScrollWindowEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type SetHandleEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type StylusActionState = int32 - - -### type StylusStateWindowEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type TouchActionState = int32 - - -### type TouchStateWindowEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type Window struct { - -```go -Mouse hid.Mouse -Keyboard hid.Keyboard -Touch hid.Touch -Stylus hid.Stylus -Controller hid.Controller -Cursor hid.Cursor -GpuHost rendering.GPUApplication -GpuInstance *rendering.GPUApplicationInstance -OnResize events.Event -OnMove events.Event -OnActivate events.Event -OnDeactivate events.Event -``` - - -```go -// Has unexported fields. -``` - -} - -### func FindWindowAtPoint(x, y int) (*Window, bool) - - -### func New(windowName string, width, height, x, y int, adb assets.Database, platformState any) (*Window, error) - - -### func (w *Window) AddBorder() - - -### func (w *Window) Center() (x int, y int) - - -### func (w *Window) ClipboardContents() string - - -### func (w *Window) CopyToClipboard(text string) - - -### func (w *Window) CursorIbeam() - - -### func (w *Window) CursorSizeAll() - - -### func (w *Window) CursorSizeNS() - - -### func (w *Window) CursorSizeWE() - - -### func (w *Window) CursorStandard() - - -### func (w *Window) Destroy() - - -### func (w *Window) DisableRawMouseInput() - - -### func (w *Window) DotsPerMillimeter() float64 - - -### func (w *Window) EnableRawMouseInput() - - -### func (w *Window) EndUpdate() - - -### func (w *Window) Focus() - - -### func (w *Window) GetDrawableSize() (int32, int32) - - -### func (w *Window) GetInstanceExtensions() []string - - -### func (w *Window) Height() int - - -### func (w *Window) HideCursor() - - -### func (w *Window) IsClosed() bool - - -### func (w *Window) IsCrashed() bool - - -### func (w *Window) IsFullScreen() bool - - -### func (w *Window) IsMinimized() bool - - -### func (w *Window) IsPCSize() bool - - -### func (w *Window) IsPhoneSize() bool - - -### func (w *Window) IsTabletSize() bool - - -### func (w *Window) LockCursor(x, y int) - - -### func (w *Window) OpenFileDialog(startPath string, extensions []filesystem.DialogExtension, ok func(path string), cancel func()) error - - -### func (w *Window) PlatformInstance() unsafe.Pointer - - -### func (w *Window) PlatformWindow() unsafe.Pointer - - -### func (w *Window) Poll() - - -### func (w *Window) Position() (x int, y int) - - -### func (w *Window) ReadApplicationAsset(path string) ([]byte, error) - -```go - ReadApplicationAsset will read an asset bound to the application. This is - typically only useful on mobile platforms like Android. Platforms like - Linux, Windows, and Mac will return an error, use #ReadFile instead -``` - - -### func (w *Window) RemoveBorder() - - -### func (w *Window) SaveFileDialog(startPath string, fileName string, extensions []filesystem.DialogExtension, ok func(path string), cancel func()) error - - -### func (w *Window) ScreenSizeMM() (int, int, error) - - -### func (w *Window) SetCursorPosition(x, y int) - - -### func (w *Window) SetFullscreen() - - -### func (w *Window) SetIcon(img image.Image) - - -### func (w *Window) SetPosition(x, y int) - - -### func (w *Window) SetSize(width, height int) - - -### func (w *Window) SetTitle(name string) - - -### func (w *Window) SetWindowed(width, height int) - - -### func (w *Window) ShowCursor() - - -### func (w *Window) SizeMM() (int, int, error) - - -### func (w *Window) SwapBuffers() - - -### func (w *Window) ToLocalPosition(x, y int) (int, int) - - -### func (w *Window) ToScreenPosition(x, y int) (int, int) - - -### func (w *Window) UnlockCursor() - - -### func (w *Window) Viewport() matrix.Vec4 - - -### func (w *Window) Width() int - - -### func (w *Window) X() int - - -### func (w *Window) XY() (int, int) - - -### func (w *Window) Y() int - - -### type WindowActivityEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type WindowEventActivityType = uint32 - - -### type WindowEventButtonType = uint32 - - -### type WindowEventControllerConnectionType = uint32 - - -### type WindowEventType = uint8 - - -### type WindowMoveEvent struct { - -```go -// Has unexported fields. -``` - -} - -### type WindowResizeEvent struct { - -```go -// Has unexported fields. -``` - -} - - diff --git a/docs/api/plugins.md b/docs/api/plugins.md new file mode 100644 index 000000000..dff1e65ed --- /dev/null +++ b/docs/api/plugins.md @@ -0,0 +1,67 @@ + + +# plugins + +```go +import "kaijuengine.com/plugins" +``` + +## Index + +- [Variables](<#variables>) +- [func RegenerateAPI\(\) error](<#RegenerateAPI>) +- [type LuaVM](<#LuaVM>) + - [func LaunchPlugins\(adb assets.Database, path string\) \(\[\]\*LuaVM, error\)](<#LaunchPlugins>) + - [func \(vm \*LuaVM\) InvokeGlobalFunction\(name string\)](<#LuaVM.InvokeGlobalFunction>) + + +## Variables + + + +```go +var ( + GamePluginRegistry = []reflect.Type{} +) +``` + + +## func [RegenerateAPI]() + +```go +func RegenerateAPI() error +``` + + + + +## type [LuaVM]() + + + +```go +type LuaVM struct { + PluginPath string + // contains filtered or unexported fields +} +``` + + +### func [LaunchPlugins]() + +```go +func LaunchPlugins(adb assets.Database, path string) ([]*LuaVM, error) +``` + + + + +### func \(\*LuaVM\) [InvokeGlobalFunction]() + +```go +func (vm *LuaVM) InvokeGlobalFunction(name string) +``` + + + +Generated by [gomarkdoc]() diff --git a/docs/api/registry_shader_data_registry.md b/docs/api/registry_shader_data_registry.md deleted file mode 100644 index 313506a62..000000000 --- a/docs/api/registry_shader_data_registry.md +++ /dev/null @@ -1,245 +0,0 @@ -# Package registry/shader_data_registry - -**Import path:** `kaijuengine.com/registry/shader_data_registry` - - - -## Constants - - -### const ( - -```go -ShaderDataStandardFlagOutline = StandardShaderDataFlags(1 << iota) -// Enable bit will be set anytime there are flags. This is needed because -// bits at the extremes of the float will be truncated to 0 otherwise. By -// setting this bit (largest exponent bit 2^1) this issue can be prevented. -ShaderDataStandardFlagEnable = 1 << 30 -``` - -) - -## Functions - - -### func Create(name string) rendering.DrawInstance - -### func StandardShaderDataFlagsClear(target rendering.DrawInstance, flag StandardShaderDataFlags) - -### func StandardShaderDataFlagsSet(target rendering.DrawInstance, flag StandardShaderDataFlags) - -### func StandardShaderDataFlagsTest(target rendering.DrawInstance, flag StandardShaderDataFlags) bool - - -## Types - - -### type ShaderDataEdFrustumWire struct { - -```go -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -Color matrix.Color -FrustumProjection matrix.Mat4 -``` - -} - -### func (t ShaderDataEdFrustumWire) Size() int - - -### type ShaderDataEdThumbPreviewMesh struct { - -```go -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -View matrix.Mat4 `visible:"false"` -Projection matrix.Mat4 `visible:"false"` -``` - -} - -### func (s *ShaderDataEdThumbPreviewMesh) SetCamera(view, projection matrix.Mat4) - - -### func (ShaderDataEdThumbPreviewMesh) Size() int - - -### type ShaderDataEdTransformWire struct { - -```go -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -Color matrix.Color -``` - -} - -### func (t ShaderDataEdTransformWire) Size() int - - -### type ShaderDataGrid struct { - -```go -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -Color matrix.Color -``` - -} - -### func (t ShaderDataGrid) Size() int - - -### type ShaderDataPBR struct { - -```go -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -VertColors matrix.Color -MeRoEmAo matrix.Vec4 -Flags StandardShaderDataFlags `visible:"false"` -LightIds [4]int32 `visible:"false"` -``` - -} - -### func (s *ShaderDataPBR) SelectLights(lights rendering.LightsForRender) - - -### func (t ShaderDataPBR) Size() int - - -### type ShaderDataParticle struct { - -```go -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -Color matrix.Color -UVs matrix.Vec4 `default:"0,0,1,1"` -``` - -} - -### func (t ShaderDataParticle) Size() int - - -### type ShaderDataPbrSkinned struct { - -```go -rendering.SkinnedShaderDataHeader `visible:"false"` -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -VertColors matrix.Color -MeRoEmAo matrix.Vec4 -Flags StandardShaderDataFlags `visible:"false"` -LightIds [4]int32 `visible:"false"` -``` - -} - -### func (t *ShaderDataPbrSkinned) BoundDataPointer() unsafe.Pointer - - -### func (t *ShaderDataPbrSkinned) InstanceBoundDataSize() int - - -### func (t ShaderDataPbrSkinned) Size() int - - -### func (t *ShaderDataPbrSkinned) SkinningHeader() *rendering.SkinnedShaderDataHeader - - -### func (t *ShaderDataPbrSkinned) UpdateBoundData() bool - - -### type ShaderDataStandard struct { - -```go -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -Color matrix.Color -Flags StandardShaderDataFlags `visible:"false"` -``` - -} - -### func (ShaderDataStandard) Size() int - - -### type ShaderDataStandardSkinned struct { - -```go -rendering.SkinnedShaderDataHeader `visible:"false"` -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -Color matrix.Color -Flags StandardShaderDataFlags `visible:"false"` -``` - -} - -### func (t *ShaderDataStandardSkinned) BoundDataPointer() unsafe.Pointer - - -### func (t *ShaderDataStandardSkinned) InstanceBoundDataSize() int - - -### func (t ShaderDataStandardSkinned) Size() int - - -### func (t *ShaderDataStandardSkinned) SkinningHeader() *rendering.SkinnedShaderDataHeader - - -### func (t *ShaderDataStandardSkinned) UpdateBoundData() bool - - -### type ShaderDataUnlit struct { - -```go -rendering.ShaderDataBase `visible:"false"` -``` - - -```go -Color matrix.Color -UVs matrix.Vec4 `default:"0,0,1,1"` -Flags StandardShaderDataFlags `visible:"false"` -``` - -} - -### func (t ShaderDataUnlit) Size() int - - -### type StandardShaderDataFlags = uint32 - - - diff --git a/docs/api/rendering.md b/docs/api/rendering.md index f9bdbf408..1e606bf6c 100644 --- a/docs/api/rendering.md +++ b/docs/api/rendering.md @@ -1,4538 +1,8235 @@ -# Package rendering - -**Import path:** `kaijuengine.com/rendering` - + + +# rendering + +```go +import "kaijuengine.com/rendering" +``` + +## Index + +- [Constants](<#constants>) +- [Variables](<#variables>) +- [func SetupLightMaterials\(materialCache \*MaterialCache\) error](<#SetupLightMaterials>) +- [func TextureKeys\(textures \[\]\*Texture\) \[\]string](<#TextureKeys>) +- [func VertexFaceNormal\(verts \[3\]Vertex\) matrix.Vec3](<#VertexFaceNormal>) +- [type BoneTransform](<#BoneTransform>) +- [type CommandRecorder](<#CommandRecorder>) + - [func NewCommandRecorder\(device \*GPUDevice\) \(CommandRecorder, error\)](<#NewCommandRecorder>) + - [func \(c \*CommandRecorder\) Begin\(\)](<#CommandRecorder.Begin>) + - [func \(c \*CommandRecorder\) Destroy\(device \*GPUDevice\)](<#CommandRecorder.Destroy>) + - [func \(c \*CommandRecorder\) End\(\)](<#CommandRecorder.End>) + - [func \(c \*CommandRecorder\) Reset\(\)](<#CommandRecorder.Reset>) +- [type CommandRecorderSecondary](<#CommandRecorderSecondary>) + - [func NewCommandRecorderSecondary\(device \*GPUDevice, rp \*RenderPass, subpassIdx int\) \(CommandRecorderSecondary, error\)](<#NewCommandRecorderSecondary>) + - [func \(c \*CommandRecorderSecondary\) Begin\(viewport vk.Viewport, scissor vk.Rect2D\)](<#CommandRecorderSecondary.Begin>) +- [type ComputeShaderBuffer](<#ComputeShaderBuffer>) + - [func \(b \*ComputeShaderBuffer\) Initialize\(device \*GPUDevice, size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags\) error](<#ComputeShaderBuffer.Initialize>) + - [func \(b \*ComputeShaderBuffer\) WriteDescriptors\(device \*GPUDevice\)](<#ComputeShaderBuffer.WriteDescriptors>) +- [type ComputeTask](<#ComputeTask>) +- [type DescriptorSetLayoutStructure](<#DescriptorSetLayoutStructure>) +- [type DescriptorSetLayoutStructureType](<#DescriptorSetLayoutStructureType>) +- [type DrawInstance](<#DrawInstance>) + - [func ReflectDuplicateDrawInstance\(target DrawInstance\) DrawInstance](<#ReflectDuplicateDrawInstance>) +- [type DrawInstanceGroup](<#DrawInstanceGroup>) + - [func NewDrawInstanceGroup\(mesh \*Mesh, dataSize int, viewCuller ViewCuller\) DrawInstanceGroup](<#NewDrawInstanceGroup>) + - [func \(d \*DrawInstanceGroup\) AddInstance\(instance DrawInstance\)](<#DrawInstanceGroup.AddInstance>) + - [func \(d \*DrawInstanceGroup\) AlterPadding\(blockSize int\)](<#DrawInstanceGroup.AlterPadding>) + - [func \(d \*DrawInstanceGroup\) AnyVisible\(\) bool](<#DrawInstanceGroup.AnyVisible>) + - [func \(d \*DrawInstanceGroup\) Clear\(\)](<#DrawInstanceGroup.Clear>) + - [func \(d \*DrawInstanceGroup\) Destroy\(device \*GPUDevice\)](<#DrawInstanceGroup.Destroy>) + - [func \(d \*DrawInstanceGroup\) IsEmpty\(\) bool](<#DrawInstanceGroup.IsEmpty>) + - [func \(d \*DrawInstanceGroup\) IsReady\(\) bool](<#DrawInstanceGroup.IsReady>) + - [func \(d \*DrawInstanceGroup\) TotalSize\(\) int](<#DrawInstanceGroup.TotalSize>) + - [func \(d \*DrawInstanceGroup\) UpdateData\(device \*GPUDevice, frame int, lights LightsForRender\)](<#DrawInstanceGroup.UpdateData>) + - [func \(d \*DrawInstanceGroup\) VisibleCount\(\) int](<#DrawInstanceGroup.VisibleCount>) + - [func \(d \*DrawInstanceGroup\) VisibleSize\(\) int](<#DrawInstanceGroup.VisibleSize>) +- [type Drawing](<#Drawing>) + - [func \(d \*Drawing\) IsValid\(\) bool](<#Drawing.IsValid>) +- [type Drawings](<#Drawings>) + - [func NewDrawings\(\) Drawings](<#NewDrawings>) + - [func \(d \*Drawings\) AddDrawing\(drawing Drawing\)](<#Drawings.AddDrawing>) + - [func \(d \*Drawings\) AddDrawings\(drawings \[\]Drawing\)](<#Drawings.AddDrawings>) + - [func \(d \*Drawings\) Clear\(\)](<#Drawings.Clear>) + - [func \(d \*Drawings\) Destroy\(device \*GPUDevice\)](<#Drawings.Destroy>) + - [func \(d \*Drawings\) HasDrawings\(\) bool](<#Drawings.HasDrawings>) + - [func \(d \*Drawings\) PreparePending\(shadowCascades uint8\)](<#Drawings.PreparePending>) + - [func \(d \*Drawings\) Render\(device \*GPUDevice, lights LightsForRender\)](<#Drawings.Render>) +- [type FontBaseline](<#FontBaseline>) +- [type FontCache](<#FontCache>) + - [func NewFontCache\(device \*GPUDevice, assetDb assets.Database\) FontCache](<#NewFontCache>) + - [func \(cache \*FontCache\) Destroy\(\)](<#FontCache.Destroy>) + - [func \(cache \*FontCache\) EMSize\(face FontFace\) float32](<#FontCache.EMSize>) + - [func \(cache \*FontCache\) Init\(caches RenderCaches\) error](<#FontCache.Init>) + - [func \(cache \*FontCache\) LineCountWithin\(face FontFace, text string, scale, maxWidth float32\) int](<#FontCache.LineCountWithin>) + - [func \(cache \*FontCache\) MeasureCharacter\(face string, r rune, pixelSize float32\) matrix.Vec2](<#FontCache.MeasureCharacter>) + - [func \(cache \*FontCache\) MeasureString\(face FontFace, text string, scale float32\) float32](<#FontCache.MeasureString>) + - [func \(cache \*FontCache\) MeasureStringWithin\(face FontFace, text string, scale, maxWidth float32, lineHeight float32\) matrix.Vec2](<#FontCache.MeasureStringWithin>) + - [func \(cache \*FontCache\) PointOffsetWithin\(face FontFace, text string, point matrix.Vec2, scale, maxWidth float32\) int](<#FontCache.PointOffsetWithin>) + - [func \(cache \*FontCache\) PreloadFace\(face FontFace\)](<#FontCache.PreloadFace>) + - [func \(cache \*FontCache\) RenderMeshes\(caches RenderCaches, text string, x, y, z, scale, maxWidth float32, fgColor, bgColor matrix.Color, justify FontJustify, baseline FontBaseline, rootScale matrix.Vec3, instanced, is3D bool, face FontFace, lineHeight float32, cam \*cameras.Container\) \[\]Drawing](<#FontCache.RenderMeshes>) + - [func \(cache \*FontCache\) StringRectsWithinNew\(face FontFace, text string, scale, maxWidth float32\) \[\]matrix.Vec4](<#FontCache.StringRectsWithinNew>) + - [func \(cache \*FontCache\) TransparentMaterial\(target \*Material\) \*Material](<#FontCache.TransparentMaterial>) +- [type FontFace](<#FontFace>) + - [func \(f FontFace\) AsBold\(\) FontFace](<#FontFace.AsBold>) + - [func \(f FontFace\) AsExtraBold\(\) FontFace](<#FontFace.AsExtraBold>) + - [func \(f FontFace\) AsItalic\(\) FontFace](<#FontFace.AsItalic>) + - [func \(f FontFace\) AsLight\(\) FontFace](<#FontFace.AsLight>) + - [func \(f FontFace\) AsMedium\(\) FontFace](<#FontFace.AsMedium>) + - [func \(f FontFace\) AsRegular\(\) FontFace](<#FontFace.AsRegular>) + - [func \(f FontFace\) AsSemiBold\(\) FontFace](<#FontFace.AsSemiBold>) + - [func \(f FontFace\) Base\(\) FontFace](<#FontFace.Base>) + - [func \(f FontFace\) IsBold\(\) bool](<#FontFace.IsBold>) + - [func \(f FontFace\) IsExtraBold\(\) bool](<#FontFace.IsExtraBold>) + - [func \(f FontFace\) IsItalic\(\) bool](<#FontFace.IsItalic>) + - [func \(f FontFace\) RemoveBold\(\) FontFace](<#FontFace.RemoveBold>) + - [func \(f FontFace\) RemoveItalic\(\) FontFace](<#FontFace.RemoveItalic>) +- [type FontJustify](<#FontJustify>) +- [type FuncPipeline](<#FuncPipeline>) +- [type GPUAccessFlags](<#GPUAccessFlags>) +- [type GPUApplication](<#GPUApplication>) + - [func \(g \*GPUApplication\) ApplicationVersion\(\) \(major int, minor int, patch int\)](<#GPUApplication.ApplicationVersion>) + - [func \(g \*GPUApplication\) CreateInstance\(window RenderingContainer, assets assets.Database\) \(\*GPUApplicationInstance, error\)](<#GPUApplication.CreateInstance>) + - [func \(g \*GPUApplication\) Destroy\(\)](<#GPUApplication.Destroy>) + - [func \(g \*GPUApplication\) EngineVersion\(\) \(major int, minor int, patch int\)](<#GPUApplication.EngineVersion>) + - [func \(g \*GPUApplication\) FirstInstance\(\) \*GPUApplicationInstance](<#GPUApplication.FirstInstance>) + - [func \(g \*GPUApplication\) Instance\(index int\) \(\*GPUApplicationInstance, bool\)](<#GPUApplication.Instance>) + - [func \(g \*GPUApplication\) IsValid\(\) bool](<#GPUApplication.IsValid>) + - [func \(g \*GPUApplication\) Setup\(name string, version GPUApplicationVersion\)](<#GPUApplication.Setup>) +- [type GPUApplicationInstance](<#GPUApplicationInstance>) + - [func \(g \*GPUApplicationInstance\) Destroy\(\)](<#GPUApplicationInstance.Destroy>) + - [func \(g \*GPUApplicationInstance\) FinalizeLogicalDeviceSetup\(\)](<#GPUApplicationInstance.FinalizeLogicalDeviceSetup>) + - [func \(g \*GPUApplicationInstance\) Initialize\(window RenderingContainer, app \*GPUApplication, assets assets.Database\) error](<#GPUApplicationInstance.Initialize>) + - [func \(g \*GPUApplicationInstance\) PhysicalDevice\(\) \*GPUPhysicalDevice](<#GPUApplicationInstance.PhysicalDevice>) + - [func \(g \*GPUApplicationInstance\) PrimaryDevice\(\) \*GPUDevice](<#GPUApplicationInstance.PrimaryDevice>) + - [func \(g \*GPUApplicationInstance\) SelectPhysicalDevice\(method func\(options \[\]GPUPhysicalDevice\) int\) error](<#GPUApplicationInstance.SelectPhysicalDevice>) + - [func \(g \*GPUApplicationInstance\) SetupCaches\(caches RenderCaches, width, height int32\) error](<#GPUApplicationInstance.SetupCaches>) + - [func \(g \*GPUApplicationInstance\) SetupLogicalDevice\(index int\) error](<#GPUApplicationInstance.SetupLogicalDevice>) +- [type GPUApplicationVersion](<#GPUApplicationVersion>) +- [type GPUAttachmentLoadOp](<#GPUAttachmentLoadOp>) +- [type GPUAttachmentStoreOp](<#GPUAttachmentStoreOp>) +- [type GPUBuffer](<#GPUBuffer>) +- [type GPUBufferUsageFlags](<#GPUBufferUsageFlags>) +- [type GPUColorSpace](<#GPUColorSpace>) +- [type GPUCompositeAlphaFlags](<#GPUCompositeAlphaFlags>) +- [type GPUDescriptorImageInfo](<#GPUDescriptorImageInfo>) +- [type GPUDescriptorPool](<#GPUDescriptorPool>) +- [type GPUDescriptorSet](<#GPUDescriptorSet>) +- [type GPUDescriptorSetLayout](<#GPUDescriptorSetLayout>) +- [type GPUDevice](<#GPUDevice>) + - [func \(g \*GPUDevice\) BlitTargets\(passes \[\]\*RenderPass\)](<#GPUDevice.BlitTargets>) + - [func \(g \*GPUDevice\) CopyBuffer\(srcBuffer GPUBuffer, dstBuffer GPUBuffer, size uintptr\)](<#GPUDevice.CopyBuffer>) + - [func \(g \*GPUDevice\) CopyBufferToImage\(buffer GPUBuffer, image GPUImage, width, height uint32, layerCount int\)](<#GPUDevice.CopyBufferToImage>) + - [func \(g \*GPUDevice\) CreateBuffer\(size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags\) \(GPUBuffer, GPUDeviceMemory, error\)](<#GPUDevice.CreateBuffer>) + - [func \(g \*GPUDevice\) CreateFrameBuffer\(renderPass \*RenderPass, attachments \[\]GPUImageView, width, height int32\) \(GPUFrameBuffer, error\)](<#GPUDevice.CreateFrameBuffer>) + - [func \(g \*GPUDevice\) CreateImage\(id \*TextureId, properties GPUMemoryPropertyFlags, req GPUImageCreateRequest\) error](<#GPUDevice.CreateImage>) + - [func \(g \*GPUDevice\) CreateIndexBuffer\(indices \[\]uint32\) \(GPUBuffer, GPUDeviceMemory, error\)](<#GPUDevice.CreateIndexBuffer>) + - [func \(g \*GPUDevice\) CreateMesh\(mesh \*Mesh, verts \[\]Vertex, indices \[\]uint32\)](<#GPUDevice.CreateMesh>) + - [func \(g \*GPUDevice\) CreateShader\(shader \*Shader, assetDB assets.Database\) error](<#GPUDevice.CreateShader>) + - [func \(g \*GPUDevice\) CreateSwapChain\(window RenderingContainer, inst \*GPUApplicationInstance\) error](<#GPUDevice.CreateSwapChain>) + - [func \(g \*GPUDevice\) CreateTextureSampler\(mipLevels uint32, filter GPUFilter\) \(GPUSampler, error\)](<#GPUDevice.CreateTextureSampler>) + - [func \(g \*GPUDevice\) CreateVertexBuffer\(verts \[\]Vertex\) \(GPUBuffer, GPUDeviceMemory, error\)](<#GPUDevice.CreateVertexBuffer>) + - [func \(g \*GPUDevice\) DestroyBuffer\(buffer GPUBuffer\)](<#GPUDevice.DestroyBuffer>) + - [func \(g \*GPUDevice\) DestroyFrameBuffer\(frameBuffer GPUFrameBuffer\)](<#GPUDevice.DestroyFrameBuffer>) + - [func \(g \*GPUDevice\) DestroyShaderHandle\(id ShaderId\)](<#GPUDevice.DestroyShaderHandle>) + - [func \(g \*GPUDevice\) Draw\(renderPass \*RenderPass, drawings \[\]ShaderDraw, lights LightsForRender, shadows \[\]TextureId\)](<#GPUDevice.Draw>) + - [func \(g \*GPUDevice\) FreeMemory\(memory GPUDeviceMemory\)](<#GPUDevice.FreeMemory>) + - [func \(g \*GPUDevice\) GenerateMipMaps\(texId \*TextureId, imageFormat GPUFormat, texWidth, texHeight, mipLevels uint32, filter GPUFilter\) error](<#GPUDevice.GenerateMipMaps>) + - [func \(g \*GPUDevice\) MapMemory\(memory GPUDeviceMemory, offset uintptr, size uintptr, flags GPUMemoryFlags, out \*unsafe.Pointer\) error](<#GPUDevice.MapMemory>) + - [func \(g \*GPUDevice\) Memcopy\(dst unsafe.Pointer, src \[\]byte\) int](<#GPUDevice.Memcopy>) + - [func \(g \*GPUDevice\) MeshIsReady\(mesh Mesh\) bool](<#GPUDevice.MeshIsReady>) + - [func \(g \*GPUDevice\) QueueCompute\(buffer \*ComputeShaderBuffer\)](<#GPUDevice.QueueCompute>) + - [func \(g \*GPUDevice\) ReadyFrame\(inst \*GPUApplicationInstance, window RenderingContainer, camera cameras.Camera, uiCamera cameras.Camera, lights LightsForRender, runtime float32\) bool](<#GPUDevice.ReadyFrame>) + - [func \(g \*GPUDevice\) SetupTexture\(texture \*Texture, data \*TextureData\) error](<#GPUDevice.SetupTexture>) + - [func \(g \*GPUDevice\) SwapFrame\(window RenderingContainer, inst \*GPUApplicationInstance, width, height int32\) bool](<#GPUDevice.SwapFrame>) + - [func \(g \*GPUDevice\) TextureRead\(texture \*Texture\) \(\[\]byte, error\)](<#GPUDevice.TextureRead>) + - [func \(g \*GPUDevice\) TextureReadPixel\(texture \*Texture, x, y int\) matrix.Color](<#GPUDevice.TextureReadPixel>) + - [func \(g \*GPUDevice\) TextureWritePixels\(texture \*Texture, requests \[\]GPUImageWriteRequest\)](<#GPUDevice.TextureWritePixels>) + - [func \(g \*GPUDevice\) TransitionImageLayout\(vt \*TextureId, newLayout GPUImageLayout, aspectMask GPUImageAspectFlags, newAccess GPUAccessFlags, cmd \*CommandRecorder\)](<#GPUDevice.TransitionImageLayout>) + - [func \(g \*GPUDevice\) UnmapMemory\(memory GPUDeviceMemory\)](<#GPUDevice.UnmapMemory>) + - [func \(g \*GPUDevice\) WriteBufferToImageRegion\(image GPUImage, requests \[\]GPUImageWriteRequest\) error](<#GPUDevice.WriteBufferToImageRegion>) +- [type GPUDeviceMemory](<#GPUDeviceMemory>) +- [type GPUFence](<#GPUFence>) +- [type GPUFilter](<#GPUFilter>) +- [type GPUFormat](<#GPUFormat>) +- [type GPUFormatFeatureFlags](<#GPUFormatFeatureFlags>) +- [type GPUFormatProperties](<#GPUFormatProperties>) +- [type GPUFrameBuffer](<#GPUFrameBuffer>) +- [type GPUHandle](<#GPUHandle>) + - [func \(g \*GPUHandle\) HandleAddr\(\) unsafe.Pointer](<#GPUHandle.HandleAddr>) + - [func \(g \*GPUHandle\) IsValid\(\) bool](<#GPUHandle.IsValid>) + - [func \(g \*GPUHandle\) Reset\(\)](<#GPUHandle.Reset>) +- [type GPUImage](<#GPUImage>) +- [type GPUImageAspectFlags](<#GPUImageAspectFlags>) +- [type GPUImageCreateFlags](<#GPUImageCreateFlags>) +- [type GPUImageCreateRequest](<#GPUImageCreateRequest>) +- [type GPUImageLayout](<#GPUImageLayout>) +- [type GPUImageTiling](<#GPUImageTiling>) +- [type GPUImageType](<#GPUImageType>) +- [type GPUImageUsageFlags](<#GPUImageUsageFlags>) +- [type GPUImageView](<#GPUImageView>) +- [type GPUImageViewType](<#GPUImageViewType>) +- [type GPUImageWriteRequest](<#GPUImageWriteRequest>) +- [type GPUInstance](<#GPUInstance>) + - [func \(g \*GPUInstance\) Destroy\(\)](<#GPUInstance.Destroy>) + - [func \(g \*GPUInstance\) IsValid\(\) bool](<#GPUInstance.IsValid>) + - [func \(g \*GPUInstance\) Setup\(window RenderingContainer, app \*GPUApplication\) error](<#GPUInstance.Setup>) +- [type GPULight](<#GPULight>) +- [type GPULightInfo](<#GPULightInfo>) +- [type GPULogicalDevice](<#GPULogicalDevice>) + - [func \(g \*GPULogicalDevice\) CreateImageView\(id \*TextureId, aspectFlags GPUImageAspectFlags, viewType GPUImageViewType\) error](<#GPULogicalDevice.CreateImageView>) + - [func \(g \*GPULogicalDevice\) Destroy\(\)](<#GPULogicalDevice.Destroy>) + - [func \(g \*GPULogicalDevice\) DestroyFence\(fence \*GPUFence\)](<#GPULogicalDevice.DestroyFence>) + - [func \(g \*GPULogicalDevice\) DestroyGroup\(group \*DrawInstanceGroup\)](<#GPULogicalDevice.DestroyGroup>) + - [func \(g \*GPULogicalDevice\) DestroySemaphore\(semaphore \*GPUSemaphore\)](<#GPULogicalDevice.DestroySemaphore>) + - [func \(g \*GPULogicalDevice\) FreeTexture\(texId \*TextureId\)](<#GPULogicalDevice.FreeTexture>) + - [func \(g \*GPULogicalDevice\) ImageMemoryRequirements\(image GPUImage\) GPUMemoryRequirements](<#GPULogicalDevice.ImageMemoryRequirements>) + - [func \(g \*GPULogicalDevice\) RemakeSwapChain\(window RenderingContainer, inst \*GPUApplicationInstance, device \*GPUDevice\) error](<#GPULogicalDevice.RemakeSwapChain>) + - [func \(g \*GPULogicalDevice\) Setup\(inst \*GPUApplicationInstance, physicalDevice \*GPUPhysicalDevice\) error](<#GPULogicalDevice.Setup>) + - [func \(g \*GPULogicalDevice\) SetupBufferDestroyer\(device \*GPUDevice\)](<#GPULogicalDevice.SetupBufferDestroyer>) + - [func \(g \*GPULogicalDevice\) WaitForFences\(fences \[\]GPUFence\)](<#GPULogicalDevice.WaitForFences>) + - [func \(g \*GPULogicalDevice\) WaitForRender\(device \*GPUDevice\)](<#GPULogicalDevice.WaitForRender>) + - [func \(g \*GPULogicalDevice\) WaitIdle\(\)](<#GPULogicalDevice.WaitIdle>) +- [type GPUMemoryFlags](<#GPUMemoryFlags>) +- [type GPUMemoryHeap](<#GPUMemoryHeap>) +- [type GPUMemoryHeapFlags](<#GPUMemoryHeapFlags>) +- [type GPUMemoryPropertyFlags](<#GPUMemoryPropertyFlags>) +- [type GPUMemoryRequirements](<#GPUMemoryRequirements>) +- [type GPUMemoryType](<#GPUMemoryType>) +- [type GPUPainter](<#GPUPainter>) + - [func \(g \*GPUPainter\) DestroyDescriptorPools\(device \*GPUDevice\)](<#GPUPainter.DestroyDescriptorPools>) +- [type GPUPhysicalDevice](<#GPUPhysicalDevice>) + - [func ListPhysicalGpuDevices\(inst \*GPUApplicationInstance\) \(\[\]GPUPhysicalDevice, error\)](<#ListPhysicalGpuDevices>) + - [func \(g \*GPUPhysicalDevice\) FindComputeFamiliy\(\) GPUQueueFamily](<#GPUPhysicalDevice.FindComputeFamiliy>) + - [func \(g \*GPUPhysicalDevice\) FindGraphicsFamiliy\(\) GPUQueueFamily](<#GPUPhysicalDevice.FindGraphicsFamiliy>) + - [func \(g \*GPUPhysicalDevice\) FindMemoryType\(typeFilter uint32, properties GPUMemoryPropertyFlags\) int](<#GPUPhysicalDevice.FindMemoryType>) + - [func \(g \*GPUPhysicalDevice\) FindPresentFamily\(\) GPUQueueFamily](<#GPUPhysicalDevice.FindPresentFamily>) + - [func \(g \*GPUPhysicalDevice\) FindSupportedFormat\(candidates \[\]GPUFormat, tiling GPUImageTiling, features GPUFormatFeatureFlags\) GPUFormat](<#GPUPhysicalDevice.FindSupportedFormat>) + - [func \(g \*GPUPhysicalDevice\) FormatIsTileable\(format GPUFormat, tiling GPUImageTiling\) bool](<#GPUPhysicalDevice.FormatIsTileable>) + - [func \(g \*GPUPhysicalDevice\) FormatProperties\(format GPUFormat\) GPUFormatProperties](<#GPUPhysicalDevice.FormatProperties>) + - [func \(g \*GPUPhysicalDevice\) IsExtensionSupported\(extension string\) bool](<#GPUPhysicalDevice.IsExtensionSupported>) + - [func \(g \*GPUPhysicalDevice\) IsValid\(\) bool](<#GPUPhysicalDevice.IsValid>) + - [func \(g \*GPUPhysicalDevice\) MaxUsableSampleCount\(\) GPUSampleCountFlags](<#GPUPhysicalDevice.MaxUsableSampleCount>) + - [func \(g \*GPUPhysicalDevice\) PadBufferSize\(size uintptr\) uintptr](<#GPUPhysicalDevice.PadBufferSize>) + - [func \(g \*GPUPhysicalDevice\) RefreshSurfaceCapabilities\(surface unsafe.Pointer\)](<#GPUPhysicalDevice.RefreshSurfaceCapabilities>) +- [type GPUPhysicalDeviceExtension](<#GPUPhysicalDeviceExtension>) +- [type GPUPhysicalDeviceFeatures](<#GPUPhysicalDeviceFeatures>) +- [type GPUPhysicalDeviceLimits](<#GPUPhysicalDeviceLimits>) +- [type GPUPhysicalDeviceMemoryProperties](<#GPUPhysicalDeviceMemoryProperties>) +- [type GPUPhysicalDeviceProperties](<#GPUPhysicalDeviceProperties>) +- [type GPUPhysicalDeviceSparseProperties](<#GPUPhysicalDeviceSparseProperties>) +- [type GPUPhysicalDeviceType](<#GPUPhysicalDeviceType>) +- [type GPUPipeline](<#GPUPipeline>) +- [type GPUPipelineLayout](<#GPUPipelineLayout>) +- [type GPUPipelineStageFlags](<#GPUPipelineStageFlags>) +- [type GPUPresentMode](<#GPUPresentMode>) +- [type GPUQueue](<#GPUQueue>) +- [type GPUQueueFamily](<#GPUQueueFamily>) + - [func InvalidGPUQueueFamily\(\) GPUQueueFamily](<#InvalidGPUQueueFamily>) + - [func \(g GPUQueueFamily\) IsValid\(\) bool](<#GPUQueueFamily.IsValid>) +- [type GPUResult](<#GPUResult>) +- [type GPUSampleCountFlags](<#GPUSampleCountFlags>) +- [type GPUSampler](<#GPUSampler>) +- [type GPUSemaphore](<#GPUSemaphore>) +- [type GPUShaderModule](<#GPUShaderModule>) +- [type GPUSurface](<#GPUSurface>) + - [func \(g \*GPUSurface\) Create\(instance \*GPUInstance, window RenderingContainer\) error](<#GPUSurface.Create>) + - [func \(g \*GPUSurface\) Destroy\(inst \*GPUApplicationInstance\)](<#GPUSurface.Destroy>) +- [type GPUSurfaceCapabilities](<#GPUSurfaceCapabilities>) +- [type GPUSurfaceFormat](<#GPUSurfaceFormat>) +- [type GPUSurfaceTransformFlags](<#GPUSurfaceTransformFlags>) +- [type GPUSwapChain](<#GPUSwapChain>) + - [func \(g \*GPUSwapChain\) CopyAndReset\(\) GPUSwapChain](<#GPUSwapChain.CopyAndReset>) + - [func \(g \*GPUSwapChain\) CreateColor\(device \*GPUDevice\) error](<#GPUSwapChain.CreateColor>) + - [func \(g \*GPUSwapChain\) CreateDepth\(device \*GPUDevice\) error](<#GPUSwapChain.CreateDepth>) + - [func \(g \*GPUSwapChain\) CreateFrameBuffer\(device \*GPUDevice\) error](<#GPUSwapChain.CreateFrameBuffer>) + - [func \(g \*GPUSwapChain\) Destroy\(device \*GPUDevice\)](<#GPUSwapChain.Destroy>) + - [func \(g \*GPUSwapChain\) SelectExtent\(window RenderingContainer, device \*GPUPhysicalDevice\) matrix.Vec2i](<#GPUSwapChain.SelectExtent>) + - [func \(g \*GPUSwapChain\) SelectPresentMode\(device \*GPUPhysicalDevice\) GPUPresentMode](<#GPUSwapChain.SelectPresentMode>) + - [func \(g \*GPUSwapChain\) SelectSurfaceFormat\(device \*GPUPhysicalDevice\) GPUSurfaceFormat](<#GPUSwapChain.SelectSurfaceFormat>) + - [func \(g \*GPUSwapChain\) Setup\(window RenderingContainer, inst \*GPUApplicationInstance, device \*GPUDevice\) error](<#GPUSwapChain.Setup>) + - [func \(g \*GPUSwapChain\) SetupImageViews\(device \*GPUDevice\) error](<#GPUSwapChain.SetupImageViews>) + - [func \(g \*GPUSwapChain\) SetupRenderPass\(device \*GPUDevice, assets assets.Database\) error](<#GPUSwapChain.SetupRenderPass>) + - [func \(g \*GPUSwapChain\) SetupSyncObjects\(device \*GPUDevice\) error](<#GPUSwapChain.SetupSyncObjects>) +- [type GPUSwapChainSupportDetails](<#GPUSwapChainSupportDetails>) +- [type GlobalShaderData](<#GlobalShaderData>) +- [type InstanceCopyData](<#InstanceCopyData>) + - [func InstanceCopyDataNew\(padding int\) InstanceCopyData](<#InstanceCopyDataNew>) +- [type InstanceDriverData](<#InstanceDriverData>) +- [type InstanceGroupSkinningData](<#InstanceGroupSkinningData>) +- [type Light](<#Light>) + - [func NewLight\(device \*GPUDevice, assetDb assets.Database, materialCache \*MaterialCache, lightType LightType\) Light](<#NewLight>) + - [func \(l \*Light\) Direction\(followcam cameras.Camera\) matrix.Vec3](<#Light.Direction>) + - [func \(l \*Light\) FrameDirty\(\) bool](<#Light.FrameDirty>) + - [func \(l \*Light\) IsValid\(\) bool](<#Light.IsValid>) + - [func \(l \*Light\) ResetFrameDirty\(\) bool](<#Light.ResetFrameDirty>) + - [func \(l \*Light\) SetAmbient\(ambient matrix.Vec3\)](<#Light.SetAmbient>) + - [func \(l \*Light\) SetCastsShadows\(castsShadows bool\)](<#Light.SetCastsShadows>) + - [func \(l \*Light\) SetConstant\(constant float32\)](<#Light.SetConstant>) + - [func \(l \*Light\) SetCutoff\(cutoff float32\)](<#Light.SetCutoff>) + - [func \(l \*Light\) SetDiffuse\(diffuse matrix.Vec3\)](<#Light.SetDiffuse>) + - [func \(l \*Light\) SetDirection\(dir matrix.Vec3\)](<#Light.SetDirection>) + - [func \(l \*Light\) SetIntensity\(intensity float32\)](<#Light.SetIntensity>) + - [func \(l \*Light\) SetLinear\(linear float32\)](<#Light.SetLinear>) + - [func \(l \*Light\) SetOuterCutoff\(outerCutoff float32\)](<#Light.SetOuterCutoff>) + - [func \(l \*Light\) SetPosition\(position matrix.Vec3\)](<#Light.SetPosition>) + - [func \(l \*Light\) SetQuadratic\(quadratic float32\)](<#Light.SetQuadratic>) + - [func \(l \*Light\) SetSpecular\(specular matrix.Vec3\)](<#Light.SetSpecular>) + - [func \(l \*Light\) Type\(\) LightType](<#Light.Type>) + - [func \(l \*Light\) WorldSpace\(followcam cameras.Camera\) matrix.Vec3](<#Light.WorldSpace>) +- [type LightShadowShaderData](<#LightShadowShaderData>) + - [func \(t LightShadowShaderData\) Size\(\) int](<#LightShadowShaderData.Size>) +- [type LightType](<#LightType>) +- [type LightsForRender](<#LightsForRender>) +- [type Material](<#Material>) + - [func \(m \*Material\) CreateInstance\(textures \[\]\*Texture\) \*Material](<#Material.CreateInstance>) + - [func \(m \*Material\) Destroy\(device \*GPUDevice\)](<#Material.Destroy>) + - [func \(m \*Material\) HasTransparentSuffix\(\) bool](<#Material.HasTransparentSuffix>) + - [func \(m \*Material\) RenderPass\(\) \*RenderPass](<#Material.RenderPass>) + - [func \(m \*Material\) SelectRoot\(\) \*Material](<#Material.SelectRoot>) +- [type MaterialCache](<#MaterialCache>) + - [func NewMaterialCache\(device \*GPUDevice, assetDatabase assets.Database\) MaterialCache](<#NewMaterialCache>) + - [func \(m \*MaterialCache\) AddMaterial\(material \*Material\) \*Material](<#MaterialCache.AddMaterial>) + - [func \(m \*MaterialCache\) Destroy\(\)](<#MaterialCache.Destroy>) + - [func \(m \*MaterialCache\) FindMaterial\(key string\) \(\*Material, bool\)](<#MaterialCache.FindMaterial>) + - [func \(m \*MaterialCache\) Material\(key string\) \(\*Material, error\)](<#MaterialCache.Material>) +- [type MaterialData](<#MaterialData>) + - [func \(d \*MaterialData\) Compile\(assets assets.Database, device \*GPUDevice\) \(\*Material, error\)](<#MaterialData.Compile>) + - [func \(d \*MaterialData\) CompileExt\(assets assets.Database, device \*GPUDevice, copyShader bool\) \(\*Material, error\)](<#MaterialData.CompileExt>) +- [type MaterialTextureData](<#MaterialTextureData>) + - [func \(d \*MaterialTextureData\) FilterToVK\(\) TextureFilter](<#MaterialTextureData.FilterToVK>) +- [type Mesh](<#Mesh>) + - [func NewMesh\(key string, verts \[\]Vertex, indexes \[\]uint32\) \*Mesh](<#NewMesh>) + - [func NewMeshArrow\(cache \*MeshCache, shaftLength, shaftRadius, tipHeight, tipRadius float32, segments int\) \*Mesh](<#NewMeshArrow>) + - [func NewMeshCapsule\(cache \*MeshCache, radius, height float32, segments, rings int\) \*Mesh](<#NewMeshCapsule>) + - [func NewMeshCircleWire\(cache \*MeshCache, radius float32, segments int\) \*Mesh](<#NewMeshCircleWire>) + - [func NewMeshCone\(cache \*MeshCache, height, baseRadius float32, segments int, capped bool\) \*Mesh](<#NewMeshCone>) + - [func NewMeshCube\(cache \*MeshCache\) \*Mesh](<#NewMeshCube>) + - [func NewMeshCubeInverse\(cache \*MeshCache\) \*Mesh](<#NewMeshCubeInverse>) + - [func NewMeshCylinder\(cache \*MeshCache, height, radius float32, segments int, capped bool\) \*Mesh](<#NewMeshCylinder>) + - [func NewMeshFrustum\(cache \*MeshCache, key string, inverseProjection matrix.Mat4\) \*Mesh](<#NewMeshFrustum>) + - [func NewMeshFrustumBox\(cache \*MeshCache, inverseProjection matrix.Mat4\) \*Mesh](<#NewMeshFrustumBox>) + - [func NewMeshGrid\(cache \*MeshCache, key string, points \[\]matrix.Vec3, vertColor matrix.Color\) \*Mesh](<#NewMeshGrid>) + - [func NewMeshLine\(cache \*MeshCache, key string, p0, p1 matrix.Vec3, vertColor matrix.Color\) \*Mesh](<#NewMeshLine>) + - [func NewMeshOffsetQuad\(cache \*MeshCache, key string, sideOffsets matrix.Vec4\) \*Mesh](<#NewMeshOffsetQuad>) + - [func NewMeshPlane\(cache \*MeshCache\) \*Mesh](<#NewMeshPlane>) + - [func NewMeshPoint\(cache \*MeshCache, key string, position matrix.Vec3, vertColor matrix.Color\) \*Mesh](<#NewMeshPoint>) + - [func NewMeshQuad\(cache \*MeshCache\) \*Mesh](<#NewMeshQuad>) + - [func NewMeshQuadAnchored\(anchor QuadPivot, cache \*MeshCache\) \*Mesh](<#NewMeshQuadAnchored>) + - [func NewMeshScreenQuad\(cache \*MeshCache\) \*Mesh](<#NewMeshScreenQuad>) + - [func NewMeshSkyboxCube\(cache \*MeshCache\) \*Mesh](<#NewMeshSkyboxCube>) + - [func NewMeshSphere\(cache \*MeshCache, radius float32, latitudeBands, longitudeBands int\) \*Mesh](<#NewMeshSphere>) + - [func NewMeshTexturableCube\(cache \*MeshCache\) \*Mesh](<#NewMeshTexturableCube>) + - [func NewMeshTriangle\(cache \*MeshCache\) \*Mesh](<#NewMeshTriangle>) + - [func NewMeshUnitQuad\(cache \*MeshCache\) \*Mesh](<#NewMeshUnitQuad>) + - [func NewMeshWireCone\(cache \*MeshCache, radius, height float32, segments, heightSegments int\) \*Mesh](<#NewMeshWireCone>) + - [func NewMeshWireCube\(cache \*MeshCache, key string, vertColor matrix.Color\) \*Mesh](<#NewMeshWireCube>) + - [func NewMeshWireCylinder\(cache \*MeshCache, radius, height float32, segments, heightSegments int\) \*Mesh](<#NewMeshWireCylinder>) + - [func NewMeshWireQuad\(cache \*MeshCache, key string, vertColor matrix.Color\) \*Mesh](<#NewMeshWireQuad>) + - [func NewMeshWireSphere\(cache \*MeshCache, radius float32, latitudeBands, longitudeBands int\) \*Mesh](<#NewMeshWireSphere>) + - [func \(m Mesh\) Bounds\(\) collision.AABB](<#Mesh.Bounds>) + - [func \(m \*Mesh\) DelayedCreate\(device \*GPUDevice\)](<#Mesh.DelayedCreate>) + - [func \(m Mesh\) IsReady\(\) bool](<#Mesh.IsReady>) + - [func \(m Mesh\) Key\(\) string](<#Mesh.Key>) + - [func \(m \*Mesh\) SetKey\(key string\)](<#Mesh.SetKey>) +- [type MeshCache](<#MeshCache>) + - [func NewMeshCache\(device \*GPUDevice, assetDatabase assets.Database\) MeshCache](<#NewMeshCache>) + - [func \(m \*MeshCache\) AddMesh\(mesh \*Mesh\) \*Mesh](<#MeshCache.AddMesh>) + - [func \(m \*MeshCache\) CreatePending\(\)](<#MeshCache.CreatePending>) + - [func \(m \*MeshCache\) Destroy\(\)](<#MeshCache.Destroy>) + - [func \(m \*MeshCache\) FindMesh\(key string\) \(\*Mesh, bool\)](<#MeshCache.FindMesh>) + - [func \(m \*MeshCache\) Mesh\(key string, verts \[\]Vertex, indexes \[\]uint32\) \*Mesh](<#MeshCache.Mesh>) + - [func \(m \*MeshCache\) RemoveMesh\(key string\)](<#MeshCache.RemoveMesh>) +- [type MeshCleanup](<#MeshCleanup>) +- [type MeshCullMode](<#MeshCullMode>) +- [type MeshDrawMode](<#MeshDrawMode>) +- [type MeshId](<#MeshId>) + - [func \(m MeshId\) IsValid\(\) bool](<#MeshId.IsValid>) +- [type PointShadow](<#PointShadow>) +- [type QuadPivot](<#QuadPivot>) +- [type RenderCaches](<#RenderCaches>) +- [type RenderPass](<#RenderPass>) + - [func NewRenderPass\(device \*GPUDevice, setup \*RenderPassDataCompiled\) \(\*RenderPass, error\)](<#NewRenderPass>) + - [func \(p \*RenderPass\) Destroy\(device \*GPUDevice\)](<#RenderPass.Destroy>) + - [func \(r \*RenderPass\) ExecuteSecondaryCommands\(\)](<#RenderPass.ExecuteSecondaryCommands>) + - [func \(r \*RenderPass\) Height\(\) int](<#RenderPass.Height>) + - [func \(r \*RenderPass\) IsShadowPass\(\) bool](<#RenderPass.IsShadowPass>) + - [func \(p \*RenderPass\) Recontstruct\(device \*GPUDevice\) error](<#RenderPass.Recontstruct>) + - [func \(r \*RenderPass\) SelectOutputAttachment\(device \*GPUDevice\) \*Texture](<#RenderPass.SelectOutputAttachment>) + - [func \(r \*RenderPass\) SelectOutputAttachmentWithSuffix\(suffix string\) \(\*Texture, bool\)](<#RenderPass.SelectOutputAttachmentWithSuffix>) + - [func \(r \*RenderPass\) Texture\(index int\) \*Texture](<#RenderPass.Texture>) + - [func \(r \*RenderPass\) Width\(\) int](<#RenderPass.Width>) +- [type RenderPassAttachmentDescription](<#RenderPassAttachmentDescription>) + - [func \(ad \*RenderPassAttachmentDescription\) FinalLayoutToVK\(\) GPUImageLayout](<#RenderPassAttachmentDescription.FinalLayoutToVK>) + - [func \(ad \*RenderPassAttachmentDescription\) FormatToVK\(device \*GPUDevice\) GPUFormat](<#RenderPassAttachmentDescription.FormatToVK>) + - [func \(ad \*RenderPassAttachmentDescription\) InitialLayoutToVK\(\) GPUImageLayout](<#RenderPassAttachmentDescription.InitialLayoutToVK>) + - [func \(ad \*RenderPassAttachmentDescription\) LoadOpToVK\(\) GPUAttachmentLoadOp](<#RenderPassAttachmentDescription.LoadOpToVK>) + - [func \(ad \*RenderPassAttachmentDescription\) SamplesToVK\(device \*GPUPhysicalDevice\) GPUSampleCountFlags](<#RenderPassAttachmentDescription.SamplesToVK>) + - [func \(ad \*RenderPassAttachmentDescription\) StencilLoadOpToVK\(\) GPUAttachmentLoadOp](<#RenderPassAttachmentDescription.StencilLoadOpToVK>) + - [func \(ad \*RenderPassAttachmentDescription\) StencilStoreOpToVK\(\) GPUAttachmentStoreOp](<#RenderPassAttachmentDescription.StencilStoreOpToVK>) + - [func \(ad \*RenderPassAttachmentDescription\) StoreOpToVK\(\) GPUAttachmentStoreOp](<#RenderPassAttachmentDescription.StoreOpToVK>) +- [type RenderPassAttachmentDescriptionCompiled](<#RenderPassAttachmentDescriptionCompiled>) + - [func \(p \*RenderPassAttachmentDescriptionCompiled\) IsDepthFormat\(\) bool](<#RenderPassAttachmentDescriptionCompiled.IsDepthFormat>) +- [type RenderPassAttachmentImage](<#RenderPassAttachmentImage>) + - [func \(ai \*RenderPassAttachmentImage\) AccessToVK\(\) GPUAccessFlags](<#RenderPassAttachmentImage.AccessToVK>) + - [func \(ai \*RenderPassAttachmentImage\) AspectToVK\(\) GPUImageAspectFlags](<#RenderPassAttachmentImage.AspectToVK>) + - [func \(ai \*RenderPassAttachmentImage\) FilterToVK\(\) GPUFilter](<#RenderPassAttachmentImage.FilterToVK>) + - [func \(img \*RenderPassAttachmentImage\) IsInvalid\(\) bool](<#RenderPassAttachmentImage.IsInvalid>) + - [func \(ai \*RenderPassAttachmentImage\) MemoryPropertyToVK\(\) GPUMemoryPropertyFlags](<#RenderPassAttachmentImage.MemoryPropertyToVK>) + - [func \(ai \*RenderPassAttachmentImage\) TilingToVK\(\) GPUImageTiling](<#RenderPassAttachmentImage.TilingToVK>) + - [func \(ai \*RenderPassAttachmentImage\) UsageToVK\(\) GPUImageUsageFlags](<#RenderPassAttachmentImage.UsageToVK>) +- [type RenderPassAttachmentImageClear](<#RenderPassAttachmentImageClear>) +- [type RenderPassAttachmentImageCompiled](<#RenderPassAttachmentImageCompiled>) + - [func \(img \*RenderPassAttachmentImageCompiled\) IsInvalid\(\) bool](<#RenderPassAttachmentImageCompiled.IsInvalid>) +- [type RenderPassAttachmentReference](<#RenderPassAttachmentReference>) + - [func \(ad \*RenderPassAttachmentReference\) LayoutToVK\(\) GPUImageLayout](<#RenderPassAttachmentReference.LayoutToVK>) +- [type RenderPassAttachmentReferenceCompiled](<#RenderPassAttachmentReferenceCompiled>) +- [type RenderPassData](<#RenderPassData>) + - [func NewRenderPassData\(src string\) \(RenderPassData, error\)](<#NewRenderPassData>) + - [func \(d \*RenderPassData\) Compile\(device \*GPUDevice\) RenderPassDataCompiled](<#RenderPassData.Compile>) +- [type RenderPassDataCompiled](<#RenderPassDataCompiled>) + - [func \(r \*RenderPassDataCompiled\) ConstructRenderPass\(device \*GPUDevice\) \(\*RenderPass, error\)](<#RenderPassDataCompiled.ConstructRenderPass>) +- [type RenderPassGroup](<#RenderPassGroup>) +- [type RenderPassSubpass](<#RenderPassSubpass>) +- [type RenderPassSubpassData](<#RenderPassSubpassData>) +- [type RenderPassSubpassDataCompiled](<#RenderPassSubpassDataCompiled>) +- [type RenderPassSubpassDependency](<#RenderPassSubpassDependency>) + - [func \(sd \*RenderPassSubpassDependency\) DependencyFlagsToVK\(\) vk.DependencyFlags](<#RenderPassSubpassDependency.DependencyFlagsToVK>) + - [func \(sd \*RenderPassSubpassDependency\) DstAccessMaskToVK\(\) GPUAccessFlags](<#RenderPassSubpassDependency.DstAccessMaskToVK>) + - [func \(sd \*RenderPassSubpassDependency\) DstStageMaskToVK\(\) vk.PipelineStageFlags](<#RenderPassSubpassDependency.DstStageMaskToVK>) + - [func \(sd \*RenderPassSubpassDependency\) SrcAccessMaskToVK\(\) GPUAccessFlags](<#RenderPassSubpassDependency.SrcAccessMaskToVK>) + - [func \(sd \*RenderPassSubpassDependency\) SrcStageMaskToVK\(\) vk.PipelineStageFlags](<#RenderPassSubpassDependency.SrcStageMaskToVK>) +- [type RenderPassSubpassDependencyCompiled](<#RenderPassSubpassDependencyCompiled>) +- [type RenderPassSubpassDescription](<#RenderPassSubpassDescription>) + - [func \(ad \*RenderPassSubpassDescription\) PipelineBindPointToVK\(\) vulkan\_const.PipelineBindPoint](<#RenderPassSubpassDescription.PipelineBindPointToVK>) +- [type RenderPassSubpassDescriptionCompiled](<#RenderPassSubpassDescriptionCompiled>) +- [type RenderPassSubpassImageData](<#RenderPassSubpassImageData>) +- [type RenderingContainer](<#RenderingContainer>) +- [type Shader](<#Shader>) + - [func NewShader\(shaderData ShaderDataCompiled\) \*Shader](<#NewShader>) + - [func \(s \*Shader\) AddSubShader\(key string, shader \*Shader\)](<#Shader.AddSubShader>) + - [func \(s \*Shader\) DelayedCreate\(device \*GPUDevice, assetDatabase assets.Database\)](<#Shader.DelayedCreate>) + - [func \(s \*Shader\) Reload\(shaderData ShaderDataCompiled\)](<#Shader.Reload>) + - [func \(s \*Shader\) RemoveSubShader\(key string\)](<#Shader.RemoveSubShader>) + - [func \(s \*Shader\) ShaderDataName\(\) string](<#Shader.ShaderDataName>) + - [func \(s \*Shader\) SubShader\(key string\) \*Shader](<#Shader.SubShader>) +- [type ShaderBuffer](<#ShaderBuffer>) +- [type ShaderCache](<#ShaderCache>) + - [func NewShaderCache\(device \*GPUDevice, assetDatabase assets.Database\) ShaderCache](<#NewShaderCache>) + - [func \(s \*ShaderCache\) AddShader\(shader \*Shader\)](<#ShaderCache.AddShader>) + - [func \(s \*ShaderCache\) CreatePending\(\)](<#ShaderCache.CreatePending>) + - [func \(s \*ShaderCache\) Destroy\(\)](<#ShaderCache.Destroy>) + - [func \(s \*ShaderCache\) ReloadShader\(shaderData ShaderDataCompiled\)](<#ShaderCache.ReloadShader>) + - [func \(s \*ShaderCache\) Shader\(shaderData ShaderDataCompiled\) \(shader \*Shader, isNew bool\)](<#ShaderCache.Shader>) +- [type ShaderCleanup](<#ShaderCleanup>) +- [type ShaderData](<#ShaderData>) + - [func \(d \*ShaderData\) Compile\(\) ShaderDataCompiled](<#ShaderData.Compile>) +- [type ShaderDataBase](<#ShaderDataBase>) + - [func NewShaderDataBase\(\) ShaderDataBase](<#NewShaderDataBase>) + - [func \(s \*ShaderDataBase\) Activate\(\)](<#ShaderDataBase.Activate>) + - [func \(s \*ShaderDataBase\) Base\(\) \*ShaderDataBase](<#ShaderDataBase.Base>) + - [func \(s \*ShaderDataBase\) BoundDataPointer\(\) unsafe.Pointer](<#ShaderDataBase.BoundDataPointer>) + - [func \(s \*ShaderDataBase\) CancelDestroy\(\)](<#ShaderDataBase.CancelDestroy>) + - [func \(s \*ShaderDataBase\) DataPointer\(\) unsafe.Pointer](<#ShaderDataBase.DataPointer>) + - [func \(s \*ShaderDataBase\) Deactivate\(\)](<#ShaderDataBase.Deactivate>) + - [func \(s \*ShaderDataBase\) Destroy\(\)](<#ShaderDataBase.Destroy>) + - [func \(s \*ShaderDataBase\) InstanceBoundDataSize\(\) int](<#ShaderDataBase.InstanceBoundDataSize>) + - [func \(s \*ShaderDataBase\) IsDestroyed\(\) bool](<#ShaderDataBase.IsDestroyed>) + - [func \(s \*ShaderDataBase\) IsInView\(\) bool](<#ShaderDataBase.IsInView>) + - [func \(s \*ShaderDataBase\) Model\(\) matrix.Mat4](<#ShaderDataBase.Model>) + - [func \(s \*ShaderDataBase\) ModelPtr\(\) \*matrix.Mat4](<#ShaderDataBase.ModelPtr>) + - [func \(s \*ShaderDataBase\) SelectLights\(lights LightsForRender\)](<#ShaderDataBase.SelectLights>) + - [func \(s \*ShaderDataBase\) SetModel\(model matrix.Mat4\)](<#ShaderDataBase.SetModel>) + - [func \(s \*ShaderDataBase\) Setup\(\)](<#ShaderDataBase.Setup>) + - [func \(s \*ShaderDataBase\) SkinningHeader\(\) \*SkinnedShaderDataHeader](<#ShaderDataBase.SkinningHeader>) + - [func \(s \*ShaderDataBase\) Transform\(\) \*matrix.Transform](<#ShaderDataBase.Transform>) + - [func \(s \*ShaderDataBase\) UpdateBoundData\(\) bool](<#ShaderDataBase.UpdateBoundData>) + - [func \(s \*ShaderDataBase\) UpdateModel\(viewCuller ViewCuller, container collision.AABB\)](<#ShaderDataBase.UpdateModel>) +- [type ShaderDataCombine](<#ShaderDataCombine>) + - [func \(t ShaderDataCombine\) Size\(\) int](<#ShaderDataCombine.Size>) +- [type ShaderDataCompiled](<#ShaderDataCompiled>) + - [func \(s \*ShaderDataCompiled\) IsCompute\(\) bool](<#ShaderDataCompiled.IsCompute>) + - [func \(s \*ShaderDataCompiled\) SelectLayout\(stage string\) \*ShaderLayoutGroup](<#ShaderDataCompiled.SelectLayout>) + - [func \(sd \*ShaderDataCompiled\) Stride\(\) uint32](<#ShaderDataCompiled.Stride>) + - [func \(sd \*ShaderDataCompiled\) ToAttributeDescription\(locationStart uint32\) \[\]vk.VertexInputAttributeDescription](<#ShaderDataCompiled.ToAttributeDescription>) + - [func \(sd \*ShaderDataCompiled\) ToDescriptorSetLayoutStructure\(\) DescriptorSetLayoutStructure](<#ShaderDataCompiled.ToDescriptorSetLayoutStructure>) + - [func \(sd \*ShaderDataCompiled\) WorkGroups\(\) \[3\]uint32](<#ShaderDataCompiled.WorkGroups>) +- [type ShaderDraw](<#ShaderDraw>) + - [func NewShaderDraw\(material \*Material\) ShaderDraw](<#NewShaderDraw>) + - [func \(s \*ShaderDraw\) AddInstanceGroup\(group DrawInstanceGroup\)](<#ShaderDraw.AddInstanceGroup>) + - [func \(s \*ShaderDraw\) Clear\(\)](<#ShaderDraw.Clear>) + - [func \(s \*ShaderDraw\) Destroy\(device \*GPUDevice\)](<#ShaderDraw.Destroy>) + - [func \(s \*ShaderDraw\) Filter\(filter func\(\*DrawInstanceGroup\) bool\) \[\]\*DrawInstanceGroup](<#ShaderDraw.Filter>) +- [type ShaderDriverData](<#ShaderDriverData>) + - [func NewShaderDriverData\(\) ShaderDriverData](<#NewShaderDriverData>) +- [type ShaderId](<#ShaderId>) + - [func \(s ShaderId\) IsValid\(\) bool](<#ShaderId.IsValid>) +- [type ShaderLayout](<#ShaderLayout>) + - [func \(l \*ShaderLayout\) Capacity\(\) int](<#ShaderLayout.Capacity>) + - [func \(l \*ShaderLayout\) DescriptorType\(\) vulkan\_const.DescriptorType](<#ShaderLayout.DescriptorType>) + - [func \(l \*ShaderLayout\) FullName\(\) string](<#ShaderLayout.FullName>) + - [func \(l \*ShaderLayout\) IsBuffer\(\) bool](<#ShaderLayout.IsBuffer>) + - [func \(l \*ShaderLayout\) Stride\(\) int](<#ShaderLayout.Stride>) +- [type ShaderLayoutGroup](<#ShaderLayoutGroup>) + - [func \(g \*ShaderLayoutGroup\) DescriptorFlag\(\) vulkan\_const.ShaderStageFlagBits](<#ShaderLayoutGroup.DescriptorFlag>) +- [type ShaderLayoutStructField](<#ShaderLayoutStructField>) +- [type ShaderPipelineColorBlend](<#ShaderPipelineColorBlend>) + - [func \(s \*ShaderPipelineColorBlend\) LogicOpToVK\(\) vulkan\_const.LogicOp](<#ShaderPipelineColorBlend.LogicOpToVK>) +- [type ShaderPipelineColorBlendAttachments](<#ShaderPipelineColorBlendAttachments>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) AlphaBlendOpToVK\(\) vulkan\_const.BlendOp](<#ShaderPipelineColorBlendAttachments.AlphaBlendOpToVK>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) BlendEnableToVK\(\) vk.Bool32](<#ShaderPipelineColorBlendAttachments.BlendEnableToVK>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) ColorBlendOpToVK\(\) vulkan\_const.BlendOp](<#ShaderPipelineColorBlendAttachments.ColorBlendOpToVK>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) ColorWriteMaskToVK\(\) vulkan\_const.ColorComponentFlagBits](<#ShaderPipelineColorBlendAttachments.ColorWriteMaskToVK>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) DstAlphaBlendFactorToVK\(\) vulkan\_const.BlendFactor](<#ShaderPipelineColorBlendAttachments.DstAlphaBlendFactorToVK>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) DstColorBlendFactorToVK\(\) vulkan\_const.BlendFactor](<#ShaderPipelineColorBlendAttachments.DstColorBlendFactorToVK>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) ListAlphaBlendOp\(\) \[\]string](<#ShaderPipelineColorBlendAttachments.ListAlphaBlendOp>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) ListColorBlendOp\(\) \[\]string](<#ShaderPipelineColorBlendAttachments.ListColorBlendOp>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) ListDstAlphaBlendFactor\(\) \[\]string](<#ShaderPipelineColorBlendAttachments.ListDstAlphaBlendFactor>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) ListDstColorBlendFactor\(\) \[\]string](<#ShaderPipelineColorBlendAttachments.ListDstColorBlendFactor>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) ListSrcAlphaBlendFactor\(\) \[\]string](<#ShaderPipelineColorBlendAttachments.ListSrcAlphaBlendFactor>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) ListSrcColorBlendFactor\(\) \[\]string](<#ShaderPipelineColorBlendAttachments.ListSrcColorBlendFactor>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) SrcAlphaBlendFactorToVK\(\) vulkan\_const.BlendFactor](<#ShaderPipelineColorBlendAttachments.SrcAlphaBlendFactorToVK>) + - [func \(a \*ShaderPipelineColorBlendAttachments\) SrcColorBlendFactorToVK\(\) vulkan\_const.BlendFactor](<#ShaderPipelineColorBlendAttachments.SrcColorBlendFactorToVK>) +- [type ShaderPipelineColorBlendAttachmentsCompiled](<#ShaderPipelineColorBlendAttachmentsCompiled>) +- [type ShaderPipelineColorBlendCompiled](<#ShaderPipelineColorBlendCompiled>) +- [type ShaderPipelineData](<#ShaderPipelineData>) + - [func \(s \*ShaderPipelineData\) AlphaToCoverageEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.AlphaToCoverageEnableToVK>) + - [func \(s \*ShaderPipelineData\) AlphaToOneEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.AlphaToOneEnableToVK>) + - [func \(s \*ShaderPipelineData\) BackStencilOpStateToVK\(\) vk.StencilOpState](<#ShaderPipelineData.BackStencilOpStateToVK>) + - [func \(s \*ShaderPipelineData\) BlendConstants\(\) \[4\]float32](<#ShaderPipelineData.BlendConstants>) + - [func \(d \*ShaderPipelineData\) Compile\(device \*GPUPhysicalDevice\) ShaderPipelineDataCompiled](<#ShaderPipelineData.Compile>) + - [func \(s \*ShaderPipelineData\) DepthBiasEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.DepthBiasEnableToVK>) + - [func \(s \*ShaderPipelineData\) DepthBoundsTestEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.DepthBoundsTestEnableToVK>) + - [func \(s \*ShaderPipelineData\) DepthClampEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.DepthClampEnableToVK>) + - [func \(s \*ShaderPipelineData\) DepthTestEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.DepthTestEnableToVK>) + - [func \(s \*ShaderPipelineData\) DepthWriteEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.DepthWriteEnableToVK>) + - [func \(s \*ShaderPipelineData\) FrontStencilOpStateToVK\(\) vk.StencilOpState](<#ShaderPipelineData.FrontStencilOpStateToVK>) + - [func \(s ShaderPipelineData\) ListBackCompareOp\(\) \[\]string](<#ShaderPipelineData.ListBackCompareOp>) + - [func \(s ShaderPipelineData\) ListBackDepthFailOp\(\) \[\]string](<#ShaderPipelineData.ListBackDepthFailOp>) + - [func \(s ShaderPipelineData\) ListBackFailOp\(\) \[\]string](<#ShaderPipelineData.ListBackFailOp>) + - [func \(s ShaderPipelineData\) ListBackPassOp\(\) \[\]string](<#ShaderPipelineData.ListBackPassOp>) + - [func \(s ShaderPipelineData\) ListBlendFactor\(\) \[\]string](<#ShaderPipelineData.ListBlendFactor>) + - [func \(s ShaderPipelineData\) ListBlendOp\(\) \[\]string](<#ShaderPipelineData.ListBlendOp>) + - [func \(s ShaderPipelineData\) ListCullMode\(\) \[\]string](<#ShaderPipelineData.ListCullMode>) + - [func \(s ShaderPipelineData\) ListDepthCompareOp\(\) \[\]string](<#ShaderPipelineData.ListDepthCompareOp>) + - [func \(s ShaderPipelineData\) ListFrontCompareOp\(\) \[\]string](<#ShaderPipelineData.ListFrontCompareOp>) + - [func \(s ShaderPipelineData\) ListFrontDepthFailOp\(\) \[\]string](<#ShaderPipelineData.ListFrontDepthFailOp>) + - [func \(s ShaderPipelineData\) ListFrontFace\(\) \[\]string](<#ShaderPipelineData.ListFrontFace>) + - [func \(s ShaderPipelineData\) ListFrontFailOp\(\) \[\]string](<#ShaderPipelineData.ListFrontFailOp>) + - [func \(s ShaderPipelineData\) ListFrontPassOp\(\) \[\]string](<#ShaderPipelineData.ListFrontPassOp>) + - [func \(s ShaderPipelineData\) ListLogicOp\(\) \[\]string](<#ShaderPipelineData.ListLogicOp>) + - [func \(s ShaderPipelineData\) ListPatchControlPoints\(\) \[\]string](<#ShaderPipelineData.ListPatchControlPoints>) + - [func \(s ShaderPipelineData\) ListPolygonMode\(\) \[\]string](<#ShaderPipelineData.ListPolygonMode>) + - [func \(s ShaderPipelineData\) ListRasterizationSamples\(\) \[\]string](<#ShaderPipelineData.ListRasterizationSamples>) + - [func \(s ShaderPipelineData\) ListTopology\(\) \[\]string](<#ShaderPipelineData.ListTopology>) + - [func \(s \*ShaderPipelineData\) LogicOpEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.LogicOpEnableToVK>) + - [func \(s \*ShaderPipelineData\) PrimitiveRestartToVK\(\) vk.Bool32](<#ShaderPipelineData.PrimitiveRestartToVK>) + - [func \(s \*ShaderPipelineData\) RasterizerDiscardEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.RasterizerDiscardEnableToVK>) + - [func \(s \*ShaderPipelineData\) SampleShadingEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.SampleShadingEnableToVK>) + - [func \(s \*ShaderPipelineData\) StencilTestEnableToVK\(\) vk.Bool32](<#ShaderPipelineData.StencilTestEnableToVK>) +- [type ShaderPipelineDataCompiled](<#ShaderPipelineDataCompiled>) + - [func \(s \*ShaderPipelineDataCompiled\) ConstructPipeline\(device \*GPUDevice, shader \*Shader, renderPass \*RenderPass, stages \[\]vk.PipelineShaderStageCreateInfo\) bool](<#ShaderPipelineDataCompiled.ConstructPipeline>) +- [type ShaderPipelineDepthStencil](<#ShaderPipelineDepthStencil>) +- [type ShaderPipelineDepthStencilCompiled](<#ShaderPipelineDepthStencilCompiled>) +- [type ShaderPipelineGraphicsPipeline](<#ShaderPipelineGraphicsPipeline>) + - [func \(s \*ShaderPipelineGraphicsPipeline\) PipelineCreateFlagsToVK\(\) vk.PipelineCreateFlags](<#ShaderPipelineGraphicsPipeline.PipelineCreateFlagsToVK>) +- [type ShaderPipelineGraphicsPipelineCompiled](<#ShaderPipelineGraphicsPipelineCompiled>) +- [type ShaderPipelineInputAssembly](<#ShaderPipelineInputAssembly>) + - [func \(s \*ShaderPipelineInputAssembly\) TopologyToVK\(\) vulkan\_const.PrimitiveTopology](<#ShaderPipelineInputAssembly.TopologyToVK>) +- [type ShaderPipelineInputAssemblyCompiled](<#ShaderPipelineInputAssemblyCompiled>) +- [type ShaderPipelinePipelineMultisample](<#ShaderPipelinePipelineMultisample>) + - [func \(s \*ShaderPipelinePipelineMultisample\) RasterizationSamplesToVK\(device \*GPUPhysicalDevice\) GPUSampleCountFlags](<#ShaderPipelinePipelineMultisample.RasterizationSamplesToVK>) +- [type ShaderPipelinePipelineMultisampleCompiled](<#ShaderPipelinePipelineMultisampleCompiled>) +- [type ShaderPipelinePipelineRasterization](<#ShaderPipelinePipelineRasterization>) + - [func \(s \*ShaderPipelinePipelineRasterization\) CullModeToVK\(\) vulkan\_const.CullModeFlagBits](<#ShaderPipelinePipelineRasterization.CullModeToVK>) + - [func \(s \*ShaderPipelinePipelineRasterization\) FrontFaceToVK\(\) vulkan\_const.FrontFace](<#ShaderPipelinePipelineRasterization.FrontFaceToVK>) + - [func \(s \*ShaderPipelinePipelineRasterization\) PolygonModeToVK\(\) vulkan\_const.PolygonMode](<#ShaderPipelinePipelineRasterization.PolygonModeToVK>) +- [type ShaderPipelinePipelineRasterizationCompiled](<#ShaderPipelinePipelineRasterizationCompiled>) +- [type ShaderPipelinePushConstant](<#ShaderPipelinePushConstant>) + - [func \(s \*ShaderPipelinePushConstant\) ShaderStageFlagsToVK\(\) vk.ShaderStageFlags](<#ShaderPipelinePushConstant.ShaderStageFlagsToVK>) +- [type ShaderPipelinePushConstantCompiled](<#ShaderPipelinePushConstantCompiled>) +- [type ShaderPipelineTessellation](<#ShaderPipelineTessellation>) + - [func \(s \*ShaderPipelineTessellation\) PatchControlPointsToVK\(\) uint32](<#ShaderPipelineTessellation.PatchControlPointsToVK>) +- [type ShaderPipelineTessellationCompiled](<#ShaderPipelineTessellationCompiled>) +- [type ShaderType](<#ShaderType>) +- [type SkinnedShaderDataHeader](<#SkinnedShaderDataHeader>) + - [func \(h \*SkinnedShaderDataHeader\) BoneByIndex\(index int\) \*BoneTransform](<#SkinnedShaderDataHeader.BoneByIndex>) + - [func \(h \*SkinnedShaderDataHeader\) CreateBones\(ids \[\]int32\)](<#SkinnedShaderDataHeader.CreateBones>) + - [func \(h \*SkinnedShaderDataHeader\) FindBone\(id int32\) \*BoneTransform](<#SkinnedShaderDataHeader.FindBone>) + - [func \(h \*SkinnedShaderDataHeader\) HasBones\(\) bool](<#SkinnedShaderDataHeader.HasBones>) + - [func \(h \*SkinnedShaderDataHeader\) SkinNamedDataInstanceSize\(\) int](<#SkinnedShaderDataHeader.SkinNamedDataInstanceSize>) + - [func \(h \*SkinnedShaderDataHeader\) SkinNamedDataPointer\(\) unsafe.Pointer](<#SkinnedShaderDataHeader.SkinNamedDataPointer>) + - [func \(h \*SkinnedShaderDataHeader\) SkinUpdateNamedData\(\) bool](<#SkinnedShaderDataHeader.SkinUpdateNamedData>) +- [type TextShaderData](<#TextShaderData>) + - [func \(s TextShaderData\) Size\(\) int](<#TextShaderData.Size>) +- [type Texture](<#Texture>) + - [func NewTexture\(assetDb assets.Database, key string, filter TextureFilter\) \(\*Texture, error\)](<#NewTexture>) + - [func NewTextureFromImage\(key string, data \[\]byte, filter TextureFilter\) \(\*Texture, error\)](<#NewTextureFromImage>) + - [func NewTextureFromMemory\(key string, data \[\]byte, width, height int, filter TextureFilter\) \(\*Texture, error\)](<#NewTextureFromMemory>) + - [func \(t \*Texture\) DelayedCreate\(device \*GPUDevice\)](<#Texture.DelayedCreate>) + - [func \(t \*Texture\) ReadAllPixels\(app \*GPUApplication\) \(\[\]byte, error\)](<#Texture.ReadAllPixels>) + - [func \(t \*Texture\) ReadPendingDataForTransparency\(\) bool](<#Texture.ReadPendingDataForTransparency>) + - [func \(t \*Texture\) ReadPixel\(app \*GPUApplication, x, y int\) matrix.Color](<#Texture.ReadPixel>) + - [func \(t \*Texture\) Reload\(assetDb assets.Database\) error](<#Texture.Reload>) + - [func \(t \*Texture\) SetPendingDataDimensions\(dim TextureDimensions\)](<#Texture.SetPendingDataDimensions>) + - [func \(t Texture\) Size\(\) matrix.Vec2](<#Texture.Size>) + - [func \(t \*Texture\) WritePixels\(device \*GPUDevice, requests \[\]GPUImageWriteRequest\)](<#Texture.WritePixels>) +- [type TextureCache](<#TextureCache>) + - [func NewTextureCache\(device \*GPUDevice, assetDatabase assets.Database\) TextureCache](<#NewTextureCache>) + - [func \(t \*TextureCache\) CreatePending\(\)](<#TextureCache.CreatePending>) + - [func \(t \*TextureCache\) Destroy\(\)](<#TextureCache.Destroy>) + - [func \(t \*TextureCache\) ForceRemoveTexture\(key string, filter TextureFilter\)](<#TextureCache.ForceRemoveTexture>) + - [func \(t \*TextureCache\) InsertRawTexture\(key string, data \[\]byte, width, height int, filter TextureFilter\) \(\*Texture, error\)](<#TextureCache.InsertRawTexture>) + - [func \(t \*TextureCache\) InsertTexture\(tex \*Texture\)](<#TextureCache.InsertTexture>) + - [func \(t \*TextureCache\) ReloadTexture\(textureKey string, filter TextureFilter\) error](<#TextureCache.ReloadTexture>) + - [func \(t \*TextureCache\) Texture\(textureKey string, filter TextureFilter\) \(\*Texture, error\)](<#TextureCache.Texture>) +- [type TextureCleanup](<#TextureCleanup>) +- [type TextureColorFormat](<#TextureColorFormat>) +- [type TextureData](<#TextureData>) + - [func ReadRawTextureData\(mem \[\]byte, inputType TextureFileFormat\) TextureData](<#ReadRawTextureData>) + - [func TexturePixelsFromAsset\(assetDb assets.Database, key string\) \(TextureData, error\)](<#TexturePixelsFromAsset>) +- [type TextureDimensions](<#TextureDimensions>) +- [type TextureFileFormat](<#TextureFileFormat>) +- [type TextureFilter](<#TextureFilter>) +- [type TextureId](<#TextureId>) + - [func \(t TextureId\) IsValid\(\) bool](<#TextureId.IsValid>) +- [type TextureInputType](<#TextureInputType>) +- [type TextureMemType](<#TextureMemType>) +- [type Vertex](<#Vertex>) + - [func MeshPlaneData\(\) \(\[\]Vertex, \[\]uint32\)](<#MeshPlaneData>) + - [func MeshQuadData\(\) \(\[\]Vertex, \[\]uint32\)](<#MeshQuadData>) +- [type ViewCuller](<#ViewCuller>) ## Constants + + +```go +const ( + FontJustifyLeft = FontJustify(iota) + FontJustifyCenter + FontJustifyRight +) +``` -### const ( + ```go -FontJustifyLeft = FontJustify(iota) -FontJustifyCenter -FontJustifyRight +const ( + FontBaselineBottom = FontBaseline(iota) + FontBaselineCenter + FontBaselineTop +) ``` + + +```go +const ( + FontBold = FontFace("OpenSans-Bold") + FontBoldItalic = FontFace("OpenSans-BoldItalic") + FontExtraBold = FontFace("OpenSans-ExtraBold") + FontExtraBoldItalic = FontFace("OpenSans-ExtraBoldItalic") + FontItalic = FontFace("OpenSans-Italic") + FontLight = FontFace("OpenSans-Light") + FontLightItalic = FontFace("OpenSans-LightItalic") + FontRegular = FontFace("OpenSans-Regular") + FontSemiBold = FontFace("OpenSans-SemiBold") + FontSemiBoldItalic = FontFace("OpenSans-SemiBoldItalic") ) -### const ( +``` + + ```go -FontBaselineBottom = FontBaseline(iota) -FontBaselineCenter -FontBaselineTop +const ( + MaxJoints = 50 + MaxSkinInstances = 50 +) ``` + + +```go +const ( + GPUSuccess = iota + GPUNotReady + GPUTimeout + GPUEventSet + GPUEventReset + GPUIncomplete + GPUErrorOutOfHostMemory + GPUErrorOutOfDeviceMemory + GPUErrorInitializationFailed + GPUErrorDeviceLost + GPUErrorMemoryMapFailed + GPUErrorLayerNotPresent + GPUErrorExtensionNotPresent + GPUErrorFeatureNotPresent + GPUErrorIncompatibleDriver + GPUErrorTooManyObjects + GPUErrorFormatNotSupported + GPUErrorFragmentedPool + GPUErrorOutOfPoolMemory + GPUErrorInvalidExternalHandle + GPUErrorSurfaceLost + GPUErrorNativeWindowInUse + GPUSuboptimal + GPUErrorOutOfDate + GPUErrorIncompatibleDisplay + GPUErrorValidationFailed + GPUErrorInvalidShaderNv + GPUErrorInvalidDrmFormatModifierPlaneLayout + GPUErrorFragmentation + GPUErrorNotPermitted ) -### const ( +``` + + ```go -FontBold = FontFace("OpenSans-Bold") -FontBoldItalic = FontFace("OpenSans-BoldItalic") -FontExtraBold = FontFace("OpenSans-ExtraBold") -FontExtraBoldItalic = FontFace("OpenSans-ExtraBoldItalic") -FontItalic = FontFace("OpenSans-Italic") -FontLight = FontFace("OpenSans-Light") -FontLightItalic = FontFace("OpenSans-LightItalic") -FontRegular = FontFace("OpenSans-Regular") -FontSemiBold = FontFace("OpenSans-SemiBold") -FontSemiBoldItalic = FontFace("OpenSans-SemiBoldItalic") -``` +const ( + MaxLocalLights = 20 + MaxCascades = 3 ) -### const ( +``` + + ```go -MaxJoints = 50 -MaxSkinInstances = 50 +const ( + LightTypeDirectional = LightType(iota) + LightTypePoint + LightTypeSpot +) ``` + + +```go +const ( + QuadPivotCenter = QuadPivot(iota) + QuadPivotLeft + QuadPivotTop + QuadPivotRight + QuadPivotBottom + QuadPivotBottomLeft + QuadPivotBottomRight + QuadPivotTopLeft + QuadPivotTopRight ) -### const ( - -```go -GPUSuccess = iota -GPUNotReady -GPUTimeout -GPUEventSet -GPUEventReset -GPUIncomplete -GPUErrorOutOfHostMemory -GPUErrorOutOfDeviceMemory -GPUErrorInitializationFailed -GPUErrorDeviceLost -GPUErrorMemoryMapFailed -GPUErrorLayerNotPresent -GPUErrorExtensionNotPresent -GPUErrorFeatureNotPresent -GPUErrorIncompatibleDriver -GPUErrorTooManyObjects -GPUErrorFormatNotSupported -GPUErrorFragmentedPool -GPUErrorOutOfPoolMemory -GPUErrorInvalidExternalHandle -GPUErrorSurfaceLost -GPUErrorNativeWindowInUse -GPUSuboptimal -GPUErrorOutOfDate -GPUErrorIncompatibleDisplay -GPUErrorValidationFailed -GPUErrorInvalidShaderNv -GPUErrorInvalidDrmFormatModifierPlaneLayout -GPUErrorFragmentation -GPUErrorNotPermitted ``` + + +```go +const ( + BytesInPixel = 4 + MaxCommandPools = 5 + MaxSecondaryCommands = 25 ) -### const ( +``` + + ```go -MaxLocalLights = 20 +const ( + CubeMapSides = 6 +) ``` + ```go -MaxCascades = 3 +const ( + DefaultFontEMSize = 14.0 +) ``` + + +```go +const ( + GPUWholeSize = (^uintptr(0)) ) -### const ( +``` + + ```go -LightTypeDirectional = LightType(iota) -LightTypePoint -LightTypeSpot +const ( + GenerateUniqueTextureKey = "" +) ``` + + +```go +const ( + QuaternionSize = int(unsafe.Sizeof(matrix.Quaternion{})) ) -### const ( +``` + + ```go -QuadPivotCenter = QuadPivot(iota) -QuadPivotLeft -QuadPivotTop -QuadPivotRight -QuadPivotBottom -QuadPivotBottomLeft -QuadPivotBottomRight -QuadPivotTopLeft -QuadPivotTopRight +const ShaderBaseDataStart = unsafe.Offsetof(ShaderDataBase{}.model) ``` +## Variables + + + +```go +var ( + StringVkFormat = map[string]vulkan_const.Format{ + "Undefined": vulkan_const.FormatUndefined, + + "R4g4UnormPack8": vulkan_const.FormatR4g4UnormPack8, + "R4g4b4a4UnormPack16": vulkan_const.FormatR4g4b4a4UnormPack16, + "B4g4r4a4UnormPack16": vulkan_const.FormatB4g4r4a4UnormPack16, + "R5g6b5UnormPack16": vulkan_const.FormatR5g6b5UnormPack16, + "B5g6r5UnormPack16": vulkan_const.FormatB5g6r5UnormPack16, + "R5g5b5a1UnormPack16": vulkan_const.FormatR5g5b5a1UnormPack16, + "B5g5r5a1UnormPack16": vulkan_const.FormatB5g5r5a1UnormPack16, + "A1r5g5b5UnormPack16": vulkan_const.FormatA1r5g5b5UnormPack16, + "R8Unorm": vulkan_const.FormatR8Unorm, + "R8Snorm": vulkan_const.FormatR8Snorm, + "R8Uscaled": vulkan_const.FormatR8Uscaled, + "R8Sscaled": vulkan_const.FormatR8Sscaled, + "R8Uint": vulkan_const.FormatR8Uint, + "R8Sint": vulkan_const.FormatR8Sint, + "R8Srgb": vulkan_const.FormatR8Srgb, + "R8g8Unorm": vulkan_const.FormatR8g8Unorm, + "R8g8Snorm": vulkan_const.FormatR8g8Snorm, + "R8g8Uscaled": vulkan_const.FormatR8g8Uscaled, + "R8g8Sscaled": vulkan_const.FormatR8g8Sscaled, + "R8g8Uint": vulkan_const.FormatR8g8Uint, + "R8g8Sint": vulkan_const.FormatR8g8Sint, + "R8g8Srgb": vulkan_const.FormatR8g8Srgb, + "R8g8b8Unorm": vulkan_const.FormatR8g8b8Unorm, + "R8g8b8Snorm": vulkan_const.FormatR8g8b8Snorm, + "R8g8b8Uscaled": vulkan_const.FormatR8g8b8Uscaled, + "R8g8b8Sscaled": vulkan_const.FormatR8g8b8Sscaled, + "R8g8b8Uint": vulkan_const.FormatR8g8b8Uint, + "R8g8b8Sint": vulkan_const.FormatR8g8b8Sint, + "R8g8b8Srgb": vulkan_const.FormatR8g8b8Srgb, + "B8g8r8Unorm": vulkan_const.FormatB8g8r8Unorm, + "B8g8r8Snorm": vulkan_const.FormatB8g8r8Snorm, + "B8g8r8Uscaled": vulkan_const.FormatB8g8r8Uscaled, + "B8g8r8Sscaled": vulkan_const.FormatB8g8r8Sscaled, + "B8g8r8Uint": vulkan_const.FormatB8g8r8Uint, + "B8g8r8Sint": vulkan_const.FormatB8g8r8Sint, + "B8g8r8Srgb": vulkan_const.FormatB8g8r8Srgb, + "R8g8b8a8Unorm": vulkan_const.FormatR8g8b8a8Unorm, + "R8g8b8a8Snorm": vulkan_const.FormatR8g8b8a8Snorm, + "R8g8b8a8Uscaled": vulkan_const.FormatR8g8b8a8Uscaled, + "R8g8b8a8Sscaled": vulkan_const.FormatR8g8b8a8Sscaled, + "R8g8b8a8Uint": vulkan_const.FormatR8g8b8a8Uint, + "R8g8b8a8Sint": vulkan_const.FormatR8g8b8a8Sint, + "R8g8b8a8Srgb": vulkan_const.FormatR8g8b8a8Srgb, + "B8g8r8a8Unorm": vulkan_const.FormatB8g8r8a8Unorm, + "B8g8r8a8Snorm": vulkan_const.FormatB8g8r8a8Snorm, + "B8g8r8a8Uscaled": vulkan_const.FormatB8g8r8a8Uscaled, + "B8g8r8a8Sscaled": vulkan_const.FormatB8g8r8a8Sscaled, + "B8g8r8a8Uint": vulkan_const.FormatB8g8r8a8Uint, + "B8g8r8a8Sint": vulkan_const.FormatB8g8r8a8Sint, + "B8g8r8a8Srgb": vulkan_const.FormatB8g8r8a8Srgb, + "A8b8g8r8UnormPack32": vulkan_const.FormatA8b8g8r8UnormPack32, + "A8b8g8r8SnormPack32": vulkan_const.FormatA8b8g8r8SnormPack32, + "A8b8g8r8UscaledPack32": vulkan_const.FormatA8b8g8r8UscaledPack32, + "A8b8g8r8SscaledPack32": vulkan_const.FormatA8b8g8r8SscaledPack32, + "A8b8g8r8UintPack32": vulkan_const.FormatA8b8g8r8UintPack32, + "A8b8g8r8SintPack32": vulkan_const.FormatA8b8g8r8SintPack32, + "A8b8g8r8SrgbPack32": vulkan_const.FormatA8b8g8r8SrgbPack32, + "A2r10g10b10UnormPack32": vulkan_const.FormatA2r10g10b10UnormPack32, + "A2r10g10b10SnormPack32": vulkan_const.FormatA2r10g10b10SnormPack32, + "A2r10g10b10UscaledPack32": vulkan_const.FormatA2r10g10b10UscaledPack32, + "A2r10g10b10SscaledPack32": vulkan_const.FormatA2r10g10b10SscaledPack32, + "A2r10g10b10UintPack32": vulkan_const.FormatA2r10g10b10UintPack32, + "A2r10g10b10SintPack32": vulkan_const.FormatA2r10g10b10SintPack32, + "A2b10g10r10UnormPack32": vulkan_const.FormatA2b10g10r10UnormPack32, + "A2b10g10r10SnormPack32": vulkan_const.FormatA2b10g10r10SnormPack32, + "A2b10g10r10UscaledPack32": vulkan_const.FormatA2b10g10r10UscaledPack32, + "A2b10g10r10SscaledPack32": vulkan_const.FormatA2b10g10r10SscaledPack32, + "A2b10g10r10UintPack32": vulkan_const.FormatA2b10g10r10UintPack32, + "A2b10g10r10SintPack32": vulkan_const.FormatA2b10g10r10SintPack32, + "R16Unorm": vulkan_const.FormatR16Unorm, + "R16Snorm": vulkan_const.FormatR16Snorm, + "R16Uscaled": vulkan_const.FormatR16Uscaled, + "R16Sscaled": vulkan_const.FormatR16Sscaled, + "R16Uint": vulkan_const.FormatR16Uint, + "R16Sint": vulkan_const.FormatR16Sint, + "R16Sfloat": vulkan_const.FormatR16Sfloat, + "R16g16Unorm": vulkan_const.FormatR16g16Unorm, + "R16g16Snorm": vulkan_const.FormatR16g16Snorm, + "R16g16Uscaled": vulkan_const.FormatR16g16Uscaled, + "R16g16Sscaled": vulkan_const.FormatR16g16Sscaled, + "R16g16Uint": vulkan_const.FormatR16g16Uint, + "R16g16Sint": vulkan_const.FormatR16g16Sint, + "R16g16Sfloat": vulkan_const.FormatR16g16Sfloat, + "R16g16b16Unorm": vulkan_const.FormatR16g16b16Unorm, + "R16g16b16Snorm": vulkan_const.FormatR16g16b16Snorm, + "R16g16b16Uscaled": vulkan_const.FormatR16g16b16Uscaled, + "R16g16b16Sscaled": vulkan_const.FormatR16g16b16Sscaled, + "R16g16b16Uint": vulkan_const.FormatR16g16b16Uint, + "R16g16b16Sint": vulkan_const.FormatR16g16b16Sint, + "R16g16b16Sfloat": vulkan_const.FormatR16g16b16Sfloat, + "R16g16b16a16Unorm": vulkan_const.FormatR16g16b16a16Unorm, + "R16g16b16a16Snorm": vulkan_const.FormatR16g16b16a16Snorm, + "R16g16b16a16Uscaled": vulkan_const.FormatR16g16b16a16Uscaled, + "R16g16b16a16Sscaled": vulkan_const.FormatR16g16b16a16Sscaled, + "R16g16b16a16Uint": vulkan_const.FormatR16g16b16a16Uint, + "R16g16b16a16Sint": vulkan_const.FormatR16g16b16a16Sint, + "R16g16b16a16Sfloat": vulkan_const.FormatR16g16b16a16Sfloat, + "R32Uint": vulkan_const.FormatR32Uint, + "R32Sint": vulkan_const.FormatR32Sint, + "R32Sfloat": vulkan_const.FormatR32Sfloat, + "R32g32Uint": vulkan_const.FormatR32g32Uint, + "R32g32Sint": vulkan_const.FormatR32g32Sint, + "R32g32Sfloat": vulkan_const.FormatR32g32Sfloat, + "R32g32b32Uint": vulkan_const.FormatR32g32b32Uint, + "R32g32b32Sint": vulkan_const.FormatR32g32b32Sint, + "R32g32b32Sfloat": vulkan_const.FormatR32g32b32Sfloat, + "R32g32b32a32Uint": vulkan_const.FormatR32g32b32a32Uint, + "R32g32b32a32Sint": vulkan_const.FormatR32g32b32a32Sint, + "R32g32b32a32Sfloat": vulkan_const.FormatR32g32b32a32Sfloat, + "R64Uint": vulkan_const.FormatR64Uint, + "R64Sint": vulkan_const.FormatR64Sint, + "R64Sfloat": vulkan_const.FormatR64Sfloat, + "R64g64Uint": vulkan_const.FormatR64g64Uint, + "R64g64Sint": vulkan_const.FormatR64g64Sint, + "R64g64Sfloat": vulkan_const.FormatR64g64Sfloat, + "R64g64b64Uint": vulkan_const.FormatR64g64b64Uint, + "R64g64b64Sint": vulkan_const.FormatR64g64b64Sint, + "R64g64b64Sfloat": vulkan_const.FormatR64g64b64Sfloat, + "R64g64b64a64Uint": vulkan_const.FormatR64g64b64a64Uint, + "R64g64b64a64Sint": vulkan_const.FormatR64g64b64a64Sint, + "R64g64b64a64Sfloat": vulkan_const.FormatR64g64b64a64Sfloat, + "B10g11r11UfloatPack32": vulkan_const.FormatB10g11r11UfloatPack32, + "E5b9g9r9UfloatPack32": vulkan_const.FormatE5b9g9r9UfloatPack32, + "D16Unorm": vulkan_const.FormatD16Unorm, + "X8D24UnormPack32": vulkan_const.FormatX8D24UnormPack32, + "D32Sfloat": vulkan_const.FormatD32Sfloat, + "S8Uint": vulkan_const.FormatS8Uint, + "D16UnormS8Uint": vulkan_const.FormatD16UnormS8Uint, + "D24UnormS8Uint": vulkan_const.FormatD24UnormS8Uint, + "D32SfloatS8Uint": vulkan_const.FormatD32SfloatS8Uint, + "Bc1RgbUnormBlock": vulkan_const.FormatBc1RgbUnormBlock, + "Bc1RgbSrgbBlock": vulkan_const.FormatBc1RgbSrgbBlock, + "Bc1RgbaUnormBlock": vulkan_const.FormatBc1RgbaUnormBlock, + "Bc1RgbaSrgbBlock": vulkan_const.FormatBc1RgbaSrgbBlock, + "Bc2UnormBlock": vulkan_const.FormatBc2UnormBlock, + "Bc2SrgbBlock": vulkan_const.FormatBc2SrgbBlock, + "Bc3UnormBlock": vulkan_const.FormatBc3UnormBlock, + "Bc3SrgbBlock": vulkan_const.FormatBc3SrgbBlock, + "Bc4UnormBlock": vulkan_const.FormatBc4UnormBlock, + "Bc4SnormBlock": vulkan_const.FormatBc4SnormBlock, + "Bc5UnormBlock": vulkan_const.FormatBc5UnormBlock, + "Bc5SnormBlock": vulkan_const.FormatBc5SnormBlock, + "Bc6hUfloatBlock": vulkan_const.FormatBc6hUfloatBlock, + "Bc6hSfloatBlock": vulkan_const.FormatBc6hSfloatBlock, + "Bc7UnormBlock": vulkan_const.FormatBc7UnormBlock, + "Bc7SrgbBlock": vulkan_const.FormatBc7SrgbBlock, + "Etc2R8g8b8UnormBlock": vulkan_const.FormatEtc2R8g8b8UnormBlock, + "Etc2R8g8b8SrgbBlock": vulkan_const.FormatEtc2R8g8b8SrgbBlock, + "Etc2R8g8b8a1UnormBlock": vulkan_const.FormatEtc2R8g8b8a1UnormBlock, + "Etc2R8g8b8a1SrgbBlock": vulkan_const.FormatEtc2R8g8b8a1SrgbBlock, + "Etc2R8g8b8a8UnormBlock": vulkan_const.FormatEtc2R8g8b8a8UnormBlock, + "Etc2R8g8b8a8SrgbBlock": vulkan_const.FormatEtc2R8g8b8a8SrgbBlock, + "EacR11UnormBlock": vulkan_const.FormatEacR11UnormBlock, + "EacR11SnormBlock": vulkan_const.FormatEacR11SnormBlock, + "EacR11g11UnormBlock": vulkan_const.FormatEacR11g11UnormBlock, + "EacR11g11SnormBlock": vulkan_const.FormatEacR11g11SnormBlock, + "Astc4x4UnormBlock": vulkan_const.FormatAstc4x4UnormBlock, + "Astc4x4SrgbBlock": vulkan_const.FormatAstc4x4SrgbBlock, + "Astc5x4UnormBlock": vulkan_const.FormatAstc5x4UnormBlock, + "Astc5x4SrgbBlock": vulkan_const.FormatAstc5x4SrgbBlock, + "Astc5x5UnormBlock": vulkan_const.FormatAstc5x5UnormBlock, + "Astc5x5SrgbBlock": vulkan_const.FormatAstc5x5SrgbBlock, + "Astc6x5UnormBlock": vulkan_const.FormatAstc6x5UnormBlock, + "Astc6x5SrgbBlock": vulkan_const.FormatAstc6x5SrgbBlock, + "Astc6x6UnormBlock": vulkan_const.FormatAstc6x6UnormBlock, + "Astc6x6SrgbBlock": vulkan_const.FormatAstc6x6SrgbBlock, + "Astc8x5UnormBlock": vulkan_const.FormatAstc8x5UnormBlock, + "Astc8x5SrgbBlock": vulkan_const.FormatAstc8x5SrgbBlock, + "Astc8x6UnormBlock": vulkan_const.FormatAstc8x6UnormBlock, + "Astc8x6SrgbBlock": vulkan_const.FormatAstc8x6SrgbBlock, + "Astc8x8UnormBlock": vulkan_const.FormatAstc8x8UnormBlock, + "Astc8x8SrgbBlock": vulkan_const.FormatAstc8x8SrgbBlock, + "Astc10x5UnormBlock": vulkan_const.FormatAstc10x5UnormBlock, + "Astc10x5SrgbBlock": vulkan_const.FormatAstc10x5SrgbBlock, + "Astc10x6UnormBlock": vulkan_const.FormatAstc10x6UnormBlock, + "Astc10x6SrgbBlock": vulkan_const.FormatAstc10x6SrgbBlock, + "Astc10x8UnormBlock": vulkan_const.FormatAstc10x8UnormBlock, + "Astc10x8SrgbBlock": vulkan_const.FormatAstc10x8SrgbBlock, + "Astc10x10UnormBlock": vulkan_const.FormatAstc10x10UnormBlock, + "Astc10x10SrgbBlock": vulkan_const.FormatAstc10x10SrgbBlock, + "Astc12x10UnormBlock": vulkan_const.FormatAstc12x10UnormBlock, + "Astc12x10SrgbBlock": vulkan_const.FormatAstc12x10SrgbBlock, + "Astc12x12UnormBlock": vulkan_const.FormatAstc12x12UnormBlock, + "Astc12x12SrgbBlock": vulkan_const.FormatAstc12x12SrgbBlock, + "G8b8g8r8422Unorm": vulkan_const.FormatG8b8g8r8422Unorm, + "B8g8r8g8422Unorm": vulkan_const.FormatB8g8r8g8422Unorm, + "G8B8R83plane420Unorm": vulkan_const.FormatG8B8R83plane420Unorm, + "G8B8r82plane420Unorm": vulkan_const.FormatG8B8r82plane420Unorm, + "G8B8R83plane422Unorm": vulkan_const.FormatG8B8R83plane422Unorm, + "G8B8r82plane422Unorm": vulkan_const.FormatG8B8r82plane422Unorm, + "G8B8R83plane444Unorm": vulkan_const.FormatG8B8R83plane444Unorm, + "R10x6UnormPack16": vulkan_const.FormatR10x6UnormPack16, + "R10x6g10x6Unorm2pack16": vulkan_const.FormatR10x6g10x6Unorm2pack16, + "R10x6g10x6b10x6a10x6Unorm4pack16": vulkan_const.FormatR10x6g10x6b10x6a10x6Unorm4pack16, + "G10x6b10x6g10x6r10x6422Unorm4pack16": vulkan_const.FormatG10x6b10x6g10x6r10x6422Unorm4pack16, + "B10x6g10x6r10x6g10x6422Unorm4pack16": vulkan_const.FormatB10x6g10x6r10x6g10x6422Unorm4pack16, + "G10x6B10x6R10x63plane420Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane420Unorm3pack16, + "G10x6B10x6r10x62plane420Unorm3pack16": vulkan_const.FormatG10x6B10x6r10x62plane420Unorm3pack16, + "G10x6B10x6R10x63plane422Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane422Unorm3pack16, + "G10x6B10x6r10x62plane422Unorm3pack16": vulkan_const.FormatG10x6B10x6r10x62plane422Unorm3pack16, + "G10x6B10x6R10x63plane444Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane444Unorm3pack16, + "R12x4UnormPack16": vulkan_const.FormatR12x4UnormPack16, + "R12x4g12x4Unorm2pack16": vulkan_const.FormatR12x4g12x4Unorm2pack16, + "R12x4g12x4b12x4a12x4Unorm4pack16": vulkan_const.FormatR12x4g12x4b12x4a12x4Unorm4pack16, + "G12x4b12x4g12x4r12x4422Unorm4pack16": vulkan_const.FormatG12x4b12x4g12x4r12x4422Unorm4pack16, + "B12x4g12x4r12x4g12x4422Unorm4pack16": vulkan_const.FormatB12x4g12x4r12x4g12x4422Unorm4pack16, + "G12x4B12x4R12x43plane420Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane420Unorm3pack16, + "G12x4B12x4r12x42plane420Unorm3pack16": vulkan_const.FormatG12x4B12x4r12x42plane420Unorm3pack16, + "G12x4B12x4R12x43plane422Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane422Unorm3pack16, + "G12x4B12x4r12x42plane422Unorm3pack16": vulkan_const.FormatG12x4B12x4r12x42plane422Unorm3pack16, + "G12x4B12x4R12x43plane444Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane444Unorm3pack16, + "G16b16g16r16422Unorm": vulkan_const.FormatG16b16g16r16422Unorm, + "B16g16r16g16422Unorm": vulkan_const.FormatB16g16r16g16422Unorm, + "G16B16R163plane420Unorm": vulkan_const.FormatG16B16R163plane420Unorm, + "G16B16r162plane420Unorm": vulkan_const.FormatG16B16r162plane420Unorm, + "G16B16R163plane422Unorm": vulkan_const.FormatG16B16R163plane422Unorm, + "G16B16r162plane422Unorm": vulkan_const.FormatG16B16r162plane422Unorm, + "G16B16R163plane444Unorm": vulkan_const.FormatG16B16R163plane444Unorm, + "Pvrtc12bppUnormBlockImg": vulkan_const.FormatPvrtc12bppUnormBlockImg, + "Pvrtc14bppUnormBlockImg": vulkan_const.FormatPvrtc14bppUnormBlockImg, + "Pvrtc22bppUnormBlockImg": vulkan_const.FormatPvrtc22bppUnormBlockImg, + "Pvrtc24bppUnormBlockImg": vulkan_const.FormatPvrtc24bppUnormBlockImg, + "Pvrtc12bppSrgbBlockImg": vulkan_const.FormatPvrtc12bppSrgbBlockImg, + "Pvrtc14bppSrgbBlockImg": vulkan_const.FormatPvrtc14bppSrgbBlockImg, + "Pvrtc22bppSrgbBlockImg": vulkan_const.FormatPvrtc22bppSrgbBlockImg, + "Pvrtc24bppSrgbBlockImg": vulkan_const.FormatPvrtc24bppSrgbBlockImg, + // contains filtered or unexported fields + } + StringVkBlendFactor = map[string]vulkan_const.BlendFactor{ + "Zero": vulkan_const.BlendFactorZero, + "One": vulkan_const.BlendFactorOne, + "SrcColor": vulkan_const.BlendFactorSrcColor, + "SrcAlpha": vulkan_const.BlendFactorSrcAlpha, + "OneMinusSrcColor": vulkan_const.BlendFactorOneMinusSrcColor, + "DstColor": vulkan_const.BlendFactorDstColor, + "OneMinusDstColor": vulkan_const.BlendFactorOneMinusDstColor, + "OneMinusSrcAlpha": vulkan_const.BlendFactorOneMinusSrcAlpha, + "DstAlpha": vulkan_const.BlendFactorDstAlpha, + "OneMinusDstAlpha": vulkan_const.BlendFactorOneMinusDstAlpha, + "ConstantColor": vulkan_const.BlendFactorConstantColor, + "OneMinusConstantColor": vulkan_const.BlendFactorOneMinusConstantColor, + "ConstantAlpha": vulkan_const.BlendFactorConstantAlpha, + "OneMinusConstantAlpha": vulkan_const.BlendFactorOneMinusConstantAlpha, + "SrcAlphaSaturate": vulkan_const.BlendFactorSrcAlphaSaturate, + "Src1Color": vulkan_const.BlendFactorSrc1Color, + "OneMinusSrc1Color": vulkan_const.BlendFactorOneMinusSrc1Color, + "Src1Alpha": vulkan_const.BlendFactorSrc1Alpha, + "OneMinusSrc1Alpha": vulkan_const.BlendFactorOneMinusSrc1Alpha, + } + StringVkBlendOp = map[string]vulkan_const.BlendOp{ + "Add": vulkan_const.BlendOpAdd, + "Subtract": vulkan_const.BlendOpSubtract, + "ReverseSubtract": vulkan_const.BlendOpReverseSubtract, + "Min": vulkan_const.BlendOpMin, + "Max": vulkan_const.BlendOpMax, + "Zero": vulkan_const.BlendOpZero, + "Src": vulkan_const.BlendOpSrc, + "Dst": vulkan_const.BlendOpDst, + "SrcOver": vulkan_const.BlendOpSrcOver, + "DstOver": vulkan_const.BlendOpDstOver, + "SrcIn": vulkan_const.BlendOpSrcIn, + "DstIn": vulkan_const.BlendOpDstIn, + "SrcOut": vulkan_const.BlendOpSrcOut, + "DstOut": vulkan_const.BlendOpDstOut, + "SrcAtop": vulkan_const.BlendOpSrcAtop, + "DstAtop": vulkan_const.BlendOpDstAtop, + "Xor": vulkan_const.BlendOpXor, + "Multiply": vulkan_const.BlendOpMultiply, + "Screen": vulkan_const.BlendOpScreen, + "Overlay": vulkan_const.BlendOpOverlay, + "Darken": vulkan_const.BlendOpDarken, + "Lighten": vulkan_const.BlendOpLighten, + "Colordodge": vulkan_const.BlendOpColordodge, + "Colorburn": vulkan_const.BlendOpColorburn, + "Hardlight": vulkan_const.BlendOpHardlight, + "Softlight": vulkan_const.BlendOpSoftlight, + "Difference": vulkan_const.BlendOpDifference, + "Exclusion": vulkan_const.BlendOpExclusion, + "Invert": vulkan_const.BlendOpInvert, + "InvertRgb": vulkan_const.BlendOpInvertRgb, + "Lineardodge": vulkan_const.BlendOpLineardodge, + "Linearburn": vulkan_const.BlendOpLinearburn, + "Vividlight": vulkan_const.BlendOpVividlight, + "Linearlight": vulkan_const.BlendOpLinearlight, + "Pinlight": vulkan_const.BlendOpPinlight, + "Hardmix": vulkan_const.BlendOpHardmix, + "HslHue": vulkan_const.BlendOpHslHue, + "HslSaturation": vulkan_const.BlendOpHslSaturation, + "HslColor": vulkan_const.BlendOpHslColor, + "HslLuminosity": vulkan_const.BlendOpHslLuminosity, + "Plus": vulkan_const.BlendOpPlus, + "PlusClamped": vulkan_const.BlendOpPlusClamped, + "PlusClampedAlpha": vulkan_const.BlendOpPlusClampedAlpha, + "PlusDarker": vulkan_const.BlendOpPlusDarker, + "Minus": vulkan_const.BlendOpMinus, + "MinusClamped": vulkan_const.BlendOpMinusClamped, + "Contrast": vulkan_const.BlendOpContrast, + "InvertOvg": vulkan_const.BlendOpInvertOvg, + "Red": vulkan_const.BlendOpRed, + "Green": vulkan_const.BlendOpBlue, + "Blue": vulkan_const.BlendOpBlue, + } + StringVkLogicOp = map[string]vulkan_const.LogicOp{ + "Clear": vulkan_const.LogicOpClear, + "And": vulkan_const.LogicOpAnd, + "AndReverse": vulkan_const.LogicOpAndReverse, + "Copy": vulkan_const.LogicOpCopy, + "AndInverted": vulkan_const.LogicOpAndInverted, + "NoOp": vulkan_const.LogicOpNoOp, + "Xor": vulkan_const.LogicOpXor, + "Or": vulkan_const.LogicOpOr, + "Nor": vulkan_const.LogicOpNor, + "Equivalent": vulkan_const.LogicOpEquivalent, + "Invert": vulkan_const.LogicOpInvert, + "OrReverse": vulkan_const.LogicOpOrReverse, + "CopyInverted": vulkan_const.LogicOpCopyInverted, + "OrInverted": vulkan_const.LogicOpOrInverted, + "Nand": vulkan_const.LogicOpNand, + "Set": vulkan_const.LogicOpSet, + } + StringVkCompareOp = map[string]vulkan_const.CompareOp{ + "Never": vulkan_const.CompareOpNever, + "Equal": vulkan_const.CompareOpEqual, + "LessOrEqual": vulkan_const.CompareOpLessOrEqual, + "Greater": vulkan_const.CompareOpGreater, + "NotEqual": vulkan_const.CompareOpNotEqual, + "GreaterOrEqual": vulkan_const.CompareOpGreaterOrEqual, + "Always": vulkan_const.CompareOpAlways, + "Less": vulkan_const.CompareOpLess, + } + StringVkStencilOp = map[string]vulkan_const.StencilOp{ + "Zero": vulkan_const.StencilOpZero, + "Replace": vulkan_const.StencilOpReplace, + "IncrementAndClamp": vulkan_const.StencilOpIncrementAndClamp, + "DecrementAndClamp": vulkan_const.StencilOpDecrementAndClamp, + "Invert": vulkan_const.StencilOpInvert, + "IncrementAndWrap": vulkan_const.StencilOpIncrementAndWrap, + "DecrementAndWrap": vulkan_const.StencilOpDecrementAndWrap, + "Keep": vulkan_const.StencilOpKeep, + } + StringVkPrimitiveTopology = map[string]vulkan_const.PrimitiveTopology{ + "Points": vulkan_const.PrimitiveTopologyPointList, + "Lines": vulkan_const.PrimitiveTopologyLineList, + "Triangles": vulkan_const.PrimitiveTopologyTriangleList, + "Patches": vulkan_const.PrimitiveTopologyPatchList, + } + StringVkPolygonMode = map[string]vulkan_const.PolygonMode{ + "Point": vulkan_const.PolygonModePoint, + "Line": vulkan_const.PolygonModeLine, + "Fill": vulkan_const.PolygonModeFill, + } + StringVkCullModeFlagBits = map[string]vulkan_const.CullModeFlagBits{ + "None": vulkan_const.CullModeNone, + "Front": vulkan_const.CullModeFrontBit, + "Back": vulkan_const.CullModeBackBit, + } + StringVkFrontFace = map[string]vulkan_const.FrontFace{ + "Clockwise": vulkan_const.FrontFaceClockwise, + "CounterClockwise": vulkan_const.FrontFaceCounterClockwise, + } + StringVkSampleCountFlagBits = map[string]GPUSampleCountFlags{ + + "1Bit": GPUSampleCount1Bit, + "2Bit": GPUSampleCount2Bit, + "4Bit": GPUSampleCount4Bit, + "8Bit": GPUSampleCount8Bit, + "16Bit": GPUSampleCount16Bit, + "32Bit": GPUSampleCount32Bit, + "64Bit": GPUSampleCount64Bit, + // contains filtered or unexported fields + } + StringVkPatchControlPoints = map[string]uint32{ + "Lines": 2, + "Triangles": 3, + "Quads": 4, + } + StringVkAttachmentLoadOp = map[string]GPUAttachmentLoadOp{ + "Load": GPUAttachmentLoadOpLoad, + "Clear": GPUAttachmentLoadOpClear, + "DontCare": GPUAttachmentLoadOpDontCare, + } + StringVkAttachmentStoreOp = map[string]GPUAttachmentStoreOp{ + "Store": GPUAttachmentStoreOpStore, + "DontCare": GPUAttachmentStoreOpDontCare, + } + StringVkImageLayout = map[string]GPUImageLayout{ + "Undefined": GPUImageLayoutUndefined, + "General": GPUImageLayoutGeneral, + "ColorAttachmentOptimal": GPUImageLayoutColorAttachmentOptimal, + "DepthStencilAttachmentOptimal": GPUImageLayoutDepthStencilAttachmentOptimal, + "DepthStencilReadOnlyOptimal": GPUImageLayoutDepthStencilReadOnlyOptimal, + "ShaderReadOnlyOptimal": GPUImageLayoutShaderReadOnlyOptimal, + "TransferSrcOptimal": GPUImageLayoutTransferSrcOptimal, + "TransferDstOptimal": GPUImageLayoutTransferDstOptimal, + "Preinitialized": GPUImageLayoutPreinitialized, + "DepthReadOnlyStencilAttachmentOptimal": GPUImageLayoutDepthReadOnlyStencilAttachmentOptimal, + "DepthAttachmentStencilReadOnlyOptimal": GPUImageLayoutDepthAttachmentStencilReadOnlyOptimal, + "PresentSrc": GPUImageLayoutPresentSrc, + "SharedPresent": GPUImageLayoutSharedPresent, + "ShadingRateOptimalNv": GPUImageLayoutShadingRateOptimalNv, + } + StringVkPipelineStageFlagBits = map[string]vulkan_const.PipelineStageFlagBits{ + "TopOfPipeBit": vulkan_const.PipelineStageTopOfPipeBit, + "DrawIndirectBit": vulkan_const.PipelineStageDrawIndirectBit, + "VertexInputBit": vulkan_const.PipelineStageVertexInputBit, + "VertexShaderBit": vulkan_const.PipelineStageVertexShaderBit, + "TessellationControlShaderBit": vulkan_const.PipelineStageTessellationControlShaderBit, + "TessellationEvaluationShaderBit": vulkan_const.PipelineStageTessellationEvaluationShaderBit, + "GeometryShaderBit": vulkan_const.PipelineStageGeometryShaderBit, + "FragmentShaderBit": vulkan_const.PipelineStageFragmentShaderBit, + "EarlyFragmentTestsBit": vulkan_const.PipelineStageEarlyFragmentTestsBit, + "LateFragmentTestsBit": vulkan_const.PipelineStageLateFragmentTestsBit, + "ColorAttachmentOutputBit": vulkan_const.PipelineStageColorAttachmentOutputBit, + "ComputeShaderBit": vulkan_const.PipelineStageComputeShaderBit, + "TransferBit": vulkan_const.PipelineStageTransferBit, + "BottomOfPipeBit": vulkan_const.PipelineStageBottomOfPipeBit, + "HostBit": vulkan_const.PipelineStageHostBit, + "AllGraphicsBit": vulkan_const.PipelineStageAllGraphicsBit, + "AllCommandsBit": vulkan_const.PipelineStageAllCommandsBit, + "TransformFeedbackBit": vulkan_const.PipelineStageTransformFeedbackBit, + "ConditionalRenderingBit": vulkan_const.PipelineStageConditionalRenderingBit, + "CommandProcessBitNvx": vulkan_const.PipelineStageCommandProcessBitNvx, + "ShadingRateImageBitNv": vulkan_const.PipelineStageShadingRateImageBitNv, + "RaytracingBitNvx": vulkan_const.PipelineStageRaytracingBitNvx, + "TaskShaderBitNv": vulkan_const.PipelineStageTaskShaderBitNv, + "MeshShaderBitNv": vulkan_const.PipelineStageMeshShaderBitNv, + } + StringVkAccessFlagBits = map[string]GPUAccessFlags{ + "IndirectCommandReadBit": GPUAccessIndirectCommandReadBit, + "IndexReadBit": GPUAccessIndexReadBit, + "VertexAttributeReadBit": GPUAccessVertexAttributeReadBit, + "UniformReadBit": GPUAccessUniformReadBit, + "InputAttachmentReadBit": GPUAccessInputAttachmentReadBit, + "ShaderReadBit": GPUAccessShaderReadBit, + "ShaderWriteBit": GPUAccessShaderWriteBit, + "ColorAttachmentReadBit": GPUAccessColorAttachmentReadBit, + "ColorAttachmentWriteBit": GPUAccessColorAttachmentWriteBit, + "DepthStencilAttachmentReadBit": GPUAccessDepthStencilAttachmentReadBit, + "DepthStencilAttachmentWriteBit": GPUAccessDepthStencilAttachmentWriteBit, + "TransferReadBit": GPUAccessTransferReadBit, + "TransferWriteBit": GPUAccessTransferWriteBit, + "HostReadBit": GPUAccessHostReadBit, + "HostWriteBit": GPUAccessHostWriteBit, + "MemoryReadBit": GPUAccessMemoryReadBit, + "MemoryWriteBit": GPUAccessMemoryWriteBit, + "TransformFeedbackWriteBit": GPUAccessTransformFeedbackWriteBit, + "TransformFeedbackCounterReadBit": GPUAccessTransformFeedbackCounterReadBit, + "TransformFeedbackCounterWriteBit": GPUAccessTransformFeedbackCounterWriteBit, + "ConditionalRenderingReadBit": GPUAccessConditionalRenderingReadBit, + "CommandProcessReadBitNvx": GPUAccessCommandProcessReadBitNvx, + "CommandProcessWriteBitNvx": GPUAccessCommandProcessWriteBitNvx, + "ColorAttachmentReadNoncoherentBit": GPUAccessColorAttachmentReadNoncoherentBit, + "ShadingRateImageReadBitNv": GPUAccessShadingRateImageReadBitNv, + "AccelerationStructureReadBitNvx": GPUAccessAccelerationStructureReadBitNvx, + "AccelerationStructureWriteBitNvx": GPUAccessAccelerationStructureWriteBitNvx, + } + StringVkShaderStageFlagBits = map[string]vulkan_const.ShaderStageFlagBits{ + "VertexBit": vulkan_const.ShaderStageVertexBit, + "TessellationControlBit": vulkan_const.ShaderStageTessellationControlBit, + "TessellationEvaluationBit": vulkan_const.ShaderStageTessellationEvaluationBit, + "GeometryBit": vulkan_const.ShaderStageGeometryBit, + "FragmentBit": vulkan_const.ShaderStageFragmentBit, + "ComputeBit": vulkan_const.ShaderStageComputeBit, + "AllGraphics": vulkan_const.ShaderStageAllGraphics, + "All": vulkan_const.ShaderStageAll, + "RaygenBitNvx": vulkan_const.ShaderStageRaygenBitNvx, + "AnyHitBitNvx": vulkan_const.ShaderStageAnyHitBitNvx, + "ClosestHitBitNvx": vulkan_const.ShaderStageClosestHitBitNvx, + "MissBitNvx": vulkan_const.ShaderStageMissBitNvx, + "IntersectionBitNvx": vulkan_const.ShaderStageIntersectionBitNvx, + "CallableBitNvx": vulkan_const.ShaderStageCallableBitNvx, + "TaskBitNv": vulkan_const.ShaderStageTaskBitNv, + "MeshBitNv": vulkan_const.ShaderStageMeshBitNv, + "FlagBitsMaxEnum": vulkan_const.ShaderStageFlagBitsMaxEnum, + } + StringVkPipelineBindPoint = map[string]vulkan_const.PipelineBindPoint{ + "Graphics": vulkan_const.PipelineBindPointGraphics, + "Compute": vulkan_const.PipelineBindPointCompute, + "RaytracingNvx": vulkan_const.PipelineBindPointRaytracingNvx, + } + StringVkDependencyFlagBits = map[string]vulkan_const.DependencyFlagBits{ + "ByRegionBit": vulkan_const.DependencyByRegionBit, + "DeviceGroupBit": vulkan_const.DependencyDeviceGroupBit, + "ViewLocalBit": vulkan_const.DependencyViewLocalBit, + } + StringVkColorComponentFlagBits = map[string]vulkan_const.ColorComponentFlagBits{ + "R": vulkan_const.ColorComponentRBit, + "G": vulkan_const.ColorComponentGBit, + "B": vulkan_const.ColorComponentBBit, + "A": vulkan_const.ColorComponentABit, + } + StringVkPipelineCreateFlagBits = map[string]vulkan_const.PipelineCreateFlagBits{ + "DisableOptimizationBit": vulkan_const.PipelineCreateDisableOptimizationBit, + "AllowDerivativesBit": vulkan_const.PipelineCreateAllowDerivativesBit, + "DerivativeBit": vulkan_const.PipelineCreateDerivativeBit, + "ViewIndexFromDeviceIndexBit": vulkan_const.PipelineCreateViewIndexFromDeviceIndexBit, + "DispatchBase": vulkan_const.PipelineCreateDispatchBase, + "DeferCompileBitNvx": vulkan_const.PipelineCreateDeferCompileBitNvx, + } + StringVkImageTiling = map[string]GPUImageTiling{ + "Optimal": GPUImageTilingOptimal, + "Linear": GPUImageTilingLinear, + "DrmFormatModifier": GPUImageTilingDrmFormatModifier, + } + StringVkFilter = map[string]GPUFilter{ + "Nearest": GPUFilterNearest, + "Linear": GPUFilterLinear, + "CubicImg": GPUFilterCubicImg, + } + StringVkImageUsageFlagBits = map[string]GPUImageUsageFlags{ + "TransferSrcBit": GPUImageUsageTransferSrcBit, + "TransferDstBit": GPUImageUsageTransferDstBit, + "SampledBit": GPUImageUsageSampledBit, + "StorageBit": GPUImageUsageStorageBit, + "ColorAttachmentBit": GPUImageUsageColorAttachmentBit, + "DepthStencilAttachmentBit": GPUImageUsageDepthStencilAttachmentBit, + "TransientAttachmentBit": GPUImageUsageTransientAttachmentBit, + "InputAttachmentBit": GPUImageUsageInputAttachmentBit, + "ShadingRateImageBitNv": GPUImageUsageShadingRateImageBitNv, + } + StringVkMemoryPropertyFlagBits = map[string]GPUMemoryPropertyFlags{ + "DeviceLocalBit": GPUMemoryPropertyDeviceLocalBit, + "HostVisibleBit": GPUMemoryPropertyHostVisibleBit, + "HostCoherentBit": GPUMemoryPropertyHostCoherentBit, + "HostCachedBit": GPUMemoryPropertyHostCachedBit, + "LazilyAllocatedBit": GPUMemoryPropertyLazilyAllocatedBit, + "ProtectedBit": GPUMemoryPropertyProtectedBit, + } + StringVkImageAspectFlagBits = map[string]GPUImageAspectFlags{ + "ColorBit": GPUImageAspectColorBit, + "DepthBit": GPUImageAspectDepthBit, + "StencilBit": GPUImageAspectStencilBit, + "MetadataBit": GPUImageAspectMetadataBit, + "Plane0Bit": GPUImageAspectPlane0Bit, + "Plane1Bit": GPUImageAspectPlane1Bit, + "Plane2Bit": GPUImageAspectPlane2Bit, + "MemoryPlane0Bit": GPUImageAspectMemoryPlane0Bit, + "MemoryPlane1Bit": GPUImageAspectMemoryPlane1Bit, + "MemoryPlane2Bit": GPUImageAspectMemoryPlane2Bit, + "MemoryPlane3Bit": GPUImageAspectMemoryPlane3Bit, + } + StringVkMap = map[string]any{ + "StringVkFormat": StringVkFormat, + "StringVkBlendFactor": StringVkBlendFactor, + "StringVkBlendOp": StringVkBlendOp, + "StringVkLogicOp": StringVkLogicOp, + "StringVkCompareOp": StringVkCompareOp, + "StringVkStencilOp": StringVkStencilOp, + "StringVkPrimitiveTopology": StringVkPrimitiveTopology, + "StringVkPolygonMode": StringVkPolygonMode, + "StringVkCullModeFlagBits": StringVkCullModeFlagBits, + "StringVkFrontFace": StringVkFrontFace, + "StringVkSampleCountFlagBits": StringVkSampleCountFlagBits, + "StringVkPatchControlPoints": StringVkPatchControlPoints, + "StringVkAttachmentLoadOp": StringVkAttachmentLoadOp, + "StringVkAttachmentStoreOp": StringVkAttachmentStoreOp, + "StringVkImageLayout": StringVkImageLayout, + "StringVkPipelineStageFlagBits": StringVkPipelineStageFlagBits, + "StringVkAccessFlagBits": StringVkAccessFlagBits, + "StringVkPipelineBindPoint": StringVkPipelineBindPoint, + "StringVkDependencyFlagBits": StringVkDependencyFlagBits, + "StringVkColorComponentFlagBits": StringVkColorComponentFlagBits, + "StringVkPipelineCreateFlagBits": StringVkPipelineCreateFlagBits, + "StringVkImageTiling": StringVkImageTiling, + "StringVkFilter": StringVkFilter, + "StringVkImageUsageFlagBits": StringVkImageUsageFlagBits, + "StringVkMemoryPropertyFlagBits": StringVkMemoryPropertyFlagBits, + "StringVkImageAspectFlagBits": StringVkImageAspectFlagBits, + } ) -### const ( +``` + + +## func [SetupLightMaterials]() ```go -QuaternionSize = int(unsafe.Sizeof(matrix.Quaternion{})) +func SetupLightMaterials(materialCache *MaterialCache) error ``` -) -### const ( + + + +## func [TextureKeys]() ```go -CubeMapSides = 6 +func TextureKeys(textures []*Texture) []string ``` -) -### const ( + + + +## func [VertexFaceNormal]() ```go -BytesInPixel = 4 -MaxCommandPools = 5 -MaxSecondaryCommands = 25 +func VertexFaceNormal(verts [3]Vertex) matrix.Vec3 ``` -) -### const ( + + + +## type [BoneTransform]() + + ```go -DefaultFontEMSize = 14.0 +type BoneTransform struct { + Id int32 + Transform matrix.Transform + Skin matrix.Mat4 +} ``` -) -### const ( + +## type [CommandRecorder]() + + ```go -GPUWholeSize = (^uintptr(0)) +type CommandRecorder struct { + // contains filtered or unexported fields +} ``` -) -### const ( + +### func [NewCommandRecorder]() ```go -GenerateUniqueTextureKey = "" +func NewCommandRecorder(device *GPUDevice) (CommandRecorder, error) ``` -) -### const ShaderBaseDataStart = unsafe.Offsetof(ShaderDataBase{}.model) -## Variables + +### func \(\*CommandRecorder\) [Begin]() +```go +func (c *CommandRecorder) Begin() +``` -### var ( - -```go -StringVkFormat = map[string]vulkan_const.Format{ - "Undefined": vulkan_const.FormatUndefined, - detectDepthFormatKey: vulkan_const.FormatUndefined, - swapChainFormatKey: vulkan_const.FormatUndefined, - "R4g4UnormPack8": vulkan_const.FormatR4g4UnormPack8, - "R4g4b4a4UnormPack16": vulkan_const.FormatR4g4b4a4UnormPack16, - "B4g4r4a4UnormPack16": vulkan_const.FormatB4g4r4a4UnormPack16, - "R5g6b5UnormPack16": vulkan_const.FormatR5g6b5UnormPack16, - "B5g6r5UnormPack16": vulkan_const.FormatB5g6r5UnormPack16, - "R5g5b5a1UnormPack16": vulkan_const.FormatR5g5b5a1UnormPack16, - "B5g5r5a1UnormPack16": vulkan_const.FormatB5g5r5a1UnormPack16, - "A1r5g5b5UnormPack16": vulkan_const.FormatA1r5g5b5UnormPack16, - "R8Unorm": vulkan_const.FormatR8Unorm, - "R8Snorm": vulkan_const.FormatR8Snorm, - "R8Uscaled": vulkan_const.FormatR8Uscaled, - "R8Sscaled": vulkan_const.FormatR8Sscaled, - "R8Uint": vulkan_const.FormatR8Uint, - "R8Sint": vulkan_const.FormatR8Sint, - "R8Srgb": vulkan_const.FormatR8Srgb, - "R8g8Unorm": vulkan_const.FormatR8g8Unorm, - "R8g8Snorm": vulkan_const.FormatR8g8Snorm, - "R8g8Uscaled": vulkan_const.FormatR8g8Uscaled, - "R8g8Sscaled": vulkan_const.FormatR8g8Sscaled, - "R8g8Uint": vulkan_const.FormatR8g8Uint, - "R8g8Sint": vulkan_const.FormatR8g8Sint, - "R8g8Srgb": vulkan_const.FormatR8g8Srgb, - "R8g8b8Unorm": vulkan_const.FormatR8g8b8Unorm, - "R8g8b8Snorm": vulkan_const.FormatR8g8b8Snorm, - "R8g8b8Uscaled": vulkan_const.FormatR8g8b8Uscaled, - "R8g8b8Sscaled": vulkan_const.FormatR8g8b8Sscaled, - "R8g8b8Uint": vulkan_const.FormatR8g8b8Uint, - "R8g8b8Sint": vulkan_const.FormatR8g8b8Sint, - "R8g8b8Srgb": vulkan_const.FormatR8g8b8Srgb, - "B8g8r8Unorm": vulkan_const.FormatB8g8r8Unorm, - "B8g8r8Snorm": vulkan_const.FormatB8g8r8Snorm, - "B8g8r8Uscaled": vulkan_const.FormatB8g8r8Uscaled, - "B8g8r8Sscaled": vulkan_const.FormatB8g8r8Sscaled, - "B8g8r8Uint": vulkan_const.FormatB8g8r8Uint, - "B8g8r8Sint": vulkan_const.FormatB8g8r8Sint, - "B8g8r8Srgb": vulkan_const.FormatB8g8r8Srgb, - "R8g8b8a8Unorm": vulkan_const.FormatR8g8b8a8Unorm, - "R8g8b8a8Snorm": vulkan_const.FormatR8g8b8a8Snorm, - "R8g8b8a8Uscaled": vulkan_const.FormatR8g8b8a8Uscaled, - "R8g8b8a8Sscaled": vulkan_const.FormatR8g8b8a8Sscaled, - "R8g8b8a8Uint": vulkan_const.FormatR8g8b8a8Uint, - "R8g8b8a8Sint": vulkan_const.FormatR8g8b8a8Sint, - "R8g8b8a8Srgb": vulkan_const.FormatR8g8b8a8Srgb, - "B8g8r8a8Unorm": vulkan_const.FormatB8g8r8a8Unorm, - "B8g8r8a8Snorm": vulkan_const.FormatB8g8r8a8Snorm, - "B8g8r8a8Uscaled": vulkan_const.FormatB8g8r8a8Uscaled, - "B8g8r8a8Sscaled": vulkan_const.FormatB8g8r8a8Sscaled, - "B8g8r8a8Uint": vulkan_const.FormatB8g8r8a8Uint, - "B8g8r8a8Sint": vulkan_const.FormatB8g8r8a8Sint, - "B8g8r8a8Srgb": vulkan_const.FormatB8g8r8a8Srgb, - "A8b8g8r8UnormPack32": vulkan_const.FormatA8b8g8r8UnormPack32, - "A8b8g8r8SnormPack32": vulkan_const.FormatA8b8g8r8SnormPack32, - "A8b8g8r8UscaledPack32": vulkan_const.FormatA8b8g8r8UscaledPack32, - "A8b8g8r8SscaledPack32": vulkan_const.FormatA8b8g8r8SscaledPack32, - "A8b8g8r8UintPack32": vulkan_const.FormatA8b8g8r8UintPack32, - "A8b8g8r8SintPack32": vulkan_const.FormatA8b8g8r8SintPack32, - "A8b8g8r8SrgbPack32": vulkan_const.FormatA8b8g8r8SrgbPack32, - "A2r10g10b10UnormPack32": vulkan_const.FormatA2r10g10b10UnormPack32, - "A2r10g10b10SnormPack32": vulkan_const.FormatA2r10g10b10SnormPack32, - "A2r10g10b10UscaledPack32": vulkan_const.FormatA2r10g10b10UscaledPack32, - "A2r10g10b10SscaledPack32": vulkan_const.FormatA2r10g10b10SscaledPack32, - "A2r10g10b10UintPack32": vulkan_const.FormatA2r10g10b10UintPack32, - "A2r10g10b10SintPack32": vulkan_const.FormatA2r10g10b10SintPack32, - "A2b10g10r10UnormPack32": vulkan_const.FormatA2b10g10r10UnormPack32, - "A2b10g10r10SnormPack32": vulkan_const.FormatA2b10g10r10SnormPack32, - "A2b10g10r10UscaledPack32": vulkan_const.FormatA2b10g10r10UscaledPack32, - "A2b10g10r10SscaledPack32": vulkan_const.FormatA2b10g10r10SscaledPack32, - "A2b10g10r10UintPack32": vulkan_const.FormatA2b10g10r10UintPack32, - "A2b10g10r10SintPack32": vulkan_const.FormatA2b10g10r10SintPack32, - "R16Unorm": vulkan_const.FormatR16Unorm, - "R16Snorm": vulkan_const.FormatR16Snorm, - "R16Uscaled": vulkan_const.FormatR16Uscaled, - "R16Sscaled": vulkan_const.FormatR16Sscaled, - "R16Uint": vulkan_const.FormatR16Uint, - "R16Sint": vulkan_const.FormatR16Sint, - "R16Sfloat": vulkan_const.FormatR16Sfloat, - "R16g16Unorm": vulkan_const.FormatR16g16Unorm, - "R16g16Snorm": vulkan_const.FormatR16g16Snorm, - "R16g16Uscaled": vulkan_const.FormatR16g16Uscaled, - "R16g16Sscaled": vulkan_const.FormatR16g16Sscaled, - "R16g16Uint": vulkan_const.FormatR16g16Uint, - "R16g16Sint": vulkan_const.FormatR16g16Sint, - "R16g16Sfloat": vulkan_const.FormatR16g16Sfloat, - "R16g16b16Unorm": vulkan_const.FormatR16g16b16Unorm, - "R16g16b16Snorm": vulkan_const.FormatR16g16b16Snorm, - "R16g16b16Uscaled": vulkan_const.FormatR16g16b16Uscaled, - "R16g16b16Sscaled": vulkan_const.FormatR16g16b16Sscaled, - "R16g16b16Uint": vulkan_const.FormatR16g16b16Uint, - "R16g16b16Sint": vulkan_const.FormatR16g16b16Sint, - "R16g16b16Sfloat": vulkan_const.FormatR16g16b16Sfloat, - "R16g16b16a16Unorm": vulkan_const.FormatR16g16b16a16Unorm, - "R16g16b16a16Snorm": vulkan_const.FormatR16g16b16a16Snorm, - "R16g16b16a16Uscaled": vulkan_const.FormatR16g16b16a16Uscaled, - "R16g16b16a16Sscaled": vulkan_const.FormatR16g16b16a16Sscaled, - "R16g16b16a16Uint": vulkan_const.FormatR16g16b16a16Uint, - "R16g16b16a16Sint": vulkan_const.FormatR16g16b16a16Sint, - "R16g16b16a16Sfloat": vulkan_const.FormatR16g16b16a16Sfloat, - "R32Uint": vulkan_const.FormatR32Uint, - "R32Sint": vulkan_const.FormatR32Sint, - "R32Sfloat": vulkan_const.FormatR32Sfloat, - "R32g32Uint": vulkan_const.FormatR32g32Uint, - "R32g32Sint": vulkan_const.FormatR32g32Sint, - "R32g32Sfloat": vulkan_const.FormatR32g32Sfloat, - "R32g32b32Uint": vulkan_const.FormatR32g32b32Uint, - "R32g32b32Sint": vulkan_const.FormatR32g32b32Sint, - "R32g32b32Sfloat": vulkan_const.FormatR32g32b32Sfloat, - "R32g32b32a32Uint": vulkan_const.FormatR32g32b32a32Uint, - "R32g32b32a32Sint": vulkan_const.FormatR32g32b32a32Sint, - "R32g32b32a32Sfloat": vulkan_const.FormatR32g32b32a32Sfloat, - "R64Uint": vulkan_const.FormatR64Uint, - "R64Sint": vulkan_const.FormatR64Sint, - "R64Sfloat": vulkan_const.FormatR64Sfloat, - "R64g64Uint": vulkan_const.FormatR64g64Uint, - "R64g64Sint": vulkan_const.FormatR64g64Sint, - "R64g64Sfloat": vulkan_const.FormatR64g64Sfloat, - "R64g64b64Uint": vulkan_const.FormatR64g64b64Uint, - "R64g64b64Sint": vulkan_const.FormatR64g64b64Sint, - "R64g64b64Sfloat": vulkan_const.FormatR64g64b64Sfloat, - "R64g64b64a64Uint": vulkan_const.FormatR64g64b64a64Uint, - "R64g64b64a64Sint": vulkan_const.FormatR64g64b64a64Sint, - "R64g64b64a64Sfloat": vulkan_const.FormatR64g64b64a64Sfloat, - "B10g11r11UfloatPack32": vulkan_const.FormatB10g11r11UfloatPack32, - "E5b9g9r9UfloatPack32": vulkan_const.FormatE5b9g9r9UfloatPack32, - "D16Unorm": vulkan_const.FormatD16Unorm, - "X8D24UnormPack32": vulkan_const.FormatX8D24UnormPack32, - "D32Sfloat": vulkan_const.FormatD32Sfloat, - "S8Uint": vulkan_const.FormatS8Uint, - "D16UnormS8Uint": vulkan_const.FormatD16UnormS8Uint, - "D24UnormS8Uint": vulkan_const.FormatD24UnormS8Uint, - "D32SfloatS8Uint": vulkan_const.FormatD32SfloatS8Uint, - "Bc1RgbUnormBlock": vulkan_const.FormatBc1RgbUnormBlock, - "Bc1RgbSrgbBlock": vulkan_const.FormatBc1RgbSrgbBlock, - "Bc1RgbaUnormBlock": vulkan_const.FormatBc1RgbaUnormBlock, - "Bc1RgbaSrgbBlock": vulkan_const.FormatBc1RgbaSrgbBlock, - "Bc2UnormBlock": vulkan_const.FormatBc2UnormBlock, - "Bc2SrgbBlock": vulkan_const.FormatBc2SrgbBlock, - "Bc3UnormBlock": vulkan_const.FormatBc3UnormBlock, - "Bc3SrgbBlock": vulkan_const.FormatBc3SrgbBlock, - "Bc4UnormBlock": vulkan_const.FormatBc4UnormBlock, - "Bc4SnormBlock": vulkan_const.FormatBc4SnormBlock, - "Bc5UnormBlock": vulkan_const.FormatBc5UnormBlock, - "Bc5SnormBlock": vulkan_const.FormatBc5SnormBlock, - "Bc6hUfloatBlock": vulkan_const.FormatBc6hUfloatBlock, - "Bc6hSfloatBlock": vulkan_const.FormatBc6hSfloatBlock, - "Bc7UnormBlock": vulkan_const.FormatBc7UnormBlock, - "Bc7SrgbBlock": vulkan_const.FormatBc7SrgbBlock, - "Etc2R8g8b8UnormBlock": vulkan_const.FormatEtc2R8g8b8UnormBlock, - "Etc2R8g8b8SrgbBlock": vulkan_const.FormatEtc2R8g8b8SrgbBlock, - "Etc2R8g8b8a1UnormBlock": vulkan_const.FormatEtc2R8g8b8a1UnormBlock, - "Etc2R8g8b8a1SrgbBlock": vulkan_const.FormatEtc2R8g8b8a1SrgbBlock, - "Etc2R8g8b8a8UnormBlock": vulkan_const.FormatEtc2R8g8b8a8UnormBlock, - "Etc2R8g8b8a8SrgbBlock": vulkan_const.FormatEtc2R8g8b8a8SrgbBlock, - "EacR11UnormBlock": vulkan_const.FormatEacR11UnormBlock, - "EacR11SnormBlock": vulkan_const.FormatEacR11SnormBlock, - "EacR11g11UnormBlock": vulkan_const.FormatEacR11g11UnormBlock, - "EacR11g11SnormBlock": vulkan_const.FormatEacR11g11SnormBlock, - "Astc4x4UnormBlock": vulkan_const.FormatAstc4x4UnormBlock, - "Astc4x4SrgbBlock": vulkan_const.FormatAstc4x4SrgbBlock, - "Astc5x4UnormBlock": vulkan_const.FormatAstc5x4UnormBlock, - "Astc5x4SrgbBlock": vulkan_const.FormatAstc5x4SrgbBlock, - "Astc5x5UnormBlock": vulkan_const.FormatAstc5x5UnormBlock, - "Astc5x5SrgbBlock": vulkan_const.FormatAstc5x5SrgbBlock, - "Astc6x5UnormBlock": vulkan_const.FormatAstc6x5UnormBlock, - "Astc6x5SrgbBlock": vulkan_const.FormatAstc6x5SrgbBlock, - "Astc6x6UnormBlock": vulkan_const.FormatAstc6x6UnormBlock, - "Astc6x6SrgbBlock": vulkan_const.FormatAstc6x6SrgbBlock, - "Astc8x5UnormBlock": vulkan_const.FormatAstc8x5UnormBlock, - "Astc8x5SrgbBlock": vulkan_const.FormatAstc8x5SrgbBlock, - "Astc8x6UnormBlock": vulkan_const.FormatAstc8x6UnormBlock, - "Astc8x6SrgbBlock": vulkan_const.FormatAstc8x6SrgbBlock, - "Astc8x8UnormBlock": vulkan_const.FormatAstc8x8UnormBlock, - "Astc8x8SrgbBlock": vulkan_const.FormatAstc8x8SrgbBlock, - "Astc10x5UnormBlock": vulkan_const.FormatAstc10x5UnormBlock, - "Astc10x5SrgbBlock": vulkan_const.FormatAstc10x5SrgbBlock, - "Astc10x6UnormBlock": vulkan_const.FormatAstc10x6UnormBlock, - "Astc10x6SrgbBlock": vulkan_const.FormatAstc10x6SrgbBlock, - "Astc10x8UnormBlock": vulkan_const.FormatAstc10x8UnormBlock, - "Astc10x8SrgbBlock": vulkan_const.FormatAstc10x8SrgbBlock, - "Astc10x10UnormBlock": vulkan_const.FormatAstc10x10UnormBlock, - "Astc10x10SrgbBlock": vulkan_const.FormatAstc10x10SrgbBlock, - "Astc12x10UnormBlock": vulkan_const.FormatAstc12x10UnormBlock, - "Astc12x10SrgbBlock": vulkan_const.FormatAstc12x10SrgbBlock, - "Astc12x12UnormBlock": vulkan_const.FormatAstc12x12UnormBlock, - "Astc12x12SrgbBlock": vulkan_const.FormatAstc12x12SrgbBlock, - "G8b8g8r8422Unorm": vulkan_const.FormatG8b8g8r8422Unorm, - "B8g8r8g8422Unorm": vulkan_const.FormatB8g8r8g8422Unorm, - "G8B8R83plane420Unorm": vulkan_const.FormatG8B8R83plane420Unorm, - "G8B8r82plane420Unorm": vulkan_const.FormatG8B8r82plane420Unorm, - "G8B8R83plane422Unorm": vulkan_const.FormatG8B8R83plane422Unorm, - "G8B8r82plane422Unorm": vulkan_const.FormatG8B8r82plane422Unorm, - "G8B8R83plane444Unorm": vulkan_const.FormatG8B8R83plane444Unorm, - "R10x6UnormPack16": vulkan_const.FormatR10x6UnormPack16, - "R10x6g10x6Unorm2pack16": vulkan_const.FormatR10x6g10x6Unorm2pack16, - "R10x6g10x6b10x6a10x6Unorm4pack16": vulkan_const.FormatR10x6g10x6b10x6a10x6Unorm4pack16, - "G10x6b10x6g10x6r10x6422Unorm4pack16": vulkan_const.FormatG10x6b10x6g10x6r10x6422Unorm4pack16, - "B10x6g10x6r10x6g10x6422Unorm4pack16": vulkan_const.FormatB10x6g10x6r10x6g10x6422Unorm4pack16, - "G10x6B10x6R10x63plane420Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane420Unorm3pack16, - "G10x6B10x6r10x62plane420Unorm3pack16": vulkan_const.FormatG10x6B10x6r10x62plane420Unorm3pack16, - "G10x6B10x6R10x63plane422Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane422Unorm3pack16, - "G10x6B10x6r10x62plane422Unorm3pack16": vulkan_const.FormatG10x6B10x6r10x62plane422Unorm3pack16, - "G10x6B10x6R10x63plane444Unorm3pack16": vulkan_const.FormatG10x6B10x6R10x63plane444Unorm3pack16, - "R12x4UnormPack16": vulkan_const.FormatR12x4UnormPack16, - "R12x4g12x4Unorm2pack16": vulkan_const.FormatR12x4g12x4Unorm2pack16, - "R12x4g12x4b12x4a12x4Unorm4pack16": vulkan_const.FormatR12x4g12x4b12x4a12x4Unorm4pack16, - "G12x4b12x4g12x4r12x4422Unorm4pack16": vulkan_const.FormatG12x4b12x4g12x4r12x4422Unorm4pack16, - "B12x4g12x4r12x4g12x4422Unorm4pack16": vulkan_const.FormatB12x4g12x4r12x4g12x4422Unorm4pack16, - "G12x4B12x4R12x43plane420Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane420Unorm3pack16, - "G12x4B12x4r12x42plane420Unorm3pack16": vulkan_const.FormatG12x4B12x4r12x42plane420Unorm3pack16, - "G12x4B12x4R12x43plane422Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane422Unorm3pack16, - "G12x4B12x4r12x42plane422Unorm3pack16": vulkan_const.FormatG12x4B12x4r12x42plane422Unorm3pack16, - "G12x4B12x4R12x43plane444Unorm3pack16": vulkan_const.FormatG12x4B12x4R12x43plane444Unorm3pack16, - "G16b16g16r16422Unorm": vulkan_const.FormatG16b16g16r16422Unorm, - "B16g16r16g16422Unorm": vulkan_const.FormatB16g16r16g16422Unorm, - "G16B16R163plane420Unorm": vulkan_const.FormatG16B16R163plane420Unorm, - "G16B16r162plane420Unorm": vulkan_const.FormatG16B16r162plane420Unorm, - "G16B16R163plane422Unorm": vulkan_const.FormatG16B16R163plane422Unorm, - "G16B16r162plane422Unorm": vulkan_const.FormatG16B16r162plane422Unorm, - "G16B16R163plane444Unorm": vulkan_const.FormatG16B16R163plane444Unorm, - "Pvrtc12bppUnormBlockImg": vulkan_const.FormatPvrtc12bppUnormBlockImg, - "Pvrtc14bppUnormBlockImg": vulkan_const.FormatPvrtc14bppUnormBlockImg, - "Pvrtc22bppUnormBlockImg": vulkan_const.FormatPvrtc22bppUnormBlockImg, - "Pvrtc24bppUnormBlockImg": vulkan_const.FormatPvrtc24bppUnormBlockImg, - "Pvrtc12bppSrgbBlockImg": vulkan_const.FormatPvrtc12bppSrgbBlockImg, - "Pvrtc14bppSrgbBlockImg": vulkan_const.FormatPvrtc14bppSrgbBlockImg, - "Pvrtc22bppSrgbBlockImg": vulkan_const.FormatPvrtc22bppSrgbBlockImg, - "Pvrtc24bppSrgbBlockImg": vulkan_const.FormatPvrtc24bppSrgbBlockImg, -} -StringVkBlendFactor = map[string]vulkan_const.BlendFactor{ - "Zero": vulkan_const.BlendFactorZero, - "One": vulkan_const.BlendFactorOne, - "SrcColor": vulkan_const.BlendFactorSrcColor, - "SrcAlpha": vulkan_const.BlendFactorSrcAlpha, - "OneMinusSrcColor": vulkan_const.BlendFactorOneMinusSrcColor, - "DstColor": vulkan_const.BlendFactorDstColor, - "OneMinusDstColor": vulkan_const.BlendFactorOneMinusDstColor, - "OneMinusSrcAlpha": vulkan_const.BlendFactorOneMinusSrcAlpha, - "DstAlpha": vulkan_const.BlendFactorDstAlpha, - "OneMinusDstAlpha": vulkan_const.BlendFactorOneMinusDstAlpha, - "ConstantColor": vulkan_const.BlendFactorConstantColor, - "OneMinusConstantColor": vulkan_const.BlendFactorOneMinusConstantColor, - "ConstantAlpha": vulkan_const.BlendFactorConstantAlpha, - "OneMinusConstantAlpha": vulkan_const.BlendFactorOneMinusConstantAlpha, - "SrcAlphaSaturate": vulkan_const.BlendFactorSrcAlphaSaturate, - "Src1Color": vulkan_const.BlendFactorSrc1Color, - "OneMinusSrc1Color": vulkan_const.BlendFactorOneMinusSrc1Color, - "Src1Alpha": vulkan_const.BlendFactorSrc1Alpha, - "OneMinusSrc1Alpha": vulkan_const.BlendFactorOneMinusSrc1Alpha, -} -StringVkBlendOp = map[string]vulkan_const.BlendOp{ - "Add": vulkan_const.BlendOpAdd, - "Subtract": vulkan_const.BlendOpSubtract, - "ReverseSubtract": vulkan_const.BlendOpReverseSubtract, - "Min": vulkan_const.BlendOpMin, - "Max": vulkan_const.BlendOpMax, - "Zero": vulkan_const.BlendOpZero, - "Src": vulkan_const.BlendOpSrc, - "Dst": vulkan_const.BlendOpDst, - "SrcOver": vulkan_const.BlendOpSrcOver, - "DstOver": vulkan_const.BlendOpDstOver, - "SrcIn": vulkan_const.BlendOpSrcIn, - "DstIn": vulkan_const.BlendOpDstIn, - "SrcOut": vulkan_const.BlendOpSrcOut, - "DstOut": vulkan_const.BlendOpDstOut, - "SrcAtop": vulkan_const.BlendOpSrcAtop, - "DstAtop": vulkan_const.BlendOpDstAtop, - "Xor": vulkan_const.BlendOpXor, - "Multiply": vulkan_const.BlendOpMultiply, - "Screen": vulkan_const.BlendOpScreen, - "Overlay": vulkan_const.BlendOpOverlay, - "Darken": vulkan_const.BlendOpDarken, - "Lighten": vulkan_const.BlendOpLighten, - "Colordodge": vulkan_const.BlendOpColordodge, - "Colorburn": vulkan_const.BlendOpColorburn, - "Hardlight": vulkan_const.BlendOpHardlight, - "Softlight": vulkan_const.BlendOpSoftlight, - "Difference": vulkan_const.BlendOpDifference, - "Exclusion": vulkan_const.BlendOpExclusion, - "Invert": vulkan_const.BlendOpInvert, - "InvertRgb": vulkan_const.BlendOpInvertRgb, - "Lineardodge": vulkan_const.BlendOpLineardodge, - "Linearburn": vulkan_const.BlendOpLinearburn, - "Vividlight": vulkan_const.BlendOpVividlight, - "Linearlight": vulkan_const.BlendOpLinearlight, - "Pinlight": vulkan_const.BlendOpPinlight, - "Hardmix": vulkan_const.BlendOpHardmix, - "HslHue": vulkan_const.BlendOpHslHue, - "HslSaturation": vulkan_const.BlendOpHslSaturation, - "HslColor": vulkan_const.BlendOpHslColor, - "HslLuminosity": vulkan_const.BlendOpHslLuminosity, - "Plus": vulkan_const.BlendOpPlus, - "PlusClamped": vulkan_const.BlendOpPlusClamped, - "PlusClampedAlpha": vulkan_const.BlendOpPlusClampedAlpha, - "PlusDarker": vulkan_const.BlendOpPlusDarker, - "Minus": vulkan_const.BlendOpMinus, - "MinusClamped": vulkan_const.BlendOpMinusClamped, - "Contrast": vulkan_const.BlendOpContrast, - "InvertOvg": vulkan_const.BlendOpInvertOvg, - "Red": vulkan_const.BlendOpRed, - "Green": vulkan_const.BlendOpBlue, - "Blue": vulkan_const.BlendOpBlue, -} -StringVkLogicOp = map[string]vulkan_const.LogicOp{ - "Clear": vulkan_const.LogicOpClear, - "And": vulkan_const.LogicOpAnd, - "AndReverse": vulkan_const.LogicOpAndReverse, - "Copy": vulkan_const.LogicOpCopy, - "AndInverted": vulkan_const.LogicOpAndInverted, - "NoOp": vulkan_const.LogicOpNoOp, - "Xor": vulkan_const.LogicOpXor, - "Or": vulkan_const.LogicOpOr, - "Nor": vulkan_const.LogicOpNor, - "Equivalent": vulkan_const.LogicOpEquivalent, - "Invert": vulkan_const.LogicOpInvert, - "OrReverse": vulkan_const.LogicOpOrReverse, - "CopyInverted": vulkan_const.LogicOpCopyInverted, - "OrInverted": vulkan_const.LogicOpOrInverted, - "Nand": vulkan_const.LogicOpNand, - "Set": vulkan_const.LogicOpSet, -} -StringVkCompareOp = map[string]vulkan_const.CompareOp{ - "Never": vulkan_const.CompareOpNever, - "Equal": vulkan_const.CompareOpEqual, - "LessOrEqual": vulkan_const.CompareOpLessOrEqual, - "Greater": vulkan_const.CompareOpGreater, - "NotEqual": vulkan_const.CompareOpNotEqual, - "GreaterOrEqual": vulkan_const.CompareOpGreaterOrEqual, - "Always": vulkan_const.CompareOpAlways, - "Less": vulkan_const.CompareOpLess, -} -StringVkStencilOp = map[string]vulkan_const.StencilOp{ - "Zero": vulkan_const.StencilOpZero, - "Replace": vulkan_const.StencilOpReplace, - "IncrementAndClamp": vulkan_const.StencilOpIncrementAndClamp, - "DecrementAndClamp": vulkan_const.StencilOpDecrementAndClamp, - "Invert": vulkan_const.StencilOpInvert, - "IncrementAndWrap": vulkan_const.StencilOpIncrementAndWrap, - "DecrementAndWrap": vulkan_const.StencilOpDecrementAndWrap, - "Keep": vulkan_const.StencilOpKeep, -} -StringVkPrimitiveTopology = map[string]vulkan_const.PrimitiveTopology{ - "Points": vulkan_const.PrimitiveTopologyPointList, - "Lines": vulkan_const.PrimitiveTopologyLineList, - "Triangles": vulkan_const.PrimitiveTopologyTriangleList, - "Patches": vulkan_const.PrimitiveTopologyPatchList, -} -StringVkPolygonMode = map[string]vulkan_const.PolygonMode{ - "Point": vulkan_const.PolygonModePoint, - "Line": vulkan_const.PolygonModeLine, - "Fill": vulkan_const.PolygonModeFill, -} -StringVkCullModeFlagBits = map[string]vulkan_const.CullModeFlagBits{ - "None": vulkan_const.CullModeNone, - "Front": vulkan_const.CullModeFrontBit, - "Back": vulkan_const.CullModeBackBit, -} -StringVkFrontFace = map[string]vulkan_const.FrontFace{ - "Clockwise": vulkan_const.FrontFaceClockwise, - "CounterClockwise": vulkan_const.FrontFaceCounterClockwise, -} -StringVkSampleCountFlagBits = map[string]GPUSampleCountFlags{ - swapChainSampleCountKey: GPUSampleSwapChainCount, - "1Bit": GPUSampleCount1Bit, - "2Bit": GPUSampleCount2Bit, - "4Bit": GPUSampleCount4Bit, - "8Bit": GPUSampleCount8Bit, - "16Bit": GPUSampleCount16Bit, - "32Bit": GPUSampleCount32Bit, - "64Bit": GPUSampleCount64Bit, -} -StringVkPatchControlPoints = map[string]uint32{ - "Lines": 2, - "Triangles": 3, - "Quads": 4, -} -StringVkAttachmentLoadOp = map[string]GPUAttachmentLoadOp{ - "Load": GPUAttachmentLoadOpLoad, - "Clear": GPUAttachmentLoadOpClear, - "DontCare": GPUAttachmentLoadOpDontCare, -} -StringVkAttachmentStoreOp = map[string]GPUAttachmentStoreOp{ - "Store": GPUAttachmentStoreOpStore, - "DontCare": GPUAttachmentStoreOpDontCare, -} -StringVkImageLayout = map[string]GPUImageLayout{ - "Undefined": GPUImageLayoutUndefined, - "General": GPUImageLayoutGeneral, - "ColorAttachmentOptimal": GPUImageLayoutColorAttachmentOptimal, - "DepthStencilAttachmentOptimal": GPUImageLayoutDepthStencilAttachmentOptimal, - "DepthStencilReadOnlyOptimal": GPUImageLayoutDepthStencilReadOnlyOptimal, - "ShaderReadOnlyOptimal": GPUImageLayoutShaderReadOnlyOptimal, - "TransferSrcOptimal": GPUImageLayoutTransferSrcOptimal, - "TransferDstOptimal": GPUImageLayoutTransferDstOptimal, - "Preinitialized": GPUImageLayoutPreinitialized, - "DepthReadOnlyStencilAttachmentOptimal": GPUImageLayoutDepthReadOnlyStencilAttachmentOptimal, - "DepthAttachmentStencilReadOnlyOptimal": GPUImageLayoutDepthAttachmentStencilReadOnlyOptimal, - "PresentSrc": GPUImageLayoutPresentSrc, - "SharedPresent": GPUImageLayoutSharedPresent, - "ShadingRateOptimalNv": GPUImageLayoutShadingRateOptimalNv, -} -StringVkPipelineStageFlagBits = map[string]vulkan_const.PipelineStageFlagBits{ - "TopOfPipeBit": vulkan_const.PipelineStageTopOfPipeBit, - "DrawIndirectBit": vulkan_const.PipelineStageDrawIndirectBit, - "VertexInputBit": vulkan_const.PipelineStageVertexInputBit, - "VertexShaderBit": vulkan_const.PipelineStageVertexShaderBit, - "TessellationControlShaderBit": vulkan_const.PipelineStageTessellationControlShaderBit, - "TessellationEvaluationShaderBit": vulkan_const.PipelineStageTessellationEvaluationShaderBit, - "GeometryShaderBit": vulkan_const.PipelineStageGeometryShaderBit, - "FragmentShaderBit": vulkan_const.PipelineStageFragmentShaderBit, - "EarlyFragmentTestsBit": vulkan_const.PipelineStageEarlyFragmentTestsBit, - "LateFragmentTestsBit": vulkan_const.PipelineStageLateFragmentTestsBit, - "ColorAttachmentOutputBit": vulkan_const.PipelineStageColorAttachmentOutputBit, - "ComputeShaderBit": vulkan_const.PipelineStageComputeShaderBit, - "TransferBit": vulkan_const.PipelineStageTransferBit, - "BottomOfPipeBit": vulkan_const.PipelineStageBottomOfPipeBit, - "HostBit": vulkan_const.PipelineStageHostBit, - "AllGraphicsBit": vulkan_const.PipelineStageAllGraphicsBit, - "AllCommandsBit": vulkan_const.PipelineStageAllCommandsBit, - "TransformFeedbackBit": vulkan_const.PipelineStageTransformFeedbackBit, - "ConditionalRenderingBit": vulkan_const.PipelineStageConditionalRenderingBit, - "CommandProcessBitNvx": vulkan_const.PipelineStageCommandProcessBitNvx, - "ShadingRateImageBitNv": vulkan_const.PipelineStageShadingRateImageBitNv, - "RaytracingBitNvx": vulkan_const.PipelineStageRaytracingBitNvx, - "TaskShaderBitNv": vulkan_const.PipelineStageTaskShaderBitNv, - "MeshShaderBitNv": vulkan_const.PipelineStageMeshShaderBitNv, -} -StringVkAccessFlagBits = map[string]GPUAccessFlags{ - "IndirectCommandReadBit": GPUAccessIndirectCommandReadBit, - "IndexReadBit": GPUAccessIndexReadBit, - "VertexAttributeReadBit": GPUAccessVertexAttributeReadBit, - "UniformReadBit": GPUAccessUniformReadBit, - "InputAttachmentReadBit": GPUAccessInputAttachmentReadBit, - "ShaderReadBit": GPUAccessShaderReadBit, - "ShaderWriteBit": GPUAccessShaderWriteBit, - "ColorAttachmentReadBit": GPUAccessColorAttachmentReadBit, - "ColorAttachmentWriteBit": GPUAccessColorAttachmentWriteBit, - "DepthStencilAttachmentReadBit": GPUAccessDepthStencilAttachmentReadBit, - "DepthStencilAttachmentWriteBit": GPUAccessDepthStencilAttachmentWriteBit, - "TransferReadBit": GPUAccessTransferReadBit, - "TransferWriteBit": GPUAccessTransferWriteBit, - "HostReadBit": GPUAccessHostReadBit, - "HostWriteBit": GPUAccessHostWriteBit, - "MemoryReadBit": GPUAccessMemoryReadBit, - "MemoryWriteBit": GPUAccessMemoryWriteBit, - "TransformFeedbackWriteBit": GPUAccessTransformFeedbackWriteBit, - "TransformFeedbackCounterReadBit": GPUAccessTransformFeedbackCounterReadBit, - "TransformFeedbackCounterWriteBit": GPUAccessTransformFeedbackCounterWriteBit, - "ConditionalRenderingReadBit": GPUAccessConditionalRenderingReadBit, - "CommandProcessReadBitNvx": GPUAccessCommandProcessReadBitNvx, - "CommandProcessWriteBitNvx": GPUAccessCommandProcessWriteBitNvx, - "ColorAttachmentReadNoncoherentBit": GPUAccessColorAttachmentReadNoncoherentBit, - "ShadingRateImageReadBitNv": GPUAccessShadingRateImageReadBitNv, - "AccelerationStructureReadBitNvx": GPUAccessAccelerationStructureReadBitNvx, - "AccelerationStructureWriteBitNvx": GPUAccessAccelerationStructureWriteBitNvx, -} -StringVkShaderStageFlagBits = map[string]vulkan_const.ShaderStageFlagBits{ - "VertexBit": vulkan_const.ShaderStageVertexBit, - "TessellationControlBit": vulkan_const.ShaderStageTessellationControlBit, - "TessellationEvaluationBit": vulkan_const.ShaderStageTessellationEvaluationBit, - "GeometryBit": vulkan_const.ShaderStageGeometryBit, - "FragmentBit": vulkan_const.ShaderStageFragmentBit, - "ComputeBit": vulkan_const.ShaderStageComputeBit, - "AllGraphics": vulkan_const.ShaderStageAllGraphics, - "All": vulkan_const.ShaderStageAll, - "RaygenBitNvx": vulkan_const.ShaderStageRaygenBitNvx, - "AnyHitBitNvx": vulkan_const.ShaderStageAnyHitBitNvx, - "ClosestHitBitNvx": vulkan_const.ShaderStageClosestHitBitNvx, - "MissBitNvx": vulkan_const.ShaderStageMissBitNvx, - "IntersectionBitNvx": vulkan_const.ShaderStageIntersectionBitNvx, - "CallableBitNvx": vulkan_const.ShaderStageCallableBitNvx, - "TaskBitNv": vulkan_const.ShaderStageTaskBitNv, - "MeshBitNv": vulkan_const.ShaderStageMeshBitNv, - "FlagBitsMaxEnum": vulkan_const.ShaderStageFlagBitsMaxEnum, -} -StringVkPipelineBindPoint = map[string]vulkan_const.PipelineBindPoint{ - "Graphics": vulkan_const.PipelineBindPointGraphics, - "Compute": vulkan_const.PipelineBindPointCompute, - "RaytracingNvx": vulkan_const.PipelineBindPointRaytracingNvx, -} -StringVkDependencyFlagBits = map[string]vulkan_const.DependencyFlagBits{ - "ByRegionBit": vulkan_const.DependencyByRegionBit, - "DeviceGroupBit": vulkan_const.DependencyDeviceGroupBit, - "ViewLocalBit": vulkan_const.DependencyViewLocalBit, -} -StringVkColorComponentFlagBits = map[string]vulkan_const.ColorComponentFlagBits{ - "R": vulkan_const.ColorComponentRBit, - "G": vulkan_const.ColorComponentGBit, - "B": vulkan_const.ColorComponentBBit, - "A": vulkan_const.ColorComponentABit, -} -StringVkPipelineCreateFlagBits = map[string]vulkan_const.PipelineCreateFlagBits{ - "DisableOptimizationBit": vulkan_const.PipelineCreateDisableOptimizationBit, - "AllowDerivativesBit": vulkan_const.PipelineCreateAllowDerivativesBit, - "DerivativeBit": vulkan_const.PipelineCreateDerivativeBit, - "ViewIndexFromDeviceIndexBit": vulkan_const.PipelineCreateViewIndexFromDeviceIndexBit, - "DispatchBase": vulkan_const.PipelineCreateDispatchBase, - "DeferCompileBitNvx": vulkan_const.PipelineCreateDeferCompileBitNvx, -} -StringVkImageTiling = map[string]GPUImageTiling{ - "Optimal": GPUImageTilingOptimal, - "Linear": GPUImageTilingLinear, - "DrmFormatModifier": GPUImageTilingDrmFormatModifier, + + + +### func \(\*CommandRecorder\) [Destroy]() + +```go +func (c *CommandRecorder) Destroy(device *GPUDevice) +``` + + + + +### func \(\*CommandRecorder\) [End]() + +```go +func (c *CommandRecorder) End() +``` + + + + +### func \(\*CommandRecorder\) [Reset]() + +```go +func (c *CommandRecorder) Reset() +``` + + + + +## type [CommandRecorderSecondary]() + + + +```go +type CommandRecorderSecondary struct { + CommandRecorder + // contains filtered or unexported fields } -StringVkFilter = map[string]GPUFilter{ - "Nearest": GPUFilterNearest, - "Linear": GPUFilterLinear, - "CubicImg": GPUFilterCubicImg, +``` + + +### func [NewCommandRecorderSecondary]() + +```go +func NewCommandRecorderSecondary(device *GPUDevice, rp *RenderPass, subpassIdx int) (CommandRecorderSecondary, error) +``` + + + + +### func \(\*CommandRecorderSecondary\) [Begin]() + +```go +func (c *CommandRecorderSecondary) Begin(viewport vk.Viewport, scissor vk.Rect2D) +``` + + + + +## type [ComputeShaderBuffer]() + + + +```go +type ComputeShaderBuffer struct { + ShaderBuffer + Shader *Shader + // contains filtered or unexported fields } -StringVkImageUsageFlagBits = map[string]GPUImageUsageFlags{ - "TransferSrcBit": GPUImageUsageTransferSrcBit, - "TransferDstBit": GPUImageUsageTransferDstBit, - "SampledBit": GPUImageUsageSampledBit, - "StorageBit": GPUImageUsageStorageBit, - "ColorAttachmentBit": GPUImageUsageColorAttachmentBit, - "DepthStencilAttachmentBit": GPUImageUsageDepthStencilAttachmentBit, - "TransientAttachmentBit": GPUImageUsageTransientAttachmentBit, - "InputAttachmentBit": GPUImageUsageInputAttachmentBit, - "ShadingRateImageBitNv": GPUImageUsageShadingRateImageBitNv, +``` + + +### func \(\*ComputeShaderBuffer\) [Initialize]() + +```go +func (b *ComputeShaderBuffer) Initialize(device *GPUDevice, size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags) error +``` + + + + +### func \(\*ComputeShaderBuffer\) [WriteDescriptors]() + +```go +func (b *ComputeShaderBuffer) WriteDescriptors(device *GPUDevice) +``` + + + + +## type [ComputeTask]() + + + +```go +type ComputeTask struct { + Shader *Shader + DescriptorSets []GPUDescriptorSet + WorkGroups [3]uint32 } -StringVkMemoryPropertyFlagBits = map[string]GPUMemoryPropertyFlags{ - "DeviceLocalBit": GPUMemoryPropertyDeviceLocalBit, - "HostVisibleBit": GPUMemoryPropertyHostVisibleBit, - "HostCoherentBit": GPUMemoryPropertyHostCoherentBit, - "HostCachedBit": GPUMemoryPropertyHostCachedBit, - "LazilyAllocatedBit": GPUMemoryPropertyLazilyAllocatedBit, - "ProtectedBit": GPUMemoryPropertyProtectedBit, +``` + + +## type [DescriptorSetLayoutStructure]() + + + +```go +type DescriptorSetLayoutStructure struct { + Types []DescriptorSetLayoutStructureType } -StringVkImageAspectFlagBits = map[string]GPUImageAspectFlags{ - "ColorBit": GPUImageAspectColorBit, - "DepthBit": GPUImageAspectDepthBit, - "StencilBit": GPUImageAspectStencilBit, - "MetadataBit": GPUImageAspectMetadataBit, - "Plane0Bit": GPUImageAspectPlane0Bit, - "Plane1Bit": GPUImageAspectPlane1Bit, - "Plane2Bit": GPUImageAspectPlane2Bit, - "MemoryPlane0Bit": GPUImageAspectMemoryPlane0Bit, - "MemoryPlane1Bit": GPUImageAspectMemoryPlane1Bit, - "MemoryPlane2Bit": GPUImageAspectMemoryPlane2Bit, - "MemoryPlane3Bit": GPUImageAspectMemoryPlane3Bit, +``` + + +## type [DescriptorSetLayoutStructureType]() + + + +```go +type DescriptorSetLayoutStructureType struct { + Type vulkan_const.DescriptorType + Flags vulkan_const.ShaderStageFlagBits + Count, Binding uint32 } -StringVkMap = map[string]any{ - "StringVkFormat": StringVkFormat, - "StringVkBlendFactor": StringVkBlendFactor, - "StringVkBlendOp": StringVkBlendOp, - "StringVkLogicOp": StringVkLogicOp, - "StringVkCompareOp": StringVkCompareOp, - "StringVkStencilOp": StringVkStencilOp, - "StringVkPrimitiveTopology": StringVkPrimitiveTopology, - "StringVkPolygonMode": StringVkPolygonMode, - "StringVkCullModeFlagBits": StringVkCullModeFlagBits, - "StringVkFrontFace": StringVkFrontFace, - "StringVkSampleCountFlagBits": StringVkSampleCountFlagBits, - "StringVkPatchControlPoints": StringVkPatchControlPoints, - "StringVkAttachmentLoadOp": StringVkAttachmentLoadOp, - "StringVkAttachmentStoreOp": StringVkAttachmentStoreOp, - "StringVkImageLayout": StringVkImageLayout, - "StringVkPipelineStageFlagBits": StringVkPipelineStageFlagBits, - "StringVkAccessFlagBits": StringVkAccessFlagBits, - "StringVkPipelineBindPoint": StringVkPipelineBindPoint, - "StringVkDependencyFlagBits": StringVkDependencyFlagBits, - "StringVkColorComponentFlagBits": StringVkColorComponentFlagBits, - "StringVkPipelineCreateFlagBits": StringVkPipelineCreateFlagBits, - "StringVkImageTiling": StringVkImageTiling, - "StringVkFilter": StringVkFilter, - "StringVkImageUsageFlagBits": StringVkImageUsageFlagBits, - "StringVkMemoryPropertyFlagBits": StringVkMemoryPropertyFlagBits, - "StringVkImageAspectFlagBits": StringVkImageAspectFlagBits, +``` + + +## type [DrawInstance]() + + + +```go +type DrawInstance interface { + Base() *ShaderDataBase + SkinningHeader() *SkinnedShaderDataHeader + Destroy() + IsDestroyed() bool + Activate() + Deactivate() + IsInView() bool + Size() int + SetModel(model matrix.Mat4) + UpdateModel(viewCuller ViewCuller, container collision.AABB) + DataPointer() unsafe.Pointer + // Returns true if it should write the data, otherwise false + UpdateBoundData() bool + BoundDataPointer() unsafe.Pointer + InstanceBoundDataSize() int + + SelectLights(lights LightsForRender) + // contains filtered or unexported methods } ``` -) + +### func [ReflectDuplicateDrawInstance]() -## Functions +```go +func ReflectDuplicateDrawInstance(target DrawInstance) DrawInstance +``` -### func SetupLightMaterials(materialCache *MaterialCache) error -### func TextureKeys(textures []*Texture) []string + +## type [DrawInstanceGroup]() -### func VertexFaceNormal(verts [3]Vertex) matrix.Vec3 -## Types +```go +type DrawInstanceGroup struct { + Mesh *Mesh + InstanceDriverData + MaterialInstance *Material + Instances []DrawInstance + // contains filtered or unexported fields +} +``` -### type BoneTransform struct { + +### func [NewDrawInstanceGroup]() ```go -Id int32 -Transform matrix.Transform -Skin matrix.Mat4 +func NewDrawInstanceGroup(mesh *Mesh, dataSize int, viewCuller ViewCuller) DrawInstanceGroup ``` -} -### type CommandRecorder struct { + + +### func \(\*DrawInstanceGroup\) [AddInstance]() ```go -// Has unexported fields. +func (d *DrawInstanceGroup) AddInstance(instance DrawInstance) ``` -} -### func NewCommandRecorder(device *GPUDevice) (CommandRecorder, error) + + +### func \(\*DrawInstanceGroup\) [AlterPadding]() + +```go +func (d *DrawInstanceGroup) AlterPadding(blockSize int) +``` -### func (c *CommandRecorder) Begin() + +### func \(\*DrawInstanceGroup\) [AnyVisible]() + +```go +func (d *DrawInstanceGroup) AnyVisible() bool +``` -### func (c *CommandRecorder) Destroy(device *GPUDevice) -### func (c *CommandRecorder) End() + +### func \(\*DrawInstanceGroup\) [Clear]() +```go +func (d *DrawInstanceGroup) Clear() +``` -### func (c *CommandRecorder) Reset() -### type CommandRecorderSecondary struct { + +### func \(\*DrawInstanceGroup\) [Destroy]() ```go -CommandRecorder +func (d *DrawInstanceGroup) Destroy(device *GPUDevice) ``` + + +### func \(\*DrawInstanceGroup\) [IsEmpty]() + ```go -// Has unexported fields. +func (d *DrawInstanceGroup) IsEmpty() bool ``` -} -### func NewCommandRecorderSecondary(device *GPUDevice, rp *RenderPass, subpassIdx int) (CommandRecorderSecondary, error) + +### func \(\*DrawInstanceGroup\) [IsReady]() + +```go +func (d *DrawInstanceGroup) IsReady() bool +``` -### func (c *CommandRecorderSecondary) Begin(viewport vk.Viewport, scissor vk.Rect2D) -### type ComputeShaderBuffer struct { + +### func \(\*DrawInstanceGroup\) [TotalSize]() ```go -ShaderBuffer -Shader *Shader +func (d *DrawInstanceGroup) TotalSize() int ``` + + +### func \(\*DrawInstanceGroup\) [UpdateData]() + ```go -// Has unexported fields. +func (d *DrawInstanceGroup) UpdateData(device *GPUDevice, frame int, lights LightsForRender) ``` -} -### func (b *ComputeShaderBuffer) Initialize(device *GPUDevice, size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags) error + +### func \(\*DrawInstanceGroup\) [VisibleCount]() -### func (b *ComputeShaderBuffer) WriteDescriptors(device *GPUDevice) +```go +func (d *DrawInstanceGroup) VisibleCount() int +``` -### type ComputeTask struct { + + +### func \(\*DrawInstanceGroup\) [VisibleSize]() ```go -Shader *Shader -DescriptorSets []GPUDescriptorSet -WorkGroups [3]uint32 +func (d *DrawInstanceGroup) VisibleSize() int ``` + + + +## type [Drawing]() + +Drawing represents a renderable entity in the engine. It bundles together the material, mesh, shader instance data, transform, sorting order, and an optional view culler used during rendering. + +```go +type Drawing struct { + // Material defines the visual appearance and render pass for the drawing. + Material *Material + // Mesh contains the geometry to be rendered. + Mesh *Mesh + // ShaderData holds per‑instance data for the shader (e.g., uniforms). + ShaderData DrawInstance + // Transform specifies the transform this drawing follows. + Transform *matrix.Transform + // Sort determines the draw order within a render pass. + Sort int + // ViewCuller optionally culls the drawing based on the view frustum. + ViewCuller ViewCuller } +``` -### type DescriptorSetLayoutStructure struct { + +### func \(\*Drawing\) [IsValid]() ```go -Types []DescriptorSetLayoutStructureType +func (d *Drawing) IsValid() bool ``` +IsValid reports whether the Drawing is properly configured for rendering. A Drawing is considered valid if it has a non\-nil Material. This check is used before submitting the drawing to the render pipeline. + + +## type [Drawings]() + + + +```go +type Drawings struct { + // contains filtered or unexported fields } +``` -### type DescriptorSetLayoutStructureType struct { + +### func [NewDrawings]() ```go -Type vulkan_const.DescriptorType -Flags vulkan_const.ShaderStageFlagBits -Count, Binding uint32 +func NewDrawings() Drawings +``` + + + + +### func \(\*Drawings\) [AddDrawing]() + +```go +func (d *Drawings) AddDrawing(drawing Drawing) ``` -} -### type DrawInstance interface { + + +### func \(\*Drawings\) [AddDrawings]() ```go -Base() *ShaderDataBase -SkinningHeader() *SkinnedShaderDataHeader -Destroy() -IsDestroyed() bool -Activate() -Deactivate() -IsInView() bool -Size() int -SetModel(model matrix.Mat4) -UpdateModel(viewCuller ViewCuller, container collision.AABB) -DataPointer() unsafe.Pointer -// Returns true if it should write the data, otherwise false -UpdateBoundData() bool -BoundDataPointer() unsafe.Pointer -InstanceBoundDataSize() int +func (d *Drawings) AddDrawings(drawings []Drawing) ``` + + +### func \(\*Drawings\) [Clear]() + ```go -SelectLights(lights LightsForRender) +func (d *Drawings) Clear() ``` + + +### func \(\*Drawings\) [Destroy]() + ```go -// Has unexported methods. +func (d *Drawings) Destroy(device *GPUDevice) ``` -} -### func ReflectDuplicateDrawInstance(target DrawInstance) DrawInstance + + +### func \(\*Drawings\) [HasDrawings]() + +```go +func (d *Drawings) HasDrawings() bool +``` -### type DrawInstanceGroup struct { + + +### func \(\*Drawings\) [PreparePending]() ```go -Mesh *Mesh -InstanceDriverData -MaterialInstance *Material +func (d *Drawings) PreparePending(shadowCascades uint8) ``` + + +### func \(\*Drawings\) [Render]() + ```go -Instances []DrawInstance +func (d *Drawings) Render(device *GPUDevice, lights LightsForRender) ``` + + +## type [FontBaseline]() + + + ```go -// Has unexported fields. +type FontBaseline int ``` + +## type [FontCache]() + + + +```go +type FontCache struct { + FaceMutex sync.RWMutex + // contains filtered or unexported fields } +``` + + +### func [NewFontCache]() + +```go +func NewFontCache(device *GPUDevice, assetDb assets.Database) FontCache +``` + + + + +### func \(\*FontCache\) [Destroy]() + +```go +func (cache *FontCache) Destroy() +``` + + + + +### func \(\*FontCache\) [EMSize]() + +```go +func (cache *FontCache) EMSize(face FontFace) float32 +``` + + + + +### func \(\*FontCache\) [Init]() + +```go +func (cache *FontCache) Init(caches RenderCaches) error +``` + + -### func NewDrawInstanceGroup(mesh *Mesh, dataSize int, viewCuller ViewCuller) DrawInstanceGroup + +### func \(\*FontCache\) [LineCountWithin]() +```go +func (cache *FontCache) LineCountWithin(face FontFace, text string, scale, maxWidth float32) int +``` + + + + +### func \(\*FontCache\) [MeasureCharacter]() + +```go +func (cache *FontCache) MeasureCharacter(face string, r rune, pixelSize float32) matrix.Vec2 +``` + + + + +### func \(\*FontCache\) [MeasureString]() + +```go +func (cache *FontCache) MeasureString(face FontFace, text string, scale float32) float32 +``` + + + + +### func \(\*FontCache\) [MeasureStringWithin]() + +```go +func (cache *FontCache) MeasureStringWithin(face FontFace, text string, scale, maxWidth float32, lineHeight float32) matrix.Vec2 +``` + + + + +### func \(\*FontCache\) [PointOffsetWithin]() + +```go +func (cache *FontCache) PointOffsetWithin(face FontFace, text string, point matrix.Vec2, scale, maxWidth float32) int +``` + + + + +### func \(\*FontCache\) [PreloadFace]() + +```go +func (cache *FontCache) PreloadFace(face FontFace) +``` + + + + +### func \(\*FontCache\) [RenderMeshes]() + +```go +func (cache *FontCache) RenderMeshes(caches RenderCaches, text string, x, y, z, scale, maxWidth float32, fgColor, bgColor matrix.Color, justify FontJustify, baseline FontBaseline, rootScale matrix.Vec3, instanced, is3D bool, face FontFace, lineHeight float32, cam *cameras.Container) []Drawing +``` + + + + +### func \(\*FontCache\) [StringRectsWithinNew]() + +```go +func (cache *FontCache) StringRectsWithinNew(face FontFace, text string, scale, maxWidth float32) []matrix.Vec4 +``` + + + + +### func \(\*FontCache\) [TransparentMaterial]() + +```go +func (cache *FontCache) TransparentMaterial(target *Material) *Material +``` + + + + +## type [FontFace]() + + + +```go +type FontFace string +``` + + +### func \(FontFace\) [AsBold]() + +```go +func (f FontFace) AsBold() FontFace +``` + + + + +### func \(FontFace\) [AsExtraBold]() + +```go +func (f FontFace) AsExtraBold() FontFace +``` + + + + +### func \(FontFace\) [AsItalic]() + +```go +func (f FontFace) AsItalic() FontFace +``` + + + + +### func \(FontFace\) [AsLight]() + +```go +func (f FontFace) AsLight() FontFace +``` + + + + +### func \(FontFace\) [AsMedium]() + +```go +func (f FontFace) AsMedium() FontFace +``` + + + + +### func \(FontFace\) [AsRegular]() + +```go +func (f FontFace) AsRegular() FontFace +``` + + + + +### func \(FontFace\) [AsSemiBold]() + +```go +func (f FontFace) AsSemiBold() FontFace +``` + + + + +### func \(FontFace\) [Base]() + +```go +func (f FontFace) Base() FontFace +``` + + + + +### func \(FontFace\) [IsBold]() + +```go +func (f FontFace) IsBold() bool +``` + + + + +### func \(FontFace\) [IsExtraBold]() + +```go +func (f FontFace) IsExtraBold() bool +``` + + + + +### func \(FontFace\) [IsItalic]() + +```go +func (f FontFace) IsItalic() bool +``` + + + + +### func \(FontFace\) [RemoveBold]() + +```go +func (f FontFace) RemoveBold() FontFace +``` + + + + +### func \(FontFace\) [RemoveItalic]() + +```go +func (f FontFace) RemoveItalic() FontFace +``` + + + + +## type [FontJustify]() + + + +```go +type FontJustify int +``` + + +## type [FuncPipeline]() + + + +```go +type FuncPipeline func(device *GPUDevice, shader *Shader, shaderStages []vk.PipelineShaderStageCreateInfo) bool +``` + + +## type [GPUAccessFlags]() + + + +```go +type GPUAccessFlags uint32 +``` + + + +```go +const ( + GPUAccessIndirectCommandReadBit GPUAccessFlags = (1 << iota) + GPUAccessIndexReadBit + GPUAccessVertexAttributeReadBit + GPUAccessUniformReadBit + GPUAccessInputAttachmentReadBit + GPUAccessShaderReadBit + GPUAccessShaderWriteBit + GPUAccessColorAttachmentReadBit + GPUAccessColorAttachmentWriteBit + GPUAccessDepthStencilAttachmentReadBit + GPUAccessDepthStencilAttachmentWriteBit + GPUAccessTransferReadBit + GPUAccessTransferWriteBit + GPUAccessHostReadBit + GPUAccessHostWriteBit + GPUAccessMemoryReadBit + GPUAccessMemoryWriteBit + GPUAccessTransformFeedbackWriteBit + GPUAccessTransformFeedbackCounterReadBit + GPUAccessTransformFeedbackCounterWriteBit + GPUAccessConditionalRenderingReadBit + GPUAccessCommandProcessReadBitNvx + GPUAccessCommandProcessWriteBitNvx + GPUAccessColorAttachmentReadNoncoherentBit + GPUAccessShadingRateImageReadBitNv + GPUAccessAccelerationStructureReadBitNvx + GPUAccessAccelerationStructureWriteBitNvx +) +``` + + +## type [GPUApplication]() + + + +```go +type GPUApplication struct { + Name string + Version GPUApplicationVersion + Instances []*GPUApplicationInstance +} +``` + + +### func \(\*GPUApplication\) [ApplicationVersion]() + +```go +func (g *GPUApplication) ApplicationVersion() (major int, minor int, patch int) +``` + + + + +### func \(\*GPUApplication\) [CreateInstance]() + +```go +func (g *GPUApplication) CreateInstance(window RenderingContainer, assets assets.Database) (*GPUApplicationInstance, error) +``` + + + + +### func \(\*GPUApplication\) [Destroy]() + +```go +func (g *GPUApplication) Destroy() +``` + + + + +### func \(\*GPUApplication\) [EngineVersion]() + +```go +func (g *GPUApplication) EngineVersion() (major int, minor int, patch int) +``` + + + + +### func \(\*GPUApplication\) [FirstInstance]() + +```go +func (g *GPUApplication) FirstInstance() *GPUApplicationInstance +``` + + + + +### func \(\*GPUApplication\) [Instance]() + +```go +func (g *GPUApplication) Instance(index int) (*GPUApplicationInstance, bool) +``` + + + + +### func \(\*GPUApplication\) [IsValid]() + +```go +func (g *GPUApplication) IsValid() bool +``` + + + + +### func \(\*GPUApplication\) [Setup]() + +```go +func (g *GPUApplication) Setup(name string, version GPUApplicationVersion) +``` + + + + +## type [GPUApplicationInstance]() + + + +```go +type GPUApplicationInstance struct { + GPUInstance + Surface GPUSurface + Devices []GPUDevice + // contains filtered or unexported fields +} +``` + + +### func \(\*GPUApplicationInstance\) [Destroy]() + +```go +func (g *GPUApplicationInstance) Destroy() +``` + + + + +### func \(\*GPUApplicationInstance\) [FinalizeLogicalDeviceSetup]() + +```go +func (g *GPUApplicationInstance) FinalizeLogicalDeviceSetup() +``` + + + + +### func \(\*GPUApplicationInstance\) [Initialize]() + +```go +func (g *GPUApplicationInstance) Initialize(window RenderingContainer, app *GPUApplication, assets assets.Database) error +``` + + + + +### func \(\*GPUApplicationInstance\) [PhysicalDevice]() + +```go +func (g *GPUApplicationInstance) PhysicalDevice() *GPUPhysicalDevice +``` + + + + +### func \(\*GPUApplicationInstance\) [PrimaryDevice]() + +```go +func (g *GPUApplicationInstance) PrimaryDevice() *GPUDevice +``` + + + + +### func \(\*GPUApplicationInstance\) [SelectPhysicalDevice]() + +```go +func (g *GPUApplicationInstance) SelectPhysicalDevice(method func(options []GPUPhysicalDevice) int) error +``` + + + + +### func \(\*GPUApplicationInstance\) [SetupCaches]() + +```go +func (g *GPUApplicationInstance) SetupCaches(caches RenderCaches, width, height int32) error +``` + + + + +### func \(\*GPUApplicationInstance\) [SetupLogicalDevice]() + +```go +func (g *GPUApplicationInstance) SetupLogicalDevice(index int) error +``` + + + + +## type [GPUApplicationVersion]() + + + +```go +type GPUApplicationVersion struct { + Major int + Minor int + Patch int +} +``` + + +## type [GPUAttachmentLoadOp]() + + + +```go +type GPUAttachmentLoadOp uint8 +``` + + + +```go +const ( + GPUAttachmentLoadOpLoad GPUAttachmentLoadOp = iota + GPUAttachmentLoadOpClear + GPUAttachmentLoadOpDontCare +) +``` + + +## type [GPUAttachmentStoreOp]() + + + +```go +type GPUAttachmentStoreOp uint8 +``` + + + +```go +const ( + GPUAttachmentStoreOpStore GPUAttachmentStoreOp = iota + GPUAttachmentStoreOpDontCare +) +``` + + +## type [GPUBuffer]() + + + +```go +type GPUBuffer struct{ GPUHandle } +``` + + +## type [GPUBufferUsageFlags]() + + + +```go +type GPUBufferUsageFlags uint16 +``` + + + +```go +const ( + GPUBufferUsageTransferSrcBit GPUBufferUsageFlags = (1 << iota) + GPUBufferUsageTransferDstBit + GPUBufferUsageUniformTexelBufferBit + GPUBufferUsageStorageTexelBufferBit + GPUBufferUsageUniformBufferBit + GPUBufferUsageStorageBufferBit + GPUBufferUsageIndexBufferBit + GPUBufferUsageVertexBufferBit + GPUBufferUsageIndirectBufferBit + GPUBufferUsageTransformFeedbackBufferBit + GPUBufferUsageTransformFeedbackCounterBufferBit + GPUBufferUsageConditionalRenderingBit + GPUBufferUsageRaytracingBitNvx +) +``` + + +## type [GPUColorSpace]() + + + +```go +type GPUColorSpace int32 +``` + + + +```go +const ( + GPUColorSpaceSrgbNonlinear GPUColorSpace = iota + GPUColorSpaceDisplayP3Nonlinear + GPUColorSpaceExtendedSrgbLinear + GPUColorSpaceDciP3Linear + GPUColorSpaceDciP3Nonlinear + GPUColorSpaceBt709Linear + GPUColorSpaceBt709Nonlinear + GPUColorSpaceBt2020Linear + GPUColorSpaceHdr10St2084 + GPUColorSpaceDolbyvision + GPUColorSpaceHdr10Hlg + GPUColorSpaceAdobergbLinear + GPUColorSpaceAdobergbNonlinear + GPUColorSpacePassThrough + GPUColorSpaceExtendedSrgbNonlinear +) +``` + + +## type [GPUCompositeAlphaFlags]() + + + +```go +type GPUCompositeAlphaFlags int32 +``` + + + +```go +const ( + GPUCompositeAlphaOpaqueBit GPUCompositeAlphaFlags = (1 << iota) + GPUCompositeAlphaPreMultipliedBit + GPUCompositeAlphaPostMultipliedBit + GPUCompositeAlphaInheritBit +) +``` + + +## type [GPUDescriptorImageInfo]() + + + +```go +type GPUDescriptorImageInfo struct { + Sampler GPUSampler + ImageView GPUImageView + ImageLayout GPUImageLayout +} +``` + + +## type [GPUDescriptorPool]() + + + +```go +type GPUDescriptorPool struct{ GPUHandle } +``` + + +## type [GPUDescriptorSet]() + + + +```go +type GPUDescriptorSet struct{ GPUHandle } +``` + + +## type [GPUDescriptorSetLayout]() + + + +```go +type GPUDescriptorSetLayout struct{ GPUHandle } +``` + + +## type [GPUDevice]() + + + +```go +type GPUDevice struct { + PhysicalDevice GPUPhysicalDevice + LogicalDevice GPULogicalDevice + Painter GPUPainter + // contains filtered or unexported fields +} +``` + + +### func \(\*GPUDevice\) [BlitTargets]() + +```go +func (g *GPUDevice) BlitTargets(passes []*RenderPass) +``` + + + + +### func \(\*GPUDevice\) [CopyBuffer]() + +```go +func (g *GPUDevice) CopyBuffer(srcBuffer GPUBuffer, dstBuffer GPUBuffer, size uintptr) +``` + + + + +### func \(\*GPUDevice\) [CopyBufferToImage]() + +```go +func (g *GPUDevice) CopyBufferToImage(buffer GPUBuffer, image GPUImage, width, height uint32, layerCount int) +``` + + + + +### func \(\*GPUDevice\) [CreateBuffer]() + +```go +func (g *GPUDevice) CreateBuffer(size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags) (GPUBuffer, GPUDeviceMemory, error) +``` + + + + +### func \(\*GPUDevice\) [CreateFrameBuffer]() + +```go +func (g *GPUDevice) CreateFrameBuffer(renderPass *RenderPass, attachments []GPUImageView, width, height int32) (GPUFrameBuffer, error) +``` + + + + +### func \(\*GPUDevice\) [CreateImage]() + +```go +func (g *GPUDevice) CreateImage(id *TextureId, properties GPUMemoryPropertyFlags, req GPUImageCreateRequest) error +``` + + + + +### func \(\*GPUDevice\) [CreateIndexBuffer]() + +```go +func (g *GPUDevice) CreateIndexBuffer(indices []uint32) (GPUBuffer, GPUDeviceMemory, error) +``` + + + + +### func \(\*GPUDevice\) [CreateMesh]() + +```go +func (g *GPUDevice) CreateMesh(mesh *Mesh, verts []Vertex, indices []uint32) +``` + + + + +### func \(\*GPUDevice\) [CreateShader]() + +```go +func (g *GPUDevice) CreateShader(shader *Shader, assetDB assets.Database) error +``` + + + + +### func \(\*GPUDevice\) [CreateSwapChain]() + +```go +func (g *GPUDevice) CreateSwapChain(window RenderingContainer, inst *GPUApplicationInstance) error +``` + + + + +### func \(\*GPUDevice\) [CreateTextureSampler]() + +```go +func (g *GPUDevice) CreateTextureSampler(mipLevels uint32, filter GPUFilter) (GPUSampler, error) +``` + + + + +### func \(\*GPUDevice\) [CreateVertexBuffer]() + +```go +func (g *GPUDevice) CreateVertexBuffer(verts []Vertex) (GPUBuffer, GPUDeviceMemory, error) +``` + + + + +### func \(\*GPUDevice\) [DestroyBuffer]() + +```go +func (g *GPUDevice) DestroyBuffer(buffer GPUBuffer) +``` + + + + +### func \(\*GPUDevice\) [DestroyFrameBuffer]() + +```go +func (g *GPUDevice) DestroyFrameBuffer(frameBuffer GPUFrameBuffer) +``` + + + + +### func \(\*GPUDevice\) [DestroyShaderHandle]() + +```go +func (g *GPUDevice) DestroyShaderHandle(id ShaderId) +``` + + + + +### func \(\*GPUDevice\) [Draw]() + +```go +func (g *GPUDevice) Draw(renderPass *RenderPass, drawings []ShaderDraw, lights LightsForRender, shadows []TextureId) +``` + + + + +### func \(\*GPUDevice\) [FreeMemory]() + +```go +func (g *GPUDevice) FreeMemory(memory GPUDeviceMemory) +``` + + + + +### func \(\*GPUDevice\) [GenerateMipMaps]() + +```go +func (g *GPUDevice) GenerateMipMaps(texId *TextureId, imageFormat GPUFormat, texWidth, texHeight, mipLevels uint32, filter GPUFilter) error +``` + + + + +### func \(\*GPUDevice\) [MapMemory]() + +```go +func (g *GPUDevice) MapMemory(memory GPUDeviceMemory, offset uintptr, size uintptr, flags GPUMemoryFlags, out *unsafe.Pointer) error +``` + + + + +### func \(\*GPUDevice\) [Memcopy]() + +```go +func (g *GPUDevice) Memcopy(dst unsafe.Pointer, src []byte) int +``` + + + + +### func \(\*GPUDevice\) [MeshIsReady]() + +```go +func (g *GPUDevice) MeshIsReady(mesh Mesh) bool +``` + + + + +### func \(\*GPUDevice\) [QueueCompute]() + +```go +func (g *GPUDevice) QueueCompute(buffer *ComputeShaderBuffer) +``` + + + + +### func \(\*GPUDevice\) [ReadyFrame]() + +```go +func (g *GPUDevice) ReadyFrame(inst *GPUApplicationInstance, window RenderingContainer, camera cameras.Camera, uiCamera cameras.Camera, lights LightsForRender, runtime float32) bool +``` + + + + +### func \(\*GPUDevice\) [SetupTexture]() + +```go +func (g *GPUDevice) SetupTexture(texture *Texture, data *TextureData) error +``` + + + + +### func \(\*GPUDevice\) [SwapFrame]() + +```go +func (g *GPUDevice) SwapFrame(window RenderingContainer, inst *GPUApplicationInstance, width, height int32) bool +``` + + + + +### func \(\*GPUDevice\) [TextureRead]() + +```go +func (g *GPUDevice) TextureRead(texture *Texture) ([]byte, error) +``` + + + + +### func \(\*GPUDevice\) [TextureReadPixel]() + +```go +func (g *GPUDevice) TextureReadPixel(texture *Texture, x, y int) matrix.Color +``` + + + + +### func \(\*GPUDevice\) [TextureWritePixels]() + +```go +func (g *GPUDevice) TextureWritePixels(texture *Texture, requests []GPUImageWriteRequest) +``` + + + + +### func \(\*GPUDevice\) [TransitionImageLayout]() + +```go +func (g *GPUDevice) TransitionImageLayout(vt *TextureId, newLayout GPUImageLayout, aspectMask GPUImageAspectFlags, newAccess GPUAccessFlags, cmd *CommandRecorder) +``` + + + + +### func \(\*GPUDevice\) [UnmapMemory]() + +```go +func (g *GPUDevice) UnmapMemory(memory GPUDeviceMemory) +``` + + + + +### func \(\*GPUDevice\) [WriteBufferToImageRegion]() + +```go +func (g *GPUDevice) WriteBufferToImageRegion(image GPUImage, requests []GPUImageWriteRequest) error +``` + + + + +## type [GPUDeviceMemory]() + + + +```go +type GPUDeviceMemory struct{ GPUHandle } +``` + + +## type [GPUFence]() + + + +```go +type GPUFence struct{ GPUHandle } +``` + + +## type [GPUFilter]() + + + +```go +type GPUFilter uint8 +``` + + + +```go +const ( + GPUFilterNearest GPUFilter = iota + GPUFilterLinear + GPUFilterCubicImg +) +``` + + +## type [GPUFormat]() + + + +```go +type GPUFormat int32 +``` + + + +```go +const ( + GPUFormatUndefined GPUFormat = iota + GPUFormatR4g4UnormPack8 + GPUFormatR4g4b4a4UnormPack16 + GPUFormatB4g4r4a4UnormPack16 + GPUFormatR5g6b5UnormPack16 + GPUFormatB5g6r5UnormPack16 + GPUFormatR5g5b5a1UnormPack16 + GPUFormatB5g5r5a1UnormPack16 + GPUFormatA1r5g5b5UnormPack16 + GPUFormatR8Unorm + GPUFormatR8Snorm + GPUFormatR8Uscaled + GPUFormatR8Sscaled + GPUFormatR8Uint + GPUFormatR8Sint + GPUFormatR8Srgb + GPUFormatR8g8Unorm + GPUFormatR8g8Snorm + GPUFormatR8g8Uscaled + GPUFormatR8g8Sscaled + GPUFormatR8g8Uint + GPUFormatR8g8Sint + GPUFormatR8g8Srgb + GPUFormatR8g8b8Unorm + GPUFormatR8g8b8Snorm + GPUFormatR8g8b8Uscaled + GPUFormatR8g8b8Sscaled + GPUFormatR8g8b8Uint + GPUFormatR8g8b8Sint + GPUFormatR8g8b8Srgb + GPUFormatB8g8r8Unorm + GPUFormatB8g8r8Snorm + GPUFormatB8g8r8Uscaled + GPUFormatB8g8r8Sscaled + GPUFormatB8g8r8Uint + GPUFormatB8g8r8Sint + GPUFormatB8g8r8Srgb + GPUFormatR8g8b8a8Unorm + GPUFormatR8g8b8a8Snorm + GPUFormatR8g8b8a8Uscaled + GPUFormatR8g8b8a8Sscaled + GPUFormatR8g8b8a8Uint + GPUFormatR8g8b8a8Sint + GPUFormatR8g8b8a8Srgb + GPUFormatB8g8r8a8Unorm + GPUFormatB8g8r8a8Snorm + GPUFormatB8g8r8a8Uscaled + GPUFormatB8g8r8a8Sscaled + GPUFormatB8g8r8a8Uint + GPUFormatB8g8r8a8Sint + GPUFormatB8g8r8a8Srgb + GPUFormatA8b8g8r8UnormPack32 + GPUFormatA8b8g8r8SnormPack32 + GPUFormatA8b8g8r8UscaledPack32 + GPUFormatA8b8g8r8SscaledPack32 + GPUFormatA8b8g8r8UintPack32 + GPUFormatA8b8g8r8SintPack32 + GPUFormatA8b8g8r8SrgbPack32 + GPUFormatA2r10g10b10UnormPack32 + GPUFormatA2r10g10b10SnormPack32 + GPUFormatA2r10g10b10UscaledPack32 + GPUFormatA2r10g10b10SscaledPack32 + GPUFormatA2r10g10b10UintPack32 + GPUFormatA2r10g10b10SintPack32 + GPUFormatA2b10g10r10UnormPack32 + GPUFormatA2b10g10r10SnormPack32 + GPUFormatA2b10g10r10UscaledPack32 + GPUFormatA2b10g10r10SscaledPack32 + GPUFormatA2b10g10r10UintPack32 + GPUFormatA2b10g10r10SintPack32 + GPUFormatR16Unorm + GPUFormatR16Snorm + GPUFormatR16Uscaled + GPUFormatR16Sscaled + GPUFormatR16Uint + GPUFormatR16Sint + GPUFormatR16Sfloat + GPUFormatR16g16Unorm + GPUFormatR16g16Snorm + GPUFormatR16g16Uscaled + GPUFormatR16g16Sscaled + GPUFormatR16g16Uint + GPUFormatR16g16Sint + GPUFormatR16g16Sfloat + GPUFormatR16g16b16Unorm + GPUFormatR16g16b16Snorm + GPUFormatR16g16b16Uscaled + GPUFormatR16g16b16Sscaled + GPUFormatR16g16b16Uint + GPUFormatR16g16b16Sint + GPUFormatR16g16b16Sfloat + GPUFormatR16g16b16a16Unorm + GPUFormatR16g16b16a16Snorm + GPUFormatR16g16b16a16Uscaled + GPUFormatR16g16b16a16Sscaled + GPUFormatR16g16b16a16Uint + GPUFormatR16g16b16a16Sint + GPUFormatR16g16b16a16Sfloat + GPUFormatR32Uint + GPUFormatR32Sint + GPUFormatR32Sfloat + GPUFormatR32g32Uint + GPUFormatR32g32Sint + GPUFormatR32g32Sfloat + GPUFormatR32g32b32Uint + GPUFormatR32g32b32Sint + GPUFormatR32g32b32Sfloat + GPUFormatR32g32b32a32Uint + GPUFormatR32g32b32a32Sint + GPUFormatR32g32b32a32Sfloat + GPUFormatR64Uint + GPUFormatR64Sint + GPUFormatR64Sfloat + GPUFormatR64g64Uint + GPUFormatR64g64Sint + GPUFormatR64g64Sfloat + GPUFormatR64g64b64Uint + GPUFormatR64g64b64Sint + GPUFormatR64g64b64Sfloat + GPUFormatR64g64b64a64Uint + GPUFormatR64g64b64a64Sint + GPUFormatR64g64b64a64Sfloat + GPUFormatB10g11r11UfloatPack32 + GPUFormatE5b9g9r9UfloatPack32 + GPUFormatD16Unorm + GPUFormatX8D24UnormPack32 + GPUFormatD32Sfloat + GPUFormatS8Uint + GPUFormatD16UnormS8Uint + GPUFormatD24UnormS8Uint + GPUFormatD32SfloatS8Uint + GPUFormatBc1RgbUnormBlock + GPUFormatBc1RgbSrgbBlock + GPUFormatBc1RgbaUnormBlock + GPUFormatBc1RgbaSrgbBlock + GPUFormatBc2UnormBlock + GPUFormatBc2SrgbBlock + GPUFormatBc3UnormBlock + GPUFormatBc3SrgbBlock + GPUFormatBc4UnormBlock + GPUFormatBc4SnormBlock + GPUFormatBc5UnormBlock + GPUFormatBc5SnormBlock + GPUFormatBc6hUfloatBlock + GPUFormatBc6hSfloatBlock + GPUFormatBc7UnormBlock + GPUFormatBc7SrgbBlock + GPUFormatEtc2R8g8b8UnormBlock + GPUFormatEtc2R8g8b8SrgbBlock + GPUFormatEtc2R8g8b8a1UnormBlock + GPUFormatEtc2R8g8b8a1SrgbBlock + GPUFormatEtc2R8g8b8a8UnormBlock + GPUFormatEtc2R8g8b8a8SrgbBlock + GPUFormatEacR11UnormBlock + GPUFormatEacR11SnormBlock + GPUFormatEacR11g11UnormBlock + GPUFormatEacR11g11SnormBlock + GPUFormatAstc4x4UnormBlock + GPUFormatAstc4x4SrgbBlock + GPUFormatAstc5x4UnormBlock + GPUFormatAstc5x4SrgbBlock + GPUFormatAstc5x5UnormBlock + GPUFormatAstc5x5SrgbBlock + GPUFormatAstc6x5UnormBlock + GPUFormatAstc6x5SrgbBlock + GPUFormatAstc6x6UnormBlock + GPUFormatAstc6x6SrgbBlock + GPUFormatAstc8x5UnormBlock + GPUFormatAstc8x5SrgbBlock + GPUFormatAstc8x6UnormBlock + GPUFormatAstc8x6SrgbBlock + GPUFormatAstc8x8UnormBlock + GPUFormatAstc8x8SrgbBlock + GPUFormatAstc10x5UnormBlock + GPUFormatAstc10x5SrgbBlock + GPUFormatAstc10x6UnormBlock + GPUFormatAstc10x6SrgbBlock + GPUFormatAstc10x8UnormBlock + GPUFormatAstc10x8SrgbBlock + GPUFormatAstc10x10UnormBlock + GPUFormatAstc10x10SrgbBlock + GPUFormatAstc12x10UnormBlock + GPUFormatAstc12x10SrgbBlock + GPUFormatAstc12x12UnormBlock + GPUFormatAstc12x12SrgbBlock + GPUFormatG8b8g8r8422Unorm + GPUFormatB8g8r8g8422Unorm + GPUFormatG8B8R83plane420Unorm + GPUFormatG8B8r82plane420Unorm + GPUFormatG8B8R83plane422Unorm + GPUFormatG8B8r82plane422Unorm + GPUFormatG8B8R83plane444Unorm + GPUFormatR10x6UnormPack16 + GPUFormatR10x6g10x6Unorm2pack16 + GPUFormatR10x6g10x6b10x6a10x6Unorm4pack16 + GPUFormatG10x6b10x6g10x6r10x6422Unorm4pack16 + GPUFormatB10x6g10x6r10x6g10x6422Unorm4pack16 + GPUFormatG10x6B10x6R10x63plane420Unorm3pack16 + GPUFormatG10x6B10x6r10x62plane420Unorm3pack16 + GPUFormatG10x6B10x6R10x63plane422Unorm3pack16 + GPUFormatG10x6B10x6r10x62plane422Unorm3pack16 + GPUFormatG10x6B10x6R10x63plane444Unorm3pack16 + GPUFormatR12x4UnormPack16 + GPUFormatR12x4g12x4Unorm2pack16 + GPUFormatR12x4g12x4b12x4a12x4Unorm4pack16 + GPUFormatG12x4b12x4g12x4r12x4422Unorm4pack16 + GPUFormatB12x4g12x4r12x4g12x4422Unorm4pack16 + GPUFormatG12x4B12x4R12x43plane420Unorm3pack16 + GPUFormatG12x4B12x4r12x42plane420Unorm3pack16 + GPUFormatG12x4B12x4R12x43plane422Unorm3pack16 + GPUFormatG12x4B12x4r12x42plane422Unorm3pack16 + GPUFormatG12x4B12x4R12x43plane444Unorm3pack16 + GPUFormatG16b16g16r16422Unorm + GPUFormatB16g16r16g16422Unorm + GPUFormatG16B16R163plane420Unorm + GPUFormatG16B16r162plane420Unorm + GPUFormatG16B16R163plane422Unorm + GPUFormatG16B16r162plane422Unorm + GPUFormatG16B16R163plane444Unorm + GPUFormatPvrtc12bppUnormBlockImg + GPUFormatPvrtc14bppUnormBlockImg + GPUFormatPvrtc22bppUnormBlockImg + GPUFormatPvrtc24bppUnormBlockImg + GPUFormatPvrtc12bppSrgbBlockImg + GPUFormatPvrtc14bppSrgbBlockImg + GPUFormatPvrtc22bppSrgbBlockImg + GPUFormatPvrtc24bppSrgbBlockImg +) +``` + + +## type [GPUFormatFeatureFlags]() + + + +```go +type GPUFormatFeatureFlags int32 +``` + + + +```go +const ( + GPUFormatFeatureSampledImageBit GPUFormatFeatureFlags = iota + GPUFormatFeatureStorageImageBit + GPUFormatFeatureStorageImageAtomicBit + GPUFormatFeatureUniformTexelBufferBit + GPUFormatFeatureStorageTexelBufferBit + GPUFormatFeatureStorageTexelBufferAtomicBit + GPUFormatFeatureVertexBufferBit + GPUFormatFeatureColorAttachmentBit + GPUFormatFeatureColorAttachmentBlendBit + GPUFormatFeatureDepthStencilAttachmentBit + GPUFormatFeatureBlitSrcBit + GPUFormatFeatureBlitDstBit + GPUFormatFeatureSampledImageFilterLinearBit + GPUFormatFeatureTransferSrcBit + GPUFormatFeatureTransferDstBit + GPUFormatFeatureMidpointChromaSamplesBit + GPUFormatFeatureSampledImageYcbcrConversionLinearFilterBit + GPUFormatFeatureSampledImageYcbcrConversionSeparateReconstructionFilterBit + GPUFormatFeatureSampledImageYcbcrConversionChromaReconstructionExplicitBit + GPUFormatFeatureSampledImageYcbcrConversionChromaReconstructionExplicitForceableBit + GPUFormatFeatureDisjointBit + GPUFormatFeatureCositedChromaSamplesBit + GPUFormatFeatureSampledImageFilterCubicBitImg + GPUFormatFeatureSampledImageFilterMinmaxBit +) +``` + + +## type [GPUFormatProperties]() + + + +```go +type GPUFormatProperties struct { + LinearTilingFeatures GPUFormatFeatureFlags + OptimalTilingFeatures GPUFormatFeatureFlags + BufferFeatures GPUFormatFeatureFlags +} +``` + + +## type [GPUFrameBuffer]() + + + +```go +type GPUFrameBuffer struct{ GPUHandle } +``` + + +## type [GPUHandle]() + + + +```go +type GPUHandle struct { + // contains filtered or unexported fields +} +``` + + +### func \(\*GPUHandle\) [HandleAddr]() + +```go +func (g *GPUHandle) HandleAddr() unsafe.Pointer +``` + + + + +### func \(\*GPUHandle\) [IsValid]() + +```go +func (g *GPUHandle) IsValid() bool +``` + + + + +### func \(\*GPUHandle\) [Reset]() + +```go +func (g *GPUHandle) Reset() +``` + + + + +## type [GPUImage]() + + + +```go +type GPUImage struct{ GPUHandle } +``` + + +## type [GPUImageAspectFlags]() + + + +```go +type GPUImageAspectFlags uint16 +``` + + + +```go +const ( + GPUImageAspectColorBit GPUImageAspectFlags = (1 << iota) + GPUImageAspectDepthBit + GPUImageAspectStencilBit + GPUImageAspectMetadataBit + GPUImageAspectPlane0Bit + GPUImageAspectPlane1Bit + GPUImageAspectPlane2Bit + GPUImageAspectMemoryPlane0Bit + GPUImageAspectMemoryPlane1Bit + GPUImageAspectMemoryPlane2Bit + GPUImageAspectMemoryPlane3Bit +) +``` + + +## type [GPUImageCreateFlags]() + + + +```go +type GPUImageCreateFlags uint16 +``` + + + +```go +const ( + GPUImageCreateSparseBindingBit GPUImageCreateFlags = (1 << iota) + GPUImageCreateSparseResidencyBit + GPUImageCreateSparseAliasedBit + GPUImageCreateMutableFormatBit + GPUImageCreateCubeCompatibleBit + GPUImageCreateAliasBit + GPUImageCreateSplitInstanceBindRegionsBit + GPUImageCreate2dArrayCompatibleBit + GPUImageCreateBlockTexelViewCompatibleBit + GPUImageCreateExtendedUsageBit + GPUImageCreateProtectedBit + GPUImageCreateDisjointBit + GPUImageCreateCornerSampledBitNv + GPUImageCreateSampleLocationsCompatibleDepthBit +) +``` + + +## type [GPUImageCreateRequest]() + + + +```go +type GPUImageCreateRequest struct { + Flags GPUImageCreateFlags + ImageType GPUImageType + Format GPUFormat + Extent matrix.Vec3i + MipLevels uint32 + ArrayLayers uint32 + Samples GPUSampleCountFlags + Tiling GPUImageTiling + Usage GPUImageUsageFlags +} +``` + + +## type [GPUImageLayout]() + + + +```go +type GPUImageLayout uint16 +``` + + + +```go +const ( + GPUImageLayoutUndefined GPUImageLayout = iota + GPUImageLayoutGeneral + GPUImageLayoutColorAttachmentOptimal + GPUImageLayoutDepthStencilAttachmentOptimal + GPUImageLayoutDepthStencilReadOnlyOptimal + GPUImageLayoutShaderReadOnlyOptimal + GPUImageLayoutTransferSrcOptimal + GPUImageLayoutTransferDstOptimal + GPUImageLayoutPreinitialized + GPUImageLayoutDepthReadOnlyStencilAttachmentOptimal + GPUImageLayoutDepthAttachmentStencilReadOnlyOptimal + GPUImageLayoutPresentSrc + GPUImageLayoutSharedPresent + GPUImageLayoutShadingRateOptimalNv +) +``` + + +## type [GPUImageTiling]() + + + +```go +type GPUImageTiling uint8 +``` + + + +```go +const ( + GPUImageTilingOptimal GPUImageTiling = iota + GPUImageTilingLinear + GPUImageTilingDrmFormatModifier +) +``` + + +## type [GPUImageType]() + + + +```go +type GPUImageType uint8 +``` + + + +```go +const ( + GPUImageType1d GPUImageType = iota + GPUImageType2d + GPUImageType3d +) +``` + + +## type [GPUImageUsageFlags]() + + + +```go +type GPUImageUsageFlags int32 +``` + + + +```go +const ( + GPUImageUsageTransferSrcBit GPUImageUsageFlags = (1 << iota) + GPUImageUsageTransferDstBit + GPUImageUsageSampledBit + GPUImageUsageStorageBit + GPUImageUsageColorAttachmentBit + GPUImageUsageDepthStencilAttachmentBit + GPUImageUsageTransientAttachmentBit + GPUImageUsageInputAttachmentBit + GPUImageUsageShadingRateImageBitNv +) +``` + + +## type [GPUImageView]() + + + +```go +type GPUImageView struct{ GPUHandle } +``` + + +## type [GPUImageViewType]() + + + +```go +type GPUImageViewType uint8 +``` + + + +```go +const ( + GPUImageViewType1d GPUImageViewType = iota + GPUImageViewType2d + GPUImageViewType3d + GPUImageViewTypeCube + GPUImageViewType1dArray + GPUImageViewType2dArray + GPUImageViewTypeCubeArray +) +``` + + +## type [GPUImageWriteRequest]() + + + +```go +type GPUImageWriteRequest struct { + Region matrix.Vec4i + Pixels []byte +} +``` + + +## type [GPUInstance]() + + + +```go +type GPUInstance struct { + // contains filtered or unexported fields +} +``` + + +### func \(\*GPUInstance\) [Destroy]() + +```go +func (g *GPUInstance) Destroy() +``` + + + + +### func \(\*GPUInstance\) [IsValid]() + +```go +func (g *GPUInstance) IsValid() bool +``` + + + + +### func \(\*GPUInstance\) [Setup]() + +```go +func (g *GPUInstance) Setup(window RenderingContainer, app *GPUApplication) error +``` + + + + +## type [GPULight]() + + + +```go +type GPULight struct { + Matrix [cubeMapSides]matrix.Mat4 + Position matrix.Vec3 + + Direction matrix.Vec3 + // contains filtered or unexported fields +} +``` + + +## type [GPULightInfo]() + + + +```go +type GPULightInfo struct { + Position matrix.Vec3 + Intensity float32 + Direction matrix.Vec3 + Cutoff float32 + Ambient matrix.Vec3 + OuterCutoff float32 + Diffuse matrix.Vec3 + Constant float32 + Specular matrix.Vec3 + Linear float32 + Quadratic float32 + NearPlane float32 + FarPlane float32 + Type int32 + // contains filtered or unexported fields +} +``` + + +## type [GPULogicalDevice]() + + + +```go +type GPULogicalDevice struct { + GPUHandle + + SwapChain GPUSwapChain + // contains filtered or unexported fields +} +``` + + +### func \(\*GPULogicalDevice\) [CreateImageView]() + +```go +func (g *GPULogicalDevice) CreateImageView(id *TextureId, aspectFlags GPUImageAspectFlags, viewType GPUImageViewType) error +``` + + + + +### func \(\*GPULogicalDevice\) [Destroy]() + +```go +func (g *GPULogicalDevice) Destroy() +``` + + + + +### func \(\*GPULogicalDevice\) [DestroyFence]() + +```go +func (g *GPULogicalDevice) DestroyFence(fence *GPUFence) +``` + + + + +### func \(\*GPULogicalDevice\) [DestroyGroup]() + +```go +func (g *GPULogicalDevice) DestroyGroup(group *DrawInstanceGroup) +``` + + + + +### func \(\*GPULogicalDevice\) [DestroySemaphore]() + +```go +func (g *GPULogicalDevice) DestroySemaphore(semaphore *GPUSemaphore) +``` + + + + +### func \(\*GPULogicalDevice\) [FreeTexture]() + +```go +func (g *GPULogicalDevice) FreeTexture(texId *TextureId) +``` + + + + +### func \(\*GPULogicalDevice\) [ImageMemoryRequirements]() + +```go +func (g *GPULogicalDevice) ImageMemoryRequirements(image GPUImage) GPUMemoryRequirements +``` + + + + +### func \(\*GPULogicalDevice\) [RemakeSwapChain]() + +```go +func (g *GPULogicalDevice) RemakeSwapChain(window RenderingContainer, inst *GPUApplicationInstance, device *GPUDevice) error +``` + + + + +### func \(\*GPULogicalDevice\) [Setup]() + +```go +func (g *GPULogicalDevice) Setup(inst *GPUApplicationInstance, physicalDevice *GPUPhysicalDevice) error +``` + + + + +### func \(\*GPULogicalDevice\) [SetupBufferDestroyer]() + +```go +func (g *GPULogicalDevice) SetupBufferDestroyer(device *GPUDevice) +``` + + + + +### func \(\*GPULogicalDevice\) [WaitForFences]() + +```go +func (g *GPULogicalDevice) WaitForFences(fences []GPUFence) +``` + + + + +### func \(\*GPULogicalDevice\) [WaitForRender]() + +```go +func (g *GPULogicalDevice) WaitForRender(device *GPUDevice) +``` + + + + +### func \(\*GPULogicalDevice\) [WaitIdle]() + +```go +func (g *GPULogicalDevice) WaitIdle() +``` + + + + +## type [GPUMemoryFlags]() + + + +```go +type GPUMemoryFlags uint16 +``` + + + +```go +const ( + GPUMemoryMapPlacedBit GPUMemoryFlags = (1 << iota) +) +``` + + +## type [GPUMemoryHeap]() + + + +```go +type GPUMemoryHeap struct { + Size uintptr + Flags GPUMemoryHeapFlags +} +``` + + +## type [GPUMemoryHeapFlags]() + + + +```go +type GPUMemoryHeapFlags uint8 +``` + + + +```go +const ( + GPUMemoryHeapDeviceLocalBit GPUMemoryHeapFlags = (1 << iota) + GPUMemoryHeapMultiInstanceBit +) +``` + + +## type [GPUMemoryPropertyFlags]() + + + +```go +type GPUMemoryPropertyFlags uint8 +``` + + + +```go +const ( + GPUMemoryPropertyDeviceLocalBit GPUMemoryPropertyFlags = (1 << iota) + GPUMemoryPropertyHostVisibleBit + GPUMemoryPropertyHostCoherentBit + GPUMemoryPropertyHostCachedBit + GPUMemoryPropertyLazilyAllocatedBit + GPUMemoryPropertyProtectedBit +) +``` + + +## type [GPUMemoryRequirements]() + + + +```go +type GPUMemoryRequirements struct { + Size uintptr + Alignment uintptr + MemoryTypeBits uint32 +} +``` + + +## type [GPUMemoryType]() + + + +```go +type GPUMemoryType struct { + PropertyFlags GPUMemoryPropertyFlags + HeapIndex uint32 +} +``` + + +## type [GPUPainter]() + + + +```go +type GPUPainter struct { + // contains filtered or unexported fields +} +``` + + +### func \(\*GPUPainter\) [DestroyDescriptorPools]() + +```go +func (g *GPUPainter) DestroyDescriptorPools(device *GPUDevice) +``` + + + + +## type [GPUPhysicalDevice]() + + + +```go +type GPUPhysicalDevice struct { + Features GPUPhysicalDeviceFeatures + Properties GPUPhysicalDeviceProperties + QueueFamilies []GPUQueueFamily + Extensions []GPUPhysicalDeviceExtension + SurfaceFormats []GPUSurfaceFormat + PresentModes []GPUPresentMode + SurfaceCapabilities GPUSurfaceCapabilities + // contains filtered or unexported fields +} +``` + + +### func [ListPhysicalGpuDevices]() + +```go +func ListPhysicalGpuDevices(inst *GPUApplicationInstance) ([]GPUPhysicalDevice, error) +``` + + + + +### func \(\*GPUPhysicalDevice\) [FindComputeFamiliy]() + +```go +func (g *GPUPhysicalDevice) FindComputeFamiliy() GPUQueueFamily +``` + + + + +### func \(\*GPUPhysicalDevice\) [FindGraphicsFamiliy]() + +```go +func (g *GPUPhysicalDevice) FindGraphicsFamiliy() GPUQueueFamily +``` + + + + +### func \(\*GPUPhysicalDevice\) [FindMemoryType]() + +```go +func (g *GPUPhysicalDevice) FindMemoryType(typeFilter uint32, properties GPUMemoryPropertyFlags) int +``` + + + + +### func \(\*GPUPhysicalDevice\) [FindPresentFamily]() + +```go +func (g *GPUPhysicalDevice) FindPresentFamily() GPUQueueFamily +``` + + + + +### func \(\*GPUPhysicalDevice\) [FindSupportedFormat]() + +```go +func (g *GPUPhysicalDevice) FindSupportedFormat(candidates []GPUFormat, tiling GPUImageTiling, features GPUFormatFeatureFlags) GPUFormat +``` + + + + +### func \(\*GPUPhysicalDevice\) [FormatIsTileable]() + +```go +func (g *GPUPhysicalDevice) FormatIsTileable(format GPUFormat, tiling GPUImageTiling) bool +``` + + + + +### func \(\*GPUPhysicalDevice\) [FormatProperties]() + +```go +func (g *GPUPhysicalDevice) FormatProperties(format GPUFormat) GPUFormatProperties +``` + + + + +### func \(\*GPUPhysicalDevice\) [IsExtensionSupported]() + +```go +func (g *GPUPhysicalDevice) IsExtensionSupported(extension string) bool +``` + + + + +### func \(\*GPUPhysicalDevice\) [IsValid]() + +```go +func (g *GPUPhysicalDevice) IsValid() bool +``` + + + + +### func \(\*GPUPhysicalDevice\) [MaxUsableSampleCount]() + +```go +func (g *GPUPhysicalDevice) MaxUsableSampleCount() GPUSampleCountFlags +``` + + + + +### func \(\*GPUPhysicalDevice\) [PadBufferSize]() + +```go +func (g *GPUPhysicalDevice) PadBufferSize(size uintptr) uintptr +``` + + + + +### func \(\*GPUPhysicalDevice\) [RefreshSurfaceCapabilities]() + +```go +func (g *GPUPhysicalDevice) RefreshSurfaceCapabilities(surface unsafe.Pointer) +``` + + + + +## type [GPUPhysicalDeviceExtension]() + + + +```go +type GPUPhysicalDeviceExtension struct { + Name string + Version uint32 +} +``` + + +## type [GPUPhysicalDeviceFeatures]() + + + +```go +type GPUPhysicalDeviceFeatures struct { + RobustBufferAccess bool + FullDrawIndexUint32 bool + ImageCubeArray bool + IndependentBlend bool + GeometryShader bool + TessellationShader bool + SampleRateShading bool + DualSrcBlend bool + LogicOp bool + MultiDrawIndirect bool + DrawIndirectFirstInstance bool + DepthClamp bool + DepthBiasClamp bool + FillModeNonSolid bool + DepthBounds bool + WideLines bool + LargePoints bool + AlphaToOne bool + MultiViewport bool + SamplerAnisotropy bool + TextureCompressionETC2 bool + TextureCompressionASTC_LDR bool + TextureCompressionBC bool + OcclusionQueryPrecise bool + PipelineStatisticsQuery bool + VertexPipelineStoresAndAtomics bool + FragmentStoresAndAtomics bool + ShaderTessellationAndGeometryPointSize bool + ShaderImageGatherExtended bool + ShaderStorageImageExtendedFormats bool + ShaderStorageImageMultisample bool + ShaderStorageImageReadWithoutFormat bool + ShaderStorageImageWriteWithoutFormat bool + ShaderUniformBufferArrayDynamicIndexing bool + ShaderSampledImageArrayDynamicIndexing bool + ShaderStorageBufferArrayDynamicIndexing bool + ShaderStorageImageArrayDynamicIndexing bool + ShaderClipDistance bool + ShaderCullDistance bool + ShaderFloat64 bool + ShaderInt64 bool + ShaderInt16 bool + ShaderResourceResidency bool + ShaderResourceMinLod bool + SparseBinding bool + SparseResidencyBuffer bool + SparseResidencyImage2D bool + SparseResidencyImage3D bool + SparseResidency2Samples bool + SparseResidency4Samples bool + SparseResidency8Samples bool + SparseResidency16Samples bool + SparseResidencyAliased bool + VariableMultisampleRate bool + InheritedQueries bool +} +``` + + +## type [GPUPhysicalDeviceLimits]() + + + +```go +type GPUPhysicalDeviceLimits struct { + MaxImageDimension1D uint32 + MaxImageDimension2D uint32 + MaxImageDimension3D uint32 + MaxImageDimensionCube uint32 + MaxImageArrayLayers uint32 + MaxTexelBufferElements uint32 + MaxUniformBufferRange uint32 + MaxStorageBufferRange uint32 + MaxPushConstantsSize uint32 + MaxMemoryAllocationCount uint32 + MaxSamplerAllocationCount uint32 + BufferImageGranularity uintptr + SparseAddressSpaceSize uintptr + MaxBoundDescriptorSets uint32 + MaxPerStageDescriptorSamplers uint32 + MaxPerStageDescriptorUniformBuffers uint32 + MaxPerStageDescriptorStorageBuffers uint32 + MaxPerStageDescriptorSampledImages uint32 + MaxPerStageDescriptorStorageImages uint32 + MaxPerStageDescriptorInputAttachments uint32 + MaxPerStageResources uint32 + MaxDescriptorSetSamplers uint32 + MaxDescriptorSetUniformBuffers uint32 + MaxDescriptorSetUniformBuffersDynamic uint32 + MaxDescriptorSetStorageBuffers uint32 + MaxDescriptorSetStorageBuffersDynamic uint32 + MaxDescriptorSetSampledImages uint32 + MaxDescriptorSetStorageImages uint32 + MaxDescriptorSetInputAttachments uint32 + MaxVertexInputAttributes uint32 + MaxVertexInputBindings uint32 + MaxVertexInputAttributeOffset uint32 + MaxVertexInputBindingStride uint32 + MaxVertexOutputComponents uint32 + MaxTessellationGenerationLevel uint32 + MaxTessellationPatchSize uint32 + MaxTessellationControlPerVertexInputComponents uint32 + MaxTessellationControlPerVertexOutputComponents uint32 + MaxTessellationControlPerPatchOutputComponents uint32 + MaxTessellationControlTotalOutputComponents uint32 + MaxTessellationEvaluationInputComponents uint32 + MaxTessellationEvaluationOutputComponents uint32 + MaxGeometryShaderInvocations uint32 + MaxGeometryInputComponents uint32 + MaxGeometryOutputComponents uint32 + MaxGeometryOutputVertices uint32 + MaxGeometryTotalOutputComponents uint32 + MaxFragmentInputComponents uint32 + MaxFragmentOutputAttachments uint32 + MaxFragmentDualSrcAttachments uint32 + MaxFragmentCombinedOutputResources uint32 + MaxComputeSharedMemorySize uint32 + MaxComputeWorkGroupCount [3]uint32 + MaxComputeWorkGroupInvocations uint32 + MaxComputeWorkGroupSize [3]uint32 + SubPixelPrecisionBits uint32 + SubTexelPrecisionBits uint32 + MipmapPrecisionBits uint32 + MaxDrawIndexedIndexValue uint32 + MaxDrawIndirectCount uint32 + MaxSamplerLodBias float32 + MaxSamplerAnisotropy float32 + MaxViewports uint32 + MaxViewportDimensions [2]uint32 + ViewportBoundsRange [2]float32 + ViewportSubPixelBits uint32 + MinMemoryMapAlignment uint + MinTexelBufferOffsetAlignment uintptr + MinUniformBufferOffsetAlignment uintptr + MinStorageBufferOffsetAlignment uintptr + MinTexelOffset int32 + MaxTexelOffset uint32 + MinTexelGatherOffset int32 + MaxTexelGatherOffset uint32 + MinInterpolationOffset float32 + MaxInterpolationOffset float32 + SubPixelInterpolationOffsetBits uint32 + MaxFramebufferWidth uint32 + MaxFramebufferHeight uint32 + MaxFramebufferLayers uint32 + FramebufferColorSampleCounts GPUSampleCountFlags + FramebufferDepthSampleCounts GPUSampleCountFlags + FramebufferStencilSampleCounts GPUSampleCountFlags + FramebufferNoAttachmentsSampleCounts GPUSampleCountFlags + MaxColorAttachments uint32 + SampledImageColorSampleCounts GPUSampleCountFlags + SampledImageIntegerSampleCounts GPUSampleCountFlags + SampledImageDepthSampleCounts GPUSampleCountFlags + SampledImageStencilSampleCounts GPUSampleCountFlags + StorageImageSampleCounts GPUSampleCountFlags + MaxSampleMaskWords uint32 + TimestampComputeAndGraphics bool + TimestampPeriod float32 + MaxClipDistances uint32 + MaxCullDistances uint32 + MaxCombinedClipAndCullDistances uint32 + DiscreteQueuePriorities uint32 + PointSizeRange [2]float32 + LineWidthRange [2]float32 + PointSizeGranularity float32 + LineWidthGranularity float32 + StrictLines bool + StandardSampleLocations bool + OptimalBufferCopyOffsetAlignment uintptr + OptimalBufferCopyRowPitchAlignment uintptr + NonCoherentAtomSize uintptr +} +``` + + +## type [GPUPhysicalDeviceMemoryProperties]() + + + +```go +type GPUPhysicalDeviceMemoryProperties struct { + MemoryTypes []GPUMemoryType + MemoryHeaps []GPUMemoryHeap +} +``` + + +## type [GPUPhysicalDeviceProperties]() + + + +```go +type GPUPhysicalDeviceProperties struct { + ApiVersion uint32 + DriverVersion uint32 + VendorID uint32 + DeviceID uint32 + DeviceType GPUPhysicalDeviceType + DeviceName string + PipelineCacheUUID string + Limits GPUPhysicalDeviceLimits + SparseProperties GPUPhysicalDeviceSparseProperties +} +``` + + +## type [GPUPhysicalDeviceSparseProperties]() + + + +```go +type GPUPhysicalDeviceSparseProperties struct { + ResidencyStandard2DBlockShape bool + ResidencyStandard2DMultisampleBlockShape bool + ResidencyStandard3DBlockShape bool + ResidencyAlignedMipSize bool + ResidencyNonResidentStrict bool +} +``` + + +## type [GPUPhysicalDeviceType]() + + + +```go +type GPUPhysicalDeviceType uint8 +``` + + + +```go +const ( + GPUPhysicalDeviceTypeOther GPUPhysicalDeviceType = iota + GPUPhysicalDeviceTypeIntegratedGpu + GPUPhysicalDeviceTypeDiscreteGpu + GPUPhysicalDeviceTypeVirtualGpu + GPUPhysicalDeviceTypeCpu +) +``` + + +## type [GPUPipeline]() + + + +```go +type GPUPipeline struct{ GPUHandle } +``` + + +## type [GPUPipelineLayout]() + + + +```go +type GPUPipelineLayout struct{ GPUHandle } +``` + + +## type [GPUPipelineStageFlags]() + + + +```go +type GPUPipelineStageFlags uint32 +``` + + + +```go +const ( + GPUPipelineStageTopOfPipeBit GPUPipelineStageFlags = (1 << iota) + GPUPipelineStageDrawIndirectBit + GPUPipelineStageVertexInputBit + GPUPipelineStageVertexShaderBit + GPUPipelineStageTessellationControlShaderBit + GPUPipelineStageTessellationEvaluationShaderBit + GPUPipelineStageGeometryShaderBit + GPUPipelineStageFragmentShaderBit + GPUPipelineStageEarlyFragmentTestsBit + GPUPipelineStageLateFragmentTestsBit + GPUPipelineStageColorAttachmentOutputBit + GPUPipelineStageComputeShaderBit + GPUPipelineStageTransferBit + GPUPipelineStageBottomOfPipeBit + GPUPipelineStageHostBit + GPUPipelineStageAllGraphicsBit + GPUPipelineStageAllCommandsBit + GPUPipelineStageTransformFeedbackBit + GPUPipelineStageConditionalRenderingBit + GPUPipelineStageCommandProcessBitNvx + GPUPipelineStageShadingRateImageBitNv + GPUPipelineStageRaytracingBitNvx + GPUPipelineStageTaskShaderBitNv + GPUPipelineStageMeshShaderBitNv +) +``` + + +## type [GPUPresentMode]() + + + +```go +type GPUPresentMode int32 +``` + + + +```go +const ( + GPUPresentModeImmediate GPUPresentMode = iota + GPUPresentModeMailbox + GPUPresentModeFifo + GPUPresentModeFifoRelaxed + GPUPresentModeSharedDemandRefresh + GPUPresentModeSharedContinuousRefresh +) +``` + + +## type [GPUQueue]() + + + +```go +type GPUQueue struct{ GPUHandle } +``` + + +## type [GPUQueueFamily]() + + + +```go +type GPUQueueFamily struct { + Index int + MinImageTransferGranularity matrix.Vec3i + IsGraphics bool + IsCompute bool + IsTransfer bool + IsSparseBinding bool + IsProtected bool + HasPresentSupport bool +} +``` + + +### func [InvalidGPUQueueFamily]() + +```go +func InvalidGPUQueueFamily() GPUQueueFamily +``` + + + + +### func \(GPUQueueFamily\) [IsValid]() + +```go +func (g GPUQueueFamily) IsValid() bool +``` + + + + +## type [GPUResult]() + + + +```go +type GPUResult int32 +``` + + +## type [GPUSampleCountFlags]() + + + +```go +type GPUSampleCountFlags uint8 +``` + + + +```go +const ( + GPUSampleCount1Bit GPUSampleCountFlags = (1 << iota) + GPUSampleCount2Bit + GPUSampleCount4Bit + GPUSampleCount8Bit + GPUSampleCount16Bit + GPUSampleCount32Bit + GPUSampleCount64Bit + GPUSampleSwapChainCount +) +``` + + +## type [GPUSampler]() + + + +```go +type GPUSampler struct{ GPUHandle } +``` + + +## type [GPUSemaphore]() + + + +```go +type GPUSemaphore struct{ GPUHandle } +``` + + +## type [GPUShaderModule]() + + + +```go +type GPUShaderModule struct{ GPUHandle } +``` + + +## type [GPUSurface]() + + + +```go +type GPUSurface struct { + // contains filtered or unexported fields +} +``` + + +### func \(\*GPUSurface\) [Create]() + +```go +func (g *GPUSurface) Create(instance *GPUInstance, window RenderingContainer) error +``` + + + + +### func \(\*GPUSurface\) [Destroy]() + +```go +func (g *GPUSurface) Destroy(inst *GPUApplicationInstance) +``` + + + + +## type [GPUSurfaceCapabilities]() + + + +```go +type GPUSurfaceCapabilities struct { + MinImageCount uint32 + MaxImageCount uint32 + CurrentExtent matrix.Vec2i + MinImageExtent matrix.Vec2i + MaxImageExtent matrix.Vec2i + MaxImageArrayLayers uint32 + SupportedTransforms GPUSurfaceTransformFlags + CurrentTransform GPUSurfaceTransformFlags + SupportedCompositeAlpha GPUCompositeAlphaFlags + SupportedUsageFlags GPUImageUsageFlags +} +``` + + +## type [GPUSurfaceFormat]() + + + +```go +type GPUSurfaceFormat struct { + Format GPUFormat + ColorSpace GPUColorSpace +} +``` + + +## type [GPUSurfaceTransformFlags]() + + + +```go +type GPUSurfaceTransformFlags int32 +``` + + + +```go +const ( + GPUSurfaceTransformIdentityBit GPUSurfaceTransformFlags = (1 << iota) + GPUSurfaceTransformRotate90Bit + GPUSurfaceTransformRotate180Bit + GPUSurfaceTransformRotate270Bit + GPUSurfaceTransformHorizontalMirrorBit + GPUSurfaceTransformHorizontalMirrorRotate90Bit + GPUSurfaceTransformHorizontalMirrorRotate180Bit + GPUSurfaceTransformHorizontalMirrorRotate270Bit + GPUSurfaceTransformInheritBit +) +``` + + +## type [GPUSwapChain]() + + + +```go +type GPUSwapChain struct { + GPUHandle + Images []TextureId + Extent matrix.Vec2i + Depth TextureId + Color TextureId + FrameBuffers []GPUFrameBuffer + // contains filtered or unexported fields +} +``` + + +### func \(\*GPUSwapChain\) [CopyAndReset]() + +```go +func (g *GPUSwapChain) CopyAndReset() GPUSwapChain +``` + + + + +### func \(\*GPUSwapChain\) [CreateColor]() + +```go +func (g *GPUSwapChain) CreateColor(device *GPUDevice) error +``` + + + + +### func \(\*GPUSwapChain\) [CreateDepth]() + +```go +func (g *GPUSwapChain) CreateDepth(device *GPUDevice) error +``` + + + + +### func \(\*GPUSwapChain\) [CreateFrameBuffer]() + +```go +func (g *GPUSwapChain) CreateFrameBuffer(device *GPUDevice) error +``` + + + + +### func \(\*GPUSwapChain\) [Destroy]() + +```go +func (g *GPUSwapChain) Destroy(device *GPUDevice) +``` + + + + +### func \(\*GPUSwapChain\) [SelectExtent]() + +```go +func (g *GPUSwapChain) SelectExtent(window RenderingContainer, device *GPUPhysicalDevice) matrix.Vec2i +``` + + + + +### func \(\*GPUSwapChain\) [SelectPresentMode]() + +```go +func (g *GPUSwapChain) SelectPresentMode(device *GPUPhysicalDevice) GPUPresentMode +``` + + + + +### func \(\*GPUSwapChain\) [SelectSurfaceFormat]() + +```go +func (g *GPUSwapChain) SelectSurfaceFormat(device *GPUPhysicalDevice) GPUSurfaceFormat +``` + + + + +### func \(\*GPUSwapChain\) [Setup]() + +```go +func (g *GPUSwapChain) Setup(window RenderingContainer, inst *GPUApplicationInstance, device *GPUDevice) error +``` + + + + +### func \(\*GPUSwapChain\) [SetupImageViews]() + +```go +func (g *GPUSwapChain) SetupImageViews(device *GPUDevice) error +``` + + + + +### func \(\*GPUSwapChain\) [SetupRenderPass]() + +```go +func (g *GPUSwapChain) SetupRenderPass(device *GPUDevice, assets assets.Database) error +``` + + + + +### func \(\*GPUSwapChain\) [SetupSyncObjects]() + +```go +func (g *GPUSwapChain) SetupSyncObjects(device *GPUDevice) error +``` + + + + +## type [GPUSwapChainSupportDetails]() + + + +```go +type GPUSwapChainSupportDetails struct { + // contains filtered or unexported fields +} +``` + + +## type [GlobalShaderData]() + + + +```go +type GlobalShaderData struct { + View matrix.Mat4 + Projection matrix.Mat4 + UIView matrix.Mat4 + UIProjection matrix.Mat4 + CameraPosition matrix.Vec4 + UICameraPosition matrix.Vec3 + Time float32 + ScreenSize matrix.Vec2 + CascadeCount int32 + + CascadePlaneDistances [4]float32 + VertLights [MaxLocalLights]GPULight + LightInfos [MaxLocalLights]GPULightInfo + // contains filtered or unexported fields +} +``` + + +## type [InstanceCopyData]() + + + +```go +type InstanceCopyData struct { + // contains filtered or unexported fields +} +``` + + +### func [InstanceCopyDataNew]() + +```go +func InstanceCopyDataNew(padding int) InstanceCopyData +``` + + + + +## type [InstanceDriverData]() + + + +```go +type InstanceDriverData struct { + // contains filtered or unexported fields +} +``` + + +## type [InstanceGroupSkinningData]() + + + +```go +type InstanceGroupSkinningData struct { +} +``` + + +## type [Light]() + + + +```go +type Light struct { + // contains filtered or unexported fields +} +``` + + +### func [NewLight]() + +```go +func NewLight(device *GPUDevice, assetDb assets.Database, materialCache *MaterialCache, lightType LightType) Light +``` + + + + +### func \(\*Light\) [Direction]() + +```go +func (l *Light) Direction(followcam cameras.Camera) matrix.Vec3 +``` + + + + +### func \(\*Light\) [FrameDirty]() + +```go +func (l *Light) FrameDirty() bool +``` + + + + +### func \(\*Light\) [IsValid]() + +```go +func (l *Light) IsValid() bool +``` + + + + +### func \(\*Light\) [ResetFrameDirty]() + +```go +func (l *Light) ResetFrameDirty() bool +``` + + + + +### func \(\*Light\) [SetAmbient]() + +```go +func (l *Light) SetAmbient(ambient matrix.Vec3) +``` + + + + +### func \(\*Light\) [SetCastsShadows]() + +```go +func (l *Light) SetCastsShadows(castsShadows bool) +``` + + + + +### func \(\*Light\) [SetConstant]() + +```go +func (l *Light) SetConstant(constant float32) +``` + + + + +### func \(\*Light\) [SetCutoff]() + +```go +func (l *Light) SetCutoff(cutoff float32) +``` + + + + +### func \(\*Light\) [SetDiffuse]() + +```go +func (l *Light) SetDiffuse(diffuse matrix.Vec3) +``` -### func (d *DrawInstanceGroup) AddInstance(instance DrawInstance) -### func (d *DrawInstanceGroup) AlterPadding(blockSize int) + +### func \(\*Light\) [SetDirection]() +```go +func (l *Light) SetDirection(dir matrix.Vec3) +``` -### func (d *DrawInstanceGroup) AnyVisible() bool -### func (d *DrawInstanceGroup) Clear() + +### func \(\*Light\) [SetIntensity]() +```go +func (l *Light) SetIntensity(intensity float32) +``` -### func (d *DrawInstanceGroup) Destroy(device *GPUDevice) -### func (d *DrawInstanceGroup) IsEmpty() bool + +### func \(\*Light\) [SetLinear]() +```go +func (l *Light) SetLinear(linear float32) +``` -### func (d *DrawInstanceGroup) IsReady() bool -### func (d *DrawInstanceGroup) TotalSize() int + +### func \(\*Light\) [SetOuterCutoff]() +```go +func (l *Light) SetOuterCutoff(outerCutoff float32) +``` -### func (d *DrawInstanceGroup) UpdateData(device *GPUDevice, frame int, lights LightsForRender) -### func (d *DrawInstanceGroup) VisibleCount() int + +### func \(\*Light\) [SetPosition]() +```go +func (l *Light) SetPosition(position matrix.Vec3) +``` -### func (d *DrawInstanceGroup) VisibleSize() int -### type Drawing struct { + +### func \(\*Light\) [SetQuadratic]() ```go -// Material defines the visual appearance and render pass for the drawing. -Material *Material -// Mesh contains the geometry to be rendered. -Mesh *Mesh -// ShaderData holds per‑instance data for the shader (e.g., uniforms). -ShaderData DrawInstance -// Transform specifies the transform this drawing follows. -Transform *matrix.Transform -// Sort determines the draw order within a render pass. -Sort int -// ViewCuller optionally culls the drawing based on the view frustum. -ViewCuller ViewCuller +func (l *Light) SetQuadratic(quadratic float32) ``` -} -```go - Drawing represents a renderable entity in the engine. It bundles together - the material, mesh, shader instance data, transform, sorting order, and an - optional view culler used during rendering. -``` -### func (d *Drawing) IsValid() bool + +### func \(\*Light\) [SetSpecular]() ```go - IsValid reports whether the Drawing is properly configured for rendering. - A Drawing is considered valid if it has a non-nil Material. This check is - used before submitting the drawing to the render pipeline. +func (l *Light) SetSpecular(specular matrix.Vec3) ``` -### type Drawings struct { + + +### func \(\*Light\) [Type]() ```go -// Has unexported fields. +func (l *Light) Type() LightType ``` -} -### func NewDrawings() Drawings + +### func \(\*Light\) [WorldSpace]() + +```go +func (l *Light) WorldSpace(followcam cameras.Camera) matrix.Vec3 +``` -### func (d *Drawings) AddDrawing(drawing Drawing) -### func (d *Drawings) AddDrawings(drawings []Drawing) + +## type [LightShadowShaderData]() -### func (d *Drawings) Clear() +```go +type LightShadowShaderData struct { + ShaderDataBase + LightIndex int32 +} +``` -### func (d *Drawings) Destroy(device *GPUDevice) + +### func \(LightShadowShaderData\) [Size]() +```go +func (t LightShadowShaderData) Size() int +``` -### func (d *Drawings) HasDrawings() bool -### func (d *Drawings) PreparePending(shadowCascades uint8) + +## type [LightType]() -### func (d *Drawings) Render(device *GPUDevice, lights LightsForRender) +```go +type LightType int +``` -### type FontBaseline int + +## type [LightsForRender]() -### type FontCache struct { ```go -FaceMutex sync.RWMutex -// Has unexported fields. +type LightsForRender struct { + Lights []Light + HasChanges bool +} ``` -} + +## type [Material]() + -### func NewFontCache(device *GPUDevice, assetDb assets.Database) FontCache +```go +type Material struct { + Id string -### func (cache *FontCache) Destroy() + Shader *Shader + Textures []*Texture + Instances map[string]*Material + Root weak.Pointer[Material] + PrepassMaterial weak.Pointer[Material] + IsLit bool + ReceivesShadows bool + CastsShadows bool + // contains filtered or unexported fields +} +``` -### func (cache *FontCache) EMSize(face FontFace) float32 + +### func \(\*Material\) [CreateInstance]() +```go +func (m *Material) CreateInstance(textures []*Texture) *Material +``` -### func (cache *FontCache) Init(caches RenderCaches) error -### func (cache *FontCache) LineCountWithin(face FontFace, text string, scale, maxWidth float32) int + +### func \(\*Material\) [Destroy]() +```go +func (m *Material) Destroy(device *GPUDevice) +``` -### func (cache *FontCache) MeasureCharacter(face string, r rune, pixelSize float32) matrix.Vec2 -### func (cache *FontCache) MeasureString(face FontFace, text string, scale float32) float32 + +### func \(\*Material\) [HasTransparentSuffix]() +```go +func (m *Material) HasTransparentSuffix() bool +``` -### func (cache *FontCache) MeasureStringWithin(face FontFace, text string, scale, maxWidth float32, lineHeight float32) matrix.Vec2 -### func (cache *FontCache) PointOffsetWithin(face FontFace, text string, point matrix.Vec2, scale, maxWidth float32) int + +### func \(\*Material\) [RenderPass]() +```go +func (m *Material) RenderPass() *RenderPass +``` -### func (cache *FontCache) PreloadFace(face FontFace) -### func (cache *FontCache) RenderMeshes(caches RenderCaches, + +### func \(\*Material\) [SelectRoot]() ```go -text string, x, y, z, scale, maxWidth float32, fgColor, bgColor matrix.Color, -justify FontJustify, baseline FontBaseline, rootScale matrix.Vec3, instanced, -is3D bool, face FontFace, lineHeight float32, cam *cameras.Container) []Drawing +func (m *Material) SelectRoot() *Material ``` -### func (cache *FontCache) StringRectsWithinNew(face FontFace, text string, scale, maxWidth float32) []matrix.Vec4 + + +## type [MaterialCache]() -### func (cache *FontCache) TransparentMaterial(target *Material) *Material +```go +type MaterialCache struct { + // contains filtered or unexported fields +} +``` -### type FontFace string + +### func [NewMaterialCache]() +```go +func NewMaterialCache(device *GPUDevice, assetDatabase assets.Database) MaterialCache +``` -### func (f FontFace) AsBold() FontFace -### func (f FontFace) AsExtraBold() FontFace + +### func \(\*MaterialCache\) [AddMaterial]() +```go +func (m *MaterialCache) AddMaterial(material *Material) *Material +``` -### func (f FontFace) AsItalic() FontFace -### func (f FontFace) AsLight() FontFace + +### func \(\*MaterialCache\) [Destroy]() +```go +func (m *MaterialCache) Destroy() +``` -### func (f FontFace) AsMedium() FontFace -### func (f FontFace) AsRegular() FontFace + +### func \(\*MaterialCache\) [FindMaterial]() +```go +func (m *MaterialCache) FindMaterial(key string) (*Material, bool) +``` -### func (f FontFace) AsSemiBold() FontFace -### func (f FontFace) Base() FontFace + +### func \(\*MaterialCache\) [Material]() +```go +func (m *MaterialCache) Material(key string) (*Material, error) +``` -### func (f FontFace) IsBold() bool -### func (f FontFace) IsExtraBold() bool + +## type [MaterialData]() -### func (f FontFace) IsItalic() bool +```go +type MaterialData struct { + Shader string `options:""` // Blank = fallback + RenderPass string `options:""` // Blank = fallback + ShaderPipeline string `options:"" label:"Pipeline"` // Blank = fallback + Textures []MaterialTextureData + PrepassMaterial string + IsLit bool + ReceivesShadows bool + CastsShadows bool +} +``` -### func (f FontFace) RemoveBold() FontFace + +### func \(\*MaterialData\) [Compile]() +```go +func (d *MaterialData) Compile(assets assets.Database, device *GPUDevice) (*Material, error) +``` -### func (f FontFace) RemoveItalic() FontFace -### type FontJustify int + +### func \(\*MaterialData\) [CompileExt]() +```go +func (d *MaterialData) CompileExt(assets assets.Database, device *GPUDevice, copyShader bool) (*Material, error) +``` -### type FuncPipeline func(device *GPUDevice, shader *Shader, shaderStages []vk.PipelineShaderStageCreateInfo) bool -### type GPUAccessFlags uint32 + +## type [MaterialTextureData]() -### const ( ```go -GPUAccessIndirectCommandReadBit GPUAccessFlags = (1 << iota) -GPUAccessIndexReadBit -GPUAccessVertexAttributeReadBit -GPUAccessUniformReadBit -GPUAccessInputAttachmentReadBit -GPUAccessShaderReadBit -GPUAccessShaderWriteBit -GPUAccessColorAttachmentReadBit -GPUAccessColorAttachmentWriteBit -GPUAccessDepthStencilAttachmentReadBit -GPUAccessDepthStencilAttachmentWriteBit -GPUAccessTransferReadBit -GPUAccessTransferWriteBit -GPUAccessHostReadBit -GPUAccessHostWriteBit -GPUAccessMemoryReadBit -GPUAccessMemoryWriteBit -GPUAccessTransformFeedbackWriteBit -GPUAccessTransformFeedbackCounterReadBit -GPUAccessTransformFeedbackCounterWriteBit -GPUAccessConditionalRenderingReadBit -GPUAccessCommandProcessReadBitNvx -GPUAccessCommandProcessWriteBitNvx -GPUAccessColorAttachmentReadNoncoherentBit -GPUAccessShadingRateImageReadBitNv -GPUAccessAccelerationStructureReadBitNvx -GPUAccessAccelerationStructureWriteBitNvx +type MaterialTextureData struct { + Label string `static:"true"` + Texture string `content:"Texture"` + Filter string `options:"StringVkFilter"` +} ``` -) -### type GPUApplication struct { + +### func \(\*MaterialTextureData\) [FilterToVK]() ```go -Name string -Version GPUApplicationVersion -Instances []*GPUApplicationInstance +func (d *MaterialTextureData) FilterToVK() TextureFilter ``` -} -### func (g *GPUApplication) ApplicationVersion() (major int, minor int, patch int) + +## type [Mesh]() -### func (g *GPUApplication) CreateInstance(window RenderingContainer, assets assets.Database) (*GPUApplicationInstance, error) -### func (g *GPUApplication) Destroy() +```go +type Mesh struct { + MeshId MeshId + // contains filtered or unexported fields +} +``` + +### func [NewMesh]() -### func (g *GPUApplication) EngineVersion() (major int, minor int, patch int) +```go +func NewMesh(key string, verts []Vertex, indexes []uint32) *Mesh +``` -### func (g *GPUApplication) FirstInstance() *GPUApplicationInstance + +### func [NewMeshArrow]() -### func (g *GPUApplication) Instance(index int) (*GPUApplicationInstance, bool) +```go +func NewMeshArrow(cache *MeshCache, shaftLength, shaftRadius, tipHeight, tipRadius float32, segments int) *Mesh +``` -### func (g *GPUApplication) IsValid() bool + +### func [NewMeshCapsule]() -### func (g *GPUApplication) Setup(name string, version GPUApplicationVersion) +```go +func NewMeshCapsule(cache *MeshCache, radius, height float32, segments, rings int) *Mesh +``` +NewMeshCapsule creates a capsule mesh \(cylinder with hemispherical ends\) with the specified radius and height. The capsule is aligned along the Y\-axis, with hemispheres at y=height/2 and y=\-height/2. segments controls the number of subdivisions around the circumference, rings controls the number of rings per hemisphere. -### type GPUApplicationInstance struct { + +### func [NewMeshCircleWire]() ```go -GPUInstance -Surface GPUSurface -Devices []GPUDevice +func NewMeshCircleWire(cache *MeshCache, radius float32, segments int) *Mesh ``` +NewMeshCircleWire creates a wireframe circle \(line loop\) mesh. It follows the same pattern as the other wireframe mesh generators \(e.g. NewMeshWireCube, NewMeshWireSphereLatLon, etc.\). + + +### func [NewMeshCone]() ```go -// Has unexported fields. +func NewMeshCone(cache *MeshCache, height, baseRadius float32, segments int, capped bool) *Mesh ``` -} -### func (g *GPUApplicationInstance) Destroy() + +### func [NewMeshCube]() + +```go +func NewMeshCube(cache *MeshCache) *Mesh +``` -### func (g *GPUApplicationInstance) FinalizeLogicalDeviceSetup() -### func (g *GPUApplicationInstance) Initialize(window RenderingContainer, app *GPUApplication, assets assets.Database) error + +### func [NewMeshCubeInverse]() +```go +func NewMeshCubeInverse(cache *MeshCache) *Mesh +``` -### func (g *GPUApplicationInstance) PhysicalDevice() *GPUPhysicalDevice -### func (g *GPUApplicationInstance) PrimaryDevice() *GPUDevice + +### func [NewMeshCylinder]() +```go +func NewMeshCylinder(cache *MeshCache, height, radius float32, segments int, capped bool) *Mesh +``` -### func (g *GPUApplicationInstance) SelectPhysicalDevice(method func(options []GPUPhysicalDevice) int) error -### func (g *GPUApplicationInstance) SetupCaches(caches RenderCaches, width, height int32) error + +### func [NewMeshFrustum]() +```go +func NewMeshFrustum(cache *MeshCache, key string, inverseProjection matrix.Mat4) *Mesh +``` -### func (g *GPUApplicationInstance) SetupLogicalDevice(index int) error -### type GPUApplicationVersion struct { + +### func [NewMeshFrustumBox]() ```go -Major int -Minor int -Patch int +func NewMeshFrustumBox(cache *MeshCache, inverseProjection matrix.Mat4) *Mesh ``` -} - -### type GPUAttachmentLoadOp uint8 -### const ( + +### func [NewMeshGrid]() ```go -GPUAttachmentLoadOpLoad GPUAttachmentLoadOp = iota -GPUAttachmentLoadOpClear -GPUAttachmentLoadOpDontCare +func NewMeshGrid(cache *MeshCache, key string, points []matrix.Vec3, vertColor matrix.Color) *Mesh ``` -) -### type GPUAttachmentStoreOp uint8 -### const ( + +### func [NewMeshLine]() ```go -GPUAttachmentStoreOpStore GPUAttachmentStoreOp = iota -GPUAttachmentStoreOpDontCare +func NewMeshLine(cache *MeshCache, key string, p0, p1 matrix.Vec3, vertColor matrix.Color) *Mesh ``` -) -### type GPUBuffer struct{ GPUHandle } - -### type GPUBufferUsageFlags uint16 - -### const ( + +### func [NewMeshOffsetQuad]() ```go -GPUBufferUsageTransferSrcBit GPUBufferUsageFlags = (1 << iota) -GPUBufferUsageTransferDstBit -GPUBufferUsageUniformTexelBufferBit -GPUBufferUsageStorageTexelBufferBit -GPUBufferUsageUniformBufferBit -GPUBufferUsageStorageBufferBit -GPUBufferUsageIndexBufferBit -GPUBufferUsageVertexBufferBit -GPUBufferUsageIndirectBufferBit -GPUBufferUsageTransformFeedbackBufferBit -GPUBufferUsageTransformFeedbackCounterBufferBit -GPUBufferUsageConditionalRenderingBit -GPUBufferUsageRaytracingBitNvx +func NewMeshOffsetQuad(cache *MeshCache, key string, sideOffsets matrix.Vec4) *Mesh ``` -) -### type GPUColorSpace int32 -### const ( + +### func [NewMeshPlane]() ```go -GPUColorSpaceSrgbNonlinear GPUColorSpace = iota -GPUColorSpaceDisplayP3Nonlinear -GPUColorSpaceExtendedSrgbLinear -GPUColorSpaceDciP3Linear -GPUColorSpaceDciP3Nonlinear -GPUColorSpaceBt709Linear -GPUColorSpaceBt709Nonlinear -GPUColorSpaceBt2020Linear -GPUColorSpaceHdr10St2084 -GPUColorSpaceDolbyvision -GPUColorSpaceHdr10Hlg -GPUColorSpaceAdobergbLinear -GPUColorSpaceAdobergbNonlinear -GPUColorSpacePassThrough -GPUColorSpaceExtendedSrgbNonlinear +func NewMeshPlane(cache *MeshCache) *Mesh ``` -) -### type GPUCompositeAlphaFlags int32 -### const ( + +### func [NewMeshPoint]() ```go -GPUCompositeAlphaOpaqueBit GPUCompositeAlphaFlags = (1 << iota) -GPUCompositeAlphaPreMultipliedBit -GPUCompositeAlphaPostMultipliedBit -GPUCompositeAlphaInheritBit +func NewMeshPoint(cache *MeshCache, key string, position matrix.Vec3, vertColor matrix.Color) *Mesh ``` -) -### type GPUDescriptorImageInfo struct { + + + +### func [NewMeshQuad]() ```go -Sampler GPUSampler -ImageView GPUImageView -ImageLayout GPUImageLayout +func NewMeshQuad(cache *MeshCache) *Mesh ``` -} - -### type GPUDescriptorPool struct{ GPUHandle } -### type GPUDescriptorSet struct{ GPUHandle } + +### func [NewMeshQuadAnchored]() +```go +func NewMeshQuadAnchored(anchor QuadPivot, cache *MeshCache) *Mesh +``` -### type GPUDescriptorSetLayout struct{ GPUHandle } -### type GPUDevice struct { + +### func [NewMeshScreenQuad]() ```go -PhysicalDevice GPUPhysicalDevice -LogicalDevice GPULogicalDevice -Painter GPUPainter +func NewMeshScreenQuad(cache *MeshCache) *Mesh ``` + + +### func [NewMeshSkyboxCube]() + ```go -// Has unexported fields. +func NewMeshSkyboxCube(cache *MeshCache) *Mesh ``` -} -### func (g *GPUDevice) BlitTargets(passes []*RenderPass) + +### func [NewMeshSphere]() -### func (g *GPUDevice) CopyBuffer(srcBuffer GPUBuffer, dstBuffer GPUBuffer, size uintptr) +```go +func NewMeshSphere(cache *MeshCache, radius float32, latitudeBands, longitudeBands int) *Mesh +``` -### func (g *GPUDevice) CopyBufferToImage(buffer GPUBuffer, image GPUImage, width, height uint32, layerCount int) + +### func [NewMeshTexturableCube]() -### func (g *GPUDevice) CreateBuffer(size uintptr, usage GPUBufferUsageFlags, properties GPUMemoryPropertyFlags) (GPUBuffer, GPUDeviceMemory, error) +```go +func NewMeshTexturableCube(cache *MeshCache) *Mesh +``` -### func (g *GPUDevice) CreateFrameBuffer(renderPass *RenderPass, attachments []GPUImageView, width, height int32) (GPUFrameBuffer, error) + +### func [NewMeshTriangle]() -### func (g *GPUDevice) CreateImage(id *TextureId, properties GPUMemoryPropertyFlags, req GPUImageCreateRequest) error +```go +func NewMeshTriangle(cache *MeshCache) *Mesh +``` -### func (g *GPUDevice) CreateIndexBuffer(indices []uint32) (GPUBuffer, GPUDeviceMemory, error) + +### func [NewMeshUnitQuad]() -### func (g *GPUDevice) CreateMesh(mesh *Mesh, verts []Vertex, indices []uint32) +```go +func NewMeshUnitQuad(cache *MeshCache) *Mesh +``` -### func (g *GPUDevice) CreateShader(shader *Shader, assetDB assets.Database) error + +### func [NewMeshWireCone]() -### func (g *GPUDevice) CreateSwapChain(window RenderingContainer, inst *GPUApplicationInstance) error +```go +func NewMeshWireCone(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh +``` -### func (g *GPUDevice) CreateTextureSampler(mipLevels uint32, filter GPUFilter) (GPUSampler, error) + +### func [NewMeshWireCube]() -### func (g *GPUDevice) CreateVertexBuffer(verts []Vertex) (GPUBuffer, GPUDeviceMemory, error) +```go +func NewMeshWireCube(cache *MeshCache, key string, vertColor matrix.Color) *Mesh +``` -### func (g *GPUDevice) DestroyBuffer(buffer GPUBuffer) + +### func [NewMeshWireCylinder]() -### func (g *GPUDevice) DestroyFrameBuffer(frameBuffer GPUFrameBuffer) +```go +func NewMeshWireCylinder(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh +``` -### func (g *GPUDevice) DestroyShaderHandle(id ShaderId) + +### func [NewMeshWireQuad]() -### func (g *GPUDevice) Draw(renderPass *RenderPass, drawings []ShaderDraw, lights LightsForRender, shadows []TextureId) +```go +func NewMeshWireQuad(cache *MeshCache, key string, vertColor matrix.Color) *Mesh +``` -### func (g *GPUDevice) FreeMemory(memory GPUDeviceMemory) + +### func [NewMeshWireSphere]() -### func (g *GPUDevice) GenerateMipMaps(texId *TextureId, imageFormat GPUFormat, texWidth, texHeight, mipLevels uint32, filter GPUFilter) error +```go +func NewMeshWireSphere(cache *MeshCache, radius float32, latitudeBands, longitudeBands int) *Mesh +``` -### func (g *GPUDevice) MapMemory(memory GPUDeviceMemory, offset uintptr, size uintptr, flags GPUMemoryFlags, out *unsafe.Pointer) error + +### func \(Mesh\) [Bounds]() -### func (g *GPUDevice) Memcopy(dst unsafe.Pointer, src []byte) int +```go +func (m Mesh) Bounds() collision.AABB +``` -### func (g *GPUDevice) MeshIsReady(mesh Mesh) bool + +### func \(\*Mesh\) [DelayedCreate]() -### func (g *GPUDevice) QueueCompute(buffer *ComputeShaderBuffer) +```go +func (m *Mesh) DelayedCreate(device *GPUDevice) +``` -### func (g *GPUDevice) ReadyFrame(inst *GPUApplicationInstance, window RenderingContainer, camera cameras.Camera, uiCamera cameras.Camera, lights LightsForRender, runtime float32) bool + +### func \(Mesh\) [IsReady]() -### func (g *GPUDevice) SetupTexture(texture *Texture, data *TextureData) error +```go +func (m Mesh) IsReady() bool +``` -### func (g *GPUDevice) SwapFrame(window RenderingContainer, inst *GPUApplicationInstance, width, height int32) bool + +### func \(Mesh\) [Key]() -### func (g *GPUDevice) TextureRead(texture *Texture) ([]byte, error) +```go +func (m Mesh) Key() string +``` -### func (g *GPUDevice) TextureReadPixel(texture *Texture, x, y int) matrix.Color + +### func \(\*Mesh\) [SetKey]() -### func (g *GPUDevice) TextureWritePixels(texture *Texture, requests []GPUImageWriteRequest) +```go +func (m *Mesh) SetKey(key string) +``` -### func (g *GPUDevice) TransitionImageLayout(vt *TextureId, newLayout GPUImageLayout, aspectMask GPUImageAspectFlags, newAccess GPUAccessFlags, cmd *CommandRecorder) + +## type [MeshCache]() -### func (g *GPUDevice) UnmapMemory(memory GPUDeviceMemory) -### func (g *GPUDevice) WriteBufferToImageRegion(image GPUImage, requests []GPUImageWriteRequest) error +```go +type MeshCache struct { + // contains filtered or unexported fields +} +``` + +### func [NewMeshCache]() -### type GPUDeviceMemory struct{ GPUHandle } +```go +func NewMeshCache(device *GPUDevice, assetDatabase assets.Database) MeshCache +``` -### type GPUFence struct{ GPUHandle } + +### func \(\*MeshCache\) [AddMesh]() -### type GPUFilter uint8 +```go +func (m *MeshCache) AddMesh(mesh *Mesh) *Mesh +``` +Try to add the mesh to the cache, if it already exists, return the existing mesh -### const ( + +### func \(\*MeshCache\) [CreatePending]() ```go -GPUFilterNearest GPUFilter = iota -GPUFilterLinear -GPUFilterCubicImg +func (m *MeshCache) CreatePending() ``` -) -### type GPUFormat int32 - - -### const ( - -```go -GPUFormatUndefined GPUFormat = iota -GPUFormatR4g4UnormPack8 -GPUFormatR4g4b4a4UnormPack16 -GPUFormatB4g4r4a4UnormPack16 -GPUFormatR5g6b5UnormPack16 -GPUFormatB5g6r5UnormPack16 -GPUFormatR5g5b5a1UnormPack16 -GPUFormatB5g5r5a1UnormPack16 -GPUFormatA1r5g5b5UnormPack16 -GPUFormatR8Unorm -GPUFormatR8Snorm -GPUFormatR8Uscaled -GPUFormatR8Sscaled -GPUFormatR8Uint -GPUFormatR8Sint -GPUFormatR8Srgb -GPUFormatR8g8Unorm -GPUFormatR8g8Snorm -GPUFormatR8g8Uscaled -GPUFormatR8g8Sscaled -GPUFormatR8g8Uint -GPUFormatR8g8Sint -GPUFormatR8g8Srgb -GPUFormatR8g8b8Unorm -GPUFormatR8g8b8Snorm -GPUFormatR8g8b8Uscaled -GPUFormatR8g8b8Sscaled -GPUFormatR8g8b8Uint -GPUFormatR8g8b8Sint -GPUFormatR8g8b8Srgb -GPUFormatB8g8r8Unorm -GPUFormatB8g8r8Snorm -GPUFormatB8g8r8Uscaled -GPUFormatB8g8r8Sscaled -GPUFormatB8g8r8Uint -GPUFormatB8g8r8Sint -GPUFormatB8g8r8Srgb -GPUFormatR8g8b8a8Unorm -GPUFormatR8g8b8a8Snorm -GPUFormatR8g8b8a8Uscaled -GPUFormatR8g8b8a8Sscaled -GPUFormatR8g8b8a8Uint -GPUFormatR8g8b8a8Sint -GPUFormatR8g8b8a8Srgb -GPUFormatB8g8r8a8Unorm -GPUFormatB8g8r8a8Snorm -GPUFormatB8g8r8a8Uscaled -GPUFormatB8g8r8a8Sscaled -GPUFormatB8g8r8a8Uint -GPUFormatB8g8r8a8Sint -GPUFormatB8g8r8a8Srgb -GPUFormatA8b8g8r8UnormPack32 -GPUFormatA8b8g8r8SnormPack32 -GPUFormatA8b8g8r8UscaledPack32 -GPUFormatA8b8g8r8SscaledPack32 -GPUFormatA8b8g8r8UintPack32 -GPUFormatA8b8g8r8SintPack32 -GPUFormatA8b8g8r8SrgbPack32 -GPUFormatA2r10g10b10UnormPack32 -GPUFormatA2r10g10b10SnormPack32 -GPUFormatA2r10g10b10UscaledPack32 -GPUFormatA2r10g10b10SscaledPack32 -GPUFormatA2r10g10b10UintPack32 -GPUFormatA2r10g10b10SintPack32 -GPUFormatA2b10g10r10UnormPack32 -GPUFormatA2b10g10r10SnormPack32 -GPUFormatA2b10g10r10UscaledPack32 -GPUFormatA2b10g10r10SscaledPack32 -GPUFormatA2b10g10r10UintPack32 -GPUFormatA2b10g10r10SintPack32 -GPUFormatR16Unorm -GPUFormatR16Snorm -GPUFormatR16Uscaled -GPUFormatR16Sscaled -GPUFormatR16Uint -GPUFormatR16Sint -GPUFormatR16Sfloat -GPUFormatR16g16Unorm -GPUFormatR16g16Snorm -GPUFormatR16g16Uscaled -GPUFormatR16g16Sscaled -GPUFormatR16g16Uint -GPUFormatR16g16Sint -GPUFormatR16g16Sfloat -GPUFormatR16g16b16Unorm -GPUFormatR16g16b16Snorm -GPUFormatR16g16b16Uscaled -GPUFormatR16g16b16Sscaled -GPUFormatR16g16b16Uint -GPUFormatR16g16b16Sint -GPUFormatR16g16b16Sfloat -GPUFormatR16g16b16a16Unorm -GPUFormatR16g16b16a16Snorm -GPUFormatR16g16b16a16Uscaled -GPUFormatR16g16b16a16Sscaled -GPUFormatR16g16b16a16Uint -GPUFormatR16g16b16a16Sint -GPUFormatR16g16b16a16Sfloat -GPUFormatR32Uint -GPUFormatR32Sint -GPUFormatR32Sfloat -GPUFormatR32g32Uint -GPUFormatR32g32Sint -GPUFormatR32g32Sfloat -GPUFormatR32g32b32Uint -GPUFormatR32g32b32Sint -GPUFormatR32g32b32Sfloat -GPUFormatR32g32b32a32Uint -GPUFormatR32g32b32a32Sint -GPUFormatR32g32b32a32Sfloat -GPUFormatR64Uint -GPUFormatR64Sint -GPUFormatR64Sfloat -GPUFormatR64g64Uint -GPUFormatR64g64Sint -GPUFormatR64g64Sfloat -GPUFormatR64g64b64Uint -GPUFormatR64g64b64Sint -GPUFormatR64g64b64Sfloat -GPUFormatR64g64b64a64Uint -GPUFormatR64g64b64a64Sint -GPUFormatR64g64b64a64Sfloat -GPUFormatB10g11r11UfloatPack32 -GPUFormatE5b9g9r9UfloatPack32 -GPUFormatD16Unorm -GPUFormatX8D24UnormPack32 -GPUFormatD32Sfloat -GPUFormatS8Uint -GPUFormatD16UnormS8Uint -GPUFormatD24UnormS8Uint -GPUFormatD32SfloatS8Uint -GPUFormatBc1RgbUnormBlock -GPUFormatBc1RgbSrgbBlock -GPUFormatBc1RgbaUnormBlock -GPUFormatBc1RgbaSrgbBlock -GPUFormatBc2UnormBlock -GPUFormatBc2SrgbBlock -GPUFormatBc3UnormBlock -GPUFormatBc3SrgbBlock -GPUFormatBc4UnormBlock -GPUFormatBc4SnormBlock -GPUFormatBc5UnormBlock -GPUFormatBc5SnormBlock -GPUFormatBc6hUfloatBlock -GPUFormatBc6hSfloatBlock -GPUFormatBc7UnormBlock -GPUFormatBc7SrgbBlock -GPUFormatEtc2R8g8b8UnormBlock -GPUFormatEtc2R8g8b8SrgbBlock -GPUFormatEtc2R8g8b8a1UnormBlock -GPUFormatEtc2R8g8b8a1SrgbBlock -GPUFormatEtc2R8g8b8a8UnormBlock -GPUFormatEtc2R8g8b8a8SrgbBlock -GPUFormatEacR11UnormBlock -GPUFormatEacR11SnormBlock -GPUFormatEacR11g11UnormBlock -GPUFormatEacR11g11SnormBlock -GPUFormatAstc4x4UnormBlock -GPUFormatAstc4x4SrgbBlock -GPUFormatAstc5x4UnormBlock -GPUFormatAstc5x4SrgbBlock -GPUFormatAstc5x5UnormBlock -GPUFormatAstc5x5SrgbBlock -GPUFormatAstc6x5UnormBlock -GPUFormatAstc6x5SrgbBlock -GPUFormatAstc6x6UnormBlock -GPUFormatAstc6x6SrgbBlock -GPUFormatAstc8x5UnormBlock -GPUFormatAstc8x5SrgbBlock -GPUFormatAstc8x6UnormBlock -GPUFormatAstc8x6SrgbBlock -GPUFormatAstc8x8UnormBlock -GPUFormatAstc8x8SrgbBlock -GPUFormatAstc10x5UnormBlock -GPUFormatAstc10x5SrgbBlock -GPUFormatAstc10x6UnormBlock -GPUFormatAstc10x6SrgbBlock -GPUFormatAstc10x8UnormBlock -GPUFormatAstc10x8SrgbBlock -GPUFormatAstc10x10UnormBlock -GPUFormatAstc10x10SrgbBlock -GPUFormatAstc12x10UnormBlock -GPUFormatAstc12x10SrgbBlock -GPUFormatAstc12x12UnormBlock -GPUFormatAstc12x12SrgbBlock -GPUFormatG8b8g8r8422Unorm -GPUFormatB8g8r8g8422Unorm -GPUFormatG8B8R83plane420Unorm -GPUFormatG8B8r82plane420Unorm -GPUFormatG8B8R83plane422Unorm -GPUFormatG8B8r82plane422Unorm -GPUFormatG8B8R83plane444Unorm -GPUFormatR10x6UnormPack16 -GPUFormatR10x6g10x6Unorm2pack16 -GPUFormatR10x6g10x6b10x6a10x6Unorm4pack16 -GPUFormatG10x6b10x6g10x6r10x6422Unorm4pack16 -GPUFormatB10x6g10x6r10x6g10x6422Unorm4pack16 -GPUFormatG10x6B10x6R10x63plane420Unorm3pack16 -GPUFormatG10x6B10x6r10x62plane420Unorm3pack16 -GPUFormatG10x6B10x6R10x63plane422Unorm3pack16 -GPUFormatG10x6B10x6r10x62plane422Unorm3pack16 -GPUFormatG10x6B10x6R10x63plane444Unorm3pack16 -GPUFormatR12x4UnormPack16 -GPUFormatR12x4g12x4Unorm2pack16 -GPUFormatR12x4g12x4b12x4a12x4Unorm4pack16 -GPUFormatG12x4b12x4g12x4r12x4422Unorm4pack16 -GPUFormatB12x4g12x4r12x4g12x4422Unorm4pack16 -GPUFormatG12x4B12x4R12x43plane420Unorm3pack16 -GPUFormatG12x4B12x4r12x42plane420Unorm3pack16 -GPUFormatG12x4B12x4R12x43plane422Unorm3pack16 -GPUFormatG12x4B12x4r12x42plane422Unorm3pack16 -GPUFormatG12x4B12x4R12x43plane444Unorm3pack16 -GPUFormatG16b16g16r16422Unorm -GPUFormatB16g16r16g16422Unorm -GPUFormatG16B16R163plane420Unorm -GPUFormatG16B16r162plane420Unorm -GPUFormatG16B16R163plane422Unorm -GPUFormatG16B16r162plane422Unorm -GPUFormatG16B16R163plane444Unorm -GPUFormatPvrtc12bppUnormBlockImg -GPUFormatPvrtc14bppUnormBlockImg -GPUFormatPvrtc22bppUnormBlockImg -GPUFormatPvrtc24bppUnormBlockImg -GPUFormatPvrtc12bppSrgbBlockImg -GPUFormatPvrtc14bppSrgbBlockImg -GPUFormatPvrtc22bppSrgbBlockImg -GPUFormatPvrtc24bppSrgbBlockImg -``` -) -### type GPUFormatFeatureFlags int32 - - -### const ( - -```go -GPUFormatFeatureSampledImageBit GPUFormatFeatureFlags = iota -GPUFormatFeatureStorageImageBit -GPUFormatFeatureStorageImageAtomicBit -GPUFormatFeatureUniformTexelBufferBit -GPUFormatFeatureStorageTexelBufferBit -GPUFormatFeatureStorageTexelBufferAtomicBit -GPUFormatFeatureVertexBufferBit -GPUFormatFeatureColorAttachmentBit -GPUFormatFeatureColorAttachmentBlendBit -GPUFormatFeatureDepthStencilAttachmentBit -GPUFormatFeatureBlitSrcBit -GPUFormatFeatureBlitDstBit -GPUFormatFeatureSampledImageFilterLinearBit -GPUFormatFeatureTransferSrcBit -GPUFormatFeatureTransferDstBit -GPUFormatFeatureMidpointChromaSamplesBit -GPUFormatFeatureSampledImageYcbcrConversionLinearFilterBit -GPUFormatFeatureSampledImageYcbcrConversionSeparateReconstructionFilterBit -GPUFormatFeatureSampledImageYcbcrConversionChromaReconstructionExplicitBit -GPUFormatFeatureSampledImageYcbcrConversionChromaReconstructionExplicitForceableBit -GPUFormatFeatureDisjointBit -GPUFormatFeatureCositedChromaSamplesBit -GPUFormatFeatureSampledImageFilterCubicBitImg -GPUFormatFeatureSampledImageFilterMinmaxBit -``` -) -### type GPUFormatProperties struct { + +### func \(\*MeshCache\) [Destroy]() ```go -LinearTilingFeatures GPUFormatFeatureFlags -OptimalTilingFeatures GPUFormatFeatureFlags -BufferFeatures GPUFormatFeatureFlags +func (m *MeshCache) Destroy() ``` -} - -### type GPUFrameBuffer struct{ GPUHandle } -### type GPUHandle struct { + +### func \(\*MeshCache\) [FindMesh]() ```go -// Has unexported fields. +func (m *MeshCache) FindMesh(key string) (*Mesh, bool) ``` -} -### func (g *GPUHandle) HandleAddr() unsafe.Pointer + +### func \(\*MeshCache\) [Mesh]() -### func (g *GPUHandle) IsValid() bool +```go +func (m *MeshCache) Mesh(key string, verts []Vertex, indexes []uint32) *Mesh +``` -### func (g *GPUHandle) Reset() + +### func \(\*MeshCache\) [RemoveMesh]() + +```go +func (m *MeshCache) RemoveMesh(key string) +``` -### type GPUImage struct{ GPUHandle } -### type GPUImageAspectFlags uint16 + +## type [MeshCleanup]() -### const ( ```go -GPUImageAspectColorBit GPUImageAspectFlags = (1 << iota) -GPUImageAspectDepthBit -GPUImageAspectStencilBit -GPUImageAspectMetadataBit -GPUImageAspectPlane0Bit -GPUImageAspectPlane1Bit -GPUImageAspectPlane2Bit -GPUImageAspectMemoryPlane0Bit -GPUImageAspectMemoryPlane1Bit -GPUImageAspectMemoryPlane2Bit -GPUImageAspectMemoryPlane3Bit +type MeshCleanup struct { + // contains filtered or unexported fields +} ``` -) -### type GPUImageCreateFlags uint16 + +## type [MeshCullMode]() -### const ( ```go -GPUImageCreateSparseBindingBit GPUImageCreateFlags = (1 << iota) -GPUImageCreateSparseResidencyBit -GPUImageCreateSparseAliasedBit -GPUImageCreateMutableFormatBit -GPUImageCreateCubeCompatibleBit -GPUImageCreateAliasBit -GPUImageCreateSplitInstanceBindRegionsBit -GPUImageCreate2dArrayCompatibleBit -GPUImageCreateBlockTexelViewCompatibleBit -GPUImageCreateExtendedUsageBit -GPUImageCreateProtectedBit -GPUImageCreateDisjointBit -GPUImageCreateCornerSampledBitNv -GPUImageCreateSampleLocationsCompatibleDepthBit +type MeshCullMode = int ``` -) -### type GPUImageCreateRequest struct { + ```go -Flags GPUImageCreateFlags -ImageType GPUImageType -Format GPUFormat -Extent matrix.Vec3i -MipLevels uint32 -ArrayLayers uint32 -Samples GPUSampleCountFlags -Tiling GPUImageTiling -Usage GPUImageUsageFlags +const ( + MeshCullModeBack MeshCullMode = iota + MeshCullModeFront + MeshCullModeNone +) ``` -} - -### type GPUImageLayout uint16 + +## type [MeshDrawMode]() -### const ( ```go -GPUImageLayoutUndefined GPUImageLayout = iota -GPUImageLayoutGeneral -GPUImageLayoutColorAttachmentOptimal -GPUImageLayoutDepthStencilAttachmentOptimal -GPUImageLayoutDepthStencilReadOnlyOptimal -GPUImageLayoutShaderReadOnlyOptimal -GPUImageLayoutTransferSrcOptimal -GPUImageLayoutTransferDstOptimal -GPUImageLayoutPreinitialized -GPUImageLayoutDepthReadOnlyStencilAttachmentOptimal -GPUImageLayoutDepthAttachmentStencilReadOnlyOptimal -GPUImageLayoutPresentSrc -GPUImageLayoutSharedPresent -GPUImageLayoutShadingRateOptimalNv +type MeshDrawMode = int ``` -) -### type GPUImageTiling uint8 - - -### const ( + ```go -GPUImageTilingOptimal GPUImageTiling = iota -GPUImageTilingLinear -GPUImageTilingDrmFormatModifier +const ( + MeshDrawModePoints MeshDrawMode = iota + MeshDrawModeLines + MeshDrawModeTriangles + MeshDrawModePatches +) ``` -) -### type GPUImageType uint8 + +## type [MeshId]() -### const ( ```go -GPUImageType1d GPUImageType = iota -GPUImageType2d -GPUImageType3d +type MeshId struct { + // contains filtered or unexported fields +} ``` -) -### type GPUImageUsageFlags int32 - - -### const ( + +### func \(MeshId\) [IsValid]() ```go -GPUImageUsageTransferSrcBit GPUImageUsageFlags = (1 << iota) -GPUImageUsageTransferDstBit -GPUImageUsageSampledBit -GPUImageUsageStorageBit -GPUImageUsageColorAttachmentBit -GPUImageUsageDepthStencilAttachmentBit -GPUImageUsageTransientAttachmentBit -GPUImageUsageInputAttachmentBit -GPUImageUsageShadingRateImageBitNv +func (m MeshId) IsValid() bool ``` -) -### type GPUImageView struct{ GPUHandle } -### type GPUImageViewType uint8 + +## type [PointShadow]() -### const ( ```go -GPUImageViewType1d GPUImageViewType = iota -GPUImageViewType2d -GPUImageViewType3d -GPUImageViewTypeCube -GPUImageViewType1dArray -GPUImageViewType2dArray -GPUImageViewTypeCubeArray +type PointShadow struct { + Point matrix.Vec2 // X,Z + Radius float32 + Strength float32 +} ``` -) -### type GPUImageWriteRequest struct { - -```go -Region matrix.Vec4i -Pixels []byte -``` + +## type [QuadPivot]() -} -### type GPUInstance struct { ```go -// Has unexported fields. +type QuadPivot = int32 ``` -} - -### func (g *GPUInstance) Destroy() + +## type [RenderCaches]() -### func (g *GPUInstance) IsValid() bool +```go +type RenderCaches interface { + ShaderCache() *ShaderCache + TextureCache() *TextureCache + MeshCache() *MeshCache + FontCache() *FontCache + MaterialCache() *MaterialCache + AssetDatabase() assets.Database +} +``` -### func (g *GPUInstance) Setup(window RenderingContainer, app *GPUApplication) error + +## type [RenderPass]() -### type GPULight struct { ```go -Matrix [cubeMapSides]matrix.Mat4 -Position matrix.Vec3 +type RenderPass struct { + Handle vk.RenderPass + Buffer GPUFrameBuffer + // contains filtered or unexported fields +} ``` + +### func [NewRenderPass]() ```go -Direction matrix.Vec3 -// Has unexported fields. +func NewRenderPass(device *GPUDevice, setup *RenderPassDataCompiled) (*RenderPass, error) ``` -} -### type GPULightInfo struct { + + +### func \(\*RenderPass\) [Destroy]() ```go -Position matrix.Vec3 -Intensity float32 -Direction matrix.Vec3 -Cutoff float32 -Ambient matrix.Vec3 -OuterCutoff float32 -Diffuse matrix.Vec3 -Constant float32 -Specular matrix.Vec3 -Linear float32 -Quadratic float32 -NearPlane float32 -FarPlane float32 -Type int32 -// Has unexported fields. +func (p *RenderPass) Destroy(device *GPUDevice) ``` -} -### type GPULogicalDevice struct { + + +### func \(\*RenderPass\) [ExecuteSecondaryCommands]() ```go -GPUHandle +func (r *RenderPass) ExecuteSecondaryCommands() ``` -```go -SwapChain GPUSwapChain -``` + +### func \(\*RenderPass\) [Height]() ```go -// Has unexported fields. +func (r *RenderPass) Height() int ``` -} - -### func (g *GPULogicalDevice) CreateImageView(id *TextureId, aspectFlags GPUImageAspectFlags, viewType GPUImageViewType) error -### func (g *GPULogicalDevice) Destroy() + +### func \(\*RenderPass\) [IsShadowPass]() +```go +func (r *RenderPass) IsShadowPass() bool +``` -### func (g *GPULogicalDevice) DestroyFence(fence *GPUFence) -### func (g *GPULogicalDevice) DestroyGroup(group *DrawInstanceGroup) + +### func \(\*RenderPass\) [Recontstruct]() +```go +func (p *RenderPass) Recontstruct(device *GPUDevice) error +``` -### func (g *GPULogicalDevice) DestroySemaphore(semaphore *GPUSemaphore) -### func (g *GPULogicalDevice) FreeTexture(texId *TextureId) + +### func \(\*RenderPass\) [SelectOutputAttachment]() +```go +func (r *RenderPass) SelectOutputAttachment(device *GPUDevice) *Texture +``` -### func (g *GPULogicalDevice) ImageMemoryRequirements(image GPUImage) GPUMemoryRequirements -### func (g *GPULogicalDevice) RemakeSwapChain(window RenderingContainer, inst *GPUApplicationInstance, device *GPUDevice) error + +### func \(\*RenderPass\) [SelectOutputAttachmentWithSuffix]() +```go +func (r *RenderPass) SelectOutputAttachmentWithSuffix(suffix string) (*Texture, bool) +``` -### func (g *GPULogicalDevice) Setup(inst *GPUApplicationInstance, physicalDevice *GPUPhysicalDevice) error -### func (g *GPULogicalDevice) SetupBufferDestroyer(device *GPUDevice) + +### func \(\*RenderPass\) [Texture]() +```go +func (r *RenderPass) Texture(index int) *Texture +``` -### func (g *GPULogicalDevice) WaitForFences(fences []GPUFence) -### func (g *GPULogicalDevice) WaitForRender(device *GPUDevice) + +### func \(\*RenderPass\) [Width]() +```go +func (r *RenderPass) Width() int +``` -### func (g *GPULogicalDevice) WaitIdle() -### type GPUMemoryFlags uint16 + +## type [RenderPassAttachmentDescription]() -### const ( ```go -GPUMemoryMapPlacedBit GPUMemoryFlags = (1 << iota) +type RenderPassAttachmentDescription struct { + Format string `options:"StringVkFormat"` + Samples string `options:"StringVkSampleCountFlagBits"` + LoadOp string `options:"StringVkAttachmentLoadOp"` + StoreOp string `options:"StringVkAttachmentStoreOp"` + StencilLoadOp string `options:"StringVkAttachmentLoadOp"` + StencilStoreOp string `options:"StringVkAttachmentStoreOp"` + InitialLayout string `options:"StringVkImageLayout"` + FinalLayout string `options:"StringVkImageLayout"` + Image RenderPassAttachmentImage +} ``` -) -### type GPUMemoryHeap struct { + +### func \(\*RenderPassAttachmentDescription\) [FinalLayoutToVK]() ```go -Size uintptr -Flags GPUMemoryHeapFlags +func (ad *RenderPassAttachmentDescription) FinalLayoutToVK() GPUImageLayout ``` -} - -### type GPUMemoryHeapFlags uint8 -### const ( + +### func \(\*RenderPassAttachmentDescription\) [FormatToVK]() ```go -GPUMemoryHeapDeviceLocalBit GPUMemoryHeapFlags = (1 << iota) -GPUMemoryHeapMultiInstanceBit +func (ad *RenderPassAttachmentDescription) FormatToVK(device *GPUDevice) GPUFormat ``` -) -### type GPUMemoryPropertyFlags uint8 -### const ( + +### func \(\*RenderPassAttachmentDescription\) [InitialLayoutToVK]() ```go -GPUMemoryPropertyDeviceLocalBit GPUMemoryPropertyFlags = (1 << iota) -GPUMemoryPropertyHostVisibleBit -GPUMemoryPropertyHostCoherentBit -GPUMemoryPropertyHostCachedBit -GPUMemoryPropertyLazilyAllocatedBit -GPUMemoryPropertyProtectedBit +func (ad *RenderPassAttachmentDescription) InitialLayoutToVK() GPUImageLayout ``` -) -### type GPUMemoryRequirements struct { - -```go -Size uintptr -Alignment uintptr -MemoryTypeBits uint32 -``` -} -### type GPUMemoryType struct { + +### func \(\*RenderPassAttachmentDescription\) [LoadOpToVK]() ```go -PropertyFlags GPUMemoryPropertyFlags -HeapIndex uint32 +func (ad *RenderPassAttachmentDescription) LoadOpToVK() GPUAttachmentLoadOp ``` -} -### type GPUPainter struct { + + +### func \(\*RenderPassAttachmentDescription\) [SamplesToVK]() ```go -// Has unexported fields. +func (ad *RenderPassAttachmentDescription) SamplesToVK(device *GPUPhysicalDevice) GPUSampleCountFlags ``` -} - -### func (g *GPUPainter) DestroyDescriptorPools(device *GPUDevice) -### type GPUPhysicalDevice struct { + +### func \(\*RenderPassAttachmentDescription\) [StencilLoadOpToVK]() ```go -Features GPUPhysicalDeviceFeatures -Properties GPUPhysicalDeviceProperties -QueueFamilies []GPUQueueFamily -Extensions []GPUPhysicalDeviceExtension -SurfaceFormats []GPUSurfaceFormat -PresentModes []GPUPresentMode -SurfaceCapabilities GPUSurfaceCapabilities -// Has unexported fields. +func (ad *RenderPassAttachmentDescription) StencilLoadOpToVK() GPUAttachmentLoadOp ``` -} - -### func ListPhysicalGpuDevices(inst *GPUApplicationInstance) ([]GPUPhysicalDevice, error) -### func (g *GPUPhysicalDevice) FindComputeFamiliy() GPUQueueFamily + +### func \(\*RenderPassAttachmentDescription\) [StencilStoreOpToVK]() +```go +func (ad *RenderPassAttachmentDescription) StencilStoreOpToVK() GPUAttachmentStoreOp +``` -### func (g *GPUPhysicalDevice) FindGraphicsFamiliy() GPUQueueFamily -### func (g *GPUPhysicalDevice) FindMemoryType(typeFilter uint32, properties GPUMemoryPropertyFlags) int + +### func \(\*RenderPassAttachmentDescription\) [StoreOpToVK]() +```go +func (ad *RenderPassAttachmentDescription) StoreOpToVK() GPUAttachmentStoreOp +``` -### func (g *GPUPhysicalDevice) FindPresentFamily() GPUQueueFamily -### func (g *GPUPhysicalDevice) FindSupportedFormat(candidates []GPUFormat, tiling GPUImageTiling, features GPUFormatFeatureFlags) GPUFormat + +## type [RenderPassAttachmentDescriptionCompiled]() -### func (g *GPUPhysicalDevice) FormatIsTileable(format GPUFormat, tiling GPUImageTiling) bool +```go +type RenderPassAttachmentDescriptionCompiled struct { + Format GPUFormat + Samples GPUSampleCountFlags + LoadOp GPUAttachmentLoadOp + StoreOp GPUAttachmentStoreOp + StencilLoadOp GPUAttachmentLoadOp + StencilStoreOp GPUAttachmentStoreOp + InitialLayout GPUImageLayout + FinalLayout GPUImageLayout + Image RenderPassAttachmentImageCompiled +} +``` -### func (g *GPUPhysicalDevice) FormatProperties(format GPUFormat) GPUFormatProperties + +### func \(\*RenderPassAttachmentDescriptionCompiled\) [IsDepthFormat]() +```go +func (p *RenderPassAttachmentDescriptionCompiled) IsDepthFormat() bool +``` -### func (g *GPUPhysicalDevice) IsExtensionSupported(extension string) bool -### func (g *GPUPhysicalDevice) IsValid() bool + +## type [RenderPassAttachmentImage]() -### func (g *GPUPhysicalDevice) MaxUsableSampleCount() GPUSampleCountFlags +```go +type RenderPassAttachmentImage struct { + Name string + ExistingImage string + MipLevels uint32 + LayerCount uint32 + Tiling string `options:"StringVkImageTiling"` + Filter string `options:"StringVkFilter"` + Usage []string `options:"StringVkImageUsageFlagBits"` + MemoryProperty []string `options:"StringVkMemoryPropertyFlagBits"` + Aspect []string `options:"StringVkImageAspectFlagBits"` + Access []string `options:"StringVkAccessFlagBits"` + Clear RenderPassAttachmentImageClear `tip:"AttachmentImageClear"` +} +``` -### func (g *GPUPhysicalDevice) PadBufferSize(size uintptr) uintptr + +### func \(\*RenderPassAttachmentImage\) [AccessToVK]() +```go +func (ai *RenderPassAttachmentImage) AccessToVK() GPUAccessFlags +``` -### func (g *GPUPhysicalDevice) RefreshSurfaceCapabilities(surface unsafe.Pointer) -### type GPUPhysicalDeviceExtension struct { + +### func \(\*RenderPassAttachmentImage\) [AspectToVK]() ```go -Name string -Version uint32 +func (ai *RenderPassAttachmentImage) AspectToVK() GPUImageAspectFlags ``` -} -### type GPUPhysicalDeviceFeatures struct { - -```go -RobustBufferAccess bool -FullDrawIndexUint32 bool -ImageCubeArray bool -IndependentBlend bool -GeometryShader bool -TessellationShader bool -SampleRateShading bool -DualSrcBlend bool -LogicOp bool -MultiDrawIndirect bool -DrawIndirectFirstInstance bool -DepthClamp bool -DepthBiasClamp bool -FillModeNonSolid bool -DepthBounds bool -WideLines bool -LargePoints bool -AlphaToOne bool -MultiViewport bool -SamplerAnisotropy bool -TextureCompressionETC2 bool -TextureCompressionASTC_LDR bool -TextureCompressionBC bool -OcclusionQueryPrecise bool -PipelineStatisticsQuery bool -VertexPipelineStoresAndAtomics bool -FragmentStoresAndAtomics bool -ShaderTessellationAndGeometryPointSize bool -ShaderImageGatherExtended bool -ShaderStorageImageExtendedFormats bool -ShaderStorageImageMultisample bool -ShaderStorageImageReadWithoutFormat bool -ShaderStorageImageWriteWithoutFormat bool -ShaderUniformBufferArrayDynamicIndexing bool -ShaderSampledImageArrayDynamicIndexing bool -ShaderStorageBufferArrayDynamicIndexing bool -ShaderStorageImageArrayDynamicIndexing bool -ShaderClipDistance bool -ShaderCullDistance bool -ShaderFloat64 bool -ShaderInt64 bool -ShaderInt16 bool -ShaderResourceResidency bool -ShaderResourceMinLod bool -SparseBinding bool -SparseResidencyBuffer bool -SparseResidencyImage2D bool -SparseResidencyImage3D bool -SparseResidency2Samples bool -SparseResidency4Samples bool -SparseResidency8Samples bool -SparseResidency16Samples bool -SparseResidencyAliased bool -VariableMultisampleRate bool -InheritedQueries bool -``` -} + +### func \(\*RenderPassAttachmentImage\) [FilterToVK]() -### type GPUPhysicalDeviceLimits struct { - -```go -MaxImageDimension1D uint32 -MaxImageDimension2D uint32 -MaxImageDimension3D uint32 -MaxImageDimensionCube uint32 -MaxImageArrayLayers uint32 -MaxTexelBufferElements uint32 -MaxUniformBufferRange uint32 -MaxStorageBufferRange uint32 -MaxPushConstantsSize uint32 -MaxMemoryAllocationCount uint32 -MaxSamplerAllocationCount uint32 -BufferImageGranularity uintptr -SparseAddressSpaceSize uintptr -MaxBoundDescriptorSets uint32 -MaxPerStageDescriptorSamplers uint32 -MaxPerStageDescriptorUniformBuffers uint32 -MaxPerStageDescriptorStorageBuffers uint32 -MaxPerStageDescriptorSampledImages uint32 -MaxPerStageDescriptorStorageImages uint32 -MaxPerStageDescriptorInputAttachments uint32 -MaxPerStageResources uint32 -MaxDescriptorSetSamplers uint32 -MaxDescriptorSetUniformBuffers uint32 -MaxDescriptorSetUniformBuffersDynamic uint32 -MaxDescriptorSetStorageBuffers uint32 -MaxDescriptorSetStorageBuffersDynamic uint32 -MaxDescriptorSetSampledImages uint32 -MaxDescriptorSetStorageImages uint32 -MaxDescriptorSetInputAttachments uint32 -MaxVertexInputAttributes uint32 -MaxVertexInputBindings uint32 -MaxVertexInputAttributeOffset uint32 -MaxVertexInputBindingStride uint32 -MaxVertexOutputComponents uint32 -MaxTessellationGenerationLevel uint32 -MaxTessellationPatchSize uint32 -MaxTessellationControlPerVertexInputComponents uint32 -MaxTessellationControlPerVertexOutputComponents uint32 -MaxTessellationControlPerPatchOutputComponents uint32 -MaxTessellationControlTotalOutputComponents uint32 -MaxTessellationEvaluationInputComponents uint32 -MaxTessellationEvaluationOutputComponents uint32 -MaxGeometryShaderInvocations uint32 -MaxGeometryInputComponents uint32 -MaxGeometryOutputComponents uint32 -MaxGeometryOutputVertices uint32 -MaxGeometryTotalOutputComponents uint32 -MaxFragmentInputComponents uint32 -MaxFragmentOutputAttachments uint32 -MaxFragmentDualSrcAttachments uint32 -MaxFragmentCombinedOutputResources uint32 -MaxComputeSharedMemorySize uint32 -MaxComputeWorkGroupCount [3]uint32 -MaxComputeWorkGroupInvocations uint32 -MaxComputeWorkGroupSize [3]uint32 -SubPixelPrecisionBits uint32 -SubTexelPrecisionBits uint32 -MipmapPrecisionBits uint32 -MaxDrawIndexedIndexValue uint32 -MaxDrawIndirectCount uint32 -MaxSamplerLodBias float32 -MaxSamplerAnisotropy float32 -MaxViewports uint32 -MaxViewportDimensions [2]uint32 -ViewportBoundsRange [2]float32 -ViewportSubPixelBits uint32 -MinMemoryMapAlignment uint -MinTexelBufferOffsetAlignment uintptr -MinUniformBufferOffsetAlignment uintptr -MinStorageBufferOffsetAlignment uintptr -MinTexelOffset int32 -MaxTexelOffset uint32 -MinTexelGatherOffset int32 -MaxTexelGatherOffset uint32 -MinInterpolationOffset float32 -MaxInterpolationOffset float32 -SubPixelInterpolationOffsetBits uint32 -MaxFramebufferWidth uint32 -MaxFramebufferHeight uint32 -MaxFramebufferLayers uint32 -FramebufferColorSampleCounts GPUSampleCountFlags -FramebufferDepthSampleCounts GPUSampleCountFlags -FramebufferStencilSampleCounts GPUSampleCountFlags -FramebufferNoAttachmentsSampleCounts GPUSampleCountFlags -MaxColorAttachments uint32 -SampledImageColorSampleCounts GPUSampleCountFlags -SampledImageIntegerSampleCounts GPUSampleCountFlags -SampledImageDepthSampleCounts GPUSampleCountFlags -SampledImageStencilSampleCounts GPUSampleCountFlags -StorageImageSampleCounts GPUSampleCountFlags -MaxSampleMaskWords uint32 -TimestampComputeAndGraphics bool -TimestampPeriod float32 -MaxClipDistances uint32 -MaxCullDistances uint32 -MaxCombinedClipAndCullDistances uint32 -DiscreteQueuePriorities uint32 -PointSizeRange [2]float32 -LineWidthRange [2]float32 -PointSizeGranularity float32 -LineWidthGranularity float32 -StrictLines bool -StandardSampleLocations bool -OptimalBufferCopyOffsetAlignment uintptr -OptimalBufferCopyRowPitchAlignment uintptr -NonCoherentAtomSize uintptr +```go +func (ai *RenderPassAttachmentImage) FilterToVK() GPUFilter ``` -} -### type GPUPhysicalDeviceMemoryProperties struct { + + +### func \(\*RenderPassAttachmentImage\) [IsInvalid]() ```go -MemoryTypes []GPUMemoryType -MemoryHeaps []GPUMemoryHeap +func (img *RenderPassAttachmentImage) IsInvalid() bool ``` -} -### type GPUPhysicalDeviceProperties struct { + + +### func \(\*RenderPassAttachmentImage\) [MemoryPropertyToVK]() ```go -ApiVersion uint32 -DriverVersion uint32 -VendorID uint32 -DeviceID uint32 -DeviceType GPUPhysicalDeviceType -DeviceName string -PipelineCacheUUID string -Limits GPUPhysicalDeviceLimits -SparseProperties GPUPhysicalDeviceSparseProperties +func (ai *RenderPassAttachmentImage) MemoryPropertyToVK() GPUMemoryPropertyFlags ``` -} -### type GPUPhysicalDeviceSparseProperties struct { + + +### func \(\*RenderPassAttachmentImage\) [TilingToVK]() ```go -ResidencyStandard2DBlockShape bool -ResidencyStandard2DMultisampleBlockShape bool -ResidencyStandard3DBlockShape bool -ResidencyAlignedMipSize bool -ResidencyNonResidentStrict bool +func (ai *RenderPassAttachmentImage) TilingToVK() GPUImageTiling ``` -} - -### type GPUPhysicalDeviceType uint8 -### const ( + +### func \(\*RenderPassAttachmentImage\) [UsageToVK]() ```go -GPUPhysicalDeviceTypeOther GPUPhysicalDeviceType = iota -GPUPhysicalDeviceTypeIntegratedGpu -GPUPhysicalDeviceTypeDiscreteGpu -GPUPhysicalDeviceTypeVirtualGpu -GPUPhysicalDeviceTypeCpu +func (ai *RenderPassAttachmentImage) UsageToVK() GPUImageUsageFlags ``` -) -### type GPUPipeline struct{ GPUHandle } - - -### type GPUPipelineLayout struct{ GPUHandle } -### type GPUPipelineStageFlags uint32 + +## type [RenderPassAttachmentImageClear]() -### const ( ```go -GPUPipelineStageTopOfPipeBit GPUPipelineStageFlags = (1 << iota) -GPUPipelineStageDrawIndirectBit -GPUPipelineStageVertexInputBit -GPUPipelineStageVertexShaderBit -GPUPipelineStageTessellationControlShaderBit -GPUPipelineStageTessellationEvaluationShaderBit -GPUPipelineStageGeometryShaderBit -GPUPipelineStageFragmentShaderBit -GPUPipelineStageEarlyFragmentTestsBit -GPUPipelineStageLateFragmentTestsBit -GPUPipelineStageColorAttachmentOutputBit -GPUPipelineStageComputeShaderBit -GPUPipelineStageTransferBit -GPUPipelineStageBottomOfPipeBit -GPUPipelineStageHostBit -GPUPipelineStageAllGraphicsBit -GPUPipelineStageAllCommandsBit -GPUPipelineStageTransformFeedbackBit -GPUPipelineStageConditionalRenderingBit -GPUPipelineStageCommandProcessBitNvx -GPUPipelineStageShadingRateImageBitNv -GPUPipelineStageRaytracingBitNvx -GPUPipelineStageTaskShaderBitNv -GPUPipelineStageMeshShaderBitNv +type RenderPassAttachmentImageClear struct { + R float32 + G float32 + B float32 + A float32 + Depth float32 + Stencil uint32 +} ``` -) -### type GPUPresentMode int32 + +## type [RenderPassAttachmentImageCompiled]() -### const ( ```go -GPUPresentModeImmediate GPUPresentMode = iota -GPUPresentModeMailbox -GPUPresentModeFifo -GPUPresentModeFifoRelaxed -GPUPresentModeSharedDemandRefresh -GPUPresentModeSharedContinuousRefresh +type RenderPassAttachmentImageCompiled struct { + Name string + ExistingImage string + MipLevels uint32 + LayerCount uint32 + Tiling GPUImageTiling + Filter GPUFilter + Usage GPUImageUsageFlags + MemoryProperty GPUMemoryPropertyFlags + Aspect GPUImageAspectFlags + Access GPUAccessFlags +} ``` -) -### type GPUQueue struct{ GPUHandle } - - -### type GPUQueueFamily struct { + +### func \(\*RenderPassAttachmentImageCompiled\) [IsInvalid]() ```go -Index int -MinImageTransferGranularity matrix.Vec3i -IsGraphics bool -IsCompute bool -IsTransfer bool -IsSparseBinding bool -IsProtected bool -HasPresentSupport bool +func (img *RenderPassAttachmentImageCompiled) IsInvalid() bool ``` -} - -### func InvalidGPUQueueFamily() GPUQueueFamily - - -### func (g GPUQueueFamily) IsValid() bool -### type GPUResult int32 + +## type [RenderPassAttachmentReference]() -### type GPUSampleCountFlags uint8 - - -### const ( ```go -GPUSampleCount1Bit GPUSampleCountFlags = (1 << iota) -GPUSampleCount2Bit -GPUSampleCount4Bit -GPUSampleCount8Bit -GPUSampleCount16Bit -GPUSampleCount32Bit -GPUSampleCount64Bit -GPUSampleSwapChainCount +type RenderPassAttachmentReference struct { + Attachment uint32 + Layout string `options:"StringVkImageLayout"` +} ``` -) -### type GPUSampler struct{ GPUHandle } + +### func \(\*RenderPassAttachmentReference\) [LayoutToVK]() +```go +func (ad *RenderPassAttachmentReference) LayoutToVK() GPUImageLayout +``` -### type GPUSemaphore struct{ GPUHandle } -### type GPUShaderModule struct{ GPUHandle } + +## type [RenderPassAttachmentReferenceCompiled]() -### type GPUSurface struct { ```go -// Has unexported fields. -``` - +type RenderPassAttachmentReferenceCompiled struct { + Attachment uint32 + Layout vulkan_const.ImageLayout } +``` -### func (g *GPUSurface) Create(instance *GPUInstance, window RenderingContainer) error + +## type [RenderPassData]() -### func (g *GPUSurface) Destroy(inst *GPUApplicationInstance) +```go +type RenderPassData struct { + Name string + Sort int + AttachmentDescriptions []RenderPassAttachmentDescription + SubpassDescriptions []RenderPassSubpassDescription + SubpassDependencies []RenderPassSubpassDependency + Width int + Height int + SkipCombine bool +} +``` -### type GPUSurfaceCapabilities struct { + +### func [NewRenderPassData]() ```go -MinImageCount uint32 -MaxImageCount uint32 -CurrentExtent matrix.Vec2i -MinImageExtent matrix.Vec2i -MaxImageExtent matrix.Vec2i -MaxImageArrayLayers uint32 -SupportedTransforms GPUSurfaceTransformFlags -CurrentTransform GPUSurfaceTransformFlags -SupportedCompositeAlpha GPUCompositeAlphaFlags -SupportedUsageFlags GPUImageUsageFlags +func NewRenderPassData(src string) (RenderPassData, error) ``` -} -### type GPUSurfaceFormat struct { + + +### func \(\*RenderPassData\) [Compile]() ```go -Format GPUFormat -ColorSpace GPUColorSpace +func (d *RenderPassData) Compile(device *GPUDevice) RenderPassDataCompiled ``` -} - -### type GPUSurfaceTransformFlags int32 -### const ( + +## type [RenderPassDataCompiled]() -```go -GPUSurfaceTransformIdentityBit GPUSurfaceTransformFlags = (1 << iota) -GPUSurfaceTransformRotate90Bit -GPUSurfaceTransformRotate180Bit -GPUSurfaceTransformRotate270Bit -GPUSurfaceTransformHorizontalMirrorBit -GPUSurfaceTransformHorizontalMirrorRotate90Bit -GPUSurfaceTransformHorizontalMirrorRotate180Bit -GPUSurfaceTransformHorizontalMirrorRotate270Bit -GPUSurfaceTransformInheritBit -``` -) -### type GPUSwapChain struct { ```go -GPUHandle -Images []TextureId -Extent matrix.Vec2i -Depth TextureId -Color TextureId -FrameBuffers []GPUFrameBuffer +type RenderPassDataCompiled struct { + Name string + Sort int + Width int + Height int + AttachmentDescriptions []RenderPassAttachmentDescriptionCompiled + SubpassDescriptions []RenderPassSubpassDescriptionCompiled + SubpassDependencies []RenderPassSubpassDependencyCompiled + ImageClears []vk.ClearValue + Subpass []RenderPassSubpassDataCompiled + SkipCombine bool +} ``` + +### func \(\*RenderPassDataCompiled\) [ConstructRenderPass]() ```go -// Has unexported fields. +func (r *RenderPassDataCompiled) ConstructRenderPass(device *GPUDevice) (*RenderPass, error) ``` -} -### func (g *GPUSwapChain) CopyAndReset() GPUSwapChain + + +## type [RenderPassGroup]() -### func (g *GPUSwapChain) CreateColor(device *GPUDevice) error +```go +type RenderPassGroup struct { + // contains filtered or unexported fields +} +``` -### func (g *GPUSwapChain) CreateDepth(device *GPUDevice) error + +## type [RenderPassSubpass]() -### func (g *GPUSwapChain) CreateFrameBuffer(device *GPUDevice) error +```go +type RenderPassSubpass struct { + // contains filtered or unexported fields +} +``` -### func (g *GPUSwapChain) Destroy(device *GPUDevice) + +## type [RenderPassSubpassData]() -### func (g *GPUSwapChain) SelectExtent(window RenderingContainer, device *GPUPhysicalDevice) matrix.Vec2i +```go +type RenderPassSubpassData struct { + Shader string `options:""` + ShaderPipeline string `options:""` + SampledImages []RenderPassSubpassImageData +} +``` -### func (g *GPUSwapChain) SelectPresentMode(device *GPUPhysicalDevice) GPUPresentMode + +## type [RenderPassSubpassDataCompiled]() -### func (g *GPUSwapChain) SelectSurfaceFormat(device *GPUPhysicalDevice) GPUSurfaceFormat +```go +type RenderPassSubpassDataCompiled struct { + Shader string + ShaderPipeline string + SampledImages []int +} +``` -### func (g *GPUSwapChain) Setup(window RenderingContainer, inst *GPUApplicationInstance, device *GPUDevice) error + +## type [RenderPassSubpassDependency]() -### func (g *GPUSwapChain) SetupImageViews(device *GPUDevice) error +```go +type RenderPassSubpassDependency struct { + SrcSubpass int64 + DstSubpass int64 + SrcStageMask []string `options:"StringVkPipelineStageFlagBits"` + DstStageMask []string `options:"StringVkPipelineStageFlagBits"` + SrcAccessMask []string `options:"StringVkAccessFlagBits"` + DstAccessMask []string `options:"StringVkAccessFlagBits"` + DependencyFlags []string `options:"StringVkDependencyFlagBits"` +} +``` -### func (g *GPUSwapChain) SetupRenderPass(device *GPUDevice, assets assets.Database) error + +### func \(\*RenderPassSubpassDependency\) [DependencyFlagsToVK]() +```go +func (sd *RenderPassSubpassDependency) DependencyFlagsToVK() vk.DependencyFlags +``` -### func (g *GPUSwapChain) SetupSyncObjects(device *GPUDevice) error -### type GPUSwapChainSupportDetails struct { + +### func \(\*RenderPassSubpassDependency\) [DstAccessMaskToVK]() ```go -// Has unexported fields. +func (sd *RenderPassSubpassDependency) DstAccessMaskToVK() GPUAccessFlags ``` -} -### type GlobalShaderData struct { + + +### func \(\*RenderPassSubpassDependency\) [DstStageMaskToVK]() ```go -View matrix.Mat4 -Projection matrix.Mat4 -UIView matrix.Mat4 -UIProjection matrix.Mat4 -CameraPosition matrix.Vec4 -UICameraPosition matrix.Vec3 -Time float32 -ScreenSize matrix.Vec2 -CascadeCount int32 +func (sd *RenderPassSubpassDependency) DstStageMaskToVK() vk.PipelineStageFlags ``` + + +### func \(\*RenderPassSubpassDependency\) [SrcAccessMaskToVK]() + ```go -CascadePlaneDistances [4]float32 -VertLights [MaxLocalLights]GPULight -LightInfos [MaxLocalLights]GPULightInfo -// Has unexported fields. +func (sd *RenderPassSubpassDependency) SrcAccessMaskToVK() GPUAccessFlags ``` -} -### type InstanceCopyData struct { + + +### func \(\*RenderPassSubpassDependency\) [SrcStageMaskToVK]() ```go -// Has unexported fields. +func (sd *RenderPassSubpassDependency) SrcStageMaskToVK() vk.PipelineStageFlags ``` -} -### func InstanceCopyDataNew(padding int) InstanceCopyData + + +## type [RenderPassSubpassDependencyCompiled]() -### type InstanceDriverData struct { ```go -// Has unexported fields. +type RenderPassSubpassDependencyCompiled struct { + SrcSubpass uint32 + DstSubpass uint32 + SrcStageMask vk.PipelineStageFlags + DstStageMask vk.PipelineStageFlags + SrcAccessMask vk.AccessFlags + DstAccessMask vk.AccessFlags + DependencyFlags vk.DependencyFlags +} ``` -} + +## type [RenderPassSubpassDescription]() + -### type InstanceGroupSkinningData struct { +```go +type RenderPassSubpassDescription struct { + PipelineBindPoint string `options:"StringVkPipelineBindPoint"` + ColorAttachmentReferences []RenderPassAttachmentReference + InputAttachmentReferences []RenderPassAttachmentReference + ResolveAttachments []RenderPassAttachmentReference + DepthStencilAttachment []RenderPassAttachmentReference // 1 max + PreserveAttachments []uint32 // TODO + Subpass RenderPassSubpassData } +``` -### type Light struct { + +### func \(\*RenderPassSubpassDescription\) [PipelineBindPointToVK]() ```go -// Has unexported fields. +func (ad *RenderPassSubpassDescription) PipelineBindPointToVK() vulkan_const.PipelineBindPoint ``` -} -### func NewLight(device *GPUDevice, assetDb assets.Database, materialCache *MaterialCache, lightType LightType) Light + + +## type [RenderPassSubpassDescriptionCompiled]() -### func (l *Light) Direction(followcam cameras.Camera) matrix.Vec3 +```go +type RenderPassSubpassDescriptionCompiled struct { + PipelineBindPoint vulkan_const.PipelineBindPoint + ColorAttachmentReferences []RenderPassAttachmentReferenceCompiled + InputAttachmentReferences []RenderPassAttachmentReferenceCompiled + ResolveAttachments []RenderPassAttachmentReferenceCompiled + DepthStencilAttachment []RenderPassAttachmentReferenceCompiled // 1 max + PreserveAttachments []uint32 // TODO +} +``` -### func (l *Light) FrameDirty() bool + +## type [RenderPassSubpassImageData]() -### func (l *Light) IsValid() bool +```go +type RenderPassSubpassImageData struct { + SampledImage string +} +``` -### func (l *Light) ResetFrameDirty() bool + +## type [RenderingContainer]() -### func (l *Light) SetAmbient(ambient matrix.Vec3) +```go +type RenderingContainer interface { + GetDrawableSize() (int32, int32) + GetInstanceExtensions() []string + PlatformWindow() unsafe.Pointer + PlatformInstance() unsafe.Pointer +} +``` -### func (l *Light) SetCastsShadows(castsShadows bool) + +## type [Shader]() -### func (l *Light) SetConstant(constant float32) +```go +type Shader struct { + RenderId ShaderId -### func (l *Light) SetCutoff(cutoff float32) + Material MaterialData + DriverData ShaderDriverData + Type ShaderType + // contains filtered or unexported fields +} +``` -### func (l *Light) SetDiffuse(diffuse matrix.Vec3) + +### func [NewShader]() +```go +func NewShader(shaderData ShaderDataCompiled) *Shader +``` -### func (l *Light) SetDirection(dir matrix.Vec3) -### func (l *Light) SetIntensity(intensity float32) + +### func \(\*Shader\) [AddSubShader]() +```go +func (s *Shader) AddSubShader(key string, shader *Shader) +``` -### func (l *Light) SetLinear(linear float32) -### func (l *Light) SetOuterCutoff(outerCutoff float32) + +### func \(\*Shader\) [DelayedCreate]() +```go +func (s *Shader) DelayedCreate(device *GPUDevice, assetDatabase assets.Database) +``` -### func (l *Light) SetPosition(position matrix.Vec3) -### func (l *Light) SetQuadratic(quadratic float32) + +### func \(\*Shader\) [Reload]() +```go +func (s *Shader) Reload(shaderData ShaderDataCompiled) +``` -### func (l *Light) SetSpecular(specular matrix.Vec3) -### func (l *Light) Type() LightType + +### func \(\*Shader\) [RemoveSubShader]() +```go +func (s *Shader) RemoveSubShader(key string) +``` -### func (l *Light) WorldSpace(followcam cameras.Camera) matrix.Vec3 -### type LightShadowShaderData struct { + +### func \(\*Shader\) [ShaderDataName]() ```go -ShaderDataBase -LightIndex int32 +func (s *Shader) ShaderDataName() string ``` -} -### func (t LightShadowShaderData) Size() int + +### func \(\*Shader\) [SubShader]() -### type LightType int +```go +func (s *Shader) SubShader(key string) *Shader +``` -### type LightsForRender struct { -```go -Lights []Light -HasChanges bool -``` + +## type [ShaderBuffer]() -} -### type Material struct { ```go -Id string +type ShaderBuffer struct { + // contains filtered or unexported fields +} ``` + +## type [ShaderCache]() + + ```go -Shader *Shader -Textures []*Texture -Instances map[string]*Material -Root weak.Pointer[Material] -PrepassMaterial weak.Pointer[Material] +type ShaderCache struct { + // contains filtered or unexported fields +} ``` + +### func [NewShaderCache]() ```go -IsLit bool -ReceivesShadows bool -CastsShadows bool -// Has unexported fields. +func NewShaderCache(device *GPUDevice, assetDatabase assets.Database) ShaderCache ``` -} - -### func (m *Material) CreateInstance(textures []*Texture) *Material -### func (m *Material) Destroy(device *GPUDevice) + +### func \(\*ShaderCache\) [AddShader]() +```go +func (s *ShaderCache) AddShader(shader *Shader) +``` -### func (m *Material) HasTransparentSuffix() bool -### func (m *Material) RenderPass() *RenderPass + +### func \(\*ShaderCache\) [CreatePending]() +```go +func (s *ShaderCache) CreatePending() +``` -### func (m *Material) SelectRoot() *Material -### type MaterialCache struct { + +### func \(\*ShaderCache\) [Destroy]() ```go -// Has unexported fields. +func (s *ShaderCache) Destroy() ``` -} -### func NewMaterialCache(device *GPUDevice, assetDatabase assets.Database) MaterialCache + +### func \(\*ShaderCache\) [ReloadShader]() + +```go +func (s *ShaderCache) ReloadShader(shaderData ShaderDataCompiled) +``` -### func (m *MaterialCache) AddMaterial(material *Material) *Material -### func (m *MaterialCache) Destroy() + +### func \(\*ShaderCache\) [Shader]() +```go +func (s *ShaderCache) Shader(shaderData ShaderDataCompiled) (shader *Shader, isNew bool) +``` -### func (m *MaterialCache) FindMaterial(key string) (*Material, bool) -### func (m *MaterialCache) Material(key string) (*Material, error) + +## type [ShaderCleanup]() -### type MaterialData struct { ```go -Shader string `options:""` // Blank = fallback -RenderPass string `options:""` // Blank = fallback -ShaderPipeline string `options:"" label:"Pipeline"` // Blank = fallback -Textures []MaterialTextureData -PrepassMaterial string -IsLit bool -ReceivesShadows bool -CastsShadows bool -``` - +type ShaderCleanup struct { + // contains filtered or unexported fields } +``` -### func (d *MaterialData) Compile(assets assets.Database, device *GPUDevice) (*Material, error) + +## type [ShaderData]() -### func (d *MaterialData) CompileExt(assets assets.Database, device *GPUDevice, copyShader bool) (*Material, error) +```go +type ShaderData struct { + Name string + EnableDebug bool + Vertex string `options:""` + VertexFlags string `tip:"CompileFlags"` + Fragment string `options:""` + FragmentFlags string `tip:"CompileFlags"` + Geometry string `options:""` + GeometryFlags string `tip:"CompileFlags"` + TessellationControl string `options:""` + TessellationControlFlags string `tip:"CompileFlags"` + TessellationEvaluation string `options:""` + TessellationEvaluationFlags string `tip:"CompileFlags"` + Compute string `options:""` + ComputeFlags string `tip:"CompileFlags"` + LayoutGroups []ShaderLayoutGroup `visible:"false"` + SamplerLabels []string + VertexSpv string + FragmentSpv string + GeometrySpv string + TessellationControlSpv string + TessellationEvaluationSpv string + ComputeSpv string +} +``` -### type MaterialTextureData struct { + +### func \(\*ShaderData\) [Compile]() ```go -Label string `static:"true"` -Texture string `content:"Texture"` -Filter string `options:"StringVkFilter"` +func (d *ShaderData) Compile() ShaderDataCompiled ``` -} -### func (d *MaterialTextureData) FilterToVK() TextureFilter + + +## type [ShaderDataBase]() -### type Mesh struct { ```go -MeshId MeshId +type ShaderDataBase struct { + InitModel matrix.Mat4 + // contains filtered or unexported fields +} ``` + +### func [NewShaderDataBase]() ```go -// Has unexported fields. +func NewShaderDataBase() ShaderDataBase ``` -} -### func NewMesh(key string, verts []Vertex, indexes []uint32) *Mesh + +### func \(\*ShaderDataBase\) [Activate]() -### func NewMeshArrow(cache *MeshCache, shaftLength, shaftRadius, tipHeight, tipRadius float32, segments int) *Mesh +```go +func (s *ShaderDataBase) Activate() +``` -### func NewMeshCapsule(cache *MeshCache, radius, height float32, segments, rings int) *Mesh + + +### func \(\*ShaderDataBase\) [Base]() ```go - NewMeshCapsule creates a capsule mesh (cylinder with hemispherical ends) - with the specified radius and height. The capsule is aligned along the - Y-axis, with hemispheres at y=height/2 and y=-height/2. segments controls - the number of subdivisions around the circumference, rings controls the - number of rings per hemisphere. +func (s *ShaderDataBase) Base() *ShaderDataBase ``` -### func NewMeshCircleWire(cache *MeshCache, radius float32, segments int) *Mesh + + +### func \(\*ShaderDataBase\) [BoundDataPointer]() ```go - NewMeshCircleWire creates a wireframe circle (line loop) mesh. - It follows the same pattern as the other wireframe mesh generators (e.g. - NewMeshWireCube, NewMeshWireSphereLatLon, etc.). +func (s *ShaderDataBase) BoundDataPointer() unsafe.Pointer ``` -### func NewMeshCone(cache *MeshCache, height, baseRadius float32, segments int, capped bool) *Mesh + +### func \(\*ShaderDataBase\) [CancelDestroy]() -### func NewMeshCube(cache *MeshCache) *Mesh - +```go +func (s *ShaderDataBase) CancelDestroy() +``` -### func NewMeshCubeInverse(cache *MeshCache) *Mesh -### func NewMeshCylinder(cache *MeshCache, height, radius float32, segments int, capped bool) *Mesh + +### func \(\*ShaderDataBase\) [DataPointer]() +```go +func (s *ShaderDataBase) DataPointer() unsafe.Pointer +``` -### func NewMeshFrustum(cache *MeshCache, key string, inverseProjection matrix.Mat4) *Mesh -### func NewMeshFrustumBox(cache *MeshCache, inverseProjection matrix.Mat4) *Mesh + +### func \(\*ShaderDataBase\) [Deactivate]() +```go +func (s *ShaderDataBase) Deactivate() +``` -### func NewMeshGrid(cache *MeshCache, key string, points []matrix.Vec3, vertColor matrix.Color) *Mesh -### func NewMeshLine(cache *MeshCache, key string, p0, p1 matrix.Vec3, vertColor matrix.Color) *Mesh + +### func \(\*ShaderDataBase\) [Destroy]() +```go +func (s *ShaderDataBase) Destroy() +``` -### func NewMeshOffsetQuad(cache *MeshCache, key string, sideOffsets matrix.Vec4) *Mesh -### func NewMeshPlane(cache *MeshCache) *Mesh + +### func \(\*ShaderDataBase\) [InstanceBoundDataSize]() +```go +func (s *ShaderDataBase) InstanceBoundDataSize() int +``` -### func NewMeshPoint(cache *MeshCache, key string, position matrix.Vec3, vertColor matrix.Color) *Mesh -### func NewMeshQuad(cache *MeshCache) *Mesh + +### func \(\*ShaderDataBase\) [IsDestroyed]() +```go +func (s *ShaderDataBase) IsDestroyed() bool +``` -### func NewMeshQuadAnchored(anchor QuadPivot, cache *MeshCache) *Mesh -### func NewMeshScreenQuad(cache *MeshCache) *Mesh + +### func \(\*ShaderDataBase\) [IsInView]() +```go +func (s *ShaderDataBase) IsInView() bool +``` -### func NewMeshSkyboxCube(cache *MeshCache) *Mesh -### func NewMeshSphere(cache *MeshCache, radius float32, latitudeBands, longitudeBands int) *Mesh + +### func \(\*ShaderDataBase\) [Model]() +```go +func (s *ShaderDataBase) Model() matrix.Mat4 +``` -### func NewMeshTexturableCube(cache *MeshCache) *Mesh -### func NewMeshTriangle(cache *MeshCache) *Mesh + +### func \(\*ShaderDataBase\) [ModelPtr]() +```go +func (s *ShaderDataBase) ModelPtr() *matrix.Mat4 +``` -### func NewMeshUnitQuad(cache *MeshCache) *Mesh -### func NewMeshWireCone(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh + +### func \(\*ShaderDataBase\) [SelectLights]() +```go +func (s *ShaderDataBase) SelectLights(lights LightsForRender) +``` -### func NewMeshWireCube(cache *MeshCache, key string, vertColor matrix.Color) *Mesh -### func NewMeshWireCylinder(cache *MeshCache, radius, height float32, segments, heightSegments int) *Mesh + +### func \(\*ShaderDataBase\) [SetModel]() +```go +func (s *ShaderDataBase) SetModel(model matrix.Mat4) +``` -### func NewMeshWireQuad(cache *MeshCache, key string, vertColor matrix.Color) *Mesh -### func NewMeshWireSphere(cache *MeshCache, radius float32, latitudeBands, longitudeBands int) *Mesh + +### func \(\*ShaderDataBase\) [Setup]() +```go +func (s *ShaderDataBase) Setup() +``` -### func (m Mesh) Bounds() collision.AABB -### func (m *Mesh) DelayedCreate(device *GPUDevice) + +### func \(\*ShaderDataBase\) [SkinningHeader]() +```go +func (s *ShaderDataBase) SkinningHeader() *SkinnedShaderDataHeader +``` -### func (m Mesh) IsReady() bool -### func (m Mesh) Key() string + +### func \(\*ShaderDataBase\) [Transform]() +```go +func (s *ShaderDataBase) Transform() *matrix.Transform +``` -### func (m *Mesh) SetKey(key string) -### type MeshCache struct { + +### func \(\*ShaderDataBase\) [UpdateBoundData]() ```go -// Has unexported fields. +func (s *ShaderDataBase) UpdateBoundData() bool ``` -} - -### func NewMeshCache(device *GPUDevice, assetDatabase assets.Database) MeshCache -### func (m *MeshCache) AddMesh(mesh *Mesh) *Mesh + +### func \(\*ShaderDataBase\) [UpdateModel]() ```go - Try to add the mesh to the cache, if it already exists, return the existing - mesh +func (s *ShaderDataBase) UpdateModel(viewCuller ViewCuller, container collision.AABB) ``` -### func (m *MeshCache) CreatePending() + + +## type [ShaderDataCombine]() -### func (m *MeshCache) Destroy() +```go +type ShaderDataCombine struct { + ShaderDataBase + Color matrix.Color +} +``` -### func (m *MeshCache) FindMesh(key string) (*Mesh, bool) + +### func \(ShaderDataCombine\) [Size]() +```go +func (t ShaderDataCombine) Size() int +``` -### func (m *MeshCache) Mesh(key string, verts []Vertex, indexes []uint32) *Mesh -### func (m *MeshCache) RemoveMesh(key string) + +## type [ShaderDataCompiled]() -### type MeshCleanup struct { ```go -// Has unexported fields. +type ShaderDataCompiled struct { + Name string + Vertex string + Fragment string + Geometry string + TessellationControl string + TessellationEvaluation string + Compute string + LayoutGroups []ShaderLayoutGroup + SamplerLabels []string +} ``` -} + +### func \(\*ShaderDataCompiled\) [IsCompute]() + +```go +func (s *ShaderDataCompiled) IsCompute() bool +``` -### type MeshCullMode = int -### const ( + +### func \(\*ShaderDataCompiled\) [SelectLayout]() ```go -MeshCullModeBack MeshCullMode = iota -MeshCullModeFront -MeshCullModeNone +func (s *ShaderDataCompiled) SelectLayout(stage string) *ShaderLayoutGroup ``` -) -### type MeshDrawMode = int -### const ( + +### func \(\*ShaderDataCompiled\) [Stride]() ```go -MeshDrawModePoints MeshDrawMode = iota -MeshDrawModeLines -MeshDrawModeTriangles -MeshDrawModePatches +func (sd *ShaderDataCompiled) Stride() uint32 ``` -) -### type MeshId struct { + + + +### func \(\*ShaderDataCompiled\) [ToAttributeDescription]() ```go -// Has unexported fields. +func (sd *ShaderDataCompiled) ToAttributeDescription(locationStart uint32) []vk.VertexInputAttributeDescription ``` -} - -### func (m MeshId) IsValid() bool -### type PointShadow struct { + +### func \(\*ShaderDataCompiled\) [ToDescriptorSetLayoutStructure]() ```go -Point matrix.Vec2 // X,Z -Radius float32 -Strength float32 +func (sd *ShaderDataCompiled) ToDescriptorSetLayoutStructure() DescriptorSetLayoutStructure ``` -} - -### type QuadPivot = int32 -### type RenderCaches interface { + +### func \(\*ShaderDataCompiled\) [WorkGroups]() ```go -ShaderCache() *ShaderCache -TextureCache() *TextureCache -MeshCache() *MeshCache -FontCache() *FontCache -MaterialCache() *MaterialCache -AssetDatabase() assets.Database +func (sd *ShaderDataCompiled) WorkGroups() [3]uint32 ``` -} -### type RenderPass struct { + + +## type [ShaderDraw]() + + ```go -Handle vk.RenderPass -Buffer GPUFrameBuffer +type ShaderDraw struct { + // contains filtered or unexported fields +} ``` + +### func [NewShaderDraw]() ```go -// Has unexported fields. +func NewShaderDraw(material *Material) ShaderDraw ``` -} - -### func NewRenderPass(device *GPUDevice, setup *RenderPassDataCompiled) (*RenderPass, error) -### func (p *RenderPass) Destroy(device *GPUDevice) + +### func \(\*ShaderDraw\) [AddInstanceGroup]() +```go +func (s *ShaderDraw) AddInstanceGroup(group DrawInstanceGroup) +``` -### func (r *RenderPass) ExecuteSecondaryCommands() -### func (r *RenderPass) Height() int + +### func \(\*ShaderDraw\) [Clear]() +```go +func (s *ShaderDraw) Clear() +``` -### func (r *RenderPass) IsShadowPass() bool -### func (p *RenderPass) Recontstruct(device *GPUDevice) error + +### func \(\*ShaderDraw\) [Destroy]() +```go +func (s *ShaderDraw) Destroy(device *GPUDevice) +``` -### func (r *RenderPass) SelectOutputAttachment(device *GPUDevice) *Texture -### func (r *RenderPass) SelectOutputAttachmentWithSuffix(suffix string) (*Texture, bool) + +### func \(\*ShaderDraw\) [Filter]() +```go +func (s *ShaderDraw) Filter(filter func(*DrawInstanceGroup) bool) []*DrawInstanceGroup +``` -### func (r *RenderPass) Texture(index int) *Texture -### func (r *RenderPass) Width() int + +## type [ShaderDriverData]() -### type RenderPassAttachmentDescription struct { ```go -Format string `options:"StringVkFormat"` -Samples string `options:"StringVkSampleCountFlagBits"` -LoadOp string `options:"StringVkAttachmentLoadOp"` -StoreOp string `options:"StringVkAttachmentStoreOp"` -StencilLoadOp string `options:"StringVkAttachmentLoadOp"` -StencilStoreOp string `options:"StringVkAttachmentStoreOp"` -InitialLayout string `options:"StringVkImageLayout"` -FinalLayout string `options:"StringVkImageLayout"` -Image RenderPassAttachmentImage -``` - +type ShaderDriverData struct { + DescriptorSetLayoutStructure + Stride uint32 + AttributeDescriptions []vk.VertexInputAttributeDescription } +``` -### func (ad *RenderPassAttachmentDescription) FinalLayoutToVK() GPUImageLayout + +### func [NewShaderDriverData]() +```go +func NewShaderDriverData() ShaderDriverData +``` -### func (ad *RenderPassAttachmentDescription) FormatToVK(device *GPUDevice) GPUFormat -### func (ad *RenderPassAttachmentDescription) InitialLayoutToVK() GPUImageLayout + +## type [ShaderId]() -### func (ad *RenderPassAttachmentDescription) LoadOpToVK() GPUAttachmentLoadOp +```go +type ShaderId struct { + // contains filtered or unexported fields +} +``` -### func (ad *RenderPassAttachmentDescription) SamplesToVK(device *GPUPhysicalDevice) GPUSampleCountFlags + +### func \(ShaderId\) [IsValid]() +```go +func (s ShaderId) IsValid() bool +``` -### func (ad *RenderPassAttachmentDescription) StencilLoadOpToVK() GPUAttachmentLoadOp -### func (ad *RenderPassAttachmentDescription) StencilStoreOpToVK() GPUAttachmentStoreOp + +## type [ShaderLayout]() -### func (ad *RenderPassAttachmentDescription) StoreOpToVK() GPUAttachmentStoreOp +```go +type ShaderLayout struct { + Location int // -1 if not set + Binding int // -1 if not set + Count int // 1 if not set + Set int // -1 if not set + InputAttachment int // -1 if not set + Type string // float, vec3, mat4, etc. + Name string + Source string // in, out, uniform, buffer + Fields []ShaderLayoutStructField +} +``` -### type RenderPassAttachmentDescriptionCompiled struct { + +### func \(\*ShaderLayout\) [Capacity]() ```go -Format GPUFormat -Samples GPUSampleCountFlags -LoadOp GPUAttachmentLoadOp -StoreOp GPUAttachmentStoreOp -StencilLoadOp GPUAttachmentLoadOp -StencilStoreOp GPUAttachmentStoreOp -InitialLayout GPUImageLayout -FinalLayout GPUImageLayout -Image RenderPassAttachmentImageCompiled +func (l *ShaderLayout) Capacity() int ``` -} - -### func (p *RenderPassAttachmentDescriptionCompiled) IsDepthFormat() bool -### type RenderPassAttachmentImage struct { + +### func \(\*ShaderLayout\) [DescriptorType]() ```go -Name string -ExistingImage string -MipLevels uint32 -LayerCount uint32 -Tiling string `options:"StringVkImageTiling"` -Filter string `options:"StringVkFilter"` -Usage []string `options:"StringVkImageUsageFlagBits"` -MemoryProperty []string `options:"StringVkMemoryPropertyFlagBits"` -Aspect []string `options:"StringVkImageAspectFlagBits"` -Access []string `options:"StringVkAccessFlagBits"` -Clear RenderPassAttachmentImageClear `tip:"AttachmentImageClear"` +func (l *ShaderLayout) DescriptorType() vulkan_const.DescriptorType ``` -} -### func (ai *RenderPassAttachmentImage) AccessToVK() GPUAccessFlags + +### func \(\*ShaderLayout\) [FullName]() + +```go +func (l *ShaderLayout) FullName() string +``` -### func (ai *RenderPassAttachmentImage) AspectToVK() GPUImageAspectFlags -### func (ai *RenderPassAttachmentImage) FilterToVK() GPUFilter + +### func \(\*ShaderLayout\) [IsBuffer]() +```go +func (l *ShaderLayout) IsBuffer() bool +``` -### func (img *RenderPassAttachmentImage) IsInvalid() bool -### func (ai *RenderPassAttachmentImage) MemoryPropertyToVK() GPUMemoryPropertyFlags + +### func \(\*ShaderLayout\) [Stride]() +```go +func (l *ShaderLayout) Stride() int +``` -### func (ai *RenderPassAttachmentImage) TilingToVK() GPUImageTiling -### func (ai *RenderPassAttachmentImage) UsageToVK() GPUImageUsageFlags + +## type [ShaderLayoutGroup]() -### type RenderPassAttachmentImageClear struct { ```go -R float32 -G float32 -B float32 -A float32 -Depth float32 -Stencil uint32 -``` - +type ShaderLayoutGroup struct { + Type string + WorkGroups [3]uint32 + Layouts []ShaderLayout } +``` -### type RenderPassAttachmentImageCompiled struct { + +### func \(\*ShaderLayoutGroup\) [DescriptorFlag]() ```go -Name string -ExistingImage string -MipLevels uint32 -LayerCount uint32 -Tiling GPUImageTiling -Filter GPUFilter -Usage GPUImageUsageFlags -MemoryProperty GPUMemoryPropertyFlags -Aspect GPUImageAspectFlags -Access GPUAccessFlags +func (g *ShaderLayoutGroup) DescriptorFlag() vulkan_const.ShaderStageFlagBits ``` -} -### func (img *RenderPassAttachmentImageCompiled) IsInvalid() bool + +## type [ShaderLayoutStructField]() -### type RenderPassAttachmentReference struct { -```go -Attachment uint32 -Layout string `options:"StringVkImageLayout"` -``` +```go +type ShaderLayoutStructField struct { + Type string // float, vec3, mat4, etc. + Name string } +``` -### func (ad *RenderPassAttachmentReference) LayoutToVK() GPUImageLayout + +## type [ShaderPipelineColorBlend]() -### type RenderPassAttachmentReferenceCompiled struct { ```go -Attachment uint32 -Layout vulkan_const.ImageLayout -``` - +type ShaderPipelineColorBlend struct { + LogicOpEnable bool + LogicOp string `options:"StringVkLogicOp"` + BlendConstants0 float32 `tip:"BlendConstants"` + BlendConstants1 float32 `tip:"BlendConstants"` + BlendConstants2 float32 `tip:"BlendConstants"` + BlendConstants3 float32 `tip:"BlendConstants"` } +``` -### type RenderPassData struct { + +### func \(\*ShaderPipelineColorBlend\) [LogicOpToVK]() ```go -Name string -Sort int -AttachmentDescriptions []RenderPassAttachmentDescription -SubpassDescriptions []RenderPassSubpassDescription -SubpassDependencies []RenderPassSubpassDependency -Width int -Height int -SkipCombine bool +func (s *ShaderPipelineColorBlend) LogicOpToVK() vulkan_const.LogicOp ``` -} - -### func NewRenderPassData(src string) (RenderPassData, error) -### func (d *RenderPassData) Compile(device *GPUDevice) RenderPassDataCompiled + +## type [ShaderPipelineColorBlendAttachments]() -### type RenderPassDataCompiled struct { ```go -Name string -Sort int -Width int -Height int -AttachmentDescriptions []RenderPassAttachmentDescriptionCompiled -SubpassDescriptions []RenderPassSubpassDescriptionCompiled -SubpassDependencies []RenderPassSubpassDependencyCompiled -ImageClears []vk.ClearValue -Subpass []RenderPassSubpassDataCompiled -SkipCombine bool +type ShaderPipelineColorBlendAttachments struct { + BlendEnable bool + SrcColorBlendFactor string `options:"StringVkBlendFactor"` + DstColorBlendFactor string `options:"StringVkBlendFactor"` + ColorBlendOp string `options:"StringVkBlendOp"` + SrcAlphaBlendFactor string `options:"StringVkBlendFactor"` + DstAlphaBlendFactor string `options:"StringVkBlendFactor"` + AlphaBlendOp string `options:"StringVkBlendOp"` + ColorWriteMask []string `options:"StringVkColorComponentFlagBits"` +} ``` -} + +### func \(\*ShaderPipelineColorBlendAttachments\) [AlphaBlendOpToVK]() + +```go +func (a *ShaderPipelineColorBlendAttachments) AlphaBlendOpToVK() vulkan_const.BlendOp +``` -### func (r *RenderPassDataCompiled) ConstructRenderPass(device *GPUDevice) (*RenderPass, error) -### type RenderPassGroup struct { + +### func \(\*ShaderPipelineColorBlendAttachments\) [BlendEnableToVK]() ```go -// Has unexported fields. +func (a *ShaderPipelineColorBlendAttachments) BlendEnableToVK() vk.Bool32 ``` -} -### type RenderPassSubpass struct { + + +### func \(\*ShaderPipelineColorBlendAttachments\) [ColorBlendOpToVK]() ```go -// Has unexported fields. +func (a *ShaderPipelineColorBlendAttachments) ColorBlendOpToVK() vulkan_const.BlendOp ``` -} -### type RenderPassSubpassData struct { + + +### func \(\*ShaderPipelineColorBlendAttachments\) [ColorWriteMaskToVK]() ```go -Shader string `options:""` -ShaderPipeline string `options:""` -SampledImages []RenderPassSubpassImageData +func (a *ShaderPipelineColorBlendAttachments) ColorWriteMaskToVK() vulkan_const.ColorComponentFlagBits ``` -} -### type RenderPassSubpassDataCompiled struct { + + +### func \(\*ShaderPipelineColorBlendAttachments\) [DstAlphaBlendFactorToVK]() ```go -Shader string -ShaderPipeline string -SampledImages []int +func (a *ShaderPipelineColorBlendAttachments) DstAlphaBlendFactorToVK() vulkan_const.BlendFactor ``` -} -### type RenderPassSubpassDependency struct { + + +### func \(\*ShaderPipelineColorBlendAttachments\) [DstColorBlendFactorToVK]() ```go -SrcSubpass int64 -DstSubpass int64 -SrcStageMask []string `options:"StringVkPipelineStageFlagBits"` -DstStageMask []string `options:"StringVkPipelineStageFlagBits"` -SrcAccessMask []string `options:"StringVkAccessFlagBits"` -DstAccessMask []string `options:"StringVkAccessFlagBits"` -DependencyFlags []string `options:"StringVkDependencyFlagBits"` +func (a *ShaderPipelineColorBlendAttachments) DstColorBlendFactorToVK() vulkan_const.BlendFactor ``` -} - -### func (sd *RenderPassSubpassDependency) DependencyFlagsToVK() vk.DependencyFlags -### func (sd *RenderPassSubpassDependency) DstAccessMaskToVK() GPUAccessFlags + +### func \(\*ShaderPipelineColorBlendAttachments\) [ListAlphaBlendOp]() +```go +func (a *ShaderPipelineColorBlendAttachments) ListAlphaBlendOp() []string +``` -### func (sd *RenderPassSubpassDependency) DstStageMaskToVK() vk.PipelineStageFlags -### func (sd *RenderPassSubpassDependency) SrcAccessMaskToVK() GPUAccessFlags + +### func \(\*ShaderPipelineColorBlendAttachments\) [ListColorBlendOp]() +```go +func (a *ShaderPipelineColorBlendAttachments) ListColorBlendOp() []string +``` -### func (sd *RenderPassSubpassDependency) SrcStageMaskToVK() vk.PipelineStageFlags -### type RenderPassSubpassDependencyCompiled struct { + +### func \(\*ShaderPipelineColorBlendAttachments\) [ListDstAlphaBlendFactor]() ```go -SrcSubpass uint32 -DstSubpass uint32 -SrcStageMask vk.PipelineStageFlags -DstStageMask vk.PipelineStageFlags -SrcAccessMask vk.AccessFlags -DstAccessMask vk.AccessFlags -DependencyFlags vk.DependencyFlags +func (a *ShaderPipelineColorBlendAttachments) ListDstAlphaBlendFactor() []string ``` -} -### type RenderPassSubpassDescription struct { + + +### func \(\*ShaderPipelineColorBlendAttachments\) [ListDstColorBlendFactor]() ```go -PipelineBindPoint string `options:"StringVkPipelineBindPoint"` -ColorAttachmentReferences []RenderPassAttachmentReference -InputAttachmentReferences []RenderPassAttachmentReference -ResolveAttachments []RenderPassAttachmentReference -DepthStencilAttachment []RenderPassAttachmentReference // 1 max -PreserveAttachments []uint32 // TODO -Subpass RenderPassSubpassData +func (a *ShaderPipelineColorBlendAttachments) ListDstColorBlendFactor() []string ``` -} - -### func (ad *RenderPassSubpassDescription) PipelineBindPointToVK() vulkan_const.PipelineBindPoint -### type RenderPassSubpassDescriptionCompiled struct { + +### func \(\*ShaderPipelineColorBlendAttachments\) [ListSrcAlphaBlendFactor]() ```go -PipelineBindPoint vulkan_const.PipelineBindPoint -ColorAttachmentReferences []RenderPassAttachmentReferenceCompiled -InputAttachmentReferences []RenderPassAttachmentReferenceCompiled -ResolveAttachments []RenderPassAttachmentReferenceCompiled -DepthStencilAttachment []RenderPassAttachmentReferenceCompiled // 1 max -PreserveAttachments []uint32 // TODO +func (a *ShaderPipelineColorBlendAttachments) ListSrcAlphaBlendFactor() []string ``` -} -### type RenderPassSubpassImageData struct { + + +### func \(\*ShaderPipelineColorBlendAttachments\) [ListSrcColorBlendFactor]() ```go -SampledImage string +func (a *ShaderPipelineColorBlendAttachments) ListSrcColorBlendFactor() []string ``` -} -### type RenderingContainer interface { + + +### func \(\*ShaderPipelineColorBlendAttachments\) [SrcAlphaBlendFactorToVK]() ```go -GetDrawableSize() (int32, int32) -GetInstanceExtensions() []string -PlatformWindow() unsafe.Pointer -PlatformInstance() unsafe.Pointer +func (a *ShaderPipelineColorBlendAttachments) SrcAlphaBlendFactorToVK() vulkan_const.BlendFactor ``` -} -### type Shader struct { + + +### func \(\*ShaderPipelineColorBlendAttachments\) [SrcColorBlendFactorToVK]() ```go -RenderId ShaderId +func (a *ShaderPipelineColorBlendAttachments) SrcColorBlendFactorToVK() vulkan_const.BlendFactor ``` -```go -Material MaterialData -DriverData ShaderDriverData -``` + + +## type [ShaderPipelineColorBlendAttachmentsCompiled]() + ```go -Type ShaderType -// Has unexported fields. +type ShaderPipelineColorBlendAttachmentsCompiled struct { + BlendEnable vk.Bool32 + SrcColorBlendFactor vulkan_const.BlendFactor + DstColorBlendFactor vulkan_const.BlendFactor + ColorBlendOp vulkan_const.BlendOp + SrcAlphaBlendFactor vulkan_const.BlendFactor + DstAlphaBlendFactor vulkan_const.BlendFactor + AlphaBlendOp vulkan_const.BlendOp + ColorWriteMask vk.ColorComponentFlags +} ``` -} + +## type [ShaderPipelineColorBlendCompiled]() -### func NewShader(shaderData ShaderDataCompiled) *Shader -### func (s *Shader) AddSubShader(key string, shader *Shader) +```go +type ShaderPipelineColorBlendCompiled struct { + LogicOpEnable vk.Bool32 + LogicOp vulkan_const.LogicOp + BlendConstants [4]float32 +} +``` + + +## type [ShaderPipelineData]() -### func (s *Shader) DelayedCreate(device *GPUDevice, assetDatabase assets.Database) +```go +type ShaderPipelineData struct { + Name string + InputAssembly ShaderPipelineInputAssembly + Rasterization ShaderPipelinePipelineRasterization + Multisample ShaderPipelinePipelineMultisample + ColorBlend ShaderPipelineColorBlend + ColorBlendAttachments []ShaderPipelineColorBlendAttachments + DepthStencil ShaderPipelineDepthStencil + Tessellation ShaderPipelineTessellation + GraphicsPipeline ShaderPipelineGraphicsPipeline + PushConstant ShaderPipelinePushConstant +} +``` -### func (s *Shader) Reload(shaderData ShaderDataCompiled) + +### func \(\*ShaderPipelineData\) [AlphaToCoverageEnableToVK]() +```go +func (s *ShaderPipelineData) AlphaToCoverageEnableToVK() vk.Bool32 +``` -### func (s *Shader) RemoveSubShader(key string) -### func (s *Shader) ShaderDataName() string + +### func \(\*ShaderPipelineData\) [AlphaToOneEnableToVK]() +```go +func (s *ShaderPipelineData) AlphaToOneEnableToVK() vk.Bool32 +``` -### func (s *Shader) SubShader(key string) *Shader -### type ShaderBuffer struct { + +### func \(\*ShaderPipelineData\) [BackStencilOpStateToVK]() ```go -// Has unexported fields. +func (s *ShaderPipelineData) BackStencilOpStateToVK() vk.StencilOpState ``` -} -### type ShaderCache struct { + + +### func \(\*ShaderPipelineData\) [BlendConstants]() ```go -// Has unexported fields. +func (s *ShaderPipelineData) BlendConstants() [4]float32 ``` -} -### func NewShaderCache(device *GPUDevice, assetDatabase assets.Database) ShaderCache + +### func \(\*ShaderPipelineData\) [Compile]() + +```go +func (d *ShaderPipelineData) Compile(device *GPUPhysicalDevice) ShaderPipelineDataCompiled +``` -### func (s *ShaderCache) AddShader(shader *Shader) -### func (s *ShaderCache) CreatePending() + +### func \(\*ShaderPipelineData\) [DepthBiasEnableToVK]() +```go +func (s *ShaderPipelineData) DepthBiasEnableToVK() vk.Bool32 +``` -### func (s *ShaderCache) Destroy() -### func (s *ShaderCache) ReloadShader(shaderData ShaderDataCompiled) + +### func \(\*ShaderPipelineData\) [DepthBoundsTestEnableToVK]() +```go +func (s *ShaderPipelineData) DepthBoundsTestEnableToVK() vk.Bool32 +``` -### func (s *ShaderCache) Shader(shaderData ShaderDataCompiled) (shader *Shader, isNew bool) -### type ShaderCleanup struct { + +### func \(\*ShaderPipelineData\) [DepthClampEnableToVK]() ```go -// Has unexported fields. +func (s *ShaderPipelineData) DepthClampEnableToVK() vk.Bool32 ``` -} -### type ShaderData struct { - -```go -Name string -EnableDebug bool -Vertex string `options:""` -VertexFlags string `tip:"CompileFlags"` -Fragment string `options:""` -FragmentFlags string `tip:"CompileFlags"` -Geometry string `options:""` -GeometryFlags string `tip:"CompileFlags"` -TessellationControl string `options:""` -TessellationControlFlags string `tip:"CompileFlags"` -TessellationEvaluation string `options:""` -TessellationEvaluationFlags string `tip:"CompileFlags"` -Compute string `options:""` -ComputeFlags string `tip:"CompileFlags"` -LayoutGroups []ShaderLayoutGroup `visible:"false"` -SamplerLabels []string -VertexSpv string -FragmentSpv string -GeometrySpv string -TessellationControlSpv string -TessellationEvaluationSpv string -ComputeSpv string -``` -} + +### func \(\*ShaderPipelineData\) [DepthTestEnableToVK]() -### func (d *ShaderData) Compile() ShaderDataCompiled +```go +func (s *ShaderPipelineData) DepthTestEnableToVK() vk.Bool32 +``` -### type ShaderDataBase struct { + + +### func \(\*ShaderPipelineData\) [DepthWriteEnableToVK]() ```go -InitModel matrix.Mat4 -// Has unexported fields. +func (s *ShaderPipelineData) DepthWriteEnableToVK() vk.Bool32 ``` -} -### func NewShaderDataBase() ShaderDataBase + +### func \(\*ShaderPipelineData\) [FrontStencilOpStateToVK]() -### func (s *ShaderDataBase) Activate() +```go +func (s *ShaderPipelineData) FrontStencilOpStateToVK() vk.StencilOpState +``` +TODO: This and the BackStencilOpStateToVK are duplicates because of a bad structure setup, please fix later -### func (s *ShaderDataBase) Base() *ShaderDataBase + +### func \(ShaderPipelineData\) [ListBackCompareOp]() +```go +func (s ShaderPipelineData) ListBackCompareOp() []string +``` -### func (s *ShaderDataBase) BoundDataPointer() unsafe.Pointer -### func (s *ShaderDataBase) CancelDestroy() + +### func \(ShaderPipelineData\) [ListBackDepthFailOp]() +```go +func (s ShaderPipelineData) ListBackDepthFailOp() []string +``` -### func (s *ShaderDataBase) DataPointer() unsafe.Pointer -### func (s *ShaderDataBase) Deactivate() + +### func \(ShaderPipelineData\) [ListBackFailOp]() +```go +func (s ShaderPipelineData) ListBackFailOp() []string +``` -### func (s *ShaderDataBase) Destroy() -### func (s *ShaderDataBase) InstanceBoundDataSize() int + +### func \(ShaderPipelineData\) [ListBackPassOp]() +```go +func (s ShaderPipelineData) ListBackPassOp() []string +``` -### func (s *ShaderDataBase) IsDestroyed() bool -### func (s *ShaderDataBase) IsInView() bool + +### func \(ShaderPipelineData\) [ListBlendFactor]() +```go +func (s ShaderPipelineData) ListBlendFactor() []string +``` -### func (s *ShaderDataBase) Model() matrix.Mat4 -### func (s *ShaderDataBase) ModelPtr() *matrix.Mat4 + +### func \(ShaderPipelineData\) [ListBlendOp]() +```go +func (s ShaderPipelineData) ListBlendOp() []string +``` -### func (s *ShaderDataBase) SelectLights(lights LightsForRender) -### func (s *ShaderDataBase) SetModel(model matrix.Mat4) + +### func \(ShaderPipelineData\) [ListCullMode]() +```go +func (s ShaderPipelineData) ListCullMode() []string +``` -### func (s *ShaderDataBase) Setup() -### func (s *ShaderDataBase) SkinningHeader() *SkinnedShaderDataHeader + +### func \(ShaderPipelineData\) [ListDepthCompareOp]() +```go +func (s ShaderPipelineData) ListDepthCompareOp() []string +``` -### func (s *ShaderDataBase) Transform() *matrix.Transform -### func (s *ShaderDataBase) UpdateBoundData() bool + +### func \(ShaderPipelineData\) [ListFrontCompareOp]() +```go +func (s ShaderPipelineData) ListFrontCompareOp() []string +``` -### func (s *ShaderDataBase) UpdateModel(viewCuller ViewCuller, container collision.AABB) -### type ShaderDataCombine struct { + +### func \(ShaderPipelineData\) [ListFrontDepthFailOp]() ```go -ShaderDataBase -Color matrix.Color +func (s ShaderPipelineData) ListFrontDepthFailOp() []string ``` -} - -### func (t ShaderDataCombine) Size() int -### type ShaderDataCompiled struct { + +### func \(ShaderPipelineData\) [ListFrontFace]() ```go -Name string -Vertex string -Fragment string -Geometry string -TessellationControl string -TessellationEvaluation string -Compute string -LayoutGroups []ShaderLayoutGroup -SamplerLabels []string +func (s ShaderPipelineData) ListFrontFace() []string ``` -} -### func (s *ShaderDataCompiled) IsCompute() bool + +### func \(ShaderPipelineData\) [ListFrontFailOp]() + +```go +func (s ShaderPipelineData) ListFrontFailOp() []string +``` -### func (s *ShaderDataCompiled) SelectLayout(stage string) *ShaderLayoutGroup -### func (sd *ShaderDataCompiled) Stride() uint32 + +### func \(ShaderPipelineData\) [ListFrontPassOp]() +```go +func (s ShaderPipelineData) ListFrontPassOp() []string +``` -### func (sd *ShaderDataCompiled) ToAttributeDescription(locationStart uint32) []vk.VertexInputAttributeDescription -### func (sd *ShaderDataCompiled) ToDescriptorSetLayoutStructure() DescriptorSetLayoutStructure + +### func \(ShaderPipelineData\) [ListLogicOp]() +```go +func (s ShaderPipelineData) ListLogicOp() []string +``` -### func (sd *ShaderDataCompiled) WorkGroups() [3]uint32 -### type ShaderDraw struct { + +### func \(ShaderPipelineData\) [ListPatchControlPoints]() ```go -// Has unexported fields. +func (s ShaderPipelineData) ListPatchControlPoints() []string ``` -} - -### func NewShaderDraw(material *Material) ShaderDraw -### func (s *ShaderDraw) AddInstanceGroup(group DrawInstanceGroup) + +### func \(ShaderPipelineData\) [ListPolygonMode]() +```go +func (s ShaderPipelineData) ListPolygonMode() []string +``` -### func (s *ShaderDraw) Clear() -### func (s *ShaderDraw) Destroy(device *GPUDevice) + +### func \(ShaderPipelineData\) [ListRasterizationSamples]() +```go +func (s ShaderPipelineData) ListRasterizationSamples() []string +``` -### func (s *ShaderDraw) Filter(filter func(*DrawInstanceGroup) bool) []*DrawInstanceGroup -### type ShaderDriverData struct { + +### func \(ShaderPipelineData\) [ListTopology]() ```go -DescriptorSetLayoutStructure -Stride uint32 -AttributeDescriptions []vk.VertexInputAttributeDescription +func (s ShaderPipelineData) ListTopology() []string ``` -} - -### func NewShaderDriverData() ShaderDriverData -### type ShaderId struct { + +### func \(\*ShaderPipelineData\) [LogicOpEnableToVK]() ```go -// Has unexported fields. +func (s *ShaderPipelineData) LogicOpEnableToVK() vk.Bool32 ``` -} - -### func (s ShaderId) IsValid() bool -### type ShaderLayout struct { + +### func \(\*ShaderPipelineData\) [PrimitiveRestartToVK]() ```go -Location int // -1 if not set -Binding int // -1 if not set -Count int // 1 if not set -Set int // -1 if not set -InputAttachment int // -1 if not set -Type string // float, vec3, mat4, etc. -Name string -Source string // in, out, uniform, buffer -Fields []ShaderLayoutStructField +func (s *ShaderPipelineData) PrimitiveRestartToVK() vk.Bool32 ``` -} - -### func (l *ShaderLayout) Capacity() int -### func (l *ShaderLayout) DescriptorType() vulkan_const.DescriptorType + +### func \(\*ShaderPipelineData\) [RasterizerDiscardEnableToVK]() +```go +func (s *ShaderPipelineData) RasterizerDiscardEnableToVK() vk.Bool32 +``` -### func (l *ShaderLayout) FullName() string -### func (l *ShaderLayout) IsBuffer() bool + +### func \(\*ShaderPipelineData\) [SampleShadingEnableToVK]() +```go +func (s *ShaderPipelineData) SampleShadingEnableToVK() vk.Bool32 +``` -### func (l *ShaderLayout) Stride() int -### type ShaderLayoutGroup struct { + +### func \(\*ShaderPipelineData\) [StencilTestEnableToVK]() ```go -Type string -WorkGroups [3]uint32 -Layouts []ShaderLayout +func (s *ShaderPipelineData) StencilTestEnableToVK() vk.Bool32 ``` -} -### func (g *ShaderLayoutGroup) DescriptorFlag() vulkan_const.ShaderStageFlagBits + +## type [ShaderPipelineDataCompiled]() -### type ShaderLayoutStructField struct { -```go -Type string // float, vec3, mat4, etc. -Name string -``` +```go +type ShaderPipelineDataCompiled struct { + Name string + InputAssembly ShaderPipelineInputAssemblyCompiled + Rasterization ShaderPipelinePipelineRasterizationCompiled + Multisample ShaderPipelinePipelineMultisampleCompiled + ColorBlend ShaderPipelineColorBlendCompiled + ColorBlendAttachments []ShaderPipelineColorBlendAttachmentsCompiled + DepthStencil ShaderPipelineDepthStencilCompiled + Tessellation ShaderPipelineTessellationCompiled + GraphicsPipeline ShaderPipelineGraphicsPipelineCompiled + PushConstant ShaderPipelinePushConstantCompiled } +``` -### type ShaderPipelineColorBlend struct { + +### func \(\*ShaderPipelineDataCompiled\) [ConstructPipeline]() ```go -LogicOpEnable bool -LogicOp string `options:"StringVkLogicOp"` -BlendConstants0 float32 `tip:"BlendConstants"` -BlendConstants1 float32 `tip:"BlendConstants"` -BlendConstants2 float32 `tip:"BlendConstants"` -BlendConstants3 float32 `tip:"BlendConstants"` +func (s *ShaderPipelineDataCompiled) ConstructPipeline(device *GPUDevice, shader *Shader, renderPass *RenderPass, stages []vk.PipelineShaderStageCreateInfo) bool ``` -} -### func (s *ShaderPipelineColorBlend) LogicOpToVK() vulkan_const.LogicOp + + +## type [ShaderPipelineDepthStencil]() -### type ShaderPipelineColorBlendAttachments struct { ```go -BlendEnable bool -SrcColorBlendFactor string `options:"StringVkBlendFactor"` -DstColorBlendFactor string `options:"StringVkBlendFactor"` -ColorBlendOp string `options:"StringVkBlendOp"` -SrcAlphaBlendFactor string `options:"StringVkBlendFactor"` -DstAlphaBlendFactor string `options:"StringVkBlendFactor"` -AlphaBlendOp string `options:"StringVkBlendOp"` -ColorWriteMask []string `options:"StringVkColorComponentFlagBits"` +type ShaderPipelineDepthStencil struct { + DepthTestEnable bool + DepthWriteEnable bool + DepthCompareOp string `options:"StringVkCompareOp"` + DepthBoundsTestEnable bool + StencilTestEnable bool + FrontFailOp string `options:"StringVkStencilOp" tip:"FailOp"` + FrontPassOp string `options:"StringVkStencilOp" tip:"PassOp"` + FrontDepthFailOp string `options:"StringVkStencilOp" tip:"DepthFailOp"` + FrontCompareOp string `options:"StringVkCompareOp" tip:"CompareOp"` + FrontCompareMask uint32 `tip:"CompareMask"` + FrontWriteMask uint32 `tip:"WriteMask"` + FrontReference uint32 `tip:"Reference"` + BackFailOp string `options:"StringVkStencilOp" tip:"FailOp"` + BackPassOp string `options:"StringVkStencilOp" tip:"PassOp"` + BackDepthFailOp string `options:"StringVkStencilOp" tip:"DepthFailOp"` + BackCompareOp string `options:"StringVkCompareOp" tip:"CompareOp"` + BackCompareMask uint32 `tip:"CompareMask"` + BackWriteMask uint32 `tip:"WriteMask"` + BackReference uint32 `tip:"Reference"` + MinDepthBounds float32 + MaxDepthBounds float32 +} ``` -} + +## type [ShaderPipelineDepthStencilCompiled]() + -### func (a *ShaderPipelineColorBlendAttachments) AlphaBlendOpToVK() vulkan_const.BlendOp +```go +type ShaderPipelineDepthStencilCompiled struct { + DepthTestEnable vk.Bool32 + DepthWriteEnable vk.Bool32 + DepthCompareOp vulkan_const.CompareOp + DepthBoundsTestEnable vk.Bool32 + StencilTestEnable vk.Bool32 + Front vk.StencilOpState + Back vk.StencilOpState + MinDepthBounds float32 + MaxDepthBounds float32 +} +``` -### func (a *ShaderPipelineColorBlendAttachments) BlendEnableToVK() vk.Bool32 + +## type [ShaderPipelineGraphicsPipeline]() -### func (a *ShaderPipelineColorBlendAttachments) ColorBlendOpToVK() vulkan_const.BlendOp +```go +type ShaderPipelineGraphicsPipeline struct { + Subpass uint32 + PipelineCreateFlags []string `options:"StringVkPipelineCreateFlagBits"` +} +``` -### func (a *ShaderPipelineColorBlendAttachments) ColorWriteMaskToVK() vulkan_const.ColorComponentFlagBits + +### func \(\*ShaderPipelineGraphicsPipeline\) [PipelineCreateFlagsToVK]() +```go +func (s *ShaderPipelineGraphicsPipeline) PipelineCreateFlagsToVK() vk.PipelineCreateFlags +``` -### func (a *ShaderPipelineColorBlendAttachments) DstAlphaBlendFactorToVK() vulkan_const.BlendFactor -### func (a *ShaderPipelineColorBlendAttachments) DstColorBlendFactorToVK() vulkan_const.BlendFactor + +## type [ShaderPipelineGraphicsPipelineCompiled]() -### func (a *ShaderPipelineColorBlendAttachments) ListAlphaBlendOp() []string +```go +type ShaderPipelineGraphicsPipelineCompiled struct { + Subpass uint32 + PipelineCreateFlags vk.PipelineCreateFlags +} +``` -### func (a *ShaderPipelineColorBlendAttachments) ListColorBlendOp() []string + +## type [ShaderPipelineInputAssembly]() -### func (a *ShaderPipelineColorBlendAttachments) ListDstAlphaBlendFactor() []string +```go +type ShaderPipelineInputAssembly struct { + Topology string `options:"StringVkPrimitiveTopology"` + PrimitiveRestart bool +} +``` -### func (a *ShaderPipelineColorBlendAttachments) ListDstColorBlendFactor() []string + +### func \(\*ShaderPipelineInputAssembly\) [TopologyToVK]() +```go +func (s *ShaderPipelineInputAssembly) TopologyToVK() vulkan_const.PrimitiveTopology +``` -### func (a *ShaderPipelineColorBlendAttachments) ListSrcAlphaBlendFactor() []string -### func (a *ShaderPipelineColorBlendAttachments) ListSrcColorBlendFactor() []string + +## type [ShaderPipelineInputAssemblyCompiled]() -### func (a *ShaderPipelineColorBlendAttachments) SrcAlphaBlendFactorToVK() vulkan_const.BlendFactor +```go +type ShaderPipelineInputAssemblyCompiled struct { + Topology vulkan_const.PrimitiveTopology + PrimitiveRestart vk.Bool32 +} +``` -### func (a *ShaderPipelineColorBlendAttachments) SrcColorBlendFactorToVK() vulkan_const.BlendFactor + +## type [ShaderPipelinePipelineMultisample]() -### type ShaderPipelineColorBlendAttachmentsCompiled struct { ```go -BlendEnable vk.Bool32 -SrcColorBlendFactor vulkan_const.BlendFactor -DstColorBlendFactor vulkan_const.BlendFactor -ColorBlendOp vulkan_const.BlendOp -SrcAlphaBlendFactor vulkan_const.BlendFactor -DstAlphaBlendFactor vulkan_const.BlendFactor -AlphaBlendOp vulkan_const.BlendOp -ColorWriteMask vk.ColorComponentFlags -``` - +type ShaderPipelinePipelineMultisample struct { + RasterizationSamples string `options:"StringVkSampleCountFlagBits"` + SampleShadingEnable bool + MinSampleShading float32 + AlphaToCoverageEnable bool + AlphaToOneEnable bool } +``` -### type ShaderPipelineColorBlendCompiled struct { + +### func \(\*ShaderPipelinePipelineMultisample\) [RasterizationSamplesToVK]() ```go -LogicOpEnable vk.Bool32 -LogicOp vulkan_const.LogicOp -BlendConstants [4]float32 +func (s *ShaderPipelinePipelineMultisample) RasterizationSamplesToVK(device *GPUPhysicalDevice) GPUSampleCountFlags ``` -} -### type ShaderPipelineData struct { -```go -Name string -InputAssembly ShaderPipelineInputAssembly -Rasterization ShaderPipelinePipelineRasterization -Multisample ShaderPipelinePipelineMultisample -ColorBlend ShaderPipelineColorBlend -ColorBlendAttachments []ShaderPipelineColorBlendAttachments -DepthStencil ShaderPipelineDepthStencil -Tessellation ShaderPipelineTessellation -GraphicsPipeline ShaderPipelineGraphicsPipeline -PushConstant ShaderPipelinePushConstant -``` + +## type [ShaderPipelinePipelineMultisampleCompiled]() -} -### func (s *ShaderPipelineData) AlphaToCoverageEnableToVK() vk.Bool32 +```go +type ShaderPipelinePipelineMultisampleCompiled struct { + RasterizationSamples vulkan_const.SampleCountFlagBits + SampleShadingEnable vk.Bool32 + MinSampleShading float32 + AlphaToCoverageEnable vk.Bool32 + AlphaToOneEnable vk.Bool32 +} +``` -### func (s *ShaderPipelineData) AlphaToOneEnableToVK() vk.Bool32 + +## type [ShaderPipelinePipelineRasterization]() -### func (s *ShaderPipelineData) BackStencilOpStateToVK() vk.StencilOpState +```go +type ShaderPipelinePipelineRasterization struct { + DepthClampEnable bool + RasterizerDiscardEnable bool + PolygonMode string `options:"StringVkPolygonMode"` + CullMode string `options:"StringVkCullModeFlagBits"` + FrontFace string `options:"StringVkFrontFace"` + DepthBiasEnable bool + DepthBiasConstantFactor float32 + DepthBiasClamp float32 + DepthBiasSlopeFactor float32 + LineWidth float32 +} +``` -### func (s *ShaderPipelineData) BlendConstants() [4]float32 + +### func \(\*ShaderPipelinePipelineRasterization\) [CullModeToVK]() +```go +func (s *ShaderPipelinePipelineRasterization) CullModeToVK() vulkan_const.CullModeFlagBits +``` -### func (d *ShaderPipelineData) Compile(device *GPUPhysicalDevice) ShaderPipelineDataCompiled -### func (s *ShaderPipelineData) DepthBiasEnableToVK() vk.Bool32 + +### func \(\*ShaderPipelinePipelineRasterization\) [FrontFaceToVK]() +```go +func (s *ShaderPipelinePipelineRasterization) FrontFaceToVK() vulkan_const.FrontFace +``` -### func (s *ShaderPipelineData) DepthBoundsTestEnableToVK() vk.Bool32 -### func (s *ShaderPipelineData) DepthClampEnableToVK() vk.Bool32 + +### func \(\*ShaderPipelinePipelineRasterization\) [PolygonModeToVK]() +```go +func (s *ShaderPipelinePipelineRasterization) PolygonModeToVK() vulkan_const.PolygonMode +``` -### func (s *ShaderPipelineData) DepthTestEnableToVK() vk.Bool32 -### func (s *ShaderPipelineData) DepthWriteEnableToVK() vk.Bool32 + +## type [ShaderPipelinePipelineRasterizationCompiled]() -### func (s *ShaderPipelineData) FrontStencilOpStateToVK() vk.StencilOpState ```go - TODO: This and the BackStencilOpStateToVK are duplicates because of a bad - structure setup, please fix later +type ShaderPipelinePipelineRasterizationCompiled struct { + DepthClampEnable vk.Bool32 + DiscardEnable vk.Bool32 + PolygonMode vulkan_const.PolygonMode + CullMode vk.CullModeFlags + FrontFace vulkan_const.FrontFace + DepthBiasEnable vk.Bool32 + DepthBiasConstantFactor float32 + DepthBiasClamp float32 + DepthBiasSlopeFactor float32 + LineWidth float32 +} ``` - -### func (s ShaderPipelineData) ListBackCompareOp() []string + +## type [ShaderPipelinePushConstant]() -### func (s ShaderPipelineData) ListBackDepthFailOp() []string +```go +type ShaderPipelinePushConstant struct { + Size uint32 + StageFlags []string `options:"StringVkAccessFlagBits"` +} +``` -### func (s ShaderPipelineData) ListBackFailOp() []string + +### func \(\*ShaderPipelinePushConstant\) [ShaderStageFlagsToVK]() +```go +func (s *ShaderPipelinePushConstant) ShaderStageFlagsToVK() vk.ShaderStageFlags +``` -### func (s ShaderPipelineData) ListBackPassOp() []string -### func (s ShaderPipelineData) ListBlendFactor() []string + +## type [ShaderPipelinePushConstantCompiled]() -### func (s ShaderPipelineData) ListBlendOp() []string +```go +type ShaderPipelinePushConstantCompiled struct { + Size uint32 + StageFlags vk.ShaderStageFlags +} +``` -### func (s ShaderPipelineData) ListCullMode() []string + +## type [ShaderPipelineTessellation]() -### func (s ShaderPipelineData) ListDepthCompareOp() []string +```go +type ShaderPipelineTessellation struct { + PatchControlPoints string `options:"StringVkPatchControlPoints"` +} +``` -### func (s ShaderPipelineData) ListFrontCompareOp() []string + +### func \(\*ShaderPipelineTessellation\) [PatchControlPointsToVK]() +```go +func (s *ShaderPipelineTessellation) PatchControlPointsToVK() uint32 +``` -### func (s ShaderPipelineData) ListFrontDepthFailOp() []string -### func (s ShaderPipelineData) ListFrontFace() []string + +## type [ShaderPipelineTessellationCompiled]() -### func (s ShaderPipelineData) ListFrontFailOp() []string +```go +type ShaderPipelineTessellationCompiled struct { + PatchControlPoints uint32 +} +``` -### func (s ShaderPipelineData) ListFrontPassOp() []string + +## type [ShaderType]() -### func (s ShaderPipelineData) ListLogicOp() []string +```go +type ShaderType int +``` -### func (s ShaderPipelineData) ListPatchControlPoints() []string + +```go +const ( + ShaderTypeGraphics ShaderType = iota + ShaderTypeCompute +) +``` -### func (s ShaderPipelineData) ListPolygonMode() []string + +## type [SkinnedShaderDataHeader]() -### func (s ShaderPipelineData) ListRasterizationSamples() []string +```go +type SkinnedShaderDataHeader struct { + // contains filtered or unexported fields +} +``` -### func (s ShaderPipelineData) ListTopology() []string + +### func \(\*SkinnedShaderDataHeader\) [BoneByIndex]() +```go +func (h *SkinnedShaderDataHeader) BoneByIndex(index int) *BoneTransform +``` -### func (s *ShaderPipelineData) LogicOpEnableToVK() vk.Bool32 -### func (s *ShaderPipelineData) PrimitiveRestartToVK() vk.Bool32 + +### func \(\*SkinnedShaderDataHeader\) [CreateBones]() +```go +func (h *SkinnedShaderDataHeader) CreateBones(ids []int32) +``` -### func (s *ShaderPipelineData) RasterizerDiscardEnableToVK() vk.Bool32 -### func (s *ShaderPipelineData) SampleShadingEnableToVK() vk.Bool32 + +### func \(\*SkinnedShaderDataHeader\) [FindBone]() +```go +func (h *SkinnedShaderDataHeader) FindBone(id int32) *BoneTransform +``` -### func (s *ShaderPipelineData) StencilTestEnableToVK() vk.Bool32 -### type ShaderPipelineDataCompiled struct { + +### func \(\*SkinnedShaderDataHeader\) [HasBones]() ```go -Name string -InputAssembly ShaderPipelineInputAssemblyCompiled -Rasterization ShaderPipelinePipelineRasterizationCompiled -Multisample ShaderPipelinePipelineMultisampleCompiled -ColorBlend ShaderPipelineColorBlendCompiled -ColorBlendAttachments []ShaderPipelineColorBlendAttachmentsCompiled -DepthStencil ShaderPipelineDepthStencilCompiled -Tessellation ShaderPipelineTessellationCompiled -GraphicsPipeline ShaderPipelineGraphicsPipelineCompiled -PushConstant ShaderPipelinePushConstantCompiled +func (h *SkinnedShaderDataHeader) HasBones() bool ``` -} - -### func (s *ShaderPipelineDataCompiled) ConstructPipeline(device *GPUDevice, shader *Shader, renderPass *RenderPass, stages []vk.PipelineShaderStageCreateInfo) bool -### type ShaderPipelineDepthStencil struct { + +### func \(\*SkinnedShaderDataHeader\) [SkinNamedDataInstanceSize]() ```go -DepthTestEnable bool -DepthWriteEnable bool -DepthCompareOp string `options:"StringVkCompareOp"` -DepthBoundsTestEnable bool -StencilTestEnable bool -FrontFailOp string `options:"StringVkStencilOp" tip:"FailOp"` -FrontPassOp string `options:"StringVkStencilOp" tip:"PassOp"` -FrontDepthFailOp string `options:"StringVkStencilOp" tip:"DepthFailOp"` -FrontCompareOp string `options:"StringVkCompareOp" tip:"CompareOp"` -FrontCompareMask uint32 `tip:"CompareMask"` -FrontWriteMask uint32 `tip:"WriteMask"` -FrontReference uint32 `tip:"Reference"` -BackFailOp string `options:"StringVkStencilOp" tip:"FailOp"` -BackPassOp string `options:"StringVkStencilOp" tip:"PassOp"` -BackDepthFailOp string `options:"StringVkStencilOp" tip:"DepthFailOp"` -BackCompareOp string `options:"StringVkCompareOp" tip:"CompareOp"` -BackCompareMask uint32 `tip:"CompareMask"` -BackWriteMask uint32 `tip:"WriteMask"` -BackReference uint32 `tip:"Reference"` -MinDepthBounds float32 -MaxDepthBounds float32 +func (h *SkinnedShaderDataHeader) SkinNamedDataInstanceSize() int ``` -} -### type ShaderPipelineDepthStencilCompiled struct { + + +### func \(\*SkinnedShaderDataHeader\) [SkinNamedDataPointer]() ```go -DepthTestEnable vk.Bool32 -DepthWriteEnable vk.Bool32 -DepthCompareOp vulkan_const.CompareOp -DepthBoundsTestEnable vk.Bool32 -StencilTestEnable vk.Bool32 -Front vk.StencilOpState -Back vk.StencilOpState -MinDepthBounds float32 -MaxDepthBounds float32 +func (h *SkinnedShaderDataHeader) SkinNamedDataPointer() unsafe.Pointer ``` -} -### type ShaderPipelineGraphicsPipeline struct { + + +### func \(\*SkinnedShaderDataHeader\) [SkinUpdateNamedData]() ```go -Subpass uint32 -PipelineCreateFlags []string `options:"StringVkPipelineCreateFlagBits"` +func (h *SkinnedShaderDataHeader) SkinUpdateNamedData() bool ``` -} -### func (s *ShaderPipelineGraphicsPipeline) PipelineCreateFlagsToVK() vk.PipelineCreateFlags + +## type [TextShaderData]() -### type ShaderPipelineGraphicsPipelineCompiled struct { -```go -Subpass uint32 -PipelineCreateFlags vk.PipelineCreateFlags -``` +```go +type TextShaderData struct { + ShaderDataBase + UVs matrix.Vec4 + FgColor matrix.Color + BgColor matrix.Color + Scissor matrix.Vec4 + PxRange matrix.Vec2 } +``` -### type ShaderPipelineInputAssembly struct { + +### func \(TextShaderData\) [Size]() ```go -Topology string `options:"StringVkPrimitiveTopology"` -PrimitiveRestart bool +func (s TextShaderData) Size() int ``` -} -### func (s *ShaderPipelineInputAssembly) TopologyToVK() vulkan_const.PrimitiveTopology + +## type [Texture]() -### type ShaderPipelineInputAssemblyCompiled struct { -```go -Topology vulkan_const.PrimitiveTopology -PrimitiveRestart vk.Bool32 -``` +```go +type Texture struct { + Key string + TexturePixelCache []byte + RenderId TextureId + Channels int + Filter int + MipLevels int + Width int + Height int + CacheInvalid bool + // contains filtered or unexported fields } +``` -### type ShaderPipelinePipelineMultisample struct { + +### func [NewTexture]() ```go -RasterizationSamples string `options:"StringVkSampleCountFlagBits"` -SampleShadingEnable bool -MinSampleShading float32 -AlphaToCoverageEnable bool -AlphaToOneEnable bool +func NewTexture(assetDb assets.Database, key string, filter TextureFilter) (*Texture, error) ``` -} - -### func (s *ShaderPipelinePipelineMultisample) RasterizationSamplesToVK(device *GPUPhysicalDevice) GPUSampleCountFlags -### type ShaderPipelinePipelineMultisampleCompiled struct { + +### func [NewTextureFromImage]() ```go -RasterizationSamples vulkan_const.SampleCountFlagBits -SampleShadingEnable vk.Bool32 -MinSampleShading float32 -AlphaToCoverageEnable vk.Bool32 -AlphaToOneEnable vk.Bool32 +func NewTextureFromImage(key string, data []byte, filter TextureFilter) (*Texture, error) ``` -} -### type ShaderPipelinePipelineRasterization struct { + + +### func [NewTextureFromMemory]() ```go -DepthClampEnable bool -RasterizerDiscardEnable bool -PolygonMode string `options:"StringVkPolygonMode"` -CullMode string `options:"StringVkCullModeFlagBits"` -FrontFace string `options:"StringVkFrontFace"` -DepthBiasEnable bool -DepthBiasConstantFactor float32 -DepthBiasClamp float32 -DepthBiasSlopeFactor float32 -LineWidth float32 +func NewTextureFromMemory(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error) ``` -} - -### func (s *ShaderPipelinePipelineRasterization) CullModeToVK() vulkan_const.CullModeFlagBits -### func (s *ShaderPipelinePipelineRasterization) FrontFaceToVK() vulkan_const.FrontFace + +### func \(\*Texture\) [DelayedCreate]() +```go +func (t *Texture) DelayedCreate(device *GPUDevice) +``` -### func (s *ShaderPipelinePipelineRasterization) PolygonModeToVK() vulkan_const.PolygonMode -### type ShaderPipelinePipelineRasterizationCompiled struct { + +### func \(\*Texture\) [ReadAllPixels]() ```go -DepthClampEnable vk.Bool32 -DiscardEnable vk.Bool32 -PolygonMode vulkan_const.PolygonMode -CullMode vk.CullModeFlags -FrontFace vulkan_const.FrontFace -DepthBiasEnable vk.Bool32 -DepthBiasConstantFactor float32 -DepthBiasClamp float32 -DepthBiasSlopeFactor float32 -LineWidth float32 +func (t *Texture) ReadAllPixels(app *GPUApplication) ([]byte, error) ``` -} -### type ShaderPipelinePushConstant struct { + + +### func \(\*Texture\) [ReadPendingDataForTransparency]() ```go -Size uint32 -StageFlags []string `options:"StringVkAccessFlagBits"` +func (t *Texture) ReadPendingDataForTransparency() bool ``` -} - -### func (s *ShaderPipelinePushConstant) ShaderStageFlagsToVK() vk.ShaderStageFlags -### type ShaderPipelinePushConstantCompiled struct { + +### func \(\*Texture\) [ReadPixel]() ```go -Size uint32 -StageFlags vk.ShaderStageFlags +func (t *Texture) ReadPixel(app *GPUApplication, x, y int) matrix.Color ``` -} -### type ShaderPipelineTessellation struct { + + +### func \(\*Texture\) [Reload]() ```go -PatchControlPoints string `options:"StringVkPatchControlPoints"` +func (t *Texture) Reload(assetDb assets.Database) error ``` -} - -### func (s *ShaderPipelineTessellation) PatchControlPointsToVK() uint32 -### type ShaderPipelineTessellationCompiled struct { + +### func \(\*Texture\) [SetPendingDataDimensions]() ```go -PatchControlPoints uint32 +func (t *Texture) SetPendingDataDimensions(dim TextureDimensions) ``` -} - -### type ShaderType int -### const ( + +### func \(Texture\) [Size]() ```go -ShaderTypeGraphics ShaderType = iota -ShaderTypeCompute +func (t Texture) Size() matrix.Vec2 ``` -) -### type SkinnedShaderDataHeader struct { + + + +### func \(\*Texture\) [WritePixels]() ```go -// Has unexported fields. +func (t *Texture) WritePixels(device *GPUDevice, requests []GPUImageWriteRequest) ``` -} - -### func (h *SkinnedShaderDataHeader) BoneByIndex(index int) *BoneTransform -### func (h *SkinnedShaderDataHeader) CreateBones(ids []int32) + +## type [TextureCache]() -### func (h *SkinnedShaderDataHeader) FindBone(id int32) *BoneTransform +```go +type TextureCache struct { + // contains filtered or unexported fields +} +``` -### func (h *SkinnedShaderDataHeader) HasBones() bool + +### func [NewTextureCache]() +```go +func NewTextureCache(device *GPUDevice, assetDatabase assets.Database) TextureCache +``` -### func (h *SkinnedShaderDataHeader) SkinNamedDataInstanceSize() int -### func (h *SkinnedShaderDataHeader) SkinNamedDataPointer() unsafe.Pointer + +### func \(\*TextureCache\) [CreatePending]() +```go +func (t *TextureCache) CreatePending() +``` -### func (h *SkinnedShaderDataHeader) SkinUpdateNamedData() bool -### type TextShaderData struct { + +### func \(\*TextureCache\) [Destroy]() ```go -ShaderDataBase -UVs matrix.Vec4 -FgColor matrix.Color -BgColor matrix.Color -Scissor matrix.Vec4 -PxRange matrix.Vec2 +func (t *TextureCache) Destroy() ``` -} - -### func (s TextShaderData) Size() int -### type Texture struct { + +### func \(\*TextureCache\) [ForceRemoveTexture]() ```go -Key string -TexturePixelCache []byte -RenderId TextureId -Channels int -Filter int -MipLevels int -Width int -Height int -CacheInvalid bool +func (t *TextureCache) ForceRemoveTexture(key string, filter TextureFilter) ``` + + +### func \(\*TextureCache\) [InsertRawTexture]() + ```go -// Has unexported fields. +func (t *TextureCache) InsertRawTexture(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error) ``` -} - -### func NewTexture(assetDb assets.Database, key string, filter TextureFilter) (*Texture, error) -### func NewTextureFromImage(key string, data []byte, filter TextureFilter) (*Texture, error) + +### func \(\*TextureCache\) [InsertTexture]() +```go +func (t *TextureCache) InsertTexture(tex *Texture) +``` -### func NewTextureFromMemory(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error) -### func (t *Texture) DelayedCreate(device *GPUDevice) + +### func \(\*TextureCache\) [ReloadTexture]() +```go +func (t *TextureCache) ReloadTexture(textureKey string, filter TextureFilter) error +``` -### func (t *Texture) ReadAllPixels(app *GPUApplication) ([]byte, error) -### func (t *Texture) ReadPendingDataForTransparency() bool + +### func \(\*TextureCache\) [Texture]() +```go +func (t *TextureCache) Texture(textureKey string, filter TextureFilter) (*Texture, error) +``` -### func (t *Texture) ReadPixel(app *GPUApplication, x, y int) matrix.Color -### func (t *Texture) Reload(assetDb assets.Database) error + +## type [TextureCleanup]() -### func (t *Texture) SetPendingDataDimensions(dim TextureDimensions) +```go +type TextureCleanup struct { + // contains filtered or unexported fields +} +``` -### func (t Texture) Size() matrix.Vec2 + +## type [TextureColorFormat]() -### func (t *Texture) WritePixels(device *GPUDevice, requests []GPUImageWriteRequest) +```go +type TextureColorFormat int +``` -### type TextureCache struct { + ```go -// Has unexported fields. +const ( + TextureColorFormatRgbaUnorm TextureColorFormat = iota + TextureColorFormatRgbUnorm + TextureColorFormatRgbaSrgb + TextureColorFormatRgbSrgb + TextureColorFormatLuminance +) ``` -} - -### func NewTextureCache(device *GPUDevice, assetDatabase assets.Database) TextureCache + +## type [TextureData]() -### func (t *TextureCache) CreatePending() +```go +type TextureData struct { + Mem []byte + InternalFormat TextureInputType + Format TextureColorFormat + Type TextureMemType + Width int + Height int + InputType TextureFileFormat + Dimensions TextureDimensions +} +``` -### func (t *TextureCache) Destroy() + +### func [ReadRawTextureData]() +```go +func ReadRawTextureData(mem []byte, inputType TextureFileFormat) TextureData +``` -### func (t *TextureCache) ForceRemoveTexture(key string, filter TextureFilter) -### func (t *TextureCache) InsertRawTexture(key string, data []byte, width, height int, filter TextureFilter) (*Texture, error) + +### func [TexturePixelsFromAsset]() +```go +func TexturePixelsFromAsset(assetDb assets.Database, key string) (TextureData, error) +``` -### func (t *TextureCache) InsertTexture(tex *Texture) -### func (t *TextureCache) ReloadTexture(textureKey string, filter TextureFilter) error + +## type [TextureDimensions]() -### func (t *TextureCache) Texture(textureKey string, filter TextureFilter) (*Texture, error) +```go +type TextureDimensions = int +``` -### type TextureCleanup struct { + ```go -// Has unexported fields. +const ( + TextureDimensions2 TextureDimensions = iota + TextureDimensions1 + TextureDimensions3 + TextureDimensionsCube +) ``` -} - -### type TextureColorFormat int + +## type [TextureFileFormat]() -### const ( ```go -TextureColorFormatRgbaUnorm TextureColorFormat = iota -TextureColorFormatRgbUnorm -TextureColorFormatRgbaSrgb -TextureColorFormatRgbSrgb -TextureColorFormatLuminance +type TextureFileFormat = int ``` -) -### type TextureData struct { + ```go -Mem []byte -InternalFormat TextureInputType -Format TextureColorFormat -Type TextureMemType -Width int -Height int -InputType TextureFileFormat -Dimensions TextureDimensions +const ( + TextureFileFormatAstc TextureFileFormat = iota + TextureFileFormatPng + TextureFileFormatRaw +) ``` -} + +## type [TextureFilter]() + -### func ReadRawTextureData(mem []byte, inputType TextureFileFormat) TextureData +```go +type TextureFilter = int +``` -### func TexturePixelsFromAsset(assetDb assets.Database, key string) (TextureData, error) + +```go +const ( + TextureFilterLinear TextureFilter = iota + TextureFilterNearest + TextureFilterMax +) +``` -### type TextureDimensions = int + +## type [TextureId]() -### const ( ```go -TextureDimensions2 TextureDimensions = iota -TextureDimensions1 -TextureDimensions3 -TextureDimensionsCube +type TextureId struct { + Image GPUImage + Memory GPUDeviceMemory + View GPUImageView + Sampler GPUSampler + Format GPUFormat + MipLevels uint32 + Layout GPUImageLayout + Access GPUAccessFlags + Samples GPUSampleCountFlags + Width int + Height int + LayerCount int +} ``` -) -### type TextureFileFormat = int - - -### const ( + +### func \(TextureId\) [IsValid]() ```go -TextureFileFormatAstc TextureFileFormat = iota -TextureFileFormatPng -TextureFileFormatRaw +func (t TextureId) IsValid() bool ``` -) -### type TextureFilter = int -### const ( + +## type [TextureInputType]() + + ```go -TextureFilterLinear TextureFilter = iota -TextureFilterNearest -TextureFilterMax +type TextureInputType int ``` -) -### type TextureId struct { + ```go -Image GPUImage -Memory GPUDeviceMemory -View GPUImageView -Sampler GPUSampler -Format GPUFormat -MipLevels uint32 -Layout GPUImageLayout -Access GPUAccessFlags -Samples GPUSampleCountFlags -Width int -Height int -LayerCount int +const ( + TextureInputTypeCompressedRgbaAstc4x4 TextureInputType = iota + TextureInputTypeCompressedRgbaAstc5x4 + TextureInputTypeCompressedRgbaAstc5x5 + TextureInputTypeCompressedRgbaAstc6x5 + TextureInputTypeCompressedRgbaAstc6x6 + TextureInputTypeCompressedRgbaAstc8x5 + TextureInputTypeCompressedRgbaAstc8x6 + TextureInputTypeCompressedRgbaAstc8x8 + TextureInputTypeCompressedRgbaAstc10x5 + TextureInputTypeCompressedRgbaAstc10x6 + TextureInputTypeCompressedRgbaAstc10x8 + TextureInputTypeCompressedRgbaAstc10x10 + TextureInputTypeCompressedRgbaAstc12x10 + TextureInputTypeCompressedRgbaAstc12x12 + TextureInputTypeRgba8 + TextureInputTypeRgb8 + TextureInputTypeLuminance +) ``` -} - -### func (t TextureId) IsValid() bool + +## type [TextureMemType]() -### type TextureInputType int +```go +type TextureMemType = int +``` -### const ( + ```go -TextureInputTypeCompressedRgbaAstc4x4 TextureInputType = iota -TextureInputTypeCompressedRgbaAstc5x4 -TextureInputTypeCompressedRgbaAstc5x5 -TextureInputTypeCompressedRgbaAstc6x5 -TextureInputTypeCompressedRgbaAstc6x6 -TextureInputTypeCompressedRgbaAstc8x5 -TextureInputTypeCompressedRgbaAstc8x6 -TextureInputTypeCompressedRgbaAstc8x8 -TextureInputTypeCompressedRgbaAstc10x5 -TextureInputTypeCompressedRgbaAstc10x6 -TextureInputTypeCompressedRgbaAstc10x8 -TextureInputTypeCompressedRgbaAstc10x10 -TextureInputTypeCompressedRgbaAstc12x10 -TextureInputTypeCompressedRgbaAstc12x12 -TextureInputTypeRgba8 -TextureInputTypeRgb8 -TextureInputTypeLuminance +const ( + TextureMemTypeUnsignedByte TextureMemType = iota +) ``` -) -### type TextureMemType = int + +## type [Vertex]() -### const ( ```go -TextureMemTypeUnsignedByte TextureMemType = iota +type Vertex struct { + Position matrix.Vec3 + Normal matrix.Vec3 + Tangent matrix.Vec4 + UV0 matrix.Vec2 + Color matrix.Color + JointIds matrix.Vec4i + JointWeights matrix.Vec4 + MorphTarget matrix.Vec3 +} ``` -) -### type Vertex struct { + +### func [MeshPlaneData]() ```go -Position matrix.Vec3 -Normal matrix.Vec3 -Tangent matrix.Vec4 -UV0 matrix.Vec2 -Color matrix.Color -JointIds matrix.Vec4i -JointWeights matrix.Vec4 -MorphTarget matrix.Vec3 +func MeshPlaneData() ([]Vertex, []uint32) ``` -} -### func MeshPlaneData() ([]Vertex, []uint32) + +### func [MeshQuadData]() + +```go +func MeshQuadData() ([]Vertex, []uint32) +``` -### func MeshQuadData() ([]Vertex, []uint32) -### type ViewCuller interface { + +## type [ViewCuller]() -```go -IsInView(box collision.AABB) bool -ViewChanged() bool -``` -} +```go +type ViewCuller interface { + IsInView(box collision.AABB) bool + ViewChanged() bool +} +``` +Generated by [gomarkdoc]() diff --git a/docs/api/root.md b/docs/api/root.md index 7e0ccba3e..c9140eee3 100644 --- a/docs/api/root.md +++ b/docs/api/root.md @@ -1,27 +1,55 @@ -# Package root + -**Import path:** `kaijuengine.com` +# src +```go +import "kaijuengine.com" +``` + +## Index + +- [type Game](<#Game>) + - [func \(Game\) ContentDatabase\(\) \(assets.Database, error\)](<#Game.ContentDatabase>) + - [func \(g \*Game\) Launch\(host \*engine.Host\)](<#Game.Launch>) + - [func \(Game\) PluginRegistry\(\) \[\]reflect.Type](<#Game.PluginRegistry>) -## Types + +## type [Game]() -### type Game struct { ```go -// Has unexported fields. +type Game struct { + // contains filtered or unexported fields +} ``` -} + +### func \(Game\) [ContentDatabase]() + +```go +func (Game) ContentDatabase() (assets.Database, error) +``` + + + + +### func \(\*Game\) [Launch]() -### func (Game) ContentDatabase() (assets.Database, error) +```go +func (g *Game) Launch(host *engine.Host) +``` -### func (g *Game) Launch(host *engine.Host) + +### func \(Game\) [PluginRegistry]() -### func (Game) PluginRegistry() []reflect.Type +```go +func (Game) PluginRegistry() []reflect.Type +``` +Generated by [gomarkdoc]() diff --git a/src/tools/gendocs.go b/src/tools/gendocs.go index 30cc61128..ac9fc606a 100644 --- a/src/tools/gendocs.go +++ b/src/tools/gendocs.go @@ -1,233 +1,224 @@ package main import ( - "bufio" "fmt" + "log/slog" "os" "os/exec" "path/filepath" "strings" ) -type DocGenerator struct { - sourceDir string - outputDir string - packages []string -} - -func NewDocGenerator() *DocGenerator { - return &DocGenerator{ - sourceDir: "src", - outputDir: "./docs/api", - packages: []string{ - ".", "bootstrap", "engine", "matrix", "klib", "rendering", - "platform/windowing", "platform/hid", "platform/audio", - "platform/filesystem", "engine/ui", "registry/shader_data_registry", "debug", - }, - } +type App struct { + srcPath string + docsPath string + logger *slog.Logger } func main() { - generator := NewDocGenerator() - generator.Generate() -} - -func (g *DocGenerator) Generate() { - fmt.Printf("Generating docs from: %s\n", g.sourceDir) + logger := slog.New(slog.NewTextHandler(os.Stdout, nil)) - if err := os.MkdirAll(g.outputDir, 0755); err != nil { - fmt.Printf("Error creating output dir: %v\n", err) + if len(os.Args) < 2 { + logger.Error("missing project path argument", "usage", os.Args[0]+" ") os.Exit(1) } - g.generateIndex() + app := NewApp(os.Args[1], logger) - successCount := 0 - for _, pkg := range g.packages { - fmt.Printf("Processing: %s... ", pkg) - if g.generatePackageDoc(pkg) { - fmt.Println("✓") - successCount++ - } else { - fmt.Println("✗") - } + if err := app.Run(); err != nil { + logger.Error("application failed", "error", err) + os.Exit(1) } - fmt.Printf("Generated! %d/%d packages processed.\n", successCount, len(g.packages)) + logger.Info("documentation generated successfully") } -func (g *DocGenerator) generateIndex() { - indexPath := filepath.Join(g.outputDir, "index.md") - file, err := os.Create(indexPath) - if err != nil { - return +func NewApp(srcPath string, logger *slog.Logger) *App { + docsPath := filepath.Join(filepath.Dir(srcPath), "docs", "api") + return &App{ + srcPath: srcPath, + docsPath: docsPath, + logger: logger, + } +} + +func (a *App) Run() error { + if err := os.MkdirAll(a.docsPath, os.ModePerm); err != nil { + return fmt.Errorf("error creating docs directory: %w", err) } - defer file.Close() - writer := bufio.NewWriter(file) - defer writer.Flush() + packages, err := findPackages(a.srcPath) + if err != nil { + return err + } - writer.WriteString("# Kaiju Engine API Documentation\n\n") - writer.WriteString("Auto-generated using go doc.\n\n") + a.printPackages(packages) - categories := g.categorizePackages() - for title, pkgs := range categories { - if len(pkgs) == 0 { - continue - } - writer.WriteString(fmt.Sprintf("## %s\n\n", title)) - for _, pkg := range pkgs { - link := g.getPackageLink(pkg) - displayName := g.getDisplayName(pkg) - writer.WriteString(fmt.Sprintf("- [%s](%s)\n", displayName, link)) + for name, path := range packages { + if err := a.generatePackageDoc(name, path); err != nil { + a.logger.Warn("failed to generate docs", "package", name, "error", err) } - writer.WriteString("\n") } + + return createIndex(packages, a.docsPath) } -func (g *DocGenerator) categorizePackages() map[string][]string { - categories := map[string][]string{ - "Core": {}, - "Engine": {}, - "Platform": {}, - "Rendering": {}, - "Other": {}, +func (a *App) printPackages(packages map[string]string) { + a.logger.Info("packages discovered", "count", len(packages)) + + for name, path := range packages { + a.logger.Info("package", "name", name, "path", path) } +} - for _, pkg := range g.packages { - switch { - case g.isCorePackage(pkg): - categories["Core"] = append(categories["Core"], pkg) - case strings.HasPrefix(pkg, "engine"): - categories["Engine"] = append(categories["Engine"], pkg) - case strings.HasPrefix(pkg, "platform"): - categories["Platform"] = append(categories["Platform"], pkg) - case g.isRenderingPackage(pkg): - categories["Rendering"] = append(categories["Rendering"], pkg) - default: - categories["Other"] = append(categories["Other"], pkg) - } +func (a *App) generatePackageDoc(name, path string) error { + outputFile := filepath.Join(a.docsPath, name+".md") + + a.logger.Info("generating docs", "package", name) + + if err := runGomarkdoc(a.srcPath, path, outputFile); err != nil { + return err } - return categories + a.logger.Info("generated", "file", outputFile) + return nil } -func (g *DocGenerator) isCorePackage(pkg string) bool { - return pkg == "." || pkg == "bootstrap" || pkg == "matrix" || pkg == "klib" -} +func findPackages(srcPath string) (map[string]string, error) { + packages := make(map[string]string) -func (g *DocGenerator) isRenderingPackage(pkg string) bool { - return strings.HasPrefix(pkg, "rendering") || strings.HasPrefix(pkg, "registry") -} + entries, err := os.ReadDir(srcPath) + if err != nil { + return nil, err + } -func (g *DocGenerator) getPackageLink(pkg string) string { - if pkg == "." { - return "root.md" + if hasGoFiles(srcPath) { + packages["root"] = "." } - return strings.ReplaceAll(pkg, "/", "_") + ".md" -} -func (g *DocGenerator) getDisplayName(pkg string) string { - if pkg == "." { - return "root" + for _, entry := range entries { + if !entry.IsDir() { + continue + } + + name := entry.Name() + if shouldSkip(name) { + continue + } + + packagePath := filepath.Join(srcPath, name) + if hasGoFiles(packagePath) { + packages[name] = name + } } - return pkg + + return packages, nil } -func (g *DocGenerator) generatePackageDoc(pkg string) bool { - output, err := g.executeGoDoc(pkg) +func hasGoFiles(dir string) bool { + entries, err := os.ReadDir(dir) if err != nil { return false } - filename := g.getPackageLink(pkg) - filePath := filepath.Join(g.outputDir, filename) + for _, entry := range entries { + if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".go") { + return true + } + } + return false +} - file, err := os.Create(filePath) - if err != nil { - return false +func shouldSkip(name string) bool { + skipDirs := map[string]struct{}{ + ".git": {}, "vendor": {}, "node_modules": {}, "build": {}, "dist": {}, "docs": {}, + "bullet3": {}, "soloud": {}, "libs": {}, "tools": {}, "file_templates": {}, + "generators": {}, "ollama": {}, "network": {}, } - defer file.Close() - writer := bufio.NewWriter(file) - defer writer.Flush() + _, exists := skipDirs[name] + return exists +} - g.writePackageHeader(writer, pkg) - g.convertDocToMarkdown(writer, string(output)) +func runGomarkdoc(srcPath, packagePath, outputFile string) error { + target := "." + if packagePath != "." { + target = "./" + packagePath + } - return true -} + cmd := exec.Command("gomarkdoc", "--output", outputFile, target) + cmd.Dir = srcPath -func (g *DocGenerator) executeGoDoc(pkg string) ([]byte, error) { - relativePkg := "./" + pkg - if pkg == "." { - relativePkg = "." + output, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("gomarkdoc failed: %w | output: %s", err, string(output)) } - cmd := exec.Command("go", "doc", "-all", relativePkg) - cmd.Dir = g.sourceDir - return cmd.Output() + return nil } -func (g *DocGenerator) writePackageHeader(writer *bufio.Writer, pkg string) { - displayName := g.getDisplayName(pkg) - writer.WriteString(fmt.Sprintf("# Package %s\n\n", displayName)) +func createIndex(packages map[string]string, docsPath string) error { + var builder strings.Builder - importPath := "kaijuengine.com" - if pkg != "." { - importPath += "/" + pkg - } - writer.WriteString(fmt.Sprintf("**Import path:** `%s`\n\n", importPath)) -} + builder.WriteString("# API Documentation\n\n") + builder.WriteString("Auto-generated documentation using gomarkdoc.\n\n") + + categories := categorizePackages(packages) -func (g *DocGenerator) convertDocToMarkdown(writer *bufio.Writer, output string) { - lines := strings.Split(output, "\n") - inCodeBlock := false + order := []string{"Core", "Engine", "Platform", "Rendering", "Registry", "Other"} - for _, line := range lines { - if strings.HasPrefix(line, "package ") { + for _, cat := range order { + pkgs := categories[cat] + if len(pkgs) == 0 { continue } - if g.isCodeLine(line) { - if !inCodeBlock { - writer.WriteString("```go\n") - inCodeBlock = true - } - writer.WriteString(strings.TrimPrefix(line, "\t") + "\n") - } else { - if inCodeBlock { - writer.WriteString("```\n\n") - inCodeBlock = false + builder.WriteString(fmt.Sprintf("## %s\n\n", cat)) + for _, pkg := range pkgs { + displayName := pkg + if pkg == "root" { + displayName = "Root Package" } - g.writeFormattedLine(writer, line) + builder.WriteString(fmt.Sprintf("- [%s](%s.md)\n", displayName, pkg)) } + builder.WriteString("\n") } - if inCodeBlock { - writer.WriteString("```\n") - } + indexFile := filepath.Join(docsPath, "index.md") + return os.WriteFile(indexFile, []byte(builder.String()), 0644) } -func (g *DocGenerator) isCodeLine(line string) bool { - return strings.HasPrefix(line, "\t") || (len(line) > 0 && strings.HasPrefix(line, " ")) -} +func categorizePackages(packages map[string]string) map[string][]string { + categories := map[string][]string{ + "Core": {}, + "Engine": {}, + "Platform": {}, + "Rendering": {}, + "Registry": {}, + "Other": {}, + } -func (g *DocGenerator) writeFormattedLine(writer *bufio.Writer, line string) { - if g.isHeaderLine(line) { - writer.WriteString(fmt.Sprintf("## %s\n\n", strings.Title(strings.ToLower(line)))) - } else if g.isDeclarationLine(line) { - writer.WriteString("### " + line + "\n\n") - } else { - writer.WriteString(line + "\n") + for name := range packages { + category := categorize(name) + categories[category] = append(categories[category], name) } -} -func (g *DocGenerator) isHeaderLine(line string) bool { - return line != "" && strings.ToUpper(line) == line && !strings.Contains(line, " ") && len(line) > 1 + return categories } -func (g *DocGenerator) isDeclarationLine(line string) bool { - return strings.HasPrefix(line, "func ") || strings.HasPrefix(line, "type ") || - strings.HasPrefix(line, "var ") || strings.HasPrefix(line, "const ") +func categorize(packageName string) string { + switch { + case packageName == "bootstrap": + return "Core" + case strings.HasPrefix(packageName, "engine"): + return "Engine" + case strings.HasPrefix(packageName, "platform"): + return "Platform" + case packageName == "rendering": + return "Rendering" + case strings.Contains(packageName, "registry"): + return "Registry" + default: + return "Other" + } }