Libraries.Game.Graphics.Vulkan.VulkanGraphics Documentation

Inherits from: Libraries.Game.Graphics.GraphicsManager, Libraries.Language.Object

Actions Documentation

BeginNextFrame()

This action gets the next image in the swapchain for use in the next frame of animation, clears the image, and prepares the frame's related resources (e.g. CommandBuffers and Fences).

ClearScreenColor(Libraries.Game.Graphics.Color color)

This action sets the background color of the window. This is the color used to clear the screen between each frame of animation.

Parameters

ClearScreenColor(number red, number green, number blue, number alpha)

This action sets the background color of the window. This is the color used to clear the screen between each frame of animation. The alpha component (transparency) isn't supported for OpenGL rendering, but Vulkan rendering can draw a transparent window background if the feature is enabled.

Parameters

  • number red: The red component of the color, as a number between 0.0 (no red) and 1.0 (full red).
  • number green: The green component of the color, as a number between 0.0 (no green) and 1.0 (full green).
  • number blue: The blue component of the color, as a number between 0.0 (no blue) and 1.0 (full blue).
  • number alpha: The alpha component of the color, as a number between 0.0 (completely transparent) and 1.0 (completely opaque).

ClearScreenColor(number red, number green, number blue)

This action sets the background color of the window. This is the color used to clear the screen between each frame of animation.

Parameters

  • number red: The red component of the color, as a number between 0.0 (no red) and 1.0 (full red).
  • number green: The green component of the color, as a number between 0.0 (no green) and 1.0 (full green).
  • number blue: The blue component of the color, as a number between 0.0 (no blue) and 1.0 (full blue).

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

CreateShader(integer shaderType, text sourceCode, text shaderName)

This action makes a new shader of the requested type (e.g., FRAGMENT_SHADER or VERTEX_SHADER from the Shader class) using the given source code. If the shader code successfully compiles, this action will return an integer ID representing that shader. If the shader can't be created or it does not successfully compile, this will alert an error.

Parameters

  • integer shaderType
  • text sourceCode
  • text shaderName

Return

integer:

CreateShaderProgram(Libraries.Game.Graphics.Shaders.Programs.ShaderProgram program)

CreateShaderProgram(Libraries.Game.Graphics.Shaders.Programs.ShaderProgramStrategy program)

DeleteShader(integer shaderID)

This action instructs the rendering system to delete the native resources allocated to a shader. After deleting a shader, it can't be used by the rendering system unless it's recompiled.

Parameters

  • integer shaderID

DeleteShaderProgram(integer programID)

This action instructs the rendering system to delete the native resources allocated to a shader program. After deleting a shader program, it can't be used by the rendering system unless it's reloaded. Deleting a program doesn't automatically delete the shaders attached to it -- those must also be deleted manually.

Parameters

  • integer programID

DisplayCurrentImage()

Make sure the next image in the swapchain is valid. Window resizing in particular can make the swapchain "out of date", in which case we'll need to regenerate it.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetClearValues()

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanClearValues:

GetCommandPool()

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanCommandPool:

GetComputeQueue()

This action instructs the rendering system to delete the native resources allocated to a shader. After deleting a shader, it can't be used by the rendering system unless it's recompiled.

Return

Libraries.Game.Graphics.Vulkan.VulkanQueue:

GetCurrentFramebuffer()

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanFramebuffer:

GetCurrentRenderCommandBuffer()

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanCommandBuffer:

GetCurrentResourceIndex()

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Return

integer:

GetDescriptorSetManager()

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanDescriptorSetManager:

GetDevice()

This action sets the values of an array of Vector3's in a shader "uniform" array variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanDevice:

GetGraphicsQueue()

This action sets the values of an array of Vector2's in a shader "uniform" array variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanQueue:

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetInstance()

This action sets the value of an array of Matrix3's in a shader "uniform" variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked. The array is assumed to provide the matrix in column-major order, unless the transpose flag is set to true, in which case it will be assumed to be row-major instead.

Return

Libraries.Game.Graphics.Vulkan.VulkanInstance:

GetMaterialManager()

This action tells the graphics system to render content using the shader program indicated by the provided ID.

Return

Libraries.Game.Graphics.Models.Vulkan.MaterialManagerVulkan:

GetMaxDescriptorsPerStage()

This action returns true if rendering for the application has paused, or false if it is rendering normally. Rendering is paused if the application window is minimized, and it resumes on the next frame of animation when the window is restored.

Return

integer: True if the application has paused rendering, or false if it is rendering normally.

GetMaximumTextureCount()

This action returns the maximum number of textures that can be supported on the system. This number depends on the local hardware being used.

Return

integer:

GetModelManager()

This action instructs the rendering system to delete the native resources allocated to a shader program. After deleting a shader program, it can't be used by the rendering system unless it's reloaded. Deleting a program doesn't automatically delete the shaders attached to it -- those must also be deleted manually.

Return

