Merged from trunk, all revisions from 1977 to 2143.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@2144 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-01-27 13:23:36 +00:00
parent 292874f7c2
commit 55e2c6d600
675 changed files with 9517 additions and 5024 deletions

View File

@ -1,17 +1,74 @@
Changes in version 1.6
- New scene parameter B3D_LOADER_IGNORE_MIPMAP_FLAG to ignore the often missing mipmap flag in b3d files. If this parameter is true, the old pre Irrlicht-1.5 behavior is restored.
- Added Mipmap LOD Bias attribute to MaterialLayer.
- Added ColorMask support to selectively disable color planes on rendering.
- Added support for all available depth test functions.
- Add an outNode to getCollisionPoint() that returns the scene node that was hit, as well as the triangle.
- Initial support for Alpha To Coverage, needs some more fixing until it works on all supported platforms.
- Added support for Anti-Aliasing modes per material
- Added an ICollisionCallback to ISceneNodeAnimatorCollisionResponse, to inform the application that a collision has occured. Thanks to garrittg for this.
- Added an startPosition parameter to createFlyCircleAnimator() to allow starting the animator at any position on the circle.
- Many uses of dimension2d<s32> changed to dimension2d<u32>, including IImage, ITexture and screen dimensions. You will have to change (at least) createDevice() calls to use dimension2d<u32>
- Added Doublebuffer flag to SIrrCreationParameters, for better finetuning
- Added Stereo-Framebuffer support for professional OpenGL cards
- Added IFileSystem::createMemoryWriteFile() to allow creation of an IWriteFile interface that uses an application supplied memory buffer.
- Added an IVideoDriver::writeImageToFile() overload that can take an IWriteFile interface.
- (Internal) Replaced CMemoryReadFile with CMemoryFile, that also implements an IWriteFile interface.
- Added an optional light manager to the scene manager to allow the user application to turn lights on and off during scene rendering. This can be used to produce "zoned" lighting. See example 20.ManagedLights.
- Added a method to flip the Y movement of the FPS camera.
- The Anisotropy filter can now be set to the AF value per texture layer. So no forced MAX_ANISOTROPY anymore. .irr files will probably fail, though.
- AntiAlias parameter in SIrrCreationParameters is now an u8 value specifying the multisampling level (0 for disabled, 4,6,8, and others for anti-aliasing)
- D3D devices use DISCARD for windowed renderbuffers now, can be faster.
- Changed behaviour of PixelBlend16() / PixelBlend16_simd() so that they treat the 1 bit alpha of the source pixel as boolean, i.e. they draw either the source pixel, or the destination pixel, rather than "blending". (Issue revealed by the fix to IVideoDriver::makeColorKeyTexture()).
- IVideoDriver::makeColorKeyTexture() bug fixed so that only alphas, not whole texel colors, are zeroed. An optional parameter allows using the old (buggy) behaviour for backwards compatibility.
- position2d is now a synonym for vector2d. position2d is therefore marked as deprecated, although it's unlikely to be removed.
- ISceneNodeAnimator now has a hasFinished() method.
- ISceneNodeAnimatorCollisionResponse exposes the target node. Setting the node again resets the last position, allowing the node to be teleported.
- Add a hitPosition out parameter to ISceneCollisionManager::getCollisionResultPosition() - this is a (small) API breaking change.
-------------------------------------
Changes in version 1.5.1 (??.?? 2009)
- Fixed OSX device bug where screen size was not set in fullscreen mode.
- OSX device now supports shift and ctrl keys.
- MD2 mesh loader: Now uses much less memory, reduced number of allocations when loading meshes.
-----------------------------------
Changes in version 1.5 (15.12.2008)
- Construction calls for FPS camera changed to take speed in units/milliseconds, just as the setSpeed method does.
- Code::Blocks workspaces added. C::B projects (using gcc) now output to /lib/gcc and /bin/gcc, when built on either Windows or Linux.
- Code::Blocks workspaces added. C::B projects (using gcc) now output to /lib/gcc and /bin/gcc, when built on either Windows or Linux.
- Added a test suite in the /tests directory. This can be used to perform regression tests, and should be updated with new tests to verify fixes or validate new features.
- Added a test suite in the /tests directory. This can be used to perform regression tests, and should be updated with new tests to verify fixes or validate new features.
- Changed the preferred way of altering light node's radius: Use the new member methods of ILightSceneNode instead of directly modifying the SLight structure.
@ -21,7 +78,7 @@ Changes in version 1.5 (15.12.2008)
- Terrain heightmap and texture were flipped in order to draw them as expected (looking onto the terrain from high above will just look like the actual texture/heightmap).
- Significant internal change to the way that FPS camera jump speed and collision response animator gravity interact. The behaviour is now much more realistic, but it will require you to adjust your jump speed and gravity.
- Significant internal change to the way that FPS camera jump speed and collision response animator gravity interact. The behaviour is now much more realistic, but it will require you to adjust your jump speed and gravity.
- Skybox won't be culled anymore by nearplane or farplane.
@ -47,7 +104,7 @@ Changes in version 1.5 (15.12.2008)
- ISceneNode::setParent and addChild now updates node SceneManager pointers if the node was from another SceneManager.
- Basic support for joystick input events on Windows, Linux, SDL and OSX. Tested with wired Logitech and Thrustmaster wired controllers and XBox 360 wireless controller ( http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver )
- Basic support for joystick input events on Windows, Linux, SDL and OSX. Tested with wired Logitech and Thrustmaster wired controllers and XBox 360 wireless controller ( http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver )
- Fixed scaled octree nodes being incorrectly frustum culled.

View File

@ -123,10 +123,10 @@ int main()
*/
IrrlichtDevice *device =
#ifdef _IRR_OSX_PLATFORM_
createDevice( video::EDT_OPENGL, dimension2d<s32>(640, 480), 16,
createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16,
false, false, false, 0);
#else
createDevice( video::EDT_SOFTWARE, dimension2d<s32>(640, 480), 16,
createDevice( video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16,
false, false, false, 0);
#endif
if (!device)

View File

@ -6,8 +6,8 @@ Sources = main.cpp
# general compiler settings
CPPFLAGS = -I../../include -I/usr/X11R6/include
CXXFLAGS = -O3 -ffast-math
#CXXFLAGS = -g -Wall
#CXXFLAGS = -O3 -ffast-math
CXXFLAGS = -g -Wall
#default target is Linux
all: all_linux
@ -16,8 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM
# target specific settings
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc

View File

@ -55,8 +55,8 @@ int main()
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Burning's Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");
" (d) OpenGL-ES1\n (e) Software Renderer\n (f) Burning's Software Renderer\n"\
" (g) NullDevice\n (otherKey) exit\n\n");
char i;
std::cin >> i;
@ -66,16 +66,17 @@ int main()
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
case 'd': driverType = video::EDT_OGLES1; break;
case 'e': driverType = video::EDT_SOFTWARE; break;
case 'f': driverType = video::EDT_BURNINGSVIDEO;break;
case 'g': driverType = video::EDT_NULL; break;
default: return 1;
}
// create device and exit if creation failed
IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<s32>(640, 480));
createDevice(driverType, core::dimension2d<u32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.

View File

@ -192,7 +192,7 @@ int main()
// create device
IrrlichtDevice *device = createDevice(driverType,
core::dimension2d<s32>(640, 480), 16, false);
core::dimension2d<u32>(640, 480), 16, false);
if (device == 0)
return 1; // could not create selected driver.

View File

@ -97,7 +97,7 @@ int main()
MyEventReceiver receiver;
IrrlichtDevice* device = createDevice(driverType,
core::dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
core::dimension2d<u32>(640, 480), 16, false, false, false, &receiver);
if (device == 0)
return 1; // could not create selected driver.

View File

@ -183,7 +183,7 @@ int main()
// create device and exit if creation failed
IrrlichtDevice * device = createDevice(driverType, core::dimension2d<s32>(640, 480));
IrrlichtDevice * device = createDevice(driverType, core::dimension2d<u32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.

View File

@ -50,7 +50,7 @@ int main()
// create device
IrrlichtDevice *device = createDevice(driverType,
core::dimension2d<s32>(512, 384));
core::dimension2d<u32>(512, 384));
if (device == 0)
return 1; // could not create selected driver.

View File

@ -48,7 +48,7 @@ int main()
// create device
IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<s32>(640, 480), 16, false);
createDevice(driverType, core::dimension2d<u32>(640, 480), 16, false);
if (device == 0)
return 1; // could not create selected driver.
@ -64,6 +64,8 @@ int main()
if (q3levelmesh)
q3node = smgr->addOctTreeSceneNode(q3levelmesh->getMesh(0));
q3node->setID(0); // Make it an invalid target for bounding box collision
/*
So far so good, we've loaded the quake 3 level like in tutorial 2. Now,
here comes something different: We create a triangle selector. A
@ -132,6 +134,7 @@ int main()
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0, 100.0f, .3f, -1, 0, 0, true, 3.f);
camera->setPosition(core::vector3df(-100,50,-150));
camera->setID(0); // Make it an invalid target for bounding box collision
if (selector)
{
@ -164,8 +167,11 @@ int main()
bill->setMaterialFlag(video::EMF_LIGHTING, false);
bill->setMaterialFlag(video::EMF_ZBUFFER, false);
bill->setSize(core::dimension2d<f32>(20.0f, 20.0f));
bill->setID(0); // Make it an invalid target for bounding box collision
// add 3 animated faeries.
// add 3 animated faeries. We'll make their bounding boxes visible so
// that we can see the same boxes that the scene collision manager is
// using to perform the getSceneNodeFromCameraBB() check below.
video::SMaterial material;
material.setTexture(0, driver->getTexture("../../media/faerie2.bmp"));
@ -180,16 +186,19 @@ int main()
node->setPosition(core::vector3df(-70,0,-90));
node->setMD2Animation(scene::EMAT_RUN);
node->getMaterial(0) = material;
node->setDebugDataVisible(scene::EDS_BBOX_ALL);
node = smgr->addAnimatedMeshSceneNode(faerie);
node->setPosition(core::vector3df(-70,0,-30));
node->setMD2Animation(scene::EMAT_SALUTE);
node->getMaterial(0) = material;
node->setDebugDataVisible(scene::EDS_BBOX_ALL);
node = smgr->addAnimatedMeshSceneNode(faerie);
node->setPosition(core::vector3df(-70,0,-60));
node->setMD2Animation(scene::EMAT_JUMP);
node->getMaterial(0) = material;
node->setDebugDataVisible(scene::EDS_BBOX_ALL);
}
material.setTexture(0, 0);
@ -197,9 +206,10 @@ int main()
// Add a light
smgr->addLightSceneNode(0, core::vector3df(-60,100,400),
scene::ILightSceneNode * light = smgr->addLightSceneNode(0, core::vector3df(-60,100,400),
video::SColorf(1.0f,1.0f,1.0f,1.0f),
600.0f);
light->setID(0); // Make it an invalid target for bounding box collision
/*
@ -241,9 +251,10 @@ int main()
core::vector3df intersection;
core::triangle3df tri;
const scene::ISceneNode* hitNode;
if (smgr->getSceneCollisionManager()->getCollisionPoint(
line, selector, intersection, tri))
line, selector, intersection, tri, hitNode))
{
bill->setPosition(intersection);
@ -261,10 +272,18 @@ int main()
we ask the collision manager for this, and if we've got a scene
node, we highlight it by disabling Lighting in its material, if
it is not the billboard or the quake 3 level.
We use a collision bitmask of 1, i.e. any scene node with a scene ID
with bit 1 set is valid for collision. Scene nodes ID defaults to 0xFFFFFFFF
so all nodes will have this bit by default. We have called setID(0) on
the nodes that we don't care about in order to clear this bit and make
them invalid targets for collision. This makes the test a bit more
efficient, and also stops us from accidentally picking unexpected nodes,
e.g. the quake3 level, camera, light and billboard nodes. By default,
these *are* valid targets for bounding box selection.
*/
selectedSceneNode =
smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(camera);
smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(camera, 1);
if (lastSelectedSceneNode)
lastSelectedSceneNode->setMaterialFlag(video::EMF_LIGHTING, true);

