Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_effect.inc

raw
1 { -*- buffer-read-only: t -*-
2
3 Copyright 2015-2024 Michalis Kamburelis.
4
5 This file is part of "Castle Game Engine".
6
7 "Castle Game Engine" is free software; see the file COPYING.txt,
8 included in this distribution, for details about the copyright.
9
10 "Castle Game Engine" is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 ----------------------------------------------------------------------------
15 }
16
17 { Automatically generated node properties.
18
19 Do not edit this file manually!
20 To add new properties:
21 - add them to the text files in tools/internal/x3d-nodes-to-pascal/nodes-specification/ ,
22 - and regenerate include files by running x3d-nodes-to-pascal }
23
24 {$ifdef read_interface}
25
26 strict private
27 function GetLanguage: TShaderLanguage;
28 procedure SetLanguage(const Value: TShaderLanguage);
29 function GetEnabled: Boolean;
30 procedure SetEnabled(const Value: Boolean);
31 function GetUniformMissing: TUniformMissing;
32 procedure SetUniformMissing(const Value: TUniformMissing);
33 public
34 { Create node fields and events. }
35 procedure CreateNode; override;
36 class function ClassX3DType: String; override;
37
38 strict private FFdLanguage: TSFStringEnum;
39 { Internal wrapper for property @code(Language). This wrapper API may change, we advise to access simpler @code(Language) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
40 public property FdLanguage: TSFStringEnum read FFdLanguage;
41 { Shading language. Only the GLSL (OpenGL Shading Language) is actually supported. The default value, empty string, is equivalent to GLSL. }
42 property Language: TShaderLanguage read GetLanguage write SetLanguage;
43
44 strict private FFdEnabled: TSFBool;
45 { Internal wrapper for property @code(Enabled). This wrapper API may change, we advise to access simpler @code(Enabled) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
46 public property FdEnabled: TSFBool read FFdEnabled;
47 { }
48 property Enabled: Boolean read GetEnabled write SetEnabled;
49
50 strict private FFdParts: TMFNode;
51 { Internal wrapper for property @code(Parts). This wrapper API may change, we advise to access simpler @code(Parts) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
52 public property FdParts: TMFNode read FFdParts;
53 { }
54 procedure SetParts(const Value: array of TEffectPartNode);
55
56 strict private FFdUniformMissing: TSFStringEnum;
57 { Internal wrapper for property @code(UniformMissing). This wrapper API may change, we advise to access simpler @code(UniformMissing) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
58 public property FdUniformMissing: TSFStringEnum read FFdUniformMissing;
59 { Should we report a missing uniform value. Setting this to umWarning (default) is useful to spot simple mistakes in naming uniforms. On the other hand, OpenGL aggressively removes unused uniforms from code, and it may cause spurious messages that some uniform is missing -- even though the shader is correct, is just doesn't use some uniform value e.g. because no lights are present on the current scene. }
60 property UniformMissing: TUniformMissing read GetUniformMissing write SetUniformMissing;
61
62 {$endif read_interface}
63
64 {$ifdef read_implementation}
65
66 { TEffectNode ----------------------------------------------- }
67
68 function TEffectNode.GetLanguage: TShaderLanguage;
69 begin
70 Result := TShaderLanguage(FdLanguage.EnumValue);
71 end;
72
73 procedure TEffectNode.SetLanguage(const Value: TShaderLanguage);
74 begin
75 FdLanguage.SendEnumValue(Ord(Value));
76 end;
77
78 function TEffectNode.GetEnabled: Boolean;
79 begin
80 Result := FdEnabled.Value;
81 end;
82
83 procedure TEffectNode.SetEnabled(const Value: Boolean);
84 begin
85 FdEnabled.Send(Value);
86 end;
87
88 procedure TEffectNode.SetParts(const Value: array of TEffectPartNode);
89 var
90 L: Integer;
91 A: array of TX3DNode;
92 begin
93 L := High(Value) + 1;
94 SetLength(A, L);
95 if L > 0 then
96 Move(Value[0], A[0], L * SizeOf(TEffectPartNode));
97 FdParts.Send(A);
98 end;
99
100 function TEffectNode.GetUniformMissing: TUniformMissing;
101 begin
102 Result := TUniformMissing(FdUniformMissing.EnumValue);
103 end;
104
105 procedure TEffectNode.SetUniformMissing(const Value: TUniformMissing);
106 begin
107 FdUniformMissing.SendEnumValue(Ord(Value));
108 end;
109
110 class function TEffectNode.ClassX3DType: String;
111 begin
112 Result := 'Effect';
113 end;
114
115 procedure TEffectNode.CreateNode;
116 begin
117 inherited;
118
119 FFdLanguage := TSFStringEnum.Create(Self, False, 'language', @ShaderLanguageNames, Ord(High(ShaderLanguageNames)) + 1, Ord(slDefault));
120 FdLanguage.ChangeAlways := chEverything;
121 AddField(FFdLanguage);
122
123 FFdEnabled := TSFBool.Create(Self, True, 'enabled', true);
124 FdEnabled.ChangeAlways := chVisibleNonGeometry;
125 AddField(FFdEnabled);
126
127 FFdParts := TMFNode.Create(Self, False, 'parts', [TEffectPartNode]);
128 FdParts.ChangeAlways := chEverything;
129 AddField(FFdParts);
130
131 FFdUniformMissing := TSFStringEnum.Create(Self, False, 'uniformMissing', @UniformMissingNames, Ord(High(UniformMissingNames)) + 1, Ord(umWarning));
132 FdUniformMissing.ChangeAlways := chEverything;
133 AddField(FFdUniformMissing);
134 end;
135
136 {$endif read_implementation}