Nebula
Loading...
Searching...
No Matches
framebatchtype.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
13//------------------------------------------------------------------------------
14#include "core/types.h"
15#include "util/string.h"
16
17namespace Frame
18{
20{
21public:
23 enum Code
24 {
28 Geometry, // most models and stuff in here
29 Shapes, // ShapeRenderer shapes
30 Text, // TextRenderer elements
31 UI, // user interface stuff
32 ResolveDepthBuffer, // resolve depth buffer to texture
33 MousePointers, // MousePointers
34 Lights, // render lights
35 LightProbes, // render light probes
36 System, // called by the system
37
39 };
40
45};
46
47//------------------------------------------------------------------------------
52{
53 if (str == "Depth") return Depth;
54 else if (str == "Solid") return Solid;
55 else if (str == "Alpha") return Alpha;
56 else if (str == "Geometry") return Geometry;
57 else if (str == "Shapes") return Shapes;
58 else if (str == "Text") return Text;
59 else if (str == "UI") return UI;
60 else if (str == "ResolveDepthBuffer") return ResolveDepthBuffer;
61 else if (str == "MousePointers") return MousePointers;
62 else if (str == "Lights") return Lights;
63 else if (str == "LightProbes") return LightProbes;
64 else
65 {
66 n_error("BatchType::FromString(): invalid string '%s'!", str.AsCharPtr());
67 return InvalidBatchType;
68 }
69}
70
71//------------------------------------------------------------------------------
74inline Util::String
76{
77 switch (c)
78 {
79 case Depth: return "Depth";
80 case Solid: return "Solid";
81 case Alpha: return "Alpha";
82 case Geometry: return "Geometry";
83 case Shapes: return "Shapes";
84 case Text: return "Text";
85 case UI: return "UI";
86 case ResolveDepthBuffer: return "ResolveDepthBuffer";
87 case MousePointers: return "MousePointers";
88 case Lights: return "Lights";
89 case LightProbes: return "LightProbes";
90 default:
91 n_error("BatchType::ToString(): invalid batch type!");
92 return "";
93 }
94}
95
96} // namespace Frame
97//------------------------------------------------------------------------------
98
99
Frame batch type hints for the render device and render targets.
Definition framebatchtype.h:20
static FrameBatchType::Code FromString(const Util::String &str)
convert from string
Definition framebatchtype.h:51
Code
batch type enum
Definition framebatchtype.h:24
@ System
Definition framebatchtype.h:36
@ InvalidBatchType
Definition framebatchtype.h:38
@ MousePointers
Definition framebatchtype.h:33
@ ResolveDepthBuffer
Definition framebatchtype.h:32
@ LightProbes
Definition framebatchtype.h:35
@ Geometry
Definition framebatchtype.h:28
@ Solid
Definition framebatchtype.h:26
@ Depth
Definition framebatchtype.h:25
@ Shapes
Definition framebatchtype.h:29
@ Lights
Definition framebatchtype.h:34
@ Alpha
Definition framebatchtype.h:27
@ Text
Definition framebatchtype.h:30
@ UI
Definition framebatchtype.h:31
static Util::String ToString(FrameBatchType::Code c)
convert to string
Definition framebatchtype.h:75
void __cdecl n_error(const char *msg,...)
This function is called when a serious situation is encountered which requires abortion of the applic...
Definition debug.cc:138
ImGUI debug interface for inspecting frame scripts.
Definition shaderserverbase.h:52
Nebula's universal string class.
Definition string.h:50
const char * AsCharPtr() const
return contents as character pointer
Definition string.h:542