| 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 |
public |
| 30 |
{ Create node fields and events. } |
| 31 |
procedure CreateNode; override; |
| 32 |
class function ClassX3DType: String; override; |
| 33 |
|
| 34 |
strict private FEventActivate: TSFBoolEvent; |
| 35 |
{ } |
| 36 |
public property EventActivate: TSFBoolEvent read FEventActivate; |
| 37 |
|
| 38 |
strict private FEventIsSelected: TSFBoolEvent; |
| 39 |
{ } |
| 40 |
public property EventIsSelected: TSFBoolEvent read FEventIsSelected; |
| 41 |
|
| 42 |
strict private FEventIsValid: TSFBoolEvent; |
| 43 |
{ } |
| 44 |
public property EventIsValid: TSFBoolEvent read FEventIsValid; |
| 45 |
|
| 46 |
strict private FFdLanguage: TSFStringEnum; |
| 47 |
{ 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). } |
| 48 |
public property FdLanguage: TSFStringEnum read FFdLanguage; |
| 49 |
{ Shading language. Only the GLSL (OpenGL Shading Language) is actually supported. The default value, empty string, is equivalent to GLSL. } |
| 50 |
property Language: TShaderLanguage read GetLanguage write SetLanguage; |
| 51 |
|
| 52 |
{$endif read_interface} |
| 53 |
|
| 54 |
{$ifdef read_implementation} |
| 55 |
|
| 56 |
{ TAbstractShaderNode ----------------------------------------------- } |
| 57 |
|
| 58 |
function TAbstractShaderNode.GetLanguage: TShaderLanguage; |
| 59 |
begin |
| 60 |
Result := TShaderLanguage(FdLanguage.EnumValue); |
| 61 |
end; |
| 62 |
|
| 63 |
procedure TAbstractShaderNode.SetLanguage(const Value: TShaderLanguage); |
| 64 |
begin |
| 65 |
FdLanguage.SendEnumValue(Ord(Value)); |
| 66 |
end; |
| 67 |
|
| 68 |
class function TAbstractShaderNode.ClassX3DType: String; |
| 69 |
begin |
| 70 |
Result := 'X3DShaderNode'; |
| 71 |
end; |
| 72 |
|
| 73 |
procedure TAbstractShaderNode.CreateNode; |
| 74 |
begin |
| 75 |
inherited; |
| 76 |
|
| 77 |
FEventActivate := TSFBoolEvent.Create(Self, 'activate', true); |
| 78 |
AddEvent(FEventActivate); |
| 79 |
|
| 80 |
FEventIsSelected := TSFBoolEvent.Create(Self, 'isSelected', false); |
| 81 |
AddEvent(FEventIsSelected); |
| 82 |
|
| 83 |
FEventIsValid := TSFBoolEvent.Create(Self, 'isValid', false); |
| 84 |
AddEvent(FEventIsValid); |
| 85 |
|
| 86 |
FFdLanguage := TSFStringEnum.Create(Self, False, 'language', @ShaderLanguageNames, Ord(High(ShaderLanguageNames)) + 1, Ord(slDefault)); |
| 87 |
FdLanguage.ChangeAlways := chEverything; |
| 88 |
AddField(FFdLanguage); |
| 89 |
|
| 90 |
DefaultContainerField := 'shaders'; |
| 91 |
end; |
| 92 |
|
| 93 |
{$endif read_implementation} |