Vp::SelectStencil
#include "Viewport/SelectStencil.h"
Public Functions
| Name | |
|---|---|
| SelectStencil() | |
| bool | freeStencil(int stencil) |
| unsigned char | getStencilAt(int x, int y, int r, int filter)<br>reads quad with center at x,y and radius of r from stencil buffer. |
| int | registerStencil()<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 2025-09-07 at 16:13:51 +0000