rhodonite
    Preparing search index...

    Interface IRenderable

    Interface for renderable texture objects that can be used as render targets. This interface defines the contract for objects that can be rendered to, providing texture resources and rendering capabilities.

    interface IRenderable {
        _textureResourceUid: number;
        _textureViewAsRenderTargetResourceUid: number;
        _textureViewResourceUid: number;
        fbo?: FrameBuffer;
        height: number;
        width: number;
        createCubeTextureViewAsRenderTarget(
            faceIdx: number,
            mipLevel: number,
        ): void;
        destroy3DAPIResources(): boolean;
        resize(width: number, height: number): void;
    }

    Implemented by

    Index

    Properties

    _textureResourceUid: number

    The unique identifier for the underlying texture resource

    _textureViewAsRenderTargetResourceUid: number

    The unique identifier for the texture view used as a render target

    _textureViewResourceUid: number

    The unique identifier for the texture view resource

    Optional frame buffer object associated with this renderable

    height: number

    The height of the renderable texture in pixels

    width: number

    The width of the renderable texture in pixels

    Methods

    • Creates a cube texture view as a render target for a specific face and mip level. This is typically used for cube map rendering where each face needs to be rendered to individually.

      Parameters

      • faceIdx: number

        The index of the cube face (0-5 for +X, -X, +Y, -Y, +Z, -Z)

      • mipLevel: number

        The mip level to create the view for (0 being the base level)

      Returns void

    • Destroys all associated 3D graphics API resources. This method should clean up GPU memory and release all allocated resources to prevent memory leaks.

      Returns boolean

      True if the resources were successfully destroyed, false otherwise

    • Resizes the renderable texture to the specified dimensions. This method should handle the recreation of underlying graphics API resources to accommodate the new size.

      Parameters

      • width: number

        The new width in pixels

      • height: number

        The new height in pixels

      Returns void