Commit 8db1da30 authored by hybrid's avatar hybrid

Merge revisions 1572:1596 from 1.4 branch: Some late bugfixes of the 1.4.2...

Merge revisions 1572:1596 from 1.4 branch: Some late bugfixes of the 1.4.2 release. Tutorial generation mechanism.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1598 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9d3b46ab
Changes in version 1.5 (... 2008) Changes in version 1.5 (... 2008)
- WindowsCE-Bugfix - WindowsCE-Bugfix
...@@ -209,7 +208,7 @@ Changes in version 1.5 (... 2008) ...@@ -209,7 +208,7 @@ Changes in version 1.5 (... 2008)
- Finally added StarSonata patch with table element and TabControl additions. Table is based on MultiColor listbox by Acki, and has loads of changes by CuteAlien. - Finally added StarSonata patch with table element and TabControl additions. Table is based on MultiColor listbox by Acki, and has loads of changes by CuteAlien.
------------------------------------------- -------------------------------------------
Changes in version 1.4.2 (x.x.2008) Changes in version 1.4.2 (22.9.2008)
- Unified the handling of zwrite enable with transparent materials on all hw accelerated drivers. This means that all transparent materials will now disable ZWrite, ignoring the material flag. - Unified the handling of zwrite enable with transparent materials on all hw accelerated drivers. This means that all transparent materials will now disable ZWrite, ignoring the material flag.
There is a scene manager attribute, though, which will revert this behavior to the usual SMaterial driven way. Simply call There is a scene manager attribute, though, which will revert this behavior to the usual SMaterial driven way. Simply call
......
...@@ -1277,3 +1277,40 @@ New overload/missing method (completing the findLast... and find...Char methods) ...@@ -1277,3 +1277,40 @@ New overload/missing method (completing the findLast... and find...Char methods)
Changed signature (Added return value) Changed signature (Added return value)
string<T>& trim() string<T>& trim()
Changes for Version 1.4.2
-------------------------
This is once more a bugfix release of the 1.4 branch, and hence pretty API-consistent and backward compatible. The major reason to publish this release is the OpenGL bug, which made several OpenGL 2.x drivers run in SW emulation.
However, we also introduced some driver consistency fixes, which might affect your application's behavior. So read through the next points thoroughly.
SceneParameters.h (and general video driver behavior)
The way Irrlicht handles zbuffer writing with transparent materials has changed. This was an issue ever since, because the default behavior in Irrlicht is to disable writing to the z-buffer for all really transparent, i.e. blending materials. This avoids problems with intersecting faces, but can also break renderings. And this is now consistent for both OpenGL and Direct3D.
If transparent materials should use the SMaterial flag for ZWriteEnable just as other material types use the newly introduced attribute scene::ALLOW_ZWRITE_ON_TRANSPARENT like this:
SceneManager->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true);
All transparent materials will henceforth work as specified by the material flag, until the scenemanager attribute is set to false.
SMaterialLayer.h
The texture matrix now uses irrAllocator for memory handling. This shouldn't be noticeable from the user application (besides fixed heap corruptions on Windows machines), but is still mentioned for completeness.
ISceneNode.h
Documentation error. The docs said that children of a scene node are not visible if the node itself is set to visible. This is of course wrong, children inherit non-visibility of the parent and are hence invisible if the parent is. If the parent is visible, the visibility flag of the child determines its status.
SColor.h
Removed methods (use the unsigned versions and cast in your app if necessary)
inline s32 getRedSigned(u16 color)
inline s32 getGreenSigned(u16 color)
inline s32 getBlueSigned(u16 color)
IParticleSystemSceneNode.h
Changed default values (the old direction default was no real direction)
virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter(...)
virtual IParticleCylinderEmitter* createCylinderEmitter(...)
virtual IParticleMeshEmitter* createMeshEmitter(...)
IBoneSceneNode.h
Changed signature (Made const)
virtual E_BONE_SKINNING_SPACE getSkinningSpace() const=0;
IrrlichtDevice.h
Changed signature (Return value bool instead of void). Returns whether the event has been handled somewhere.
virtual bool postEventFromUser(const SEvent& event) = 0;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* /** Example 004 Movement
This Tutorial shows how to move and animate SceneNodes. The This Tutorial shows how to move and animate SceneNodes. The
basic concept of SceneNodeAnimators is shown as well as manual basic concept of SceneNodeAnimators is shown as well as manual
movement of nodes using the keyboard. movement of nodes using the keyboard.
...@@ -11,15 +12,17 @@ and tell the linker to link with the .lib file. ...@@ -11,15 +12,17 @@ and tell the linker to link with the .lib file.
using namespace irr; using namespace irr;
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib") #pragma comment(lib, "Irrlicht.lib")
#endif
/* /*
To receive events like mouse and keyboard input, or GUI events like To receive events like mouse and keyboard input, or GUI events like "the OK
"the OK button has been clicked", we need an object which is derived from the button has been clicked", we need an object which is derived from the
IEventReceiver object. There is only one method to override: OnEvent. irr::IEventReceiver object. There is only one method to override:
This method will be called by the engine once when an event happens. irr::IEventReceiver::OnEvent(). This method will be called by the engine once
What we really want to know is whether a key is being held down, when an event happens. What we really want to know is whether a key is being
and so we will remember the current state of each key. held down, and so we will remember the current state of each key.
*/ */
class MyEventReceiver : public IEventReceiver class MyEventReceiver : public IEventReceiver
{ {
...@@ -53,10 +56,11 @@ private: ...@@ -53,10 +56,11 @@ private:
/* /*
The event receiver for moving a scene node is ready. So lets just create The event receiver for keeping the pressed keys is ready, the actual responses
an Irrlicht Device and the scene node we want to move. We also create some will be made inside the render loop, right before drawing the scene. So lets
other additional scene nodes, to show that there are also some different just create an irr::IrrlichtDevice and the scene node we want to move. We also
possibilities to move and animate scene nodes. create some other additional scene nodes, to show that there are also some
different possibilities to move and animate scene nodes.
*/ */
int main() int main()
{ {
...@@ -92,14 +96,12 @@ int main() ...@@ -92,14 +96,12 @@ int main()
if (device == 0) if (device == 0)
return 1; // could not create selected driver. return 1; // could not create selected driver.
video::IVideoDriver* driver = device->getVideoDriver(); video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager(); scene::ISceneManager* smgr = device->getSceneManager();
/* /*
Create the node for moving it with the 'W' and 'S' key. We create a Create the node which will be moved with the 'W' and 'S' key. We create a
sphere node, which is a built in geometry primitive. We place the node sphere node, which is a built-in geometry primitive. We place the node
at (0,0,30) and assign a texture to it to let it look a little bit more at (0,0,30) and assign a texture to it to let it look a little bit more
interesting. Because we have no dynamic lights in this scene we disable interesting. Because we have no dynamic lights in this scene we disable
lighting for each model (otherwise the models would be black). lighting for each model (otherwise the models would be black).
...@@ -112,15 +114,14 @@ int main() ...@@ -112,15 +114,14 @@ int main()
node->setMaterialFlag(video::EMF_LIGHTING, false); node->setMaterialFlag(video::EMF_LIGHTING, false);
} }
/*
/* Now we create another node, movable using a scene node animator. Scene
Now we create another node, moving using a scene node animator. Scene
node animators modify scene nodes and can be attached to any scene node node animators modify scene nodes and can be attached to any scene node
like mesh scene nodes, billboards, lights and even camera scene nodes. like mesh scene nodes, billboards, lights and even camera scene nodes.
Scene node animators are not only able to modify the position of a Scene node animators are not only able to modify the position of a
scene node, they can also animate the textures of an object for scene node, they can also animate the textures of an object for
example. We create a cube scene node and attach a 'fly circle' scene example. We create a cube scene node and attach a 'fly circle' scene
node to it, letting this node fly around our sphere scene node. node animator to it, letting this node fly around our sphere scene node.
*/ */
scene::ISceneNode* n = smgr->addCubeSceneNode(); scene::ISceneNode* n = smgr->addCubeSceneNode();
...@@ -138,7 +139,7 @@ int main() ...@@ -138,7 +139,7 @@ int main()
} }
/* /*
The last scene node we add to show possibilities of scene node animators is The last scene node we add to show possibilities of scene node animators is
a md2 model, which uses a 'fly straight' animator to run between to points. a md2 model, which uses a 'fly straight' animator to run between to points.
*/ */
scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/sydney.md2")); scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/sydney.md2"));
...@@ -146,7 +147,7 @@ int main() ...@@ -146,7 +147,7 @@ int main()
if (anms) if (anms)
{ {
scene::ISceneNodeAnimator* anim = scene::ISceneNodeAnimator* anim =
smgr->createFlyStraightAnimator(core::vector3df(100,0,60), smgr->createFlyStraightAnimator(core::vector3df(100,0,60),
core::vector3df(-100,0,60), 2500, true); core::vector3df(-100,0,60), 2500, true);
if (anim) if (anim)
{ {
...@@ -155,14 +156,16 @@ int main() ...@@ -155,14 +156,16 @@ int main()
} }
/* /*
To make to model look right we set the frames between which the animation To make the model look right we disable lighting, set the
should loop, rotate the model around 180 degrees, and adjust the animation speed frames between which the animation should loop, rotate the
and the texture. model around 180 degrees, and adjust the animation speed and
To set the right animation (frames and speed), we would also be able to just the texture. To set the right animation (frames and speed), we
call "anms->setMD2Animation(scene::EMAT_RUN)" for the 'run' animation would also be able to just call
instead of "setFrameLoop" and "setAnimationSpeed", "anms->setMD2Animation(scene::EMAT_RUN)" for the 'run'
but this only works with MD2 animations, and so you know how to start other animations. animation instead of "setFrameLoop" and "setAnimationSpeed",
but it a good advice to use not hardcoded frame-numbers... but this only works with MD2 animations, and so you know how to
start other animations. But a good advice is to not use
hardcoded frame-numbers...
*/ */
anms->setMaterialFlag(video::EMF_LIGHTING, false); anms->setMaterialFlag(video::EMF_LIGHTING, false);
...@@ -228,7 +231,7 @@ int main() ...@@ -228,7 +231,7 @@ int main()
{ {
core::stringw tmp(L"Movement Example - Irrlicht Engine ["); core::stringw tmp(L"Movement Example - Irrlicht Engine [");
tmp += driver->getName(); tmp += driver->getName();
tmp += L"] fps: "; tmp += L"] fps: ";
tmp += fps; tmp += fps;
device->setWindowCaption(tmp.c_str()); device->setWindowCaption(tmp.c_str());
...@@ -244,3 +247,6 @@ int main() ...@@ -244,3 +247,6 @@ int main()
return 0; return 0;
} }
/*
That's it. Compile and play around with the program.
**/
/* /** Example 005 User Interface
This tutorial shows how to use the built in User Interface of This tutorial shows how to use the built in User Interface of
the Irrlicht Engine. It will give a brief overview and show the Irrlicht Engine. It will give a brief overview and show
how to create and use windows, buttons, scroll bars, static how to create and use windows, buttons, scroll bars, static
texts and list boxes. texts, and list boxes.
As always, we include the header files, and use the irrlicht As always, we include the header files, and use the irrlicht
namespaces. We also store a pointer to the Irrlicht device, namespaces. We also store a pointer to the Irrlicht device,
...@@ -32,13 +33,13 @@ IGUIListBox* listbox = 0; ...@@ -32,13 +33,13 @@ IGUIListBox* listbox = 0;
/* /*
The Event Receiver is not only capable of getting keyboard and The Event Receiver is not only capable of getting keyboard and
mouse input events, but also events of the graphical user interface mouse input events, but also events of the graphical user interface
(gui). There are events for almost everything: Button click, (gui). There are events for almost everything: Button click,
Listbox selection change, events that say that a element was hovered Listbox selection change, events that say that a element was hovered
and so on. To be able to react to some of these events, we create and so on. To be able to react to some of these events, we create
an event receiver. an event receiver.
We only react to gui events, and if it's such an event, we get the We only react to gui events, and if it's such an event, we get the
id of the caller (the gui element which caused the event) and get id of the caller (the gui element which caused the event) and get
the pointer to the gui environment. the pointer to the gui environment.
*/ */
class MyEventReceiver : public IEventReceiver class MyEventReceiver : public IEventReceiver
...@@ -55,12 +56,12 @@ public: ...@@ -55,12 +56,12 @@ public:
{ {
/* /*
If a scrollbar changed its scroll position, and it is 'our' If a scrollbar changed its scroll position, and it is
scrollbar (the one with id 104), then we change the 'our' scrollbar (the one with id 104), then we change
transparency of all gui elements. This is a very easy task: the transparency of all gui elements. This is a very
There is a skin object, in which all color settings are stored. easy task: There is a skin object, in which all color
We simply go through all colors stored in the skin and change settings are stored. We simply go through all colors
their alpha value. stored in the skin and change their alpha value.
*/ */
case EGET_SCROLL_BAR_CHANGED: case EGET_SCROLL_BAR_CHANGED:
if (id == 104) if (id == 104)
...@@ -80,7 +81,7 @@ public: ...@@ -80,7 +81,7 @@ public:
/* /*
If a button was clicked, it could be one of 'our' If a button was clicked, it could be one of 'our'
three buttons. If it is the first, we shut down the engine. three buttons. If it is the first, we shut down the engine.
If it is the second, we create a little window with some If it is the second, we create a little window with some
text on it. We also add a string to the list box to log text on it. We also add a string to the list box to log
what happened. And if it is the third button, we create what happened. And if it is the third button, we create
a file open dialog, and add also this as string to the list box. a file open dialog, and add also this as string to the list box.
...@@ -98,15 +99,15 @@ public: ...@@ -98,15 +99,15 @@ public:
{ {
listbox->addItem(L"Window created"); listbox->addItem(L"Window created");
cnt += 30; cnt += 30;
if (cnt > 200) if (cnt > 200)
cnt = 0; cnt = 0;
IGUIWindow* window = env->addWindow( IGUIWindow* window = env->addWindow(
rect<s32>(100 + cnt, 100 + cnt, 300 + cnt, 200 + cnt), rect<s32>(100 + cnt, 100 + cnt, 300 + cnt, 200 + cnt),
false, // modal? false, // modal?
L"Test window"); L"Test window");
env->addStaticText(L"Please close me", env->addStaticText(L"Please close me",
rect<s32>(35,35,140,50), rect<s32>(35,35,140,50),
true, // border? true, // border?
false, // wordwrap? false, // wordwrap?
...@@ -134,9 +135,9 @@ public: ...@@ -134,9 +135,9 @@ public:
/* /*
Ok, now for the more interesting part. First, create the Ok, now for the more interesting part. First, create the Irrlicht device. As in
Irrlicht device. As in some examples before, we ask the user which some examples before, we ask the user which driver he wants to use for this
driver he wants to use for this example: example:
*/ */
int main() int main()
{ {
...@@ -182,7 +183,7 @@ int main() ...@@ -182,7 +183,7 @@ int main()
/* /*
To make the font a little bit nicer, we load an external font To make the font a little bit nicer, we load an external font
and set it as the new default font in the skin. and set it as the new default font in the skin.
To keep the standard font for tool tip text, we set it to To keep the standard font for tool tip text, we set it to
the built-in font. the built-in font.
*/ */
...@@ -208,7 +209,7 @@ int main() ...@@ -208,7 +209,7 @@ int main()
/* /*
Now, we add a static text and a scrollbar, which modifies the Now, we add a static text and a scrollbar, which modifies the
transparency of all gui elements. We set the maximum value of transparency of all gui elements. We set the maximum value of
the scrollbar to 255, because that's the maximal value for the scrollbar to 255, because that's the maximal value for
a color value. a color value.
Then we create an other static text and a list box. Then we create an other static text and a list box.
*/ */
...@@ -224,7 +225,9 @@ int main() ...@@ -224,7 +225,9 @@ int main()
listbox = env->addListBox(rect<s32>(50, 140, 250, 210)); listbox = env->addListBox(rect<s32>(50, 140, 250, 210));
env->addEditBox(L"Editable Text", rect<s32>(350, 80, 550, 100)); env->addEditBox(L"Editable Text", rect<s32>(350, 80, 550, 100));
// add the engine logo /*
And at last, we create a nice Irrlicht Engine logo in the top left corner.
*/
env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"), env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"),
position2d<int>(10,10)); position2d<int>(10,10));
...@@ -247,3 +250,6 @@ int main() ...@@ -247,3 +250,6 @@ int main()
return 0; return 0;
} }
/*
**/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* /** Example 012 Terrain Rendering
This tutorial will briefly show how to use the terrain renderer of Irrlicht. It will also
show the terrain renderer triangle selector to be able to do collision detection with This tutorial will briefly show how to use the terrain renderer of Irrlicht. It
terrain. will also show the terrain renderer triangle selector to be able to do
collision detection with terrain.
Note that the Terrain Renderer in Irrlicht is based on Spintz' GeoMipMapSceneNode, lots
of thanks go to him. Note that the Terrain Renderer in Irrlicht is based on Spintz'
DeusXL provided a new elegant simple solution for building larger area on small heightmaps GeoMipMapSceneNode, lots of thanks go to him. DeusXL provided a new elegant
-> terrain smoothing. simple solution for building larger area on small heightmaps -> terrain
In the beginning there is nothing special. We include the needed header files and create smoothing.
an event listener to listen if the user presses the 'W' key so we can switch to wireframe
mode and if he presses 'D' we toggle to material between solid and detail mapped. In the beginning there is nothing special. We include the needed header files
and create an event listener to listen if the user presses a key: The 'W' key
switches to wireframe mode, the 'P' key to pointcloud mode, and the 'D' key
toggles between solid and detail mapped material.
*/ */
#include <irrlicht.h> #include <irrlicht.h>
#include <iostream> #include <iostream>
...@@ -46,7 +49,7 @@ public: ...@@ -46,7 +49,7 @@ public:
return true; return true;
case irr::KEY_KEY_D: // toggle detail map case irr::KEY_KEY_D: // toggle detail map
Terrain->setMaterialType( Terrain->setMaterialType(
Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ?
video::EMT_DETAIL_MAP : video::EMT_SOLID); video::EMT_DETAIL_MAP : video::EMT_SOLID);
return true; return true;
} }
...@@ -101,7 +104,7 @@ int main() ...@@ -101,7 +104,7 @@ int main()
First, we add standard stuff to the scene: A nice irrlicht engine First, we add standard stuff to the scene: A nice irrlicht engine
logo, a small help text, a user controlled camera, and we disable logo, a small help text, a user controlled camera, and we disable
the mouse cursor. the mouse cursor.
*/ */
video::IVideoDriver* driver = device->getVideoDriver(); video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager(); scene::ISceneManager* smgr = device->getSceneManager();
...@@ -122,7 +125,7 @@ int main() ...@@ -122,7 +125,7 @@ int main()
core::rect<s32>(10,440,250,475), true, true, 0, -1, true); core::rect<s32>(10,440,250,475), true, true, 0, -1, true);
// add camera // add camera
scene::ICameraSceneNode* camera = scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0,100.0f,1200.f); smgr->addCameraSceneNodeFPS(0,100.0f,1200.f);
camera->setPosition(core::vector3df(1900*2,255*2,3700*2)); camera->setPosition(core::vector3df(1900*2,255*2,3700*2));
...@@ -133,31 +136,34 @@ int main() ...@@ -133,31 +136,34 @@ int main()
device->getCursorControl()->setVisible(false); device->getCursorControl()->setVisible(false);
/* /*
Here comes the terrain renderer scene node: We add it just like any Here comes the terrain renderer scene node: We add it just like any
other scene node to the scene using ISceneManager::addTerrainSceneNode(). other scene node to the scene using
The only parameter we use is a file name to the heightmap we use. A heightmap ISceneManager::addTerrainSceneNode(). The only parameter we use is a
is simply a gray scale texture. The terrain renderer loads it and creates file name to the heightmap we use. A heightmap is simply a gray scale
the 3D terrain from it. texture. The terrain renderer loads it and creates the 3D terrain from
To make the terrain look more big, we change the scale factor of it to (40, 4.4, 40). it.
Because we don't have any dynamic lights in the scene, we switch off the lighting,
and we set the file terrain-texture.jpg as texture for the terrain and To make the terrain look more big, we change the scale factor of
detailmap3.jpg as second texture, called detail map. At last, we set it to (40, 4.4, 40). Because we don't have any dynamic lights in the
the scale values for the texture: The first texture will be repeated only one time over scene, we switch off the lighting, and we set the file
the whole terrain, and the second one (detail map) 20 times. terrain-texture.jpg as texture for the terrain and detailmap3.jpg as
second texture, called detail map. At last, we set the scale values for
the texture: The first texture will be repeated only one time over the
whole terrain, and the second one (detail map) 20 times.
*/ */
// add terrain scene node // add terrain scene node
scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(
"../../media/terrain-heightmap.bmp", "../../media/terrain-heightmap.bmp",
0, // parent node 0, // parent node
-1, // node id -1, // node id
core::vector3df(0.f, 0.f, 0.f), // position core::vector3df(0.f, 0.f, 0.f), // position
core::vector3df(0.f, 0.f, 0.f), // rotation core::vector3df(0.f, 0.f, 0.f), // rotation
core::vector3df(40.f, 4.4f, 40.f), // scale core::vector3df(40.f, 4.4f, 40.f), // scale
video::SColor ( 255, 255, 255, 255 ), // vertexColor, video::SColor ( 255, 255, 255, 255 ), // vertexColor
5, // maxLOD 5, // maxLOD
scene::ETPS_17, // patchSize scene::ETPS_17, // patchSize
4 // smoothFactor 4 // smoothFactor
); );
terrain->setMaterialFlag(video::EMF_LIGHTING, false); terrain->setMaterialFlag(video::EMF_LIGHTING, false);
...@@ -172,10 +178,10 @@ int main() ...@@ -172,10 +178,10 @@ int main()
/* /*
To be able to do collision with the terrain, we create a triangle selector. To be able to do collision with the terrain, we create a triangle selector.
If you want to know what triangle selectors do, just take a look into the If you want to know what triangle selectors do, just take a look into the
collision tutorial. The terrain triangle selector works together with the collision tutorial. The terrain triangle selector works together with the
terrain. To demonstrate this, we create a collision response animator terrain. To demonstrate this, we create a collision response animator
and attach it to the camera, so that the camera will not be able to fly and attach it to the camera, so that the camera will not be able to fly
through the terrain. through the terrain.
*/ */
...@@ -187,23 +193,24 @@ int main() ...@@ -187,23 +193,24 @@ int main()
// create collision response animator and attach it to the camera // create collision response animator and attach it to the camera
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(60,100,60), selector, camera, core::vector3df(60,100,60),
core::vector3df(0,0,0), core::vector3df(0,0,0),
core::vector3df(0,50,0)); core::vector3df(0,50,0));
selector->drop(); selector->drop();
camera->addAnimator(anim); camera->addAnimator(anim);
anim->drop(); anim->drop();
/* /*
To make the user be able to switch between normal and wireframe mode, we create To make the user be able to switch between normal and wireframe mode,
an instance of the event reciever from above and let Irrlicht know about it. In we create an instance of the event reciever from above and let Irrlicht
addition, we add the skybox which we already used in lots of Irrlicht examples. know about it. In addition, we add the skybox which we already used in
lots of Irrlicht examples.
*/ */
// create event receiver // create event receiver
MyEventReceiver receiver(terrain); MyEventReceiver receiver(terrain);
device->setEventReceiver(&receiver); device->setEventReceiver(&receiver);
// create skybox // create skybox
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
smgr->addSkyBoxSceneNode( smgr->addSkyBoxSceneNode(
...@@ -218,7 +225,7 @@ int main() ...@@ -218,7 +225,7 @@ int main()
/* /*
That's it, draw everything. Now you know how to use terrain in Irrlicht. That's it, draw everything.
*/ */
int lastFPS = -1; int lastFPS = -1;
...@@ -256,3 +263,6 @@ int main() ...@@ -256,3 +263,6 @@ int main()
return 0; return 0;
} }
/*
Now you know how to use terrain in Irrlicht.
**/
/* /** Example 013 Render To Texture
This tutorial shows how to render to a texture using Irrlicht. Render to texture is a feature with which
it is possible to create nice special effects. In addition, this tutorial shows how to enable specular This tutorial shows how to render to a texture using Irrlicht. Render to
highlights. texture is a feature with which it is possible to create nice special effects.
In addition, this tutorial shows how to enable specular highlights.
In the beginning, everything as usual. Include the needed headers, ask the user for the rendering In the beginning, everything as usual. Include the needed headers, ask the user
driver, create the Irrlicht Device: for the rendering driver, create the Irrlicht Device:
*/ */
#include <irrlicht.h> #include <irrlicht.h>
...@@ -54,10 +55,10 @@ int main() ...@@ -54,10 +55,10 @@ int main()
/* /*
Now, we load an animated mesh to be displayed. As in most examples, Now, we load an animated mesh to be displayed. As in most examples,
we'll take the fairy md2 model. The difference here: We set the shininess we'll take the fairy md2 model. The difference here: We set the
of the model to a value other than 0 which is the default value. This shininess of the model to a value other than 0 which is the default
enables specular highlights on the model if dynamic lighting is on. value. This enables specular highlights on the model if dynamic
The value influences the size of the highlights. lighting is on. The value influences the size of the highlights.
*/ */
// load and display animated fairy mesh // load and display animated fairy mesh
...@@ -75,9 +76,10 @@ int main() ...@@ -75,9 +76,10 @@ int main()
} }
/* /*
To make specular highlights appear on the model, we need a dynamic light in the scene. To make specular highlights appear on the model, we need a dynamic
We add one directly in vicinity of the model. In addition, to make the model not that light in the scene. We add one directly in vicinity of the model. In
dark, we set the ambient light to gray. addition, to make the model not that dark, we set the ambient light to
gray.
*/ */
// add white light // add white light
...@@ -88,8 +90,9 @@ int main() ...@@ -88,8 +90,9 @@ int main()
smgr->setAmbientLight(video::SColor(0,60,60,60)); smgr->setAmbientLight(video::SColor(0,60,60,60));
/* /*
The next is just some standard stuff: Add a user controlled camera to the scene, disable The next is just some standard stuff: Add a user controlled camera to
mouse cursor, and add a test cube and let it rotate to make the scene more interesting. the scene, disable mouse cursor, and add a test cube and let it rotate
to make the scene more interesting.
*/ */
// add fps camera // add fps camera
...@@ -115,14 +118,16 @@ int main() ...@@ -115,14 +118,16 @@ int main()
device->setWindowCaption(L"Irrlicht Engine - Render to Texture and Specular Highlights example"); device->setWindowCaption(L"Irrlicht Engine - Render to Texture and Specular Highlights example");
/* /*
To test out the render to texture feature, we need a render target texture. These are not To test out the render to texture feature, we need a render target
like standard textures, but need to be created first. To create one, we call texture. These are not like standard textures, but need to be created
IVideoDriver::createRenderTargetTexture() and specify the size of the texture. Please first. To create one, we call IVideoDriver::createRenderTargetTexture()
don't use sizes bigger than the frame buffer for this, because the render target shares and specify the size of the texture. Please don't use sizes bigger than
the zbuffer with the frame buffer. And because we want to render the scene not from the the frame buffer for this, because the render target shares the zbuffer
user camera into the texture, we add another, fixed camera to the scene. But before we with the frame buffer. And because we want to render the scene not from
do all this, we check if the current running driver is able to render to textures. If the user camera into the texture, we add another fixed camera to the
it is not, we simply display a warning text. scene. But before we do all this, we check if the current running
driver is able to render to textures. If it is not, we simply display a
warning text.
*/ */
// create render target // create render target
...@@ -156,11 +161,12 @@ int main() ...@@ -156,11 +161,12 @@ int main()
} }
/* /*
Nearly finished. Now we need to draw everything. Every frame, we draw the scene twice. Nearly finished. Now we need to draw everything. Every frame, we draw
Once from the fixed camera into the render target texture and once as usual. When rendering the scene twice. Once from the fixed camera into the render target
into the render target, we need to disable the visibilty of the test cube, because it has texture and once as usual. When rendering into the render target, we
the render target texture applied to it. need to disable the visibilty of the test cube, because it has the
That's, wasn't quite complicated I hope. :) render target texture applied to it. That's it, wasn't too complicated
I hope. :)
*/ */
int lastFPS = -1; int lastFPS = -1;
...@@ -175,18 +181,18 @@ int main() ...@@ -175,18 +181,18 @@ int main()
// draw scene into render target // draw scene into render target
// set render target texture // set render target texture
driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255)); driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255));
// make cube invisible and set fixed camera as active camera // make cube invisible and set fixed camera as active camera
test->setVisible(false); test->setVisible(false);
smgr->setActiveCamera(fixedCam); smgr->setActiveCamera(fixedCam);
// draw whole scene into render buffer // draw whole scene into render buffer
smgr->drawAll(); smgr->drawAll();
// set back old render target // set back old render target
// The buffer might have been distorted, so clear it // The buffer might have been distorted, so clear it
driver->setRenderTarget(0, true, true, 0); driver->setRenderTarget(0, true, true, 0);
// make the cube visible and set the user controlled camera as active one // make the cube visible and set the user controlled camera as active one
test->setVisible(true); test->setVisible(true);
...@@ -194,7 +200,7 @@ int main() ...@@ -194,7 +200,7 @@ int main()
} }
// draw scene normally // draw scene normally
smgr->drawAll(); smgr->drawAll();
env->drawAll(); env->drawAll();
driver->endScene(); driver->endScene();
...@@ -218,3 +224,6 @@ int main() ...@@ -218,3 +224,6 @@ int main()
device->drop(); // drop device device->drop(); // drop device
return 0; return 0;
} }
/*
**/
// this example only runs in windows and demonstrates that Irrlicht /** Example 014 Win32 Window
// can run inside a win32 window.
This example only runs under MS Windows and demonstrates that Irrlicht can
render inside a win32 window. MFC and .NET Windows.Forms windows are possible,
too.
In the begining, we create a windows window using the windows API. I'm not
going to explain this code, because it is windows specific. See the MSDN or a
windows book for details.
*/
#include <irrlicht.h> #include <irrlicht.h>
#ifndef _IRR_WINDOWS_ #ifndef _IRR_WINDOWS_
...@@ -41,9 +49,6 @@ static LRESULT CALLBACK CustomWndProc(HWND hWnd, UINT message, WPARAM wParam, LP ...@@ -41,9 +49,6 @@ static LRESULT CALLBACK CustomWndProc(HWND hWnd, UINT message, WPARAM wParam, LP
} }
int main() int main()
//int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hpre, LPSTR cmd, int cc) //int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hpre, LPSTR cmd, int cc)
{ {
...@@ -99,6 +104,12 @@ int main() ...@@ -99,6 +104,12 @@ int main()
HWND hIrrlichtWindow = CreateWindow("BUTTON", "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, HWND hIrrlichtWindow = CreateWindow("BUTTON", "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
50, 80, 320, 220, hWnd, NULL, hInstance, NULL); 50, 80, 320, 220, hWnd, NULL, hInstance, NULL);
/*
So now that we have some window, we can create an Irrlicht device
inside of it. We use Irrlicht createEx() function for this. We only
need the handle (HWND) to that window, set it as windowsID parameter
and start up the engine as usual. That's it.
*/
// create irrlicht device in the button window // create irrlicht device in the button window
irr::SIrrlichtCreationParameters param; irr::SIrrlichtCreationParameters param;
...@@ -141,13 +152,17 @@ int main() ...@@ -141,13 +152,17 @@ int main()
// do message queue // do message queue
// Instead of this, you can also simply use your own message loop /*
// using GetMessage, DispatchMessage and whatever. Calling Now the only thing missing is the drawing loop using
// Device->run() will cause Irrlicht to dispatch messages internally too. IrrlichtDevice::run(). We do this as usual. But instead of this, there
// You need not call Device->run() if you want to do your own message is another possibility: You can also simply use your own message loop
// dispatching loop, but Irrlicht will not be able to fetch using GetMessage, DispatchMessage and whatever. Calling
// user input then and you have to do it on your own using the window Device->run() will cause Irrlicht to dispatch messages internally too.
// messages, DirectInput, or whatever. You need not call Device->run() if you want to do your own message
dispatching loop, but Irrlicht will not be able to fetch user input
then and you have to do it on your own using the window messages,
DirectInput, or whatever.
*/
while (device->run()) while (device->run())
{ {
...@@ -156,8 +171,10 @@ int main() ...@@ -156,8 +171,10 @@ int main()
driver->endScene(); driver->endScene();
} }
// the alternative, own message dispatching loop without Device->run() would /*
// look like this: The alternative, own message dispatching loop without Device->run()
would look like this:
*/
/*MSG msg; /*MSG msg;
while (true) while (true)
...@@ -187,3 +204,6 @@ int main() ...@@ -187,3 +204,6 @@ int main()
} }
#endif // if windows #endif // if windows
/*
That's it, Irrlicht now runs in your own windows window.
**/
/* /** Example 015 Loading Scenes from .irr Files
Since version 1.1, Irrlicht is able to save and load Since version 1.1, Irrlicht is able to save and load
the full scene graph into an .irr file, an xml based the full scene graph into an .irr file, an xml based
format. There is an editor available to edit format. There is an editor available to edit
those files, named irrEdit on http://www.ambiera.com/irredit, those files, named irrEdit (http://www.ambiera.com/irredit)
which can also be used as world and particle editor. which can also be used as world and particle editor.
This tutorial shows how to use .irr files. This tutorial shows how to use .irr files.
...@@ -13,7 +14,9 @@ Lets start: Create an Irrlicht device and setup the window. ...@@ -13,7 +14,9 @@ Lets start: Create an Irrlicht device and setup the window.
#include <iostream> #include <iostream>
using namespace irr; using namespace irr;
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib") #pragma comment(lib, "Irrlicht.lib")
#endif
int main() int main()
{ {
...@@ -38,7 +41,7 @@ int main() ...@@ -38,7 +41,7 @@ int main()
case 'e': driverType = video::EDT_BURNINGSVIDEO;break; case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break; case 'f': driverType = video::EDT_NULL; break;
default: return 1; default: return 1;
} }
// create device and exit if creation failed // create device and exit if creation failed
...@@ -53,30 +56,35 @@ int main() ...@@ -53,30 +56,35 @@ int main()
video::IVideoDriver* driver = device->getVideoDriver(); video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager(); scene::ISceneManager* smgr = device->getSceneManager();
/* Now load our .irr file. /*
.irr files can store the whole scene graph including animators, materials Now load our .irr file.
and particle systems. And there is also the possibility to store arbitrary .irr files can store the whole scene graph including animators,
user data for every scene node in that file. To keep this materials and particle systems. And there is also the possibility to
example simple, we are simply loading the scene here. See the documentation store arbitrary user data for every scene node in that file. To keep
at ISceneManager::loadScene and ISceneManager::saveScene for more information. this example simple, we are simply loading the scene here. See the
So to load and display a complicated huge scene, we only need a single call documentation at ISceneManager::loadScene and ISceneManager::saveScene
to loadScene(). for more information. So to load and display a complicated huge scene,
we only need a single call to loadScene().
*/ */
// load the scene // load the scene
smgr->loadScene("../../media/example.irr"); smgr->loadScene("../../media/example.irr");
// Now we'll create a camera, and give it a collision response animator /*
// that's built from the mesh nodes in the scene we just loaded. Now we'll create a camera, and give it a collision response animator
that's built from the mesh nodes in the scene we just loaded.
*/
scene::ICameraSceneNode * camera = smgr->addCameraSceneNodeFPS(0, 50, 100); scene::ICameraSceneNode * camera = smgr->addCameraSceneNodeFPS(0, 50, 100);
// Create a meta triangle selector to hold several triangle selectors. // Create a meta triangle selector to hold several triangle selectors.
scene::IMetaTriangleSelector * meta = smgr->createMetaTriangleSelector(); scene::IMetaTriangleSelector * meta = smgr->createMetaTriangleSelector();
// Now we will find all the nodes in the scene and create triangle /*
// selectors for all suitable nodes. Typically, you would want to make a Now we will find all the nodes in the scene and create triangle
// more informed decision about which nodes to performs collision checks selectors for all suitable nodes. Typically, you would want to make a
// on; you could capture that information in the node name or Id. more informed decision about which nodes to performs collision checks
on; you could capture that information in the node name or Id.
*/
core::array<scene::ISceneNode *> nodes; core::array<scene::ISceneNode *> nodes;
smgr->getSceneNodesFromType(scene::ESNT_ANY, nodes); // Find all nodes smgr->getSceneNodesFromType(scene::ESNT_ANY, nodes); // Find all nodes
...@@ -88,41 +96,44 @@ int main() ...@@ -88,41 +96,44 @@ int main()
switch(node->getType()) switch(node->getType())
{ {
case scene::ESNT_CUBE: case scene::ESNT_CUBE:
case scene::ESNT_ANIMATED_MESH: // Because the selector won't animate with the mesh, case scene::ESNT_ANIMATED_MESH:
// and is only being used for camera collision, we'll just use an approximate // Because the selector won't animate with the mesh,
// bounding box instead of ((scene::IAnimatedMeshSceneNode*)node)->getMesh(0) // and is only being used for camera collision, we'll just use an approximate
selector = smgr->createTriangleSelectorFromBoundingBox(node); // bounding box instead of ((scene::IAnimatedMeshSceneNode*)node)->getMesh(0)
break; selector = smgr->createTriangleSelectorFromBoundingBox(node);
break;
case scene::ESNT_MESH: case scene::ESNT_MESH:
case scene::ESNT_SPHERE: // Derived from IMeshSceneNode case scene::ESNT_SPHERE: // Derived from IMeshSceneNode
selector = smgr->createTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node); selector = smgr->createTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node);
break; break;
case scene::ESNT_TERRAIN: case scene::ESNT_TERRAIN:
selector = smgr->createTerrainTriangleSelector((scene::ITerrainSceneNode*)node); selector = smgr->createTerrainTriangleSelector((scene::ITerrainSceneNode*)node);
break; break;
case scene::ESNT_OCT_TREE: case scene::ESNT_OCT_TREE:
selector = smgr->createOctTreeTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node); selector = smgr->createOctTreeTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node);
break; break;
default: default:
// Don't create a selector for this node type // Don't create a selector for this node type
break; break;
} }
if(selector) if(selector)
{ {
// Add it to the meta selector, which will take a reference to it // Add it to the meta selector, which will take a reference to it
meta->addTriangleSelector(selector); meta->addTriangleSelector(selector);
// And drop my reference to it, so that the meta selector owns it. // And drop my reference to it, so that the meta selector owns it.
selector->drop(); selector->drop();
} }
} }
// Now that the mesh scene nodes have had triangle selectors created and added /*
// to the meta selector, create a collision response animator from that meta selector. Now that the mesh scene nodes have had triangle selectors created and added
to the meta selector, create a collision response animator from that meta selector.
*/
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
meta, camera, core::vector3df(5,5,5), meta, camera, core::vector3df(5,5,5),
core::vector3df(0,0,0)); core::vector3df(0,0,0));
...@@ -138,8 +149,10 @@ int main() ...@@ -138,8 +149,10 @@ int main()
scene::ISceneNode * cube = smgr->getSceneNodeFromType(scene::ESNT_CUBE); scene::ISceneNode * cube = smgr->getSceneNodeFromType(scene::ESNT_CUBE);
if(cube) if(cube)
camera->setTarget(cube->getAbsolutePosition()); camera->setTarget(cube->getAbsolutePosition());
// and draw everything. /*
That's it. Draw everything and finish as usual.
*/
int lastFPS = -1; int lastFPS = -1;
...@@ -154,19 +167,21 @@ int main() ...@@ -154,19 +167,21 @@ int main()
if (lastFPS != fps) if (lastFPS != fps)
{ {
core::stringw str = L"Load Irrlicht File example - Irrlicht Engine ["; core::stringw str = L"Load Irrlicht File example - Irrlicht Engine [";
str += driver->getName(); str += driver->getName();
str += "] FPS:"; str += "] FPS:";
str += fps; str += fps;
device->setWindowCaption(str.c_str()); device->setWindowCaption(str.c_str());
lastFPS = fps; lastFPS = fps;
} }
} }
device->drop(); device->drop();
return 0; return 0;
} }
/*
**/
/* /** Example 016 Quake3 Map Shader Support
This Tutorial shows how to load a Quake 3 map into the This Tutorial shows how to load a Quake 3 map into the
engine, create a SceneNode for optimizing the speed of engine, create a SceneNode for optimizing the speed of
rendering and how to create a user controlled camera. rendering and how to create a user controlled camera.
...@@ -38,9 +39,9 @@ to ask the user for a driver type using the console. ...@@ -38,9 +39,9 @@ to ask the user for a driver type using the console.
/* /*
As already written in the HelloWorld example, in the Irrlicht As already written in the HelloWorld example, in the Irrlicht
Engine, everything can be found in the namespace 'irr'. Engine, everything can be found in the namespace 'irr'.
To get rid of the irr:: in front of the name of every class, To get rid of the irr:: in front of the name of every class,
we tell the compiler that we use that namespace from now on, we tell the compiler that we use that namespace from now on,
and we will not have to write that 'irr::'. and we will not have to write that 'irr::'.
There are 5 other sub namespaces 'core', 'scene', 'video', There are 5 other sub namespaces 'core', 'scene', 'video',
'io' and 'gui'. Unlike in the HelloWorld example, 'io' and 'gui'. Unlike in the HelloWorld example,
...@@ -53,7 +54,7 @@ using namespace irr; ...@@ -53,7 +54,7 @@ using namespace irr;
using namespace scene; using namespace scene;
/* /*
Again, to be able to use the Irrlicht.DLL file, we need to link with the Again, to be able to use the Irrlicht.DLL file, we need to link with the
Irrlicht.lib. We could set this option in the project settings, but Irrlicht.lib. We could set this option in the project settings, but
to make it easy, we use a pragma comment lib: to make it easy, we use a pragma comment lib:
*/ */
...@@ -109,14 +110,14 @@ private: ...@@ -109,14 +110,14 @@ private:
/* /*
Ok, lets start. Ok, lets start.
*/ */
int IRRCALLCONV main(int argc, char* argv[]) int IRRCALLCONV main(int argc, char* argv[])
{ {
/* /*
Like in the HelloWorld example, we create an IrrlichtDevice with Like in the HelloWorld example, we create an IrrlichtDevice with
createDevice(). The difference now is that we ask the user to select createDevice(). The difference now is that we ask the user to select
which hardware accelerated driver to use. The Software device would be which hardware accelerated driver to use. The Software device would be
too slow to draw a huge Quake 3 map, but just for the fun of it, we make too slow to draw a huge Quake 3 map, but just for the fun of it, we make
this decision possible too. this decision possible too.
...@@ -188,7 +189,7 @@ int IRRCALLCONV main(int argc, char* argv[]) ...@@ -188,7 +189,7 @@ int IRRCALLCONV main(int argc, char* argv[])
/* /*
Now we can load the mesh by calling getMesh(). We get a pointer returned Now we can load the mesh by calling getMesh(). We get a pointer returned
to a IAnimatedMesh. As you know, Quake 3 maps are not really animated, to a IAnimatedMesh. As you know, Quake 3 maps are not really animated,
they are only a huge chunk of static geometry with some materials they are only a huge chunk of static geometry with some materials
...@@ -196,11 +197,11 @@ int IRRCALLCONV main(int argc, char* argv[]) ...@@ -196,11 +197,11 @@ int IRRCALLCONV main(int argc, char* argv[])
so we get the "first frame" of the "animation", which is our quake level so we get the "first frame" of the "animation", which is our quake level
and create an OctTree scene node with it, using addOctTreeSceneNode(). and create an OctTree scene node with it, using addOctTreeSceneNode().
The OctTree optimizes the scene a little bit, trying to draw only geometry The OctTree optimizes the scene a little bit, trying to draw only geometry
which is currently visible. An alternative to the OctTree would be a which is currently visible. An alternative to the OctTree would be a
AnimatedMeshSceneNode, which would draw always the complete geometry of AnimatedMeshSceneNode, which would draw always the complete geometry of
the mesh, without optimization. Try it out: Write addAnimatedMeshSceneNode the mesh, without optimization. Try it out: Write addAnimatedMeshSceneNode
instead of addOctTreeSceneNode and compare the primitives drawed by the instead of addOctTreeSceneNode and compare the primitives drawed by the
video driver. (There is a getPrimitiveCountDrawed() method in the video driver. (There is a getPrimitiveCountDrawed() method in the
IVideoDriver class). Note that this optimization with the Octree is only IVideoDriver class). Note that this optimization with the Octree is only
useful when drawing huge meshes consisting of lots of geometry. useful when drawing huge meshes consisting of lots of geometry.
*/ */
...@@ -291,14 +292,14 @@ int IRRCALLCONV main(int argc, char* argv[]) ...@@ -291,14 +292,14 @@ int IRRCALLCONV main(int argc, char* argv[])
} }
/* /*
Now we only need a Camera to look at the Quake 3 map. Now we only need a Camera to look at the Quake 3 map. And we want to
And we want to create a user controlled camera. There are some create a user controlled camera. There are some different cameras
different cameras available in the Irrlicht engine. For example the available in the Irrlicht engine. For example the Maya Camera which can
Maya Camera which can be controlled compareable to the camera in Maya: be controlled compareable to the camera in Maya: Rotate with left mouse
Rotate with left mouse button pressed, Zoom with both buttons pressed, button pressed, Zoom with both buttons pressed, translate with right
translate with right mouse button pressed. This could be created with mouse button pressed. This could be created with
addCameraSceneNodeMaya(). But for this example, we want to create a addCameraSceneNodeMaya(). But for this example, we want to create a
camera which behaves like the ones in first person shooter games (FPS). camera which behaves like the ones in first person shooter games (FPS).
*/ */
scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
...@@ -379,8 +380,8 @@ int IRRCALLCONV main(int argc, char* argv[]) ...@@ -379,8 +380,8 @@ int IRRCALLCONV main(int argc, char* argv[])
/* /*
We have done everything, so lets draw it. We also write the current We have done everything, so lets draw it. We also write the current
frames per second and the drawn primitives to the caption of the frames per second and the drawn primitives to the caption of the
window. The 'if (device->isWindowActive())' line is optional, but window. The 'if (device->isWindowActive())' line is optional, but
prevents the engine render to set the position of the mouse cursor prevents the engine render to set the position of the mouse cursor
after task switching when other program are active. after task switching when other program are active.
*/ */
int lastFPS = -1; int lastFPS = -1;
...@@ -425,4 +426,5 @@ int IRRCALLCONV main(int argc, char* argv[]) ...@@ -425,4 +426,5 @@ int IRRCALLCONV main(int argc, char* argv[])
return 0; return 0;
} }
/*
**/
# 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 = 17.SplitScreen
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 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
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.SplitScreen", "SplitScreen.vcproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.ActiveCfg = Debug|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.Build.0 = Debug|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.ActiveCfg = Release|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="17.SplitScreen"
ProjectGUID="{EB3B38EA-5CE7-4983-845B-880661E69D09}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\17.SplitScreen.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/SplitScreen.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/QIfist /Oa"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="4"
BufferSecurityCheck="FALSE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="0"
CallingConvention="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\17.SplitScreen.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="FALSE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\main.cpp">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
This diff is collapsed.
This diff is collapsed.
[Project]
FileName=example.dev
Name=Irrlicht Example 17 SplitScreen
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=17.SplitScreen.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
This diff is collapsed.
...@@ -45,7 +45,7 @@ void CDemo::run() ...@@ -45,7 +45,7 @@ void CDemo::run()
resolution.Height = 480; resolution.Height = 480;
} }
device = createDevice(driverType,resolution, 32, fullscreen, shadows, vsync, this); device = createDevice(driverType, resolution, 32, fullscreen, shadows, vsync, this);
if (!device) if (!device)
return; return;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#ifndef __C_DEMO_H_INCLUDED__ #ifndef __C_DEMO_H_INCLUDED__
#define __C_DEMO_H_INCLUDED__ #define __C_DEMO_H_INCLUDED__
//#define USE_IRRKLANG #define USE_IRRKLANG
//#define USE_SDL_MIXER //#define USE_SDL_MIXER
#include <irrlicht.h> #include <irrlicht.h>
......
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define __IRR_COMPILE_CONFIG_H_INCLUDED__ #define __IRR_COMPILE_CONFIG_H_INCLUDED__
//! Irrlicht SDK Version //! Irrlicht SDK Version
#define IRRLICHT_SDK_VERSION "1.4.1" #define IRRLICHT_SDK_VERSION "1.4.2"
//! The defines for different operating system are: //! The defines for different operating system are:
//! _IRR_XBOX_PLATFORM_ for XBox //! _IRR_XBOX_PLATFORM_ for XBox
...@@ -82,7 +82,7 @@ to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK ...@@ -82,7 +82,7 @@ to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK
and this to the linker settings: -ld3dx9 -ld3dx8 **/ and this to the linker settings: -ld3dx9 -ld3dx8 **/
#if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK)) #if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK))
//#define _IRR_COMPILE_WITH_DIRECT3D_8_ #define _IRR_COMPILE_WITH_DIRECT3D_8_
#define _IRR_COMPILE_WITH_DIRECT3D_9_ #define _IRR_COMPILE_WITH_DIRECT3D_9_
#endif #endif
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
#include "SMeshBufferTangents.h" #include "SMeshBufferTangents.h"
#include "SViewFrustum.h" #include "SViewFrustum.h"
/*! \mainpage Irrlicht Engine 1.4.1 API documentation /*! \mainpage Irrlicht Engine 1.4.2 API documentation
* *
* <div align="center"><img src="logobig.png" ></div> * <div align="center"><img src="logobig.png" ></div>
* *
......
========================================================================== ==========================================================================
The Irrlicht Engine SDK version 1.4.1 The Irrlicht Engine SDK version 1.4.2
========================================================================== ==========================================================================
Welcome the Irrlicht Engine SDK. Welcome the Irrlicht Engine SDK.
......
No preview for this file type
...@@ -444,7 +444,7 @@ WARN_LOGFILE = ...@@ -444,7 +444,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories # directories like "/usr/src/myproject". Separate the files or directories
# with spaces. # with spaces.
INPUT = ../../../include/ INPUT = ../../../include/ tut.txt
# If the value of the INPUT tag contains directories, you can use the # If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
...@@ -504,7 +504,7 @@ EXAMPLE_RECURSIVE = NO ...@@ -504,7 +504,7 @@ EXAMPLE_RECURSIVE = NO
# directories that contain image that are included in the documentation (see # directories that contain image that are included in the documentation (see
# the \image command). # the \image command).
IMAGE_PATH = IMAGE_PATH = ../../../media
# The INPUT_FILTER tag can be used to specify a program that doxygen should # The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program # invoke to filter for each input file. Doxygen will invoke the filter program
......
This diff is collapsed.
...@@ -14,6 +14,6 @@ ...@@ -14,6 +14,6 @@
| <a class="qindex" href="namespacemembers.html"><font color="#FFFFFF"> | <a class="qindex" href="namespacemembers.html"><font color="#FFFFFF">
Namespace&nbsp;Members</font></a> | <a class="qindex" href="functions.html"><font color="#FFFFFF">Class Namespace&nbsp;Members</font></a> | <a class="qindex" href="functions.html"><font color="#FFFFFF">Class
members</font></a> | <a class="qindex" href="globals.html"><font color="#FFFFFF">File members</font></a> | <a class="qindex" href="globals.html"><font color="#FFFFFF">File
members</font></a></font> </td> members</font></a> | <a class="qindex" href="pages.html"><font color="#FFFFFF">Tutorials</font></a></font> </td>
</tr> </tr>
</table> </table>
This diff is collapsed.
doxygen doxygen.cfg rm tut.txt || true;
for i in ../../../examples/[01]*/main.cpp; do
sed -f tutorials.sed $i >>tut.txt;
done
doxygen doxygen-pdf.cfg
cp doxygen.css irrlicht.png logobig.png ../../../doctemp/html cp doxygen.css irrlicht.png logobig.png ../../../doctemp/html
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment