1# New and Noteworthy in OGRE 1.11
2
3This is only a high level overview. For a detailed changes, see the git changelog.
4
5## Core changes
6
7Ogre now requires a C++11 conforming compiler (at least gcc 4.8 or VS2013). Furthermore internal headers were moved into the src/ directory and are not installed any more when creating the SDK. This prevents you from accidentally using private API, while giving us more flexibility to change the implementation.
8
9* Reduced Memory consumption of core classes
10  - by reducing padding and using bitfields for flags, the memory consumption of e.g. `Pass` could be reduced by 11%.
11  - see https://github.com/OGRECave/ogre/pull/665 for numbers of other classes
12
13* Added strong typed `Affine3` matrix class.
14  - overloads of `operator*`: no need to remember to call `transformAffine`, `concatenateAffine` etc. any more - everything is done and checked by the compiler automatically.
15  - affine only methods moved from `Matrix4` to `Affine3`. e.g. `decomposition`, `getTrans`.
16  - scale related functions moved from `Matrix4` to `Matrix3`: porting `.hasScale()` →  `.linear().hasScale()`
17  - similarly `transformDirectionAffine` is now done by extracting the linear part via `linear()` and using `operator*` of `Matrix3`, that has now improved performance.
18
19* New `SceneLoaderManager` API
20  * you can now register classes derived from `SceneLoader`
21  * calling `SceneLoaderManager::load("filename.ext", "Group", rootNode)` will then dispatch to a Loader supporting ".ext" (if available) and populate the given SceneManager starting at `rootNode`.
22
23* `Image::flipAroundX/Y` now operate in-place instead of allocating temporary memory.
24
25* `PF_DEPTH` now correctly works with `TU_RENDERTARGET`. This will create a depth-only FBO and give you the raw depth values, without needing any special shaders.
26
27* Generic Image codecs (STB Image, FreeImage) are now plugins. For distribution you should use compressed textures (e.g. DDS) with precomputed mipmaps. Having the generic codecs as plugins allows you to easily disable them. Editing software on the other hand can now easily swap in a custom implementation (like QImage).
28
29### Use plain STL where possible
30
31* C++11ifycation: replace core classes by C++11 equivalents - particularly
32  - SharedPtr -> `std::shared_ptr`. Note that due to its widespread usage, a SharedPtr wrapper class still exists for backwards compatibility.
33  - AtomicScalar -> `std::atomic`
34  - OGRE_HashMap -> `std::unordered_map`
35  - _StringHash -> `std::hash< string >`
36  - Timer: the platform specific implementations were replaced by wrapping
37  `std::chrono`.
38
39* Removed container indirections. `Ogre::vector<int>::type`, is now just plain `std::vector<int>`. The Ogre version is still there to ease porting, but will generate a deprecation warning.
40
41* drop Threading backport from 2.x, `std::thread` is now the preferred API.
42
43* Memory Allocation cleanup
44    * Drop MemoryTracker API. Nowadays [MSan](https://github.com/google/sanitizers/wiki/MemorySanitizer) is the better alternative.
45    * drop builtin support for custom memory allocators. Consequently drop nedmalloc. Was only needed on WinXP. Empty class definitions are still there for compatibility. If you still want a different allocator you have to [do so globally](http://en.cppreference.com/w/cpp/memory/new/operator_new#Global_replacements).
46
47### Platform independant OgreMain
48
49Linking against OgreMain will no longer pull in any platform UI libraries (e.g. Cocoa, X11). The respective code was moved to OgreBites.
50
51* `WindowEventUtilities` were moved to the Bites Component. They rely on low level platform code (like X11 on linux) and are mostly obsoleted by the ApplicationContext class. Generally you should be using SDL2/ Qt for windowing and just embed Ogre.
52
53  Windows porting note: to continue using `WindowEventUtilities`, you now must explicitly register `_WndProc` for each window you create:
54  ```
55  NameValuePairList miscParams;
56  miscParams["windowProc"] =
57      StringConverter::toString((size_t)WindowEventUtilities::_WndProc);
58  RenderWindow* renderWindow =
59      Root::getSingleton().createRenderWindow(name, width, height, isFullScreen, &miscParams);
60  WindowEventUtilities::_addRenderWindow(renderWindow);
61  ```
62  i.e. `Ogre::Root::initialise(True, ...)` does no longer work.
63
64* similarly the `ConfigDialog` was moved to the Bites Component.
65
66* unused `ErrorDialog` API was dropped
67
68### Breaking non-API changes
69
70These changes require unit testing on your side as compilation will succeed, but the rendering result may vary compared to 1.10.
71
72* `TextureUnit` no longer caches any `Texture` state. All texture related calls now forward to the assigned Texture. If there is no Texture assigned, calls to e.g. `TextureUnitState::setNumMipmaps` have no effect.
73
74* Textures must not be declared in an Ogre Script *and* be manually created. Ogre now immediately creates all Textures declared in scripts (in unloaded state). Previously it was possible to declare a texture name in the Material and create a manual texture before the material was fully loaded. This is not possible any more.
75If you were relying on the old behaviour, you now must explicitly set the texture via `pass->getTextureUnitState(..)->setTexture(manualTex)`.
76
77* default Light direction changed from `UNIT_Z` to `NEGATIVE_UNIT_Z` to be consistent with Cameras and SceneNodes. This will only cause issues if you were relying on the default direction. If you manually set it directly or via SceneNodes the results are the same. For legacy code with Lights attached to SceneNodes, just drop the `localDirectionVector` param.
78
79* Mesh: does not use CPU shadow buffers by default any more. If you were relying on fast read access, you will have to explicitly request shadow buffers. Everybody else just saves memory now.
80
81* AxisAlignedBox: do not cache corner positions to reduce memory usage
82
83### Other
84
85* drop RenderSystemCapabilities that were never set or that are supported everywhere
86
87* `Archive` specializations e.g. `FileSystemArchive`, `ZipArchive` are now fully hidden. You must now use the respective Factories to create them.
88
89* SceneManager: factored out SkyRenderer and ShadowRenderer helper classes. They enforce encapsulation and allow easier maintenance of the respective algorithms. In future this will be pluggable to allow for more sophisticated algorithms.
90
91
92## CMake/ Build
93
94Precompiled headers (PCH) support was rewritten and now works on GCC too (not yet with clang).
95* PCHs are the predecessors of the Module TS (C++20)
96* on both MSVC and GCC they speed up the build by about 2x
97* Consequently the "Unity build" (rather hack) option was dropped
98
99The `FindOGRE.cmake` script (deprecated in 1.10) was dropped in favour of the modern `OGREConfig.cmake` config-file package.
100Additionally `OGREConfig.cmake` was upgraded to use export targets instead of variables.
101
102This means that you now can just write
103```python
104target_link_libraries(YourApp OgreMain)
105```
106and all include path and additional libraries will be automatically handled. Using `${OGRE_INCLUDE_DIRS}` is not necessary any more.
107
108New `OGRE_RESOURCEMANAGER_STRICT` options:
109
1100. legacy mode that searches through all groups (slow)
1111. pedantic mode that forces you to specify a resource group (cumbersome)
1122. new strict mode that defaults to the default group
113
114Note that you have to clear your CMake cache variable for the new values to work. Otherwise you will get compile errors due to the old values (ON/ OFF).
115
116## Platforms
117All platform headers were hidden and are now only available for internal usage. You are forced to use the cross platform API now. Alongside support for some obsolete platforms was dropped.
118* Android: Android specific classes are now declared in the respective Main headers. e.g. APKZipArchive is in `OgreZip.h`
119* iOS/ OSX: `macUtils.h` is hidden. Use the cross-platform alternatives in `FileSystemLayer` e.g.
120   - `iOSDocumentsDirectory()` -> `getWritablePath`
121   - `macBundlePath()` -> `resolveBundlePath`
122* Google NaCl platform support was removed. [See the official migration guide](https://developer.chrome.com/native-client/migration)
123* MinGW (mingw-w64) is support again, including the D3D9 RenderSystem
124
125## RT Shader System
126
127Extend API for additional shader types (e.g. Geometry) and drop the separate HLSL4 handling. With D3D11 we now use the HLSL4 legacy mode which allows us to use the same shaders like for D3D9. This unifies the code and improves RTSS compatibility with D3D11.
128
129## Overlay
130Overlay scripts now support the standard ogrescript syntax and the `template` keyword is now optional.
131Furthermore the the `overlay_element` keyword unifies `container` and `element`, as there was little difference between those two.
132So if you had a script like this
133
134```cpp
135template container BorderPanel(MyTemplates/BasicBorderPanel)
136{
137  ...
138}
139
140MyOverlays/AnotherOverlay
141{
142    zorder 490
143    container BorderPanel(MyElements/BackPanel) : MyTemplates/BasicBorderPanel
144    {
145      ...
146    }
147}
148```
149
150you can (and should) now write
151
152```cpp
153overlay_element MyTemplates/BasicBorderPanel BorderPanel
154{
155  ...
156}
157
158overlay MyOverlays/AnotherOverlay
159{
160    zorder 490
161    overlay_element MyElements/BackPanel BorderPanel : MyTemplates/BasicBorderPanel
162    {
163      ...
164    }
165}
166```
167
168in a later release the custom parser will be replaced by a standard ScriptTranslator. However to retain support for the old syntax it is kept for now. Consequently this means that script variables and abstract objects are not yet supported.
169
170## BSP Plugin
171* ported to the new `SceneLoader` API. Consequently `BspResourceManager` was replaced by `BspSceneLoader`.
172
173## RenderSystems
174* GL: bump required OpenGL version to 1.5 (Hardware from 2003)
175* GL: no longer depends on GLU (deprecated since 2009)
176* D3D9: improved compatibility with MinGW-w64
177* GLES1: dropped GLES1 RenderSystem (deprecated since 1.8)
178
179## Bites
180This component finalized which allows us to drop the BETA status
181* SDL2 classes are no longer exported through headers.
182  * OgreBites SDLK_.. enum moved into the `OgreBites` namespace. Internal SDL2 fields no longer accessible.
183* While the API still resembles SDL2, we can now swap the implementation to e.g. Qt without API breaks.
184
185## Samples
186Build all included samples as on SamplePlugin "DefaultSamples". This greatly simplifies the build and reduces build time while external Plugins are still supported.
187
188