]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/COpenGLDriver.h
Add back lighting system
[irrlicht.git] / source / Irrlicht / COpenGLDriver.h
index c60d2ba88ae491598ca7d1be8ac57e3e2cba9c25..7121a4df65e02cce9fa69648718381a60a9866a9 100644 (file)
@@ -209,6 +209,22 @@ namespace video
                //! driver, it would return "Direct3D8.1".\r
                const wchar_t* getName() const override;\r
 \r
+               //! deletes all dynamic lights there are\r
+               virtual void deleteAllDynamicLights() override;\r
+\r
+               //! adds a dynamic light, returning an index to the light\r
+               //! \param light: the light data to use to create the light\r
+               //! \return An index to the light, or -1 if an error occurs\r
+               virtual s32 addDynamicLight(const SLight& light) override;\r
+\r
+               //! Turns a dynamic light on or off\r
+               //! \param lightIndex: the index returned by addDynamicLight\r
+               //! \param turnOn: true to turn the light on, false to turn it off\r
+               virtual void turnLightOn(s32 lightIndex, bool turnOn) override;\r
+\r
+               //! returns the maximal amount of dynamic lights the device can handle\r
+               virtual u32 getMaximalDynamicLightAmount() const override;\r
+\r
                //! Sets the dynamic ambient light color. The default color is\r
                //! (0,0,0,0) which means it is dark.\r
                //! \param color: New color of the ambient light.\r
@@ -480,6 +496,19 @@ namespace video
 \r
                SIrrlichtCreationParameters Params;\r
 \r
+               //! All the lights that have been requested; a hardware limited\r
+               //! number of them will be used at once.\r
+               struct RequestedLight\r
+               {\r
+                       RequestedLight(SLight const & lightData)\r
+                               : LightData(lightData), HardwareLightIndex(-1), DesireToBeOn(true) { }\r
+\r
+                       SLight  LightData;\r
+                       s32     HardwareLightIndex; // GL_LIGHT0 - GL_LIGHT7\r
+                       bool    DesireToBeOn;\r
+               };\r
+               core::array<RequestedLight> RequestedLights;\r
+\r
                //! Built-in 2D quad for 2D rendering.\r
                S3DVertex Quad2DVertices[4];\r
                static const u16 Quad2DIndices[4];\r