VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
constants.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 14.09.2025.
5//
6#pragma once
7
8#include <cstdint>
9
10namespace visutwin::canvas
11{
17
18 enum class FilterMode : uint32_t {
19 FILTER_NEAREST = 0, // Point sample filtering
20 FILTER_LINEAR = 1, // Bilinear filtering
21 FILTER_NEAREST_MIPMAP_NEAREST = 2, // Use the nearest neighbor in the nearest mipmap level
22 FILTER_NEAREST_MIPMAP_LINEAR = 3, // Linearly interpolate in the nearest mipmap level
23 FILTER_LINEAR_MIPMAP_NEAREST = 4, // Use the nearest neighbor after linearly interpolating between mipmap levels
24 FILTER_LINEAR_MIPMAP_LINEAR = 5 // Linearly interpolate both the mipmap levels and between texels
25 };
26
27 enum class TextureProjection : uint32_t {
28 TEXTUREPROJECTION_NONE = 0, // Texture data is not stored in a specific projection format
29 TEXTUREPROJECTION_CUBE = 1 // Texture data is stored in the cubemap projection format
30 };
31
32 enum class PixelFormat : uint32_t {
33 PIXELFORMAT_RGB8 = 6, // 24-bit RGB (8-bits for a red channel, 8 for green and 8 for blue)
34 PIXELFORMAT_RGBA8 = 7, // 32-bit RGBA (8-bits for a red channel, 8 for green, 8 for blue with 8-bit alpha)
35 PIXELFORMAT_RGBA16F = 12, // 16-bit floating point RGBA (16-bit float for each red, green, blue and alpha channel)
36 PIXELFORMAT_RGBA32F = 14, // 32-bit floating point RGBA (32-bit float for each red, green, blue and alpha channel)
37 PIXELFORMAT_R32F = 15, // 32-bit floating point single channel format
38 PIXELFORMAT_DEPTHSTENCIL = 19, // A readable depth/stencil buffer format
39 PIXELFORMAT_DEPTH = 16, // A readable depth buffer format
40 PIXELFORMAT_R8 = 52, // 8-bit per-channel (R) format
41 PIXELFORMAT_RG8 = 53, // 8-bit per-channel (RG) format
42 PIXELFORMAT_DEPTH16 = 69 // A 16-bit depth buffer format
43 };
44
52
53 enum class CullMode {
54 CULLFACE_NONE = 0, // No triangles are culled
55 CULLFACE_BACK = 1, // Triangles facing away from the view direction are culled
56 CULLFACE_FRONT = 2, // Triangles facing the view direction are culled
57 CULLFACE_FRONTANDBACK = 3 // Triangles are culled regardless of their orientation with respect to the view direction.
58 // Note that point or line primitives are unaffected by this render state
59 };
60
61 // Texture addressing modes
63 {
64 ADDRESS_REPEAT = 0, // Ignores the integer part of texture coordinates, using only the fractional part.
65 ADDRESS_CLAMP_TO_EDGE = 1, // Clamps texture coordinate to the range 0 to 1.
66 ADDRESS_MIRRORED_REPEAT = 2 // Texture coordinate to be set to the fractional part if the integer part is even.
67 // If the integer part is odd, then the texture coordinate is set to 1 minus the fractional part.
68 };
69
70 // Texture properties
83
85
87}
bool isCompressedPixelFormat(const PixelFormat format)
Definition constants.cpp:33
@ TEXPROPERTY_COMPARE_ON_READ
Definition constants.h:78
bool isIntegerPixelFormat(const PixelFormat format)
Definition constants.cpp:38