Class RenderTarget.Builder

  • Enclosing class:
    RenderTarget

    public static class RenderTarget.Builder
    extends java.lang.Object
    Constructs RenderTarget objects using a builder pattern.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • texture

        @NonNull
        public RenderTarget.Builder texture​(@NonNull
                                            RenderTarget.AttachmentPoint attachment,
                                            @Nullable
                                            Texture texture)
        Sets a texture to a given attachment point.

        All RenderTargets must have a non-null COLOR attachment.

        Parameters:
        attachment - The attachment point of the texture.
        texture - The associated texture object.
        Returns:
        A reference to this Builder for chaining calls.
      • mipLevel

        @NonNull
        public RenderTarget.Builder mipLevel​(@NonNull
                                             RenderTarget.AttachmentPoint attachment,
                                             @IntRange(from=0L)
                                             int level)
        Sets the mipmap level for a given attachment point.
        Parameters:
        attachment - The attachment point of the texture.
        level - The associated mipmap level, 0 by default.
        Returns:
        A reference to this Builder for chaining calls.
      • layer

        @NonNull
        public RenderTarget.Builder layer​(@NonNull
                                          RenderTarget.AttachmentPoint attachment,
                                          @IntRange(from=0L)
                                          int layer)
        Sets the layer for a given attachment point (for 3D textures).
        Parameters:
        attachment - The attachment point.
        layer - The associated cubemap layer.
        Returns:
        A reference to this Builder for chaining calls.
      • build

        @NonNull
        public RenderTarget build​(@NonNull
                                  Engine engine)
        Creates the RenderTarget object and returns a pointer to it.
        Returns:
        pointer to the newly created object or nullptr if exceptions are disabled and an error occurred.