11 #include "EffectsContainer.h"
12 #include "GDCore/String.h"
17 class SerializerElement;
18 class EffectsContainer;
38 void SetViewport(
float x1_,
float y1_,
float x2_,
float y2_) {
44 void SetViewportX1(
float x1_) { x1 = x1_; };
45 void SetViewportY1(
float y1_) { y1 = y1_; };
46 void SetViewportX2(
float x2_) { x2 = x2_; };
47 void SetViewportY2(
float y2_) { y2 = y2_; };
48 float GetViewportX1()
const {
return x1; };
49 float GetViewportY1()
const {
return y1; };
50 float GetViewportX2()
const {
return x2; };
51 float GetViewportY2()
const {
return y2; };
56 void SetSize(
float width_,
float height_) {
60 float GetWidth()
const {
return width; };
61 float GetHeight()
const {
return height; };
63 void SetUseDefaultSize(
bool useDefaultSize =
true) {
64 defaultSize = useDefaultSize;
66 bool UseDefaultSize()
const {
return defaultSize; }
68 void SetUseDefaultViewport(
bool useDefaultViewport =
true) {
69 defaultViewport = useDefaultViewport;
71 bool UseDefaultViewport()
const {
return defaultViewport; }
106 const gd::String& GetRenderingType()
const {
return renderingType; }
108 void SetRenderingType(
const gd::String& renderingType_) {
109 renderingType = renderingType_;
112 const gd::String& GetCameraType()
const {
return cameraType; }
114 void SetCameraType(
const gd::String& cameraType_) {
115 cameraType = cameraType_;
131 void SetLocked(
bool isLocked_) { isLocked = isLocked_; }
142 isLightingLayer = isLightingLayer_;
154 followBaseLayerCamera = followBaseLayerCamera_;
165 double GetCamera3DNearPlaneDistance()
const {
166 return camera3DNearPlaneDistance;
168 void SetCamera3DNearPlaneDistance(
double distance) {
169 camera3DNearPlaneDistance = distance;
171 double GetCamera3DFarPlaneDistance()
const {
172 return camera3DFarPlaneDistance;
174 void SetCamera3DFarPlaneDistance(
double distance) {
175 camera3DFarPlaneDistance = distance;
177 double GetCamera3DFieldOfView()
const {
return camera3DFieldOfView; }
178 void SetCamera3DFieldOfView(
double angle) { camera3DFieldOfView = angle; }
188 void SetCameraCount(std::size_t n);
199 if (n >= GetCameraCount())
return badCamera;
207 if (n >= GetCameraCount())
return badCamera;
215 if (n >= GetCameraCount())
return;
216 cameras.erase(cameras.begin() + n);
245 ambientLightColorR = r;
246 ambientLightColorG = g;
247 ambientLightColorB = b;
281 bool isLightingLayer;
283 bool followBaseLayerCamera;
285 double camera3DNearPlaneDistance;
286 double camera3DFarPlaneDistance;
287 double camera3DFieldOfView;
288 unsigned int ambientLightColorR;
289 unsigned int ambientLightColorG;
290 unsigned int ambientLightColorB;
291 std::vector<gd::Camera> cameras;
302 struct LayerHasName :
public std::binary_function<gd::Layer, gd::String, bool> {
304 return layer.
GetName() == name;
A camera is used to render a specific area of a layout.
Definition: Layer.h:29
void SetViewport(float x1_, float y1_, float x2_, float y2_)
Change the viewport, i.e the area of the window where the camera will be displayed.
Definition: Layer.h:38
void SetSize(float width_, float height_)
Change the size of the rendered area of the scene, in pixels.
Definition: Layer.h:56
Contains effects applied to an entity on screen (i.e: a Layer or an Object).
Definition: EffectsContainer.h:29
Represents a layer of a layout.
Definition: Layer.h:91
bool GetVisibility() const
Return true if layer will be displayed at the layout startup.
Definition: Layer.h:126
std::size_t GetCameraCount() const
Get cameras count.
Definition: Layer.h:193
void SetLocked(bool isLocked_)
Change if layer can be modified or not.
Definition: Layer.h:131
void SetName(const gd::String &name_)
Change layer name.
Definition: Layer.h:99
void SetAmbientLightColor(unsigned int r, unsigned int g, unsigned int b)
Definition: Layer.h:244
unsigned int GetAmbientLightColorBlue() const
Definition: Layer.h:239
bool IsLightingLayer() const
Return true if the layer is a lighting layer.
Definition: Layer.h:148
bool IsFollowingBaseLayerCamera() const
Return true if the layer follows the base layer.
Definition: Layer.h:160
void DeleteCamera(std::size_t n)
Delete a specific camera.
Definition: Layer.h:214
const gd::String & GetName() const
Get layer name.
Definition: Layer.h:104
void SetLightingLayer(bool isLightingLayer_)
Set if the layer is a lighting layer or not.
Definition: Layer.h:141
const Camera & GetCamera(std::size_t n) const
Return a reference to a camera.
Definition: Layer.h:198
unsigned int GetAmbientLightColorGreen() const
Definition: Layer.h:234
void AddCamera(const Camera &camera)
Add an already existing camera.
Definition: Layer.h:222
void SetFollowBaseLayerCamera(bool followBaseLayerCamera_)
Set if the layer automatically follows the base layer or not.
Definition: Layer.h:153
void SetVisibility(bool isVisible_)
Change if layer is displayed or not.
Definition: Layer.h:121
bool IsLocked() const
Return true if layer can't be modified.
Definition: Layer.h:136
unsigned int GetAmbientLightColorRed() const
Definition: Layer.h:229
Camera & GetCamera(std::size_t n)
Return a reference to a camera.
Definition: Layer.h:206
A generic container that can represent a value ( containing a string, double, bool or int),...
Definition: SerializerElement.h:37
String represents an UTF8 encoded string.
Definition: String.h:31
Definition: CommonTools.h:24
Functor testing layer name.
Definition: Layer.h:302