# Adapter

This type represents a rendering adapter used within the rendering system.

## GetBackBuffer

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Returns a back buffer texture. May return a blank or outdated texture, if the back buffer texture was not updated.

**Arguments**

None.

**Returns**

| Type                                             | Description                  |
| ------------------------------------------------ | ---------------------------- |
| [`Ptr`](https://lua2.fatality.win/api/types/ptr) | Back buffer texture pointer. |

**Example**

```lua
local bb = adapter:GetBackBuffer();
```

***

## GetBackBufferDownsampled

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Returns a 4x down sampled version of the back buffer texture.

Arguments

None.

Returns

| Type                                             | Description                              |
| ------------------------------------------------ | ---------------------------------------- |
| [`Ptr`](https://lua2.fatality.win/api/types/ptr) | Downsampled back buffer texture pointer. |

Example

```lua
local ds = adapter:GetBackBufferDownsampled();
```

***

## GetSharedTexture

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Returns a shared texture. This texture usually replicates the down sampled back buffer texture, although it is updated automatically ONCE before the rendering on the layer starts.

**Arguments**

None.

**Returns**

| Type                                             | Description             |
| ------------------------------------------------ | ----------------------- |
| [`Ptr`](https://lua2.fatality.win/api/types/ptr) | Shared texture pointer. |

**Example**

```lua
local shared = adapter:GetSharedTexture();
```

[^1]: This field is a method and must be invoked using a colon (:)
