diff options
author | Lizzy Fleckenstein <eliasfleckenstein@web.de> | 2023-04-13 08:40:18 +0200 |
---|---|---|
committer | Lizzy Fleckenstein <eliasfleckenstein@web.de> | 2023-04-13 18:01:09 +0200 |
commit | bf90df100e120e272c14c7975a22ed01bf3ad215 (patch) | |
tree | 073f4cf268a7f9407e5ad4a313ae76a619ff1dcc /source/Irrlicht/COpenGLDriver.h | |
parent | 7a3fc62ada4001d5bb6c97ed26ec19a4e7c9d9ac (diff) | |
download | irrlicht-bf90df100e120e272c14c7975a22ed01bf3ad215.tar.xz |
Add back lighting system
Code is taken from latest irrlicht trunk; this is relevant because there have been fixes to stencil shadows since 1.8.5 (irrlicht SVN revision 5933).
Diffstat (limited to 'source/Irrlicht/COpenGLDriver.h')
-rw-r--r-- | source/Irrlicht/COpenGLDriver.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/Irrlicht/COpenGLDriver.h b/source/Irrlicht/COpenGLDriver.h index c60d2ba..7121a4d 100644 --- a/source/Irrlicht/COpenGLDriver.h +++ b/source/Irrlicht/COpenGLDriver.h @@ -209,6 +209,22 @@ namespace video //! driver, it would return "Direct3D8.1".
const wchar_t* getName() const override;
+ //! deletes all dynamic lights there are
+ virtual void deleteAllDynamicLights() override;
+
+ //! adds a dynamic light, returning an index to the light
+ //! \param light: the light data to use to create the light
+ //! \return An index to the light, or -1 if an error occurs
+ virtual s32 addDynamicLight(const SLight& light) override;
+
+ //! Turns a dynamic light on or off
+ //! \param lightIndex: the index returned by addDynamicLight
+ //! \param turnOn: true to turn the light on, false to turn it off
+ virtual void turnLightOn(s32 lightIndex, bool turnOn) override;
+
+ //! returns the maximal amount of dynamic lights the device can handle
+ virtual u32 getMaximalDynamicLightAmount() const override;
+
//! Sets the dynamic ambient light color. The default color is
//! (0,0,0,0) which means it is dark.
//! \param color: New color of the ambient light.
@@ -480,6 +496,19 @@ namespace video SIrrlichtCreationParameters Params;
+ //! All the lights that have been requested; a hardware limited
+ //! number of them will be used at once.
+ struct RequestedLight
+ {
+ RequestedLight(SLight const & lightData)
+ : LightData(lightData), HardwareLightIndex(-1), DesireToBeOn(true) { }
+
+ SLight LightData;
+ s32 HardwareLightIndex; // GL_LIGHT0 - GL_LIGHT7
+ bool DesireToBeOn;
+ };
+ core::array<RequestedLight> RequestedLights;
+
//! Built-in 2D quad for 2D rendering.
S3DVertex Quad2DVertices[4];
static const u16 Quad2DIndices[4];
|