VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
stencilParameters.cpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
// Copyright 2025-2026 Arnis Lektauers
3
//
4
// Created by Arnis Lektauers on 09.11.2025.
5
//
6
#include <sstream>
7
8
#include "
stencilParameters.h
"
9
10
namespace
visutwin::canvas
11
{
12
StringIds
StencilParameters::stringIds;
13
14
uint32_t
StencilParameters::key
()
15
{
16
if
(_dirty) {
17
evalKey();
18
}
19
return
_key;
20
}
21
22
void
StencilParameters::evalKey()
23
{
24
// Create a string key from all parameters
25
std::ostringstream oss;
26
oss << _func <<
","
<< _ref <<
","
<< _fail <<
","
<< _zfail <<
","
<< _zpass <<
","
<< _readMask <<
","
<< _writeMask;
27
std::string
key
= oss.str();
28
29
// Convert a string to a unique number
30
_key = stringIds.
get
(
key
);
31
_dirty =
false
;
32
}
33
}
visutwin::canvas::StencilParameters::key
uint32_t key()
Definition
stencilParameters.cpp:14
visutwin::canvas::StringIds
Definition
stringIds.h:17
visutwin::canvas::StringIds::get
int get(const std::string &name)
Definition
stringIds.cpp:10
visutwin::canvas
Definition
eventHandler.cpp:9
stencilParameters.h
platform
graphics
stencilParameters.cpp
Generated by
1.16.1