Libraries.Game.Graphics.Models.Vulkan.ModelManagerVulkan:

GetPhysicalDevice()

This action sets the value of an array of Matrix4's in a shader "uniform" variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked. The array is assumed to provide the matrix in column-major order, unless the transpose flag is set to true, in which case it will be assumed to be row-major instead.

Return

Libraries.Game.Graphics.Vulkan.VulkanPhysicalDevice:

GetPhysicalDeviceLimits()

This action sets the values of an array of Vector4's in a shader "uniform" array variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanPhysicalDeviceLimits:

GetPresentationQueue()

This action sets the values of a shader "uniform" array variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanQueue:

GetSurface()

This action informs the rendering system of how to interpret elements of vertex input data for a particular input.

Return

Libraries.Game.Graphics.Vulkan.VulkanSurface:

GetSwapchain()

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanSwapchain:

GetTextureManager()

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Return

Libraries.Game.Graphics.Vulkan.VulkanTextureManager:

Initialize(Libraries.Game.Graphics.Vulkan.VulkanOptions options)

This action constructs the necessary Vulkan resources to render using this VulkanGraphics. This will also create and setup the GameDisplay for the Game class, if there isn't already one setup, because access to the screen is needed for full VulkanGraphics setup.

Parameters

Return

boolean:

IsRenderingPaused()

This action returns true if rendering for the application has paused, or false if it is rendering normally. Rendering is paused if the application window is minimized, and it resumes on the next frame of animation when the window is restored.

Return

boolean: True if the application has paused rendering, or false if it is rendering normally.

SetClearScreenColor(number red, number green, number blue, number alpha)

This action sets the background color of the window. This is the color used to clear the screen between each frame of animation. The alpha component (transparency) isn't supported for OpenGL rendering, but Vulkan rendering can draw a transparent window background if the feature is enabled.

Parameters

  • number red: The red component of the color, as a number between 0.0 (no red) and 1.0 (full red).
  • number green: The green component of the color, as a number between 0.0 (no green) and 1.0 (full green).
  • number blue: The blue component of the color, as a number between 0.0 (no blue) and 1.0 (full blue).
  • number alpha: The alpha component of the color, as a number between 0.0 (completely transparent) and 1.0 (completely opaque).

SetClearScreenColor(Libraries.Game.Graphics.Color color)

This action sets the background color of the window. This is the color used to clear the screen between each frame of animation.

Parameters

SetClearScreenColor(number red, number green, number blue)

This action sets the background color of the window. This is the color used to clear the screen between each frame of animation.

Parameters

  • number red: The red component of the color, as a number between 0.0 (no red) and 1.0 (full red).
  • number green: The green component of the color, as a number between 0.0 (no green) and 1.0 (full green).
  • number blue: The blue component of the color, as a number between 0.0 (no blue) and 1.0 (full blue).

SetShaderInput(integer uniformID, number value1, number value2, number value3)

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Parameters

  • integer uniformID
  • number value1
  • number value2
  • number value3

SetShaderInput(integer uniformID, number value1, number value2)

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Parameters

  • integer uniformID
  • number value1
  • number value2

SetShaderInput(integer uniformID, number value1, number value2, number value3, number value4)

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Parameters

  • integer uniformID
  • number value1
  • number value2
  • number value3
  • number value4

SetShaderInput(integer uniformID, integer value)

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Parameters

  • integer uniformID
  • integer value

SetShaderInput(integer uniformID, integer value1, integer value2, integer value3, integer value4)

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Parameters

  • integer uniformID
  • integer value1
  • integer value2
  • integer value3
  • integer value4

SetShaderInput(integer uniformID, integer value1, integer value2, integer value3)

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Parameters

  • integer uniformID
  • integer value1
  • integer value2
  • integer value3

SetShaderInput(integer uniformID, number value)

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Parameters

  • integer uniformID
  • number value

SetShaderInput(integer uniformID, integer value1, integer value2)

This action sets the value of a shader "uniform" variable to the given input values. The uniform is identified by a unique ID that is generated when a shader program using that uniform is compiled and linked.

Parameters

  • integer uniformID
  • integer value1
  • integer value2

SetShaderInputArray(integer uniformID, Libraries.Containers.Number32BitArray array, integer startIndex, integer length)

This action sets the values of a shader "uniform" array variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked.

Parameters

  • integer uniformID: An integer ID that represents a uniform in a linked shader program.
  • Libraries.Containers.Number32BitArray: A typed array containing the values to copy to the uniform.
  • integer startIndex: The first index of the array to begin copying.
  • integer length: How many elements should be copied from the input array to the uniform array.

SetShaderInputMatrix3(integer uniformID, Libraries.Containers.Number32BitArray array, boolean transpose)

This action sets the value of a Matrix3 shader "uniform" variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked. The array is assumed to provide the matrix in column-major order, unless the transpose flag is set to true, in which case it will be assumed to be row-major instead.