View File

@ -60,7 +60,7 @@ int main()
*/
IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<s32>(640, 480),
createDevice(driverType, core::dimension2d<u32>(640, 480),
16, false, shadows);
if (device == 0)

View File

@ -570,7 +570,7 @@ int main(int argc, char* argv[])
// create device and exit if creation failed
MyEventReceiver receiver;
Device = createDevice(driverType, core::dimension2d<s32>(800, 600),
Device = createDevice(driverType, core::dimension2d<u32>(800, 600),
16, false, false, false, &receiver);
if (Device == 0)
@ -758,7 +758,7 @@ int main(int argc, char* argv[])
// create fps text
IGUIStaticText* fpstext = env->addStaticText(L"",
core::rect<s32>(GUI_ID_TOGGLE_DEBUG_INFO,4,570,23), true, false, bar);
core::rect<s32>(400,4,570,23), true, false, bar);
IGUIStaticText* postext = env->addStaticText(L"",
core::rect<s32>(10,50,470,80),false, false, 0, GUI_ID_POSITION_TEXT);

View File

@ -149,7 +149,7 @@ int main()
// create device
device = createDevice(driverType, core::dimension2d<s32>(640, 480));
device = createDevice(driverType, core::dimension2d<u32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.

View File

@ -180,7 +180,7 @@ int main()
// create device
IrrlichtDevice* device = createDevice(driverType,
core::dimension2d<s32>(640, 480));
core::dimension2d<u32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.

View File

@ -28,10 +28,11 @@ class MyEventReceiver : public IEventReceiver
{
public:
MyEventReceiver(scene::ISceneNode* terrain)
MyEventReceiver(scene::ISceneNode* terrain, scene::ISceneNode* skybox, scene::ISceneNode* skydome) :
Terrain(terrain), Skybox(skybox), Skydome(skydome), showBox(true)
{
// store pointer to terrain so we can change its drawing mode
Terrain = terrain;
Skybox->setVisible(true);
Skydome->setVisible(false);
}
bool OnEvent(const SEvent& event)
@ -56,6 +57,11 @@ public:
Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ?
video::EMT_DETAIL_MAP : video::EMT_SOLID);
return true;
case irr::KEY_KEY_S: // toggle skies
showBox=!showBox;
Skybox->setVisible(showBox);
Skydome->setVisible(!showBox);
return true;
default:
break;
}
@ -66,12 +72,15 @@ public:
private:
scene::ISceneNode* Terrain;
scene::ISceneNode* Skybox;
scene::ISceneNode* Skydome;
bool showBox;
};
/*
The start of the main function starts like in most other example. We ask the user
for the desired renderer and start it up.
for the desired renderer and start it up. This time with the advanced parameter handling.
*/
int main()
{
@ -98,10 +107,12 @@ int main()
default: return 1;
}
// create device
IrrlichtDevice* device = createDevice(driverType,
core::dimension2d<s32>(640, 480));
// create device with full flexibility over creation parameters
// you can add more parameters if desired, check irr::SIrrlichtCreationParameters
irr::SIrrlichtCreationParameters params;
params.DriverType=driverType;
params.WindowSize=core::dimension2d<u32>(640, 480);
IrrlichtDevice* device = createDeviceEx(params);
if (device == 0)
return 1; // could not create selected driver.
@ -128,8 +139,8 @@ int main()
// add some help text
env->addStaticText(
L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map",
core::rect<s32>(10,440,250,475), true, true, 0, -1, true);
L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map\nPress 'S' to toggle skybox/skydome",
core::rect<s32>(10,421,250,475), true, true, 0, -1, true);
// add camera
scene::ICameraSceneNode* camera =
@ -137,7 +148,7 @@ int main()
camera->setPosition(core::vector3df(2700*2,255*2,2600*2));
camera->setTarget(core::vector3df(2397*2,343*2,2700*2));
camera->setFarValue(12000.0f);
camera->setFarValue(42000.0f);
// disable mouse cursor
device->getCursorControl()->setVisible(false);
@ -220,26 +231,27 @@ int main()
To make the user be able to switch between normal and wireframe mode,
we create an instance of the event reciever from above and let Irrlicht
know about it. In addition, we add the skybox which we already used in
lots of Irrlicht examples.
lots of Irrlicht examples and a skydome, which is shown mutually
exclusive with the skybox by pressing 'S'.
*/
// create event receiver
MyEventReceiver receiver(terrain);
device->setEventReceiver(&receiver);
// create skybox
// create skybox and skydome
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
smgr->addSkyBoxSceneNode(
scene::ISceneNode* skybox=smgr->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.jpg"),
driver->getTexture("../../media/irrlicht2_dn.jpg"),
driver->getTexture("../../media/irrlicht2_lf.jpg"),
driver->getTexture("../../media/irrlicht2_rt.jpg"),
driver->getTexture("../../media/irrlicht2_ft.jpg"),
driver->getTexture("../../media/irrlicht2_bk.jpg"));
scene::ISceneNode* skydome=smgr->addSkyDomeSceneNode(driver->getTexture("../../media/skydome.jpg"),16,8,0.95f,2.0f);
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
// create event receiver
MyEventReceiver receiver(terrain, skybox, skydome);
device->setEventReceiver(&receiver);
/*
That's it, draw everything.

View File

@ -45,7 +45,7 @@ int main()
// create device and exit if creation failed
IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<s32>(640, 480),
createDevice(driverType, core::dimension2d<u32>(640, 480),
16, false, false);
if (device == 0)
@ -140,7 +140,7 @@ int main()
if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET))
{
rt = driver->addRenderTargetTexture(core::dimension2d<s32>(256,256), "RTT1");
rt = driver->addRenderTargetTexture(core::dimension2d<u32>(256,256), "RTT1");
test->setMaterialTexture(0, rt); // set material of cube to render target
// add fixed camera

View File

@ -46,7 +46,7 @@ int main()
// create device and exit if creation failed
IrrlichtDevice* device =
createDevice(driverType, core::dimension2d<s32>(640, 480));
createDevice(driverType, core::dimension2d<u32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.

View File

@ -149,7 +149,7 @@ int IRRCALLCONV main(int argc, char* argv[])
}
// create device and exit if creation failed
const core::dimension2di videoDim ( 800,600 );
const core::dimension2du videoDim ( 800,600 );
IrrlichtDevice *device = createDevice(driverType, videoDim, 32, false );

View File

@ -187,3 +187,5 @@ int main()
return 0;
}
/*
**/

View File

@ -47,7 +47,8 @@ whenever the user press the S-key. All other events are sent
to the FPS camera.
*/
class MyEventReceiver : public IEventReceiver {
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
@ -100,7 +101,7 @@ int main()
//Initialise the engine
IrrlichtDevice *device = createDevice(driverType,
dimension2d<s32>(ResX,ResY), 32, fullScreen,
dimension2du(ResX,ResY), 32, fullScreen,
false, false, &receiver);
if (!device)
return 1;

View File

@ -129,7 +129,7 @@ int main()
MyEventReceiver receiver;
IrrlichtDevice* device = createDevice(driverType,
core::dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
core::dimension2d<u32>(640, 480), 16, false, false, false, &receiver);
if (device == 0)
return 1; // could not create selected driver.
@ -290,3 +290,6 @@ int main()
return 0;
}
/*
**/

View File

@ -0,0 +1,39 @@
# Makefile for Irrlicht Examples
# It's usually sufficient to change just the target name and source file list
# and be sure that CXX is set to a valid compiler
Target = 20.ManagedLights
Sources = main.cpp
# general compiler settings
CPPFLAGS = -I../../include -I/usr/X11R6/include
#CXXFLAGS = -O3 -ffast-math
CXXFLAGS = -g -Wall
#default target is Linux
all: all_linux
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
# target specific settings
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
all_win32 clean_win32: SYSTEM=Win32-gcc
all_win32 clean_win32: SUF=.exe
# name of the binary - only valid for targets which set SYSTEM
DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
all_linux all_win32:
$(warning Building...)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
clean: clean_linux clean_win32
$(warning Cleaning...)
clean_linux clean_win32:
@$(RM) $(DESTPATH)
.PHONY: all all_win32 clean clean_linux clean_win32

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Irrlicht Example 20 ManagedLights" />
<Option pch_mode="0" />
<Option compiler="gcc" />
<Build>
<Target title="default">
<Option output="..\..\bin\gcc\ManagedLights" prefix_auto="0" extension_auto="1" />
<Option type="1" />
<Option compiler="gcc" />
<Option projectResourceIncludeDirsRelation="1" />
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
</Compiler>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="default;" />
</VirtualTargets>
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add directory="..\..\include" />
</Compiler>
<Linker>
<Add library="Irrlicht" />
<Add directory="..\..\lib\gcc" />
</Linker>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@ -0,0 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "ManagedLights.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,230 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="20.ManagedLights"
ProjectGUID="{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/ManagedLights.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/ManagedLights.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\20.ManagedLights.exe"
LinkIncremental="0"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/ManagedLights.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/ManagedLights.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/ManagedLights.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\20.ManagedLights.exe"
LinkIncremental="0"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
ProgramDatabaseFile=".\Release/ManagedLights.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="main.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="20.ManagedLights_vc8"
ProjectGUID="{16007FE2-142B-47F8-93E1-519BA3F39E71}"
RootNamespace="ManagedLights_vc8"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/ManagedLights.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/ManagedLights.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\20.ManagedLights.exe"
LinkIncremental="0"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/ManagedLights.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/ManagedLights.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/ManagedLights.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\20.ManagedLights.exe"
LinkIncremental="0"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
ProgramDatabaseFile=".\Release/ManagedLights.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="main.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="20.ManagedLights_vc9"
ProjectGUID="{16007FE2-142B-47F8-93E1-519BA3F39E71}"
RootNamespace="ManagedLights_vc9"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/ManagedLights.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/ManagedLights.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\Lib\Win32-visualstudio\Irrlicht.lib"
OutputFile="..\..\bin\Win32-VisualStudio\20.ManagedLights.exe"
LinkIncremental="0"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/ManagedLights.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/ManagedLights.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/ManagedLights.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\20.ManagedLights.exe"
LinkIncremental="0"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
ProgramDatabaseFile=".\Release/ManagedLights.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="main.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,59 @@
[Project]
FileName=example.dev
Name=Irrlicht Example 20 ManagedLights
UnitCount=1
Type=1
Ver=1
ObjFiles=
Includes=..\..\include
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_
IsCpp=1
Icon=
ExeOutput=../../bin/Win32-gcc
ObjectOutput=obj
OverrideOutput=1
OverrideOutputName=20.ManagedLights.exe
HostApplication=
Folders=
CommandLine=
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=0000000000000000000000
UseCustomMakefile=0
CustomMakefile=
[Unit1]
FileName=main.cpp
CompileCpp=1
Folder=Projekt1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=
FileDescription=Irrlicht Engine example compiled using DevCpp and gcc
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0

View File

