Version 0.5 has been released.
New examples are available: 09.Meshviewer and 11.PerPixelLighting.
I skipped 10.Shaders example (for now) because shaders functionality not implemented yet.
Release Notes
~
Changes in typing:
Next classes has been renamed:
Coloru => Color (also property "Color" renamed to "ARGB"; in Colorf: method "ToColoru" renamed to "ToColor")
Matrix4f => Matrix
AABBox3Df => AABBox
Also class Dimension2Du has been removed and its "i" brother used instead. This will descreas number of type casting in C# user code.
Changed index types from "unsigned int" to "int". This is done, because C# requires (C++ doesn't) explicit casting from int to uint each time. For example, we have 2 members in GUIContextMenu:
Code: Select all
int SelectedIndex { int get(); } // it returns -1 if no item selected, that is correct, so cannot use uint here
void SetItemChecked(unsigned int index, bool isChecked); // it takes uint as index, this is correct, since -1 is not valid index and uint is fine here
But after this, when you need write a simple thing, like:
menu.SetItemChecked((uint)menu.SelectedIndex, true); // compiler requires you to cast index to uint
This is annoying thing, and it brings more type-castings when you use it in loops, for example:
Code: Select all
for (int i = 0; i < menu.ItemCount; i++)
menu.SetItemChecked(i, true);
This will not compile, because ItemCount is uint; so you must: OR cast menu.ItemCount to int, OR use uint for i.
I looked to .NET Framework into List<T>, and see that they also uses int for List<T>.Count even if "count" cannot be negative.
So the same done in Lime for GUI elements; this will decrease number of annoying type-castings.
Note: additional asserts added, so int now checks not to be negative each time where it is true.
Note: this change was made in a lot of methods and properties (of different classes) where "unsigned int" value has meaning of "index" or "count".
~
IVideoDriver::setFog() and getFog() operates with 7 arguments: set() gets from 0 up to 7, and get() gets all 7 args, each one for output. In Lime there is a special class called Fog which holds all the data about fog, so you can use it next:
Code: Select all
// when you need set fog quickly
driver.Fog = new Fog(new Color(255, 220, 220), FogType::Linear, 200, 1000, 0.1f); // also set of contructor' overloads available here, from 0 arguments up to full list - 7 items.
// when you need to read and modify just 1 value (for example End)
Fog f = driver.Fog;
f.End = 500;
driver.Fog = f;
Note: Do not write "driver.Fog.End = 500;" since this will not do the change.
~
SceneManager.AddSkyBoxSceneNode() has special overloading that allows you to call it with string arguments instead of Video.Texture, like:
Code: Select all
skybox = smgr.AddSkyBoxSceneNode(
"irrlicht2_up.jpg", "irrlicht2_dn.jpg",
"irrlicht2_lf.jpg", "irrlicht2_rt.jpg",
"irrlicht2_ft.jpg", "irrlicht2_bk.jpg");
It will load all textures automatically using ISceneManager::getVideoDriver()'s getTexture().
~
Changed type of argument timeForWay in method SceneManager.CreateFlyStraightAnimator() to float (was unsigned int). Please not that this change will not break the compilation, so be careful twice: if you use it, changed value for timeForWay to float, for example if it was "3500", now it should be "3.5f".
~
Added special class TexturePainter which allows you to access pixels in locked texture. This class doesn't wrap any Irrlicht analog, its just a helper wrapper for void* returned by video::ITexture::lock(). It can be used in next way:
Code: Select all
// this example shows how to make pixel at 10,10 to be red
TexturePainter p = texture.GetTexturePainter();
if (p.Lock())
{
p.SetPixel(10, 10, new Color(255, 0, 0));
p.Unlock(true); // "true" here means also to call texture->regenerateMipMapLevels()
}
Please note, Texture class has no Lock and Unlock methods, they both implemented in TexturePainter.
This class provides some useful functionality (which in native Irrlicht you have to calculate by your self, like mipmap level size or mipmap level count). You don't need to recreate TexturePainter each time you want to access mipmap level of Texture;
TexturePainter currently has next functionality:
Code: Select all
Color^ GetPixel(int x, int y);
bool Lock(bool readOnly, int mipmapLevel);
bool Lock(bool readOnly);
bool Lock();
void SetPixel(int x, int y, Color^ color);
void Unlock(bool alsoRegenerateMipMapLevels);
void Unlock();
property bool Locked { bool get(); }
property int MipMapLevel { int get(); }
property int MipMapLevelCount { int get(); }
property int MipMapLevelHeight { int get(); }
property int MipMapLevelWidth { int get(); }
property bool ReadOnly { bool get(); }
property Video::Texture^ Texture { Video::Texture^ get(); }
Note: almost all functionality from this class usable only when you locked the texture. For example, if you didn't called Lock(), you cannot check MipMapLevelWidth or ReadOnly -- you will get assertion check failed.
~
User data that you able to store in some GUI elements has int type (in comparision to native c++ version, it is void*). You cannot store pointer to your managed Object directly. This issue related to classes GUITreeViewNode and GUITable.
~
09.Meshviewer has been ported. However, next call is not ported:
Code: Select all
smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true);
since io::IAttributes is not ported yet.
~
Wrapped all Irrlicht's scene nodes and GUI elements.
Full list of changes:
http://irrlichtlime.svn.sourceforge.net ... f_format=h