Parameters

  • integer uniformID: An integer ID that represents a uniform in a linked shader program.
  • Libraries.Containers.Number32BitArray: A typed array containing the values to copy to the uniform.
  • boolean transpose: If set to true, the uniform will be set to the transpose of the Matrix.

SetShaderInputMatrix3Array(integer uniformID, integer matrixCount, Libraries.Containers.Number32BitArray array, integer startIndex, boolean transpose)

This action sets the value of an array of Matrix3's in a shader "uniform" variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked. The array is assumed to provide the matrix in column-major order, unless the transpose flag is set to true, in which case it will be assumed to be row-major instead.

Parameters

  • integer uniformID: An integer ID that represents a uniform in a linked shader program.
  • integer matrixCount: How many matrices should be set in the uniform. Each matrix requires 9 sequential values from the source array.
  • Libraries.Containers.Number32BitArray: A typed array containing the values to copy to the uniform.
  • integer startIndex: The first index of the array to begin copying.
  • boolean transpose: If set to true, the uniform will be set to the transpose of the Matrix.

SetShaderInputMatrix4(integer uniformID, Libraries.Containers.Number32BitArray array, boolean transpose)

This action sets the value of a Matrix4 shader "uniform" variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked. The array is assumed to provide the matrix in column-major order, unless the transpose flag is set to true, in which case it will be assumed to be row-major instead.

Parameters

  • integer uniformID: An integer ID that represents a uniform in a linked shader program.
  • Libraries.Containers.Number32BitArray: A typed array containing the values to copy to the uniform.
  • boolean transpose: If set to true, the uniform will be set to the transpose of the Matrix.

SetShaderInputMatrix4Array(integer uniformID, integer matrixCount, Libraries.Containers.Number32BitArray array, integer startIndex, boolean transpose)

This action sets the value of an array of Matrix4's in a shader "uniform" variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked. The array is assumed to provide the matrix in column-major order, unless the transpose flag is set to true, in which case it will be assumed to be row-major instead.

Parameters

  • integer uniformID: An integer ID that represents a uniform in a linked shader program.
  • integer matrixCount: How many matrices should be set in the uniform. Each matrix requires 16 sequential values from the source array.
  • Libraries.Containers.Number32BitArray: A typed array containing the values to copy to the uniform.
  • integer startIndex: The first index of the array to begin copying.
  • boolean transpose: If set to true, the uniform will be set to the transpose of the Matrix.

SetShaderInputVector2Array(integer uniformID, Libraries.Containers.Number32BitArray array, integer startIndex, integer length)

This action sets the values of an array of Vector2's in a shader "uniform" array variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked.

Parameters

  • integer uniformID: An integer ID that represents a uniform in a linked shader program.
  • Libraries.Containers.Number32BitArray: A typed array containing the values to copy to the uniform.
  • integer startIndex: The first index of the array to begin copying.
  • integer length: How many elements should be copied from the input array to the uniform array.

SetShaderInputVector3Array(integer uniformID, Libraries.Containers.Number32BitArray array, integer startIndex, integer length)

This action sets the values of an array of Vector3's in a shader "uniform" array variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked.

Parameters

  • integer uniformID: An integer ID that represents a uniform in a linked shader program.
  • Libraries.Containers.Number32BitArray: A typed array containing the values to copy to the uniform.
  • integer startIndex: The first index of the array to begin copying.
  • integer length: How many elements should be copied from the input array to the uniform array.

SetShaderInputVector4Array(integer uniformID, Libraries.Containers.Number32BitArray array, integer startIndex, integer length)

This action sets the values of an array of Vector4's in a shader "uniform" array variable. The uniform is identified by a unique ID that is generated when a shader program using the uniform is compiled and linked.

Parameters

  • integer uniformID: An integer ID that represents a uniform in a linked shader program.
  • Libraries.Containers.Number32BitArray: A typed array containing the values to copy to the uniform.
  • integer startIndex: The first index of the array to begin copying.
  • integer length: How many elements should be copied from the input array to the uniform array.

SetVertexInputInformation(integer inputID, integer size, integer type, boolean normalize, integer stride, integer offset)

This action informs the rendering system of how to interpret elements of vertex input data for a particular input.

Parameters

  • integer inputID: An ID that describes a vertex input.
  • integer size: How many bytes from the array are needed to set a single instance of the input value in the shader. Must be between 1 and 4.
  • integer type: A constant value representing the type of data, such as GL_INT.
  • boolean normalize: If set to true, fixed-point data values will be normalized when passed down to the system. If set to false, the values will be passed down without modification.
  • integer stride: How many bytes of data separate each instance of data meant to be used for this input. If this value is 0, it's assumed that there is no additional data interleaved between data used for this input.
  • integer offset: The index of the first element of this input's data in the input buffer, or in other words, how many bytes of data appear before the first instance of input data for this input.

UseShaderProgram(integer programID)

This action tells the graphics system to render content using the shader program indicated by the provided ID.

Parameters

  • integer programID