@ -0,0 +1,400 @@
// Written by Colin MacDonald
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
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
want to use more dynamic lights in your scene, then you can register an optional light
manager that allows you to to turn lights on and off at specific point during rendering.
You are still limited to 8 lights, but the limit is per scene node.
This is completely optional: if you do not register a light manager, then a default
distance-based scheme will be used to prioritise hardware lights based on their distance
from the active camera.
NO_MANAGEMENT disables the light manager and shows Irrlicht's default light behaviour.
The 8 lights nearest to the camera will be turned on, and other lights will be turned off.
In this example, this produces a funky looking but incoherent light display.
LIGHTS_NEAREST_NODE shows an implementation that turns on a limited number of lights
per mesh scene node. If finds the 3 lights that are nearest to the node being rendered,
and turns them on, turning all other lights off. This works, but as it operates on every
light for every node, it does not scale well with many lights. The flickering you can see
in this demo is due to the lights swapping their relative positions from the cubes
(a deliberate demonstration of the limitations of this technique).
LIGHTS_IN_ZONE shows a technique for turning on lights based on a 'zone'. Each empty scene
node is considered to be the parent of a zone. When nodes are rendered, they turn off all
lights, then find their parent 'zone' and turn on all lights that are inside that zone, i.e.
are descendents of it in the scene graph. This produces true 'local' lighting for each cube
in this example. You could use a similar technique to locally light all meshes in (e.g.)
a room, without the lights spilling out to other rooms.
This light manager is also an event receiver; this is purely for simplicity in this example,
it's neither necessary nor recommended for a real application.
*/
class CMyLightManager : public ILightManager, public IEventReceiver
{
typedef enum
{
NO_MANAGEMENT,
LIGHTS_NEAREST_NODE,
LIGHTS_IN_ZONE
}
LightManagementMode;
LightManagementMode Mode;
LightManagementMode RequestedMode;
// These data represent the state information that this light manager
// is interested in.
ISceneManager * SceneManager;
core::array<ILightSceneNode*> * SceneLightList;
E_SCENE_NODE_RENDER_PASS CurrentRenderPass;
ISceneNode * CurrentSceneNode;
public:
CMyLightManager(ISceneManager* sceneManager)
: Mode(NO_MANAGEMENT), RequestedMode(NO_MANAGEMENT),
SceneManager(sceneManager), SceneLightList(0),
CurrentRenderPass(ESNRP_COUNT), CurrentSceneNode(0)
{ }
virtual ~CMyLightManager(void) { }
// The input receiver interface, which just switches light management strategy
bool OnEvent(const SEvent & event)
{
bool handled = false;
if (event.EventType == irr::EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown)
{
handled = true;
switch(event.KeyInput.Key)
{
case irr::KEY_KEY_1:
RequestedMode = NO_MANAGEMENT;
break;
case irr::KEY_KEY_2:
RequestedMode = LIGHTS_NEAREST_NODE;
break;
case irr::KEY_KEY_3:
RequestedMode = LIGHTS_IN_ZONE;
break;
default:
handled = false;
break;
}
if(NO_MANAGEMENT == RequestedMode)
SceneManager->setLightManager(0); // Show that it's safe to register the light manager
else
SceneManager->setLightManager(this);
}
return handled;
}
// This is called before the first scene node is rendered.
virtual void OnPreRender(core::array<ILightSceneNode*> & lightList)
{
// Update the mode; changing it here ensures that it's consistent throughout a render
Mode = RequestedMode;
// Store the light list. I am free to alter this list until the end of OnPostRender().
SceneLightList = &lightList;
}
// Called after the last scene node is rendered.
virtual void OnPostRender()
{
// Since light management might be switched off in the event handler, we'll turn all
// lights on to ensure that they are in a consistent state. You wouldn't normally have
// to do this when using a light manager, since you'd continue to do light management
// yourself.
for(u32 i = 0; i < SceneLightList->size(); i++)
(*SceneLightList)[i]->setVisible(true);
}
virtual void OnRenderPassPreRender(E_SCENE_NODE_RENDER_PASS renderPass)
{
// I don't have to do anything here except remember which render pass I am in.
CurrentRenderPass = renderPass;
}
virtual void OnRenderPassPostRender(E_SCENE_NODE_RENDER_PASS renderPass)
{
// I only want solid nodes to be lit, so after the solid pass, turn all lights off.
if(ESNRP_SOLID == renderPass)
{
for(u32 i = 0; i < SceneLightList->size(); ++i)
(*SceneLightList)[i]->setVisible(false);
}
}
// This is called before the specified scene node is rendered
virtual void OnNodePreRender(ISceneNode* node)
{
CurrentSceneNode = node;
// This light manager only considers solid objects, but you are free to manipulate
// lights during any phase, depending on your requirements.
if(ESNRP_SOLID != CurrentRenderPass)
return;
// And in fact for this example, I only want to consider lighting for cube scene
// nodes. You will probably want to deal with lighting for (at least) mesh /
// animated mesh scene nodes as well.
if(node->getType() != ESNT_CUBE)
return;
if(LIGHTS_NEAREST_NODE == Mode)
{
// This is a naive implementation that prioritises every light in the scene
// by its proximity to the node being rendered. This produces some flickering
// when lights orbit closer to a cube than its 'zone' lights.
const vector3df nodePosition = node->getAbsolutePosition();
// Sort the light list by prioritising them based on their distance from the node
// that's about to be rendered.
array<LightDistanceElement> sortingArray;
sortingArray.reallocate(SceneLightList->size());
u32 i;
for(i = 0; i < SceneLightList->size(); ++i)
{
ILightSceneNode* lightNode = (*SceneLightList)[i];
f64 distance = lightNode->getAbsolutePosition().getDistanceFromSQ(nodePosition);
sortingArray.push_back(LightDistanceElement(lightNode, distance));
}
sortingArray.sort();
// The list is now sorted by proximity to the node.
// Turn on the three nearest lights, and turn the others off.
for(i = 0; i < sortingArray.size(); ++i)
sortingArray[i].node->setVisible(i < 3);
}
else if(LIGHTS_IN_ZONE == Mode)
{
// Empty scene nodes are used to represent 'zones'. For each solid mesh that
// is being rendered, turn off all lights, then find its 'zone' parent, and turn
// on all lights that are found under that node in the scene graph.
// This is a general purpose algorithm that doesn't use any special
// knowledge of how this particular scene graph is organised.
for(u32 i = 0; i < SceneLightList->size(); ++i)
{
ILightSceneNode* lightNode = (*SceneLightList)[i];
SLight & lightData = lightNode->getLightData();
if(ELT_DIRECTIONAL != lightData.Type)
lightNode->setVisible(false);
}
ISceneNode * parentZone = findZone(node);
if(parentZone)
turnOnZoneLights(parentZone);
}
}
// Called after the specified scene node is rendered
virtual void OnNodePostRender(ISceneNode* node)
{
// I don't need to do any light management after individual node rendering.
}
private:
// Find the empty scene node that is the parent of the specified node
ISceneNode * findZone(ISceneNode * node)
{
if(!node)
return 0;
if(node->getType() == ESNT_EMPTY)
return node;
return findZone(node->getParent());
}
// Turn on all lights that are children (directly or indirectly) of the
// specified scene node.
void turnOnZoneLights(ISceneNode * node)
{
core::list<ISceneNode*> const & children = node->getChildren();
for (core::list<ISceneNode*>::ConstIterator child = children.begin();
child != children.end();
++child)
{
if((*child)->getType() == ESNT_LIGHT)
static_cast<ILightSceneNode*>(*child)->setVisible(true);
else // Assume that lights don't have any children that are also lights
turnOnZoneLights(*child);
}
}
// A utility class to aid in sorting scene nodes into a distance order
class LightDistanceElement
{
public:
LightDistanceElement() {};
LightDistanceElement(ILightSceneNode* n, f64 d)
: node(n), distance(d) { }
ILightSceneNode* node;
f64 distance;
// Lower distance elements are sorted to the start of the array
bool operator < (const LightDistanceElement& other) const
{
return (distance < other.distance);
}
};
};
int main(int argumentCount, char * argumentValues[])
{
char driverChoice;
if(argumentCount > 1)
driverChoice = argumentValues[1][0];
else
{
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Burning's Software Renderer\n(otherKey) exit\n\n");
std::cin >> driverChoice;
}
video::E_DRIVER_TYPE driverType;
switch(driverChoice)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_BURNINGSVIDEO; break;
default: return 0;
}
IrrlichtDevice *device = createDevice(driverType, dimension2d<u32>(640, 480), 32,
false, false, false, 0);
if(!device)
return -1;
f32 const lightRadius = 60.f; // Enough to reach the far side of each 'zone'
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
gui::IGUISkin* skin = guienv->getSkin();
if (skin)
{
skin->setColor(EGDC_BUTTON_TEXT, SColor(255, 255, 255, 255));
gui::IGUIFont* font = guienv->getFont("../../media/fontlucida.png");
if(font)
skin->setFont(font);
}
guienv->addStaticText(L"1 - No light management", core::rect<s32>(10,10,200,30));
guienv->addStaticText(L"2 - Closest 3 lights", core::rect<s32>(10,30,200,50));
guienv->addStaticText(L"3 - Lights in zone", core::rect<s32>(10,50,200,70));
// Add several "zones". You could use this technique to light individual rooms, for example.
for(f32 zoneX = -100.f; zoneX <= 100.f; zoneX += 50.f)
for(f32 zoneY = -60.f; zoneY <= 60.f; zoneY += 60.f)
{
// Start with an empty scene node, which we will use to represent a zone.
ISceneNode * zoneRoot = smgr->addEmptySceneNode();
zoneRoot->setPosition(vector3df(zoneX, zoneY, 0));
// Each zone contains a rotating cube
IMeshSceneNode * node = smgr->addCubeSceneNode(15, zoneRoot);
ISceneNodeAnimator * rotation = smgr->createRotationAnimator(vector3df(0.25f, 0.5f, 0.75f));
node->addAnimator(rotation);
rotation->drop();
// And each cube has three lights attached to it. The lights are attached to billboards so
// that we can see where they are. The billboards are attached to the cube, so that the
// lights are indirect descendents of the same empty scene node as the cube.
IBillboardSceneNode * billboard = smgr->addBillboardSceneNode(node);
billboard->setPosition(vector3df(0, -14, 30));
billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
billboard->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp"));
billboard->setMaterialFlag(video::EMF_LIGHTING, false);
ILightSceneNode * light = smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), SColorf(1, 0, 0), lightRadius);
billboard = smgr->addBillboardSceneNode(node);
billboard->setPosition(vector3df(-21, -14, -21));
billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
billboard->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp"));
billboard->setMaterialFlag(video::EMF_LIGHTING, false);
light = smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), SColorf(0, 1, 0), lightRadius);
billboard = smgr->addBillboardSceneNode(node);
billboard->setPosition(vector3df(21, -14, -21));
billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
billboard->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp"));
billboard->setMaterialFlag(video::EMF_LIGHTING, false);
light = smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), SColorf(0, 0, 1), lightRadius);
// Each cube also has a smaller cube rotating around it, to show that the cubes are being
// lit by the lights in their 'zone', not just lights that are their direct children.
node = smgr->addCubeSceneNode(5, node);
node->setPosition(vector3df(0, 21, 0));
}
smgr->addCameraSceneNode(0, vector3df(0,0,-130), vector3df(0,0,0));
CMyLightManager * myLightManager = new CMyLightManager(smgr);
smgr->setLightManager(0); // This is the default: we won't do light management until told to do it.
device->setEventReceiver(myLightManager);
int lastFps = -1;
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
int fps = driver->getFPS();
if(fps != lastFps)
{
lastFps = fps;
core::stringw str = L"Managed Lights [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
}
}
myLightManager->drop(); // Drop my implicit reference
device->drop();
return 0;
}

