VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
depthState.h
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
#pragma once
7
8
#include <cstdint>
9
10
namespace
visutwin::canvas
11
{
20
class
DepthState
21
{
22
public
:
28
uint32_t
key
()
const
{
return
_key; }
29
30
bool
depthWrite
()
const
{
return
_depthWrite; }
31
void
setDepthWrite
(
bool
value) {
32
_depthWrite = value;
33
_key = (_depthWrite ? 0u : 1u) | (_depthTest ? 0u : 2u);
34
}
35
36
bool
depthTest
()
const
{
return
_depthTest; }
37
void
setDepthTest
(
bool
value) {
38
_depthTest = value;
39
_key = (_depthWrite ? 0u : 1u) | (_depthTest ? 0u : 2u);
40
}
41
46
static
DepthState
noWrite
() {
47
DepthState
state;
48
state.
setDepthWrite
(
false
);
49
return
state;
50
}
51
52
private
:
53
uint32_t _key = 0;
54
bool
_depthWrite =
true
;
55
bool
_depthTest =
true
;
56
};
57
}
visutwin::canvas::DepthState
Definition
depthState.h:21
visutwin::canvas::DepthState::noWrite
static DepthState noWrite()
Definition
depthState.h:46
visutwin::canvas::DepthState::setDepthTest
void setDepthTest(bool value)
Definition
depthState.h:37
visutwin::canvas::DepthState::depthWrite
bool depthWrite() const
Definition
depthState.h:30
visutwin::canvas::DepthState::depthTest
bool depthTest() const
Definition
depthState.h:36
visutwin::canvas::DepthState::key
uint32_t key() const
Definition
depthState.h:28
visutwin::canvas::DepthState::setDepthWrite
void setDepthWrite(bool value)
Definition
depthState.h:31
visutwin::canvas
Definition
eventHandler.cpp:9
platform
graphics
depthState.h
Generated by
1.16.1