Libraries.Game.Graphics.Vulkan.VulkanPainter2D Documentation

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

Actions Documentation

Begin()

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)

Draw(Libraries.Game.Graphics.Drawable drawable)

In this case, the current clipping values are defined, and the last set wasn't.

Parameters

End()

These buffers are for a 4x4 matrix of floats, so 4 bytes * 16 values.

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)

GetDefaultProgram()

Create the RenderPass that will be used for this painter. This must be compatible with the render pass used for the swapchain Framebuffers. The RenderPass provided to the Framebuffers will indicate how rendering to the buffers will be performed. Pipelines using the Framebuffers must either exactly match the RenderPass, or be compatible with it. More details here: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/chap8.html#renderpass-compatibility

Return

Libraries.Game.Graphics.Shaders.Programs.ShaderProgram:

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()

IsClipping()

End the render pass.

Return

boolean:

IsRenderPassValid()

Return

boolean

QueueForDrawing(Libraries.Interface.Item2D item)

In this case, the current clip values isn't defined, and the last set was.

Parameters

RegenerateRenderPass(boolean isFirstPass)

Parameters

  • boolean isFirstPass

Return

boolean

SetCamera(Libraries.Game.Graphics.Camera camera)

Try to find an existing batch that's available. This will be the most common case.

Parameters

SetClipCoordinates(number x1, number y1, number x2, number y2)

Always send a scissor command before the first draw.

Parameters

  • number x1
  • number y1
  • number x2
  • number y2

SetClipping(boolean clippingEnabled)

Set the current batch to undefined, to ensure we're starting with a clean slate again next time.

Parameters

  • boolean clippingEnabled

SetColor(Libraries.Game.Graphics.Color color)

Once the batches have loaded their vertex and index buffers, allow the shader mapping to submit commands to bind descriptors.

Parameters

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

Set scissor command

Parameters

  • number red
  • number green
  • number blue
  • number alpha

SetViewport(integer x, integer y, integer width, integer height)

Create the command to begin the render pass.

Parameters

  • integer x
  • integer y
  • integer width
  • integer height