View File

@ -1,7 +1,7 @@
<?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>

View File

@ -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

View File

@ -42,6 +42,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader_vc8", "1
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc8", "19.MouseAndJoystick\MouseAndJoystick_vc8.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(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -124,6 +126,10 @@ Global
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -21,7 +21,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement_vc9", "04.Movem
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface_vc8", "05.UserInterface\UserInterface_vc9.vcproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface_vc9", "05.UserInterface\UserInterface_vc9.vcproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}"
ProjectSection(ProjectDependencies) = postProject
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
EndProjectSection
@ -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_vc9", "20.ManagedLights\ManagedLights_vc9.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32

View File

@ -1,4 +1,4 @@
// This is a Demo of the Irrlicht Engine (c) 2005-2008 by N.Gebhardt.
// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt.
// This file is not documented.
#include "CDemo.h"
@ -37,7 +37,7 @@ CDemo::~CDemo()
void CDemo::run()
{
core::dimension2d<s32> resolution ( 800, 600 );
core::dimension2d<u32> resolution ( 800, 600 );
if ( driverType == video::EDT_BURNINGSVIDEO || driverType == video::EDT_SOFTWARE )
{
@ -570,7 +570,7 @@ void CDemo::loadSceneData()
void CDemo::createLoadingScreen()
{
core::dimension2d<int> size = device->getVideoDriver()->getScreenSize();
core::dimension2d<u32> size = device->getVideoDriver()->getScreenSize();
device->getCursorControl()->setVisible(false);
@ -635,9 +635,9 @@ void CDemo::shoot()
core::line3d<f32> line(start, end);
// get intersection point with map
const scene::ISceneNode* hitNode;
if (sm->getSceneCollisionManager()->getCollisionPoint(
line, mapSelector, end, triangle))
line, mapSelector, end, triangle, hitNode))
{
// collides with wall
core::vector3df out = triangle.getNormal();

View File

@ -1,4 +1,4 @@
// This is a Demo of the Irrlicht Engine (c) 2005-2008 by N.Gebhardt.
// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt.
// This file is not documented.
#include "CMainMenu.h"
@ -75,7 +75,7 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows,
video::E_DRIVER_TYPE& outDriver)
{
MenuDevice = createDevice(video::EDT_BURNINGSVIDEO,
core::dimension2d<s32>(512, 384), 16, false, false, false, this);
core::dimension2d<u32>(512, 384), 16, false, false, false, this);
if (MenuDevice->getFileSystem()->existFile("irrlicht.dat"))
MenuDevice->getFileSystem()->addZipFileArchive("irrlicht.dat");

View File

@ -1,4 +1,4 @@
// This is a Demo of the Irrlicht Engine (c) 2005-2008 by N.Gebhardt.
// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt.
// This file is not documented.
#include <irrlicht.h>

View File

@ -1,4 +1,4 @@
// Copyright (C) 2008 Nikolaus Gebhardt
// Copyright (C) 2008-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2008 Nikolaus Gebhardt
// Copyright (C) 2008-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2008 Nikolaus Gebhardt
// Copyright (C) 2008-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -85,6 +85,12 @@ namespace video
//! Are vertex buffer objects supported?
EVDF_VERTEX_BUFFER_OBJECT,
//! Supports Alpha To Coverage
EVDF_ALPHA_TO_COVERAGE,
//! Supports Color masks (disabling color planes in output)
EVDF_COLOR_MASK,
//! Only used for counting the elements of this enum
EVDF_COUNT
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -13,44 +13,43 @@ namespace video
//! An enum for all types of drivers the Irrlicht Engine supports.
enum E_DRIVER_TYPE
{
//! Null driver, useful for applications to run the engine
//! without visualisation. The null device is able to load
//! textures, but does not render and display any graphics.
//! Null driver, useful for applications to run the engine without visualisation.
/** The null device is able to load textures, but does not
render and display any graphics. */
EDT_NULL,
//! The Irrlicht Engine Software renderer, runs on all
//! platforms, with every hardware. It should only be used for
//! 2d graphics, but it can also perform some primitive 3d
//! functions. These 3d drawing functions are quite fast, but
//! very inaccurate, and don't even support clipping in 3D mode.
//! The Irrlicht Engine Software renderer.
/** Runs on all platforms, with every hardware. It should only be used for
2d graphics, but it can also perform some primitive 3d
functions. These 3d drawing functions are quite fast, but
very inaccurate, and don't even support clipping in 3D mode. */
EDT_SOFTWARE,
//! The Burning's Software Renderer, an alternative software
//! renderer for Irrlicht. Basically it can be described as the
//! Irrlicht Software renderer on steroids. It rasterizes 3D
//! geometry perfectly: It is able to perform correct 3d
//! clipping, perspective correct texture mapping, perspective
//! correct color mapping, and renders sub pixel correct, sub
//! texel correct primitives. In addition, it does bilinear
//! texel filtering and supports more materials than the
//! EDT_SOFTWARE driver. This renderer has been written
//! entirely by Thomas Alten, thanks a lot for this huge
//! contribution.
//! The Burning's Software Renderer, an alternative software renderer
/** Basically it can be described as the Irrlicht Software
renderer on steroids. It rasterizes 3D geometry perfectly: It
is able to perform correct 3d clipping, perspective correct
texture mapping, perspective correct color mapping, and renders
sub pixel correct, sub texel correct primitives. In addition,
it does bilinear texel filtering and supports more materials
than the EDT_SOFTWARE driver. This renderer has been written
entirely by Thomas Alten, thanks a lot for this huge
contribution. */
EDT_BURNINGSVIDEO,
//! Direct3D8 device, only available on Win32 platforms.
//! Performs hardware accelerated rendering of 3D and 2D
//! primitives.
/** Performs hardware accelerated rendering of 3D and 2D
primitives. */
EDT_DIRECT3D8,
//! Direct3D 9 device, only available on Win32 platforms.
//! Performs hardware accelerated rendering of 3D and 2D
//! primitives.
/** Performs hardware accelerated rendering of 3D and 2D
primitives. */
EDT_DIRECT3D9,
//! OpenGL device, available on most platforms.
//! Performs hardware accelerated rendering of 3D and 2D
//! primitives.
/** Performs hardware accelerated rendering of 3D and 2D
primitives. */
EDT_OPENGL,
EDT_OGLES1
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -35,3 +35,4 @@ const c8* const GUIAlignmentNames[] =
} // namespace irr
#endif // __E_GUI_ALIGNMENT_H_INCLUDED__

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -88,8 +88,7 @@ enum EGUI_ELEMENT_TYPE
//! Unknown type.
EGUIET_ELEMENT,
//! This enum is never used, it only forces the compiler to
//! compile these enumeration values to 32 bit.
//! This enum is never used, it only forces the compiler to compile this enumeration to 32 bit.
EGUIET_FORCE_32_BIT = 0x7fffffff
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -68,6 +68,12 @@ namespace video
//! Access to all layers texture wrap settings. Overwrites separate layer settings.
EMF_TEXTURE_WRAP,
//! AntiAliasing mode
EMF_ANTI_ALIASING,
//! ColorMask bits, for enabling the color planes
EMF_COLOR_MASK,
//! This is not a flag, but a value indicating how much flags there are.
EMF_MATERIAL_FLAG_COUNT
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -13,37 +13,39 @@ namespace video
//! Abstracted and easy to use fixed function/programmable pipeline material modes.
enum E_MATERIAL_TYPE
{
//! Standard solid material. Only first texture is used, which
//! is supposed to be the diffuse material.
//! Standard solid material.
/** Only first texture is used, which is supposed to be the
diffuse material. */
EMT_SOLID = 0,
//! Solid material with 2 texture layers. The second is blended
//! onto the first using the alpha value of the vertex colors.
//! This material is currently not implemented in OpenGL.
//! Solid material with 2 texture layers.
/** The second is blended onto the first using the alpha value
of the vertex colors. This material is currently not implemented in OpenGL.
*/
EMT_SOLID_2_LAYER,
//! Material type with standard lightmap technique:
//! There should be 2 textures: The first texture layer is a
//! diffuse map, the second is a light map. Dynamic light is
//! ignored.
//! Material type with standard lightmap technique
/** There should be 2 textures: The first texture layer is a
diffuse map, the second is a light map. Dynamic light is
ignored. */
EMT_LIGHTMAP,
//! Material type with lightmap technique like EMT_LIGHTMAP. But
//! lightmap and diffuse texture are added instead of modulated.
//! Material type with lightmap technique like EMT_LIGHTMAP.
/** But lightmap and diffuse texture are added instead of modulated. */
EMT_LIGHTMAP_ADD,
//! Material type with standard lightmap technique:
//! There should be 2 textures: The first texture layer is a
//! diffuse map, the second is a light map. Dynamic light is
//! ignored. The texture colors are effectively multiplied by 2
//! for brightening. Like known in DirectX as D3DTOP_MODULATE2X.
//! Material type with standard lightmap technique
/** There should be 2 textures: The first texture layer is a
diffuse map, the second is a light map. Dynamic light is
ignored. The texture colors are effectively multiplied by 2
for brightening. Like known in DirectX as D3DTOP_MODULATE2X. */
EMT_LIGHTMAP_M2,
//! Material type with standard lightmap technique:
//! There should be 2 textures: The first texture layer is a
//! diffuse map, the second is a light map. Dynamic light is
//! ignored. The texture colors are effectively multiplyied by 4
//! for brightening. Like known in DirectX as D3DTOP_MODULATE4X.
//! Material type with standard lightmap technique
/** There should be 2 textures: The first texture layer is a
diffuse map, the second is a light map. Dynamic light is
ignored. The texture colors are effectively multiplyied by 4
for brightening. Like known in DirectX as D3DTOP_MODULATE4X. */
EMT_LIGHTMAP_M4,
//! Like EMT_LIGHTMAP, but also supports dynamic lighting.
@ -55,153 +57,142 @@ namespace video
//! Like EMT_LIGHTMAP_4, but also supports dynamic lighting.
EMT_LIGHTMAP_LIGHTING_M4,
//! Detail mapped material. The first texture is diffuse color
//! map, the second is added to this and usually displayed with
//! a bigger scale value so that it adds more detail. The
//! detail map is added to the diffuse map using ADD_SIGNED, so
//! that it is possible to add and substract color from the
//! diffuse map. For example a value of (127,127,127) will not
//! change the appearance of the diffuse map at all. Often used
//! for terrain rendering.
//! Detail mapped material.
/** The first texture is diffuse color map, the second is added
to this and usually displayed with a bigger scale value so that
it adds more detail. The detail map is added to the diffuse map
using ADD_SIGNED, so that it is possible to add and substract
color from the diffuse map. For example a value of
(127,127,127) will not change the appearance of the diffuse map
at all. Often used for terrain rendering. */
EMT_DETAIL_MAP,
//! Makes the material look like it was reflection the
//! environment around it. To make this possible, a texture
//! called 'sphere map' is used, which must be set as the first
//! texture.
//! Look like a reflection of the environment around it.
/** To make this possible, a texture called 'sphere map' is
used, which must be set as the first texture. */
EMT_SPHERE_MAP,
//! A reflecting material with an optional additional non
//! reflecting texture layer. The reflection map should be set
//! as first texture.
//! A reflecting material with an optional non reflecting texture layer.
/** The reflection map should be set as first texture. */
EMT_REFLECTION_2_LAYER,
//! A transparent material. Only the first texture is used.
//! The new color is calculated by simply adding the source
//! color and the dest color. This means if for example a
//! billboard using a texture with black background and a red
//! circle on it is drawn with this material, the result is
//! that only the red circle will be drawn a little bit
//! transparent, and everything which was black is 100%
//! transparent and not visible. This material type is useful
//! for particle effects.
//! A transparent material.
/** Only the first texture is used. The new color is calculated
by simply adding the source color and the dest color. This
means if for example a billboard using a texture with black
background and a red circle on it is drawn with this material,
the result is that only the red circle will be drawn a little
bit transparent, and everything which was black is 100%
transparent and not visible. This material type is useful for
particle effects. */
EMT_TRANSPARENT_ADD_COLOR,
//! Makes the material transparent based on the texture alpha
//! channel. The final color is blended together from the
//! destination color and the texture color, using the alpha
//! channel value as blend factor. Only first texture is used.
//! If you are using this material with small textures, it is a
//! good idea to load the texture in 32 bit mode
//! (video::IVideoDriver::setTextureCreationFlag()). Also, an
//! alpha ref is used, which can be manipulated using
//! SMaterial::MaterialTypeParam. If set to 0, the alpha ref
//! gets its default value which is 0.5f and means that
//! pixels with an alpha value >127 will be written, others not.
//! In other, simple words: this value controls how sharp the
//! edges become when going from a transparent to a solid spot
//! on the texture.
//! Makes the material transparent based on the texture alpha channel.
/** The final color is blended together from the destination
color and the texture color, using the alpha channel value as
blend factor. Only first texture is used. If you are using
this material with small textures, it is a good idea to load
the texture in 32 bit mode
(video::IVideoDriver::setTextureCreationFlag()). Also, an alpha
ref is used, which can be manipulated using
SMaterial::MaterialTypeParam. This value controls how sharp the
edges become when going from a transparent to a solid spot on
the texture. */
EMT_TRANSPARENT_ALPHA_CHANNEL,
//! Makes the material transparent based on the texture alpha
//! channel. If the alpha channel value is greater than 127, a
//! pixel is written to the target, otherwise not. This
//! material does not use alpha blending and is a lot faster
//! than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing
//! stuff like leafes of plants, because the borders are not
//! blurry but sharp. Only first texture is used. If you are
//! using this material with small textures and 3d object, it
//! is a good idea to load the texture in 32 bit mode
//! (video::IVideoDriver::setTextureCreationFlag()).
//! Makes the material transparent based on the texture alpha channel.
/** If the alpha channel value is greater than 127, a
pixel is written to the target, otherwise not. This
material does not use alpha blending and is a lot faster
than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing
stuff like leafes of plants, because the borders are not
blurry but sharp. Only first texture is used. If you are
using this material with small textures and 3d object, it
is a good idea to load the texture in 32 bit mode
(video::IVideoDriver::setTextureCreationFlag()). */
EMT_TRANSPARENT_ALPHA_CHANNEL_REF,
//! Makes the material transparent based on the vertex alpha
//! value.
//! Makes the material transparent based on the vertex alpha value.
EMT_TRANSPARENT_VERTEX_ALPHA,
//! A transparent reflecting material with an optional
//! additional non reflecting texture layer. The reflection map
//! should be set as first texture. The transparency depends on
//! the alpha value in the vertex colors. A texture which will
//! not reflect can be set as second texture. Please note that
//! this material type is currently not 100% implemented in
//! OpenGL.
//! A transparent reflecting material with an optional additional non reflecting texture layer.
/** The reflection map should be set as first texture. The
transparency depends on the alpha value in the vertex colors. A
texture which will not reflect can be set as second texture.
Please note that this material type is currently not 100%
implemented in OpenGL. */
EMT_TRANSPARENT_REFLECTION_2_LAYER,
//! A solid normal map renderer. First texture is the color
//! map, the second should be the normal map. Note that you
//! should use this material only when drawing geometry
//! consisting of vertices of type S3DVertexTangents
//! (EVT_TANGENTS). You can convert any mesh into this format
//! using IMeshManipulator::createMeshWithTangents() (See
//! SpecialFX2 Tutorial). This shader runs on vertex shader
//! 1.1 and pixel shader 1.1 capable hardware and falls back to
//! a fixed function lighted material if this hardware is not
//! available. Only two lights are supported by this shader,
//! if there are more, the nearest two are chosen.
//! A solid normal map renderer.
/** First texture is the color map, the second should be the
normal map. Note that you should use this material only when
drawing geometry consisting of vertices of type
S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into
this format using IMeshManipulator::createMeshWithTangents()
(See SpecialFX2 Tutorial). This shader runs on vertex shader
1.1 and pixel shader 1.1 capable hardware and falls back to a
fixed function lighted material if this hardware is not
available. Only two lights are supported by this shader, if
there are more, the nearest two are chosen. */
EMT_NORMAL_MAP_SOLID,
//! A transparent normal map renderer. First texture is the
//! color map, the second should be the normal map. Note that
//! you should use this material only when drawing geometry
//! consisting of vertices of type S3DVertexTangents
//! (EVT_TANGENTS). You can convert any mesh into this format
//! using IMeshManipulator::createMeshWithTangents() (See
//! SpecialFX2 Tutorial). This shader runs on vertex shader
//! 1.1 and pixel shader 1.1 capable hardware and falls back to
//! a fixed function lighted material if this hardware is not
//! available. Only two lights are supported by this shader,
//! if there are more, the nearest two are chosen.
//! A transparent normal map renderer.
/** First texture is the color map, the second should be the
normal map. Note that you should use this material only when
drawing geometry consisting of vertices of type
S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into
this format using IMeshManipulator::createMeshWithTangents()
(See SpecialFX2 Tutorial). This shader runs on vertex shader
1.1 and pixel shader 1.1 capable hardware and falls back to a
fixed function lighted material if this hardware is not
available. Only two lights are supported by this shader, if
there are more, the nearest two are chosen. */
EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR,
//! A transparent (based on the vertex alpha value) normal map
//! renderer. First texture is the color map, the second
//! should be the normal map. Note that you should use this
//! material only when drawing geometry consisting of vertices
//! of type S3DVertexTangents (EVT_TANGENTS). You can convert
//! any mesh into this format using
//! IMeshManipulator::createMeshWithTangents() (See SpecialFX2
//! Tutorial). This shader runs on vertex shader 1.1 and pixel
//! shader 1.1 capable hardware and falls back to a fixed
//! function lighted material if this hardware is not available.
//! Only two lights are supported by this shader, if there are
//! more, the nearest two are chosen.
//! A transparent (based on the vertex alpha value) normal map renderer.
/** First texture is the color map, the second should be the
normal map. Note that you should use this material only when
drawing geometry consisting of vertices of type
S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into
this format using IMeshManipulator::createMeshWithTangents()
(See SpecialFX2 Tutorial). This shader runs on vertex shader
1.1 and pixel shader 1.1 capable hardware and falls back to a
fixed function lighted material if this hardware is not
available. Only two lights are supported by this shader, if
there are more, the nearest two are chosen. */
EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA,
//! Just like EMT_NORMAL_MAP_SOLID, but uses parallax mapping
//! too, which looks a lot more realistic. This only works when
//! the hardware supports at least vertex shader 1.1 and pixel
//! shader 1.4. First texture is the color map, the second
//! should be the normal map. The normal map texture should
//! contain the height value in the alpha component. The
//! IVideoDriver::makeNormalMapTexture() method writes this
//! value automatically when creating normal maps from a
//! heightmap when using a 32 bit texture. The height scale of
//! the material (affecting the bumpiness) is being controlled
//! by the SMaterial::MaterialTypeParam member. If set to
//! zero, the default value (0.02f) will be applied. Otherwise
//! the value set in SMaterial::MaterialTypeParam is taken. This
//! value depends on with which scale the texture is mapped on
//! the material. Too high or low values of MaterialTypeParam
//! can result in strange artifacts.
//! Just like EMT_NORMAL_MAP_SOLID, but uses parallax mapping.
/** Looks a lot more realistic. This only works when the
hardware supports at least vertex shader 1.1 and pixel shader
1.4. First texture is the color map, the second should be the
normal map. The normal map texture should contain the height
value in the alpha component. The
IVideoDriver::makeNormalMapTexture() method writes this value
automatically when creating normal maps from a heightmap when
using a 32 bit texture. The height scale of the material
(affecting the bumpiness) is being controlled by the
SMaterial::MaterialTypeParam member. If set to zero, the
default value (0.02f) will be applied. Otherwise the value set
in SMaterial::MaterialTypeParam is taken. This value depends on
with which scale the texture is mapped on the material. Too
high or low values of MaterialTypeParam can result in strange
artifacts. */
EMT_PARALLAX_MAP_SOLID,
//! A material just like EMT_PARALLAX_MAP_SOLID, but it is
//! transparent, using EMT_TRANSPARENT_ADD_COLOR as base
//! material.
//! A material like EMT_PARALLAX_MAP_SOLID, but transparent.
/** Using EMT_TRANSPARENT_ADD_COLOR as base material. */
EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR,
//! A material just like EMT_PARALLAX_MAP_SOLID, but it is
//! transparent, using EMT_TRANSPARENT_VERTEX_ALPHA as base
//! material.
//! A material like EMT_PARALLAX_MAP_SOLID, but transparent.
/** Using EMT_TRANSPARENT_VERTEX_ALPHA as base material. */
EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA,
//! BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC )
//! Using only first texture. Generic blending method.
/** Using only first texture. Generic blending method. */
EMT_ONETEXTURE_BLEND,
//! This value is not used. It only forces this enumeration to
//! compile in 32 bit.
//! This value is not used. It only forces this enumeration to compile to 32 bit.
EMT_FORCE_32BIT = 0x7fffffff
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -33,3 +33,4 @@ enum EMESSAGE_BOX_FLAG
} // namespace irr
#endif

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -46,8 +46,7 @@ namespace scene
//! Unknown scene node animator
ESNAT_UNKNOWN,
//! This enum is never used, it only forces the compiler to
//! compile these enumeration values to 32 bit.
//! This enum is never used, it only forces the compiler to compile this enumeration to 32 bit.
ESNAT_FORCE_32_BIT = 0x7fffffff
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -70,11 +70,11 @@ namespace scene
ESNT_MD3_SCENE_NODE = MAKE_IRR_ID('m','d','3','_'),
//! Maya Camera Scene Node
//! Legacy, for loading version <= 1.4.x .irr files
/** Legacy, for loading version <= 1.4.x .irr files */
ESNT_CAMERA_MAYA = MAKE_IRR_ID('c','a','m','M'),
//! First Person Shooter Camera
//! Legacy, for loading version <= 1.4.x .irr files
/** Legacy, for loading version <= 1.4.x .irr files */
ESNT_CAMERA_FPS = MAKE_IRR_ID('c','a','m','F'),
//! Unknown scene node

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2007-2008 Nikolaus Gebhardt / Thomas Alten
// Copyright (C) 2007-2009 Nikolaus Gebhardt / Thomas Alten
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -146,7 +146,7 @@ namespace scene
setTarget() will update its rotation so that its +Z axis will
point at the target point. FPS camera use this binding by
default; other cameras do not.
\param binding true to bind the camera's scene node rotation
\param bound True to bind the camera's scene node rotation
and targetting, false to unbind them.
@see getTargetAndRotationBinding() */
virtual void bindTargetAndRotation(bool bound) = 0;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2008 Nikolaus Gebhardt
// Copyright (C) 2008-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -358,7 +358,7 @@ struct SJoystickInfo
//! The ID of the joystick
/** This is an internal Irrlicht index; it does not map directly
* to any particular hardware joystick. It corresponds to the
* @ref SJoystickEvent Joystick ID. */
* irr::SJoystickEvent Joystick ID. */
u8 Joystick;
//! The name that the joystick uses to identify itself.

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -52,6 +52,21 @@ public:
*/
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const c8* fileName, bool deleteMemoryWhenDropped=false) = 0;
//! Creates an IWriteFile interface for accessing memory like a file.
/** This allows you to use a pointer to memory where an IWriteFile is requested.
You are responsible for allocating enough memory.
\param memory: A pointer to the start of the file in memory (allocated by you)
\param len: The length of the memory in bytes
\param fileName: The name given to this file
\param deleteMemoryWhenDropped: True if the memory should be deleted
along with the IWriteFile when it is dropped.
\return Returns a pointer to the created file interface.
The returned pointer should be dropped when no longer needed.
See IReferenceCounted::drop() for more information.
*/
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const c8* fileName, bool deleteMemoryWhenDropped=false) = 0;
//! Opens a file for write access.
/** \param filename: Name of file to open.
\param append: If the file already exist, all write operations are
@ -119,7 +134,9 @@ public:
//! Returns the base part of a filename, i.e. the name without the directory
//! part. If no directory is prefixed, the full name is returned.
/** \param filename: The file to get the basename from */
/** \param filename: The file to get the basename from
\param keepExtension True if filename with extension is returned otherwise everything
after the final '.' is removed as well. */
virtual core::stringc getFileBasename(const core::stringc& filename, bool keepExtension=true) const = 0;
//! Creates a list of files and directories in the current working directory and returns it.

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -44,10 +44,10 @@ namespace gui
virtual void setSelected(s32 idx) = 0;
//! Sets text justification of the text area
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
\param vertical: EGUIA_UPPERLEFT to align with top edge,
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
\param vertical: EGUIA_UPPERLEFT to align with top edge,
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -36,9 +36,7 @@ namespace gui
\param checked: Specifies if the menu item should be initially checked.
\return Returns the index of the new item */
virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
bool hasSubMenu=false,
bool checked=false
) = 0;
bool hasSubMenu=false, bool checked=false) = 0;
//! Adds a separator item to the menu
virtual void addSeparator() = 0;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -61,7 +61,7 @@ namespace gui
virtual void setWordWrap(bool enable) = 0;
//! Checks if word wrap is enabled
//! \return true if word wrap is enabled, false otherwise
/** \return true if word wrap is enabled, false otherwise */
virtual bool isWordWrapEnabled() const = 0;
//! Enables or disables newlines.
@ -70,15 +70,15 @@ namespace gui
virtual void setMultiLine(bool enable) = 0;
//! Checks if multi line editing is enabled
//! \return true if mult-line is enabled, false otherwise
/** \return true if mult-line is enabled, false otherwise */
virtual bool isMultiLineEnabled() const = 0;
//! Enables or disables automatic scrolling with cursor position
//! \param enable: If set to true, the text will move around with the cursor position
/** \param enable: If set to true, the text will move around with the cursor position */
virtual void setAutoScroll(bool enable) = 0;
//! Checks to see if automatic scrolling is enabled
//! \return true if automatic scrolling is enabled, false if not
/** \return true if automatic scrolling is enabled, false if not */
virtual bool isAutoScrollEnabled() const = 0;
//! Sets whether the edit box is a password box. Setting this to true will
@ -91,8 +91,8 @@ namespace gui
virtual bool isPasswordBox() const = 0;
//! Gets the size area of the text in the edit box
//! \return Returns the size in pixels of the text
virtual core::dimension2di getTextDimension() = 0;
/** \return The size in pixels of the text */
virtual core::dimension2du getTextDimension() = 0;
//! Sets the maximum amount of characters which may be entered in the box.
/** \param max: Maximum amount of characters. If 0, the character amount is

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -83,7 +83,7 @@ public:
//! Sets the relative rectangle of this element.
/** \param r The absolute position to set */
/** \param r The absolute position to set */
void setRelativePosition(const core::rect<s32>& r)
{
if (Parent)
@ -107,22 +107,22 @@ public:
}
//! Sets the relative rectangle of this element, maintaining its current width and height
/** \param position The new relative position to set. Width and height will not be changed. */
/** \param position The new relative position to set. Width and height will not be changed. */
void setRelativePosition(const core::position2di & position)
{
const core::dimension2di mySize = RelativeRect.getSize();
const core::rect<s32> rectangle(position.X, position.Y,
position.X + mySize.Width, position.Y + mySize.Height);
const core::rect<s32> rectangle(position.X, position.Y,
position.X + mySize.Width, position.Y + mySize.Height);
setRelativePosition(rectangle);
}
//! Sets the relative rectangle of this element as a proportion of its parent's area.
/** \note This method used to be 'void setRelativePosition(const core::rect<f32>& r)'
\param r The rectangle to set, interpreted as a proportion of the parent's area.
\param r The rectangle to set, interpreted as a proportion of the parent's area.
Meaningful values are in the range [0...1], unless you intend this element to spill
outside its parent. */
void setRelativePositionProportional(const core::rect<f32>& r)
void setRelativePositionProportional(const core::rect<f32>& r)
{
if (!Parent)
return;
@ -156,7 +156,7 @@ public:
//! Sets whether the element will ignore its parent's clipping rectangle
/** \param noClip If true, the element will not be clipped by its parent's clipping rectangle. */
/** \param noClip If true, the element will not be clipped by its parent's clipping rectangle. */
void setNotClipped(bool noClip)
{
NoClip = noClip;
@ -173,7 +173,7 @@ public:
//! Sets the maximum size allowed for this element
/** If set to 0,0, there is no maximum size */
void setMaxSize(core::dimension2di size)
void setMaxSize(core::dimension2du size)
{
MaxSize = size;
updateAbsolutePosition();
@ -181,7 +181,7 @@ public:
//! Sets the minimum size allowed for this element
void setMinSize(core::dimension2di size)
void setMinSize(core::dimension2du size)
{
MinSize = size;
if (MinSize.Width < 1)
@ -222,7 +222,6 @@ public:
{
core::rect<s32> parentAbsolute(0,0,0,0);
core::rect<s32> parentAbsoluteClip;
s32 diffx, diffy;
f32 fw=0.f, fh=0.f;
if (Parent)
@ -240,8 +239,8 @@ public:
parentAbsoluteClip = Parent->AbsoluteClippingRect;
}
diffx = parentAbsolute.getWidth() - LastParentRect.getWidth();
diffy = parentAbsolute.getHeight() - LastParentRect.getHeight();
const s32 diffx = parentAbsolute.getWidth() - LastParentRect.getWidth();
const s32 diffy = parentAbsolute.getHeight() - LastParentRect.getHeight();
if (AlignLeft == EGUIA_SCALE || AlignRight == EGUIA_SCALE)
fw = (f32)parentAbsolute.getWidth();
@ -315,13 +314,13 @@ public:
const s32 h = RelativeRect.getHeight();
// make sure the desired rectangle is allowed
if (w < MinSize.Width)
if (w < (s32)MinSize.Width)
RelativeRect.LowerRightCorner.X = RelativeRect.UpperLeftCorner.X + MinSize.Width;
if (h < MinSize.Height)
if (h < (s32)MinSize.Height)
RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MinSize.Height;
if (MaxSize.Width && w > MaxSize.Width)
if (MaxSize.Width && w > (s32)MaxSize.Width)
RelativeRect.LowerRightCorner.X = RelativeRect.UpperLeftCorner.X + MaxSize.Width;
if (MaxSize.Height && h > MaxSize.Height)
if (MaxSize.Height && h > (s32)MaxSize.Height)
RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MaxSize.Height;
RelativeRect.repair();
@ -345,7 +344,18 @@ public:
}
//! Returns the child element, which is at the position of the point.
//! Returns the topmost GUI element at the specific position.
/**
This will check this GUI element and all of its descendants, so it
may return this GUI element. To check all GUI elements, call this
function on device->getGUIEnvironment()->getRootGUIElement(). Note
that the root element is the size of the screen, so doing so (with
an on-screen point) will always return the root element if no other
element is above it at that point.
\param point: The point at which to find a GUI element.
\return The topmost GUI element at that point, or 0 if there are
no candidate elements at this point.
*/
IGUIElement* getElementFromPoint(const core::position2d<s32>& point)
{
IGUIElement* target = 0;
@ -356,6 +366,7 @@ public:
core::list<IGUIElement*>::Iterator it = Children.getLast();
if (IsVisible)
{
while(it != Children.end())
{
target = (*it)->getElementFromPoint(point);
@ -364,6 +375,7 @@ public:
--it;
}
}
if (IsVisible && isPointInside(point))
target = this;
@ -373,12 +385,13 @@ public:
//! Returns true if a point is within this element.
//! Elements with a shape other than a rectangle will override this method
/** Elements with a shape other than a rectangle should override this method */
virtual bool isPointInside(const core::position2d<s32>& point) const
{
return AbsoluteClippingRect.isPointInside(point);
}
//! Adds a GUI element as new child of this element.
virtual void addChild(IGUIElement* child)
{
@ -470,19 +483,18 @@ public:
}
//! Sets whether this control was created as part of its parent,
//! for example when a scrollbar is part of a listbox.
//! SubElements are not saved to disk when calling guiEnvironment->saveGUI()
//! Sets whether this control was created as part of its parent.
/** For example, it is true when a scrollbar is part of a listbox.
SubElements are not saved to disk when calling guiEnvironment->saveGUI() */
virtual void setSubElement(bool subElement)
{
IsSubElement = subElement;
}
//! If set to true, the focus will visit this element when using
//! the tab key to cycle through elements.
//! If this element is a tab group (see isTabGroup/setTabGroup) then
//! ctrl+tab will be used instead.
//! If set to true, the focus will visit this element when using the tab key to cycle through elements.
/** If this element is a tab group (see isTabGroup/setTabGroup) then
ctrl+tab will be used instead. */
void setTabStop(bool enable)
{
IsTabStop = enable;
@ -497,9 +509,9 @@ public:
}
//! Sets the priority of focus when using the tab key to navigate between a group
//! of elements. See setTabGroup, isTabGroup and getTabGroup for information on tab groups.
//! Elements with a lower number are focused first
//! Sets the priority of focus when using the tab key to navigate between a group of elements.
/** See setTabGroup, isTabGroup and getTabGroup for information on tab groups.
Elements with a lower number are focused first */
void setTabOrder(s32 index)
{
// negative = autonumber
@ -534,9 +546,9 @@ public:
}
//! Sets whether this element is a container for a group of elements which
//! can be navigated using the tab key. For example, windows are tab groups.
//! Groups can be navigated using ctrl+tab, providing isTabStop is true.
//! Sets whether this element is a container for a group of elements which can be navigated using the tab key.
/** For example, windows are tab groups.
Groups can be navigated using ctrl+tab, providing isTabStop is true. */
void setTabGroup(bool isGroup)
{
IsTabGroup = isGroup;
@ -551,8 +563,7 @@ public:
}
//! Returns the container element which holds all elements in this element's
//! tab group.
//! Returns the container element which holds all elements in this element's tab group.
IGUIElement* getTabGroup()
{
IGUIElement *ret=this;
@ -629,7 +640,7 @@ public:
//! Brings a child to front
/** \return Returns true if successful, false if not. */
/** \return True if successful, false if not. */
virtual bool bringToFront(IGUIElement* element)
{
core::list<IGUIElement*>::Iterator it = Children.begin();
@ -702,13 +713,13 @@ public:
//! searches elements to find the closest next element to tab to
//! \param startOrder: The TabOrder of the current element, -1 if none
//! \param reverse: true if searching for a lower number
//! \param group: true if searching for a higher one
//! \param first: element with the highest/lowest known tab order depending on search direction
//! \param closest: the closest match, depending on tab order and direction
//! \param includeInvisible: includes invisible elements in the search (default=false)
//! \return true if successfully found an element, false to continue searching/fail
/** \param startOrder: The TabOrder of the current element, -1 if none
\param reverse: true if searching for a lower number
\param group: true if searching for a higher one
\param first: element with the highest/lowest known tab order depending on search direction
\param closest: the closest match, depending on tab order and direction
\param includeInvisible: includes invisible elements in the search (default=false)
\return true if successfully found an element, false to continue searching/fail */
bool getNextElement(s32 startOrder, bool reverse, bool group,
IGUIElement*& first, IGUIElement*& closest, bool includeInvisible=false) const
{
@ -805,8 +816,8 @@ public:
//! Writes attributes of the scene node.
//! Implement this to expose the attributes of your scene node for
//! scripting languages, editors, debuggers or xml serialization purposes.
/** Implement this to expose the attributes of your scene node for
scripting languages, editors, debuggers or xml serialization purposes. */
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
{
out->addInt("Id", ID );
@ -828,8 +839,8 @@ public:
//! Reads attributes of the scene node.
//! Implement this to set the attributes of your scene node for
//! scripting languages, editors, debuggers or xml deserialization purposes.
/** Implement this to set the attributes of your scene node for
scripting languages, editors, debuggers or xml deserialization purposes. */
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
setID(in->getAttributeAsInt("Id"));
@ -841,10 +852,10 @@ public:
TabOrder = in->getAttributeAsInt("TabOrder");
core::position2di p = in->getAttributeAsPosition2d("MaxSize");
setMaxSize(core::dimension2di(p.X,p.Y));
setMaxSize(core::dimension2du(p.X,p.Y));
p = in->getAttributeAsPosition2d("MinSize");
setMinSize(core::dimension2di(p.X,p.Y));
setMinSize(core::dimension2du(p.X,p.Y));
setNotClipped(in->getAttributeAsBool("NoClip"));
setAlignment((EGUI_ALIGNMENT) in->getAttributeAsEnumeration("LeftAlign", GUIAlignmentNames),
@ -883,7 +894,7 @@ protected:
core::rect<f32> ScaleRect;
//! maximum and minimum size of the element
core::dimension2di MaxSize, MinSize;
core::dimension2du MaxSize, MinSize;
//! is visible?
bool IsVisible;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -62,8 +62,7 @@ class IGUIEnvironment : public virtual IReferenceCounted
{
public:
//! Draws all gui elements by traversing the GUI environment starting
//! at the root node.
//! Draws all gui elements by traversing the GUI environment starting at the root node.
virtual void drawAll() = 0;
//! Sets the focus to an element.
@ -75,7 +74,7 @@ public:
virtual bool setFocus(IGUIElement* element) = 0;
//! Returns the element which holds the focus.
//! \return Pointer to the element with focus.
/** \return Pointer to the element with focus. */
virtual IGUIElement* getFocus() const = 0;
//! Removes the focus from an element.
@ -91,15 +90,15 @@ public:
virtual bool hasFocus(IGUIElement* element) const = 0;
//! Returns the current video driver.
//! \return Pointer to the video driver.
/** \return Pointer to the video driver. */
virtual video::IVideoDriver* getVideoDriver() const = 0;
//! Returns the file system.
//! \return Pointer to the file system.
/** \return Pointer to the file system. */
virtual io::IFileSystem* getFileSystem() const = 0;
//! returns a pointer to the OS operator
//! \return Pointer to the OS operator.
/** \return Pointer to the OS operator. */
virtual IOSOperator* getOSOperator() const = 0;
//! Removes all elements from the environment.
@ -119,7 +118,7 @@ public:
virtual void setUserEventReceiver(IEventReceiver* evr) = 0;
//! Returns pointer to the current gui skin.
//! \return Pointer to the GUI skin.
/** \return Pointer to the GUI skin. */
virtual IGUISkin* getSkin() const = 0;
//! Sets a new GUI Skin
@ -173,10 +172,10 @@ public:
virtual IGUISpriteBank* addEmptySpriteBank(const c8 *name) = 0;
//! Returns the root gui element.
/** This is the first gui element, parent of all other
gui elements. You'll never need to use this method, unless you are
creating your own gui elements, trying to add them to the gui elements
without a parent.
/** This is the first gui element, the (direct or indirect) parent of all
other gui elements. It is a valid IGUIElement, with dimensions the same
size as the screen. You should not need to use this method directly, unless
you wish to reparent GUI elements to the top level.
\return Pointer to the root element of the GUI. The returned pointer
should not be dropped. See IReferenceCounted::drop() for more
information. */
@ -208,10 +207,10 @@ public:
virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false,
const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a modal screen. This control stops its parent's members from
//! being able to recieve input until its last child is removed, it
//! then deletes itself.
/** \param parent Parent gui element of the modal.
//! Adds a modal screen.
/** This control stops its parent's members from being able to receive
input until its last child is removed, it then deletes itself.
\param parent Parent gui element of the modal.
\return Pointer to the created modal. Returns 0 if an error occured.
This pointer should not be dropped. See IReferenceCounted::drop() for
more information. */
@ -434,7 +433,7 @@ public:
IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a menu to the environment.
/* This is like the menu you can find on top of most windows in modern
/** This is like the menu you can find on top of most windows in modern
graphical user interfaces.
\param parent Parent item of the element, e.g. a window.
Set it to 0 to place the menu directly in the environment.
@ -467,7 +466,15 @@ public:
IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a table to the environment
virtual IGUITable* addTable(const core::rect<s32>& rectangle,
/** \param rectangle Position and dimension of the table.
\param parent Parent item of the element, e.g. a window. Set it to 0
to place the element directly in the environment.
\param id An identifier for the table.
\param drawBackground Flag whether the background should be drawn.
\return Pointer to the created table. Returns 0 if an error occured.
This pointer should not be dropped. See IReferenceCounted::drop() for
more information. */
virtual IGUITable* addTable(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, bool drawBackground = false) = 0;
//! Returns the default element factory which can create all built in elements
@ -484,7 +491,7 @@ public:
virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0;
//! Returns amount of registered gui element factories.
//! \return Amount of registered gui element factories.
/** \return Amount of registered gui element factories. */
virtual u32 getRegisteredGUIElementFactoryCount() const = 0;
//! Returns a gui element factory by index
@ -494,23 +501,23 @@ public:
virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0;
//! Saves the current gui into a file.
//! \param filename Name of the file.
//! \param start The GUIElement to start with. Root if 0.
/** \param filename Name of the file.
\param start The GUIElement to start with. Root if 0. */
virtual bool saveGUI(const c8* filename, IGUIElement* start=0) = 0;
//! Saves the current gui into a file.
//! \param file The file to write to.
//! \param start The GUIElement to start with. Root if 0.
/** \param file The file to write to.
\param start The GUIElement to start with. Root if 0. */
virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0;
//! Loads the gui. Note that the current gui is not cleared before.
//! \param filename Name of the file .
//! \param parent Parent for the loaded GUI, root if 0.
/** \param filename Name of the file.
\param parent Parent for the loaded GUI, root if 0. */
virtual bool loadGUI(const c8* filename, IGUIElement* parent=0) = 0;
//! Loads the gui. Note that the current gui is not cleared before.
//! \param file The file to load from.
//! \param parent Parent for the loaded GUI, root if 0.
/** \param file The file to load from.
\param parent Parent for the loaded GUI, root if 0. */
virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0;
//! Writes attributes of the gui environment
@ -523,7 +530,7 @@ public:
virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) =0;
//! reads an element
virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* parent) =0;
virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) =0;
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -21,13 +21,13 @@ enum EGUI_FONT_TYPE
EGFT_BITMAP = 0,
//! Scalable vector fonts loaded from an XML file.
//! These fonts reside in system memory and use no video memory
//! until they are displayed. These are slower than bitmap fonts
//! but can be easily scaled and rotated.
/** These fonts reside in system memory and use no video memory
until they are displayed. These are slower than bitmap fonts
but can be easily scaled and rotated. */
EGFT_VECTOR,
//! A font which uses a the native API provided by the operating system.
//! Currently not used.
/** Currently not used. */
EGFT_OS,
//! An external font type provided by the user.
@ -54,7 +54,7 @@ public:
//! Calculates the dimension of a text.
/** \return Returns width and height of the area covered by the text if
it would be drawn. */
virtual core::dimension2d<s32> getDimension(const wchar_t* text) const = 0;
virtual core::dimension2d<u32> getDimension(const wchar_t* text) const = 0;
//! Calculates the index of the character in the text which is on a specific position.
/** \param text: Text string.
@ -66,8 +66,10 @@ public:
//! Returns the type of this font
virtual EGUI_FONT_TYPE getType() const { return EGFT_CUSTOM; }
//! Sets global kerning for the font.
//! Sets global kerning width for the font.
virtual void setKerningWidth (s32 kerning) = 0;
//! Sets global kerning height for the font.
virtual void setKerningHeight (s32 kerning) = 0;
//! Gets kerning values (distance between letters) for the font. If no parameters are provided,

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -36,22 +36,23 @@ namespace gui
virtual video::SColor getColor() const = 0;
//! Sets the color to fade out to or to fade in from.
//! \param color: Color to where it is faded out od from it is faded in.
/** \param color: Color to where it is faded out od from it is faded in. */
virtual void setColor(video::SColor color) = 0;
virtual void setColor(video::SColor source, video::SColor dest) = 0;
//! Starts the fade in process. In the beginning the whole rect is drawn by
//! the set color (black by default) and at the end of the overgiven
//! time the color has faded out.
//! \param time: Time specifing how long it should need to fade in,
//! in milliseconds.
//! Starts the fade in process.
/** In the beginning the whole rect is drawn by the set color
(black by default) and at the end of the overgiven time the
color has faded out.
\param time: Time specifing how long it should need to fade in,
in milliseconds. */
virtual void fadeIn(u32 time) = 0;
//! Starts the fade out process. In the beginning everything is visible,
//! and at the end of the time only the set color (black by the fault)
//! will be drawn.
//! \param time: Time specifing how long it should need to fade out,
//! in milliseconds.
//! Starts the fade out process.
/** In the beginning everything is visible, and at the end of
the time only the set color (black by the fault) will be drawn.
\param time: Time specifing how long it should need to fade out,
in milliseconds. */
virtual void fadeOut(u32 time) = 0;
//! Returns if the fade in or out process is done.

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -12,7 +12,6 @@ namespace irr
{
namespace gui
{
class IGUIFont;
class IGUISpriteBank;
//! Enumeration for listbox colors
@ -49,10 +48,9 @@ namespace gui
virtual u32 addItem(const wchar_t* text) = 0;
//! adds an list item with an icon
//! \param text Text of list entry
//! \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon
//! \return
//! returns the id of the new created item
/** \param text Text of list entry
\param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon
\return The id of the new created item */
virtual u32 addItem(const wchar_t* text, s32 icon) = 0;
//! Removes an item from the list
@ -61,10 +59,11 @@ namespace gui
//! Returns the icon of an item
virtual s32 getIcon(u32 index) const = 0;
//! Sets the sprite bank which should be used to draw list icons. This font is set to the sprite bank of
//! the built-in-font by default. A sprite can be displayed in front of every list item.
//! An icon is an index within the icon sprite bank. Several default icons are available in the
//! skin through getIcon
//! Sets the sprite bank which should be used to draw list icons.
/** This font is set to the sprite bank of the built-in-font by
default. A sprite can be displayed in front of every list item.
An icon is an index within the icon sprite bank. Several
default icons are available in the skin through getIcon. */
virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
//! clears the list, deletes all items in the listbox
@ -76,8 +75,7 @@ namespace gui
//! sets the selected item. Set this to -1 if no item should be selected
virtual void setSelected(s32 index) = 0;
//! set whether the listbox should scroll to show a newly selected item
//! or a new item as it is added to the list.
//! set whether the listbox should scroll to new or newly selected items
virtual void setAutoScrollEnabled(bool scroll) = 0;
//! returns true if automatic scrolling is enabled, false if not.
@ -108,7 +106,7 @@ namespace gui
virtual void setItem(u32 index, const wchar_t* text, s32 icon) = 0;
//! Insert the item at the given index
//! Return the index on success or -1 on failure.
/** \return The index on success or -1 on failure. */
virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) = 0;
//! Swap the items at the given indices

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -30,15 +30,17 @@ namespace gui
//! gets the small step value
virtual s32 getSmallStep() const = 0;
//! Sets the small step, the amount that the value changes by when clicking
//! on the buttons or using the cursor keys.
//! Sets the small step
/** That is the amount that the value changes by when clicking
on the buttons or using the cursor keys. */
virtual void setSmallStep(s32 step) = 0;
//! gets the large step value
virtual s32 getLargeStep() const = 0;
//! Sets the large step, the amount that the value changes by when clicking
//! in the tray, or using the page up and page down keys.
//! Sets the large step
/** That is the amount that the value changes by when clicking
in the tray, or using the page up and page down keys. */
virtual void setLargeStep(s32 step) = 0;
//! gets the current position of the scrollbar

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -460,7 +460,8 @@ namespace gui
implementations to find out how to draw the part exactly.
\param active: Specifies if the tab is currently active.
\param rect: Defining area where to draw.
\param clip: Clip area. */
\param clip: Clip area.
\param alignment Alignment of GUI element. */
virtual void draw3DTabButton(IGUIElement* element, bool active,
const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
@ -471,7 +472,9 @@ namespace gui
\param border: Specifies if the border should be drawn.
\param background: Specifies if the background should be drawn.
\param rect: Defining area where to draw.
\param clip: Clip area. */
\param clip: Clip area.
\param tabHeight Height of tab.
\param alignment Alignment of GUI element. */
virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
@ -511,6 +514,3 @@ namespace gui
#endif

View File

@ -1,4 +1,4 @@
// Copyright (C) 2006-2008 Michael Zeilfelder
// Copyright (C) 2006-2009 Michael Zeilfelder
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -29,7 +29,7 @@ namespace gui
virtual void setOverrideFont(IGUIFont* font=0) = 0;
//! Gets the override font (if any)
//! \return The override font (may be 0)
/** \return The override font (may be 0) */
virtual IGUIFont* getOverrideFont(void) const = 0;
//! Sets another color for the text.
@ -43,7 +43,7 @@ namespace gui
virtual void setOverrideColor(video::SColor color) = 0;
//! Gets the override color
//! \return: The override color
/** \return: The override color */
virtual video::SColor const& getOverrideColor(void) const = 0;
//! Sets if the static text should use the overide color or the color in the gui skin.
@ -53,7 +53,7 @@ namespace gui
virtual void enableOverrideColor(bool enable) = 0;
//! Checks if an override color is enabled
//! \return true if the override color is enabled, false otherwise
/** \return true if the override color is enabled, false otherwise */
virtual bool isOverrideColorEnabled(void) const = 0;
//! Sets another color for the background.
@ -78,7 +78,7 @@ namespace gui
virtual void setWordWrap(bool enable) = 0;
//! Checks if word wrap is enabled
//! \return true if word wrap is enabled, false otherwise
/** \return true if word wrap is enabled, false otherwise */
virtual bool isWordWrapEnabled(void) const = 0;
//! Returns the height of the text in pixels when it is drawn.

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -87,7 +87,7 @@ namespace gui
virtual s32 getTabHeight() const = 0;
//! Set the alignment of the tabs
//! Use EGUIA_UPPERLEFT or EGUIA_LOWERRIGHT
/** Use EGUIA_UPPERLEFT or EGUIA_LOWERRIGHT */
virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0;
//! Get the alignment of the tabs
@ -108,7 +108,3 @@ namespace gui
#endif

View File

@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Nikolaus Gebhardt
// Copyright (C) 2003-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -21,7 +21,7 @@ namespace gui
//! Do not use ordering
EGCO_NONE,
//! Send a EGET_TABLE_HEADER_CHANGED message when a column header is clicked.
//! Send a EGET_TABLE_HEADER_CHANGED message when a column header is clicked.
EGCO_CUSTOM,
//! Sort it ascending by it's ascii value like: a,b,c,...
@ -48,7 +48,7 @@ namespace gui
0,
};
enum EGUI_ORDERING_MODE
enum EGUI_ORDERING_MODE
{
//! No element ordering
EGOM_NONE,
@ -66,6 +66,7 @@ namespace gui
const c8* const GUIOrderingModeNames[] =
{
"none",
"ascending",
"descending",
0
@ -79,8 +80,6 @@ namespace gui
EGTDF_COUNT
};
class IGUIFont;
//! Default list box GUI element.
class IGUITable : public IGUIElement
{
@ -90,7 +89,7 @@ namespace gui
: IGUIElement(EGUIET_TABLE, environment, parent, id, rectangle) {}
//! Adds a column
//! If columnIndex is outside the current range, do push new colum at the end
/** If columnIndex is outside the current range, do push new colum at the end */
virtual void addColumn(const wchar_t* caption, s32 columnIndex=-1) = 0;
//! remove a column from the table
@ -101,8 +100,8 @@ namespace gui
//! Makes a column active. This will trigger an ordering process.
/** \param idx: The id of the column to make active.
//! \param doOrder: Do also the ordering which depending on mode for active column
\return Returns true if successful. */
\param doOrder: Do also the ordering which depending on mode for active column
\return True if successful. */
virtual bool setActiveColumn(s32 idx, bool doOrder=false) = 0;
//! Returns which header is currently active
@ -113,18 +112,16 @@ namespace gui
//! Set the width of a column
virtual void setColumnWidth(u32 columnIndex, u32 width) = 0;
//! columns can be resized by drag 'n drop
virtual void setResizableColumns(bool resizable) = 0;
//! can columns be resized by dran 'n drop?
virtual bool hasResizableColumns() const = 0;
//! This tells the table control which ordering mode should be used when
//! a column header is clicked.
/** \param columnIndex: The index of the column header.
\param state: If true, a EGET_TABLE_HEADER_CHANGED message will be sent and you can order the table data as you whish.*/
//! \param mode: One of the modes defined in EGUI_COLUMN_ORDERING
//! This tells the table control which ordering mode should be used when a column header is clicked.
/** \param columnIndex The index of the column header.
\param mode: One of the modes defined in EGUI_COLUMN_ORDERING */
virtual void setColumnOrdering(u32 columnIndex, EGUI_COLUMN_ORDERING mode) = 0;
//! Returns which row is currently selected
@ -134,10 +131,12 @@ namespace gui
virtual s32 getRowCount() const = 0;
//! adds a row to the table
/** \param rowIndex: zero based index of rows. The row will be inserted at this
position, if a row already exist there, it will be placed after it. If the row
is larger than the actual number of row by more than one, it won't be created.
Note that if you create a row that's not at the end, there might be performance issues*/
/** \param rowIndex Zero based index of rows. The row will be
inserted at this position, if a row already exist there, it
will be placed after it. If the row is larger than the actual
number of row by more than one, it won't be created. Note that
if you create a row that's not at the end, there might be
performance issues. */
virtual void addRow(u32 rowIndex) = 0;
//! Remove a row from the table
@ -149,11 +148,13 @@ namespace gui
//! Swap two row positions. This is useful for a custom ordering algo.
virtual void swapRows(u32 rowIndexA, u32 rowIndexB) = 0;
//! This tells the table to start ordering all the rows. You need to explicitly
//! tell the table to re order the rows when a new row is added or the cells data is
//! changed. This makes the system more flexible and doesn't make you pay the cost of
//! ordering when adding a lot of rows.
//! \param columnIndex: When set to -1 the active column is used.
//! This tells the table to start ordering all the rows.
/** You need to explicitly tell the table to re order the rows
when a new row is added or the cells data is changed. This
makes the system more flexible and doesn't make you pay the
cost of ordering when adding a lot of rows.
\param columnIndex: When set to -1 the active column is used.
\param mode Ordering mode of the rows. */
virtual void orderRows(s32 columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE) = 0;
//! Set the text of a cell

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -58,7 +58,7 @@ public:
virtual void unlock() = 0;
//! Returns width and height of image data.
virtual const core::dimension2d<s32>& getDimension() const = 0;
virtual const core::dimension2d<u32>& getDimension() const = 0;
//! Returns bits per pixel.
virtual u32 getBitsPerPixel() const = 0;
@ -97,7 +97,7 @@ public:
virtual u32 getPitch() const =0;
//! Copies the image into the target, scaling the image to fit
virtual void copyToScaling(void* target, s32 width, s32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0;
virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0;
//! Copies the image into the target, scaling the image to fit
virtual void copyToScaling(IImage* target) =0;

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

View File

@ -1,4 +1,4 @@
// Copyright (C) 2008 Nikolaus Gebhardt
// Copyright (C) 2008-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

60
include/ILightManager.h Normal file
View File

@ -0,0 +1,60 @@
// Written by Colin MacDonald - all rights assigned to 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
#ifndef __I_LIGHT_MANAGER_H_INCLUDED__
#define __I_LIGHT_MANAGER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrArray.h"
namespace irr
{
namespace scene
{
class ILightSceneNode;
//! 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:
//! Called after the scene's light list has been built, but before rendering has begun.
//! As actual device/hardware lights are not created until the ESNRP_LIGHT render pass,
//! this provides an opportunity for the light manager to trim or re-order the light
//! list, before any device/hardware lights have actually been created.
//! \param[in] smgr: the Scene Manager
//! \param[inout] lightLight: the Scene Manager's light list, which the light manager may
//! modify. This reference will remain valid until OnPostRender().
virtual void OnPreRender(core::array<ILightSceneNode*> & lightList) = 0;
//! Called after the last scene node is rendered.
//! After this call returns, the lightList passed to OnPreRender() becomes invalid.
virtual void OnPostRender(void) = 0;
//! Called before a render pass begins
//! \param[in] renderPass: the render pass that's about to begin
virtual void OnRenderPassPreRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0;
//! Called after the render pass specified in OnRenderPassPreRender() ends
//! \param[in] renderPass: the render pass that has finished
virtual void OnRenderPassPostRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0;
//! Called before the given scene node is rendered
//! \param[in] node: the scene node that's about to be rendered
virtual void OnNodePreRender(ISceneNode* node) = 0;
//! Called after the the node specified in OnNodePreRender() has been rendered
//! \param[in] node: the scene node that has just been rendered
virtual void OnNodePostRender(ISceneNode* node) = 0;
};
} // end namespace scene
} // end namespace irr
#endif

Some files were not shown because too many files have changed in this diff Show More