Skip to content

Vp::SelectStencil

#include "Viewport/SelectStencil.h"

Public Functions

Name
SelectStencil()
boolfreeStencil(int stencil)
unsigned chargetStencilAt(int x, int y, int r, int filter)<br>reads quad with center at x,y and radius of r from stencil buffer.
intregisterStencil()<br>Finds unused stencil value, sets it as registred and returns it.

Public Attributes

Name
bool[256]stencilRef <br>table of registred stencil values.

Public Functions Documentation

function SelectStencil

cpp
SelectStencil()
SelectStencil()

function freeStencil

cpp
bool freeStencil(
    int stencil
)
bool freeStencil(
    int stencil
)

function getStencilAt

cpp
unsigned char getStencilAt(
    int x,
    int y,
    int r,
    int filter
)
unsigned char getStencilAt(
    int x,
    int y,
    int r,
    int filter
)

reads quad with center at x,y and radius of r from stencil buffer.

If value not equal to filter and not equal zero is found within the quad, the value is returned. Otherwise, 0 is returned. This is for selecting objects by stencil. Return is selected object, filter is ignored object - only one stencil value can be ignored. Stencil value 0 is interpreted as nothing selectable.

function registerStencil

cpp
int registerStencil()
int registerStencil()

Finds unused stencil value, sets it as registred and returns it.

Return: stencil value, or -1, if no stencil value is available

Public Attributes Documentation

variable stencilRef

cpp
bool[256] stencilRef;
bool[256] stencilRef;

table of registred stencil values.

true - stencil value is already used by another object, false - free to use.


Updated on 2024-11-06 at 20:16:53 +0000