Commit ee5942f4 authored by Rogerborg's avatar Rogerborg

Add example 20 to C::B and VC7/VC9 projects. Fix some build issues with the...

Add example 20 to C::B and VC7/VC9 projects.  Fix some build issues with the light manager and example.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2065 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 94a1346a
......@@ -2,7 +2,7 @@
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Irrlicht Example 19 ManagedLights" />
<Option title="Irrlicht Example 20 ManagedLights" />
<Option pch_mode="0" />
<Option compiler="gcc" />
<Build>
......
......@@ -14,7 +14,9 @@ using namespace video;
using namespace io;
using namespace gui;
#if defined(MSC_VER)
#pragma comment(lib, "Irrlicht.lib")
#endif // MSC_VER
/*
Normally, you are limited to 8 dynamic lights per scene: this is a hardware limit. If you
......@@ -69,9 +71,9 @@ class CMyLightManager : public ILightManager, public IEventReceiver
public:
CMyLightManager(ISceneManager* sceneManager)
: SceneManager(sceneManager), SceneLightList(0),
CurrentRenderPass(ESNRP_COUNT), CurrentSceneNode(0),
Mode(NO_MANAGEMENT), RequestedMode(NO_MANAGEMENT)
: Mode(NO_MANAGEMENT), RequestedMode(NO_MANAGEMENT),
SceneManager(sceneManager), SceneLightList(0),
CurrentRenderPass(ESNRP_COUNT), CurrentSceneNode(0)
{ }
virtual ~CMyLightManager(void) { }
......@@ -179,8 +181,6 @@ public:
for(i = 0; i < SceneLightList->size(); ++i)
{
ILightSceneNode* lightNode = (*SceneLightList)[i];
SLight & lightData = lightNode->getLightData();
f64 distance = lightNode->getAbsolutePosition().getDistanceFromSQ(nodePosition);
sortingArray.push_back(LightDistanceElement(lightNode, distance));
}
......
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="Build all examples">
<Project filename="01.HelloWorld\HelloWorld.cbp" active="1" />
<Project filename="01.HelloWorld\HelloWorld.cbp" />
<Project filename="02.Quake3Map\Quake3Map.cbp" />
<Project filename="03.CustomSceneNode\CustomSceneNode.cbp" />
<Project filename="04.Movement\Movement.cbp" />
......@@ -19,6 +19,7 @@
<Project filename="16.Quake3MapShader\Quake3MapShader.cbp" />
<Project filename="18.SplitScreen\SplitScreen.cbp" />
<Project filename="19.MouseAndJoystick\MouseAndJoystick.cbp" />
<Project filename="20.ManagedLights\ManagedLights.cbp" active="1" />
<Project filename="Demo\demo.cbp" />
<Project filename="..\source\Irrlicht\Irrlicht-gcc.cbp" />
</Workspace>
......
......@@ -76,6 +76,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Qu
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
......
......@@ -92,6 +92,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen_vc9", "18.Sp
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc9", "19.MouseAndJoystick\MouseAndJoystick_vc9.vcproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
......
// Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt
// Copyright (C) 2008-2009 Nikolaus Gebhardt
// Copyright (C) 2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
......@@ -15,17 +15,13 @@ namespace scene
{
class ILightSceneNode;
//! Provides callbacks to when the the scene graph is rendered.
/** ILightManager is an optional manager that the user application can
register in order to receive callbacks as the scene is rendered.
The OnPreRender() callback provides the user application with a list of the
lights in the scene. This list can be stored and used to turn lights
on and off as each scene node is rendered in order to provide per-node
or 'local' lights.
It is assumed that the ILightManager implementation will store any
data that it wishes to retain, i.e. the ISceneManager to which it is assigned,
the lightList, the current render pass, and the current scene node.
*/
//! ILightManager provides an interface for user applications to manipulate the list
//! of lights in the scene. The light list can be trimmed or re-ordered before device/
//! hardware lights are created, and/or individual lights can be switched on and off
//! before or after each scene node is rendered.
//! It is assumed that the ILightManager implementation will store any data that it wishes
//! to retain, i.e. the ISceneManager to which it is assigned, the lightList, the current
//! render pass, and the current scene node.
class ILightManager : public IReferenceCounted
{
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment