BreakingChanges

From ClanLib Game SDK

This file describes breaking changes between versions.

ClanLib's version numbering information.

Contents

Version 3.0.0: Not released yet

(Significant breaking changes are only listed)

Compare the examples from ClanLib 2.3 and ClanLib 3.0 to determine the small differences.

The CL_ prefix has been removed. ClanLib now recides in a "clan" namespace.
On Windows, there are no longer any library dependancies (except Windows 8 SDK)
Visual Studio 2008 support has been dropped. Visual Studio 2010 and 2012 now supprted.
ClanLib requires C++11 support
The order of the matrix multiplication and subtraction has been reversed, to match the OpenGL GLSL order.
clan::Mat[234]<type> "multiply(matrix)" has been removed to avoid confusion. Replaced with "operator *"
Sprites, Images and Textures do not cache loaded textures via the constructors. However, if using resources, use the static function "resource" that uses the DisplayCache.
Colorf now inherits Vec4f, so you do not have to convert the structure before sending it to the shader
Color now inherits Vec4ub, so you do not have to convert the structure before sending it to the shader
CollisionOutline::copy() was renamed to clone() to be more consistent with ClanLib API
DisplayWindowDescription::set_decorations() was removed since it was identical to show_caption()
BlendMode, BufferControl, PolygonRasterizer and Pen have all been replaced with state classes. BlendState and DepthStencilState, RasterizerState
GraphicContext standard shader support moved into a new Canvas class. Fonts, Images and Sprites now use the Canvas class
Target removed, merged into clanGL.

Version 2.3.8: Not released yet

Version 2.3.7: Release 14 June 2013

Version 2.3.6: Release 26 March 2012

Version 2.3.5: Release 23 February 2012

Version 2.3.4: Release 2 December 2011

These breaking changes were required to fix current functionality.

CL_CPU_ExtensionX86 "sse5" enum was replaced with xop, avx, aes, fma3, fma4.
Double click events are now fixed on Linux. Unfortunately, there was a fault in some examples that did not hook this event. The examples are now fixed:
	CL_Slot slot_mouse_down = window.get_ic().get_mouse().sig_key_down().connect(this, &App::on_mouse_down);
	CL_Slot slot_mouse_dblclick = window.get_ic().get_mouse().sig_key_dblclk().connect(this, &App::on_mouse_down);
libxrender-dev is now a dependency for linux transparent windows. If you do not require transparent windows, and libxrender-dev is not found, ClanLib will still compile.

Version 2.3.3: Release 5 September 2011

Version 2.3.2: Release 19 August 2011

Version 2.3.1: Release 29 July 2011

Version 2.3.0: Release 26 July 2011

CL_WeakPtr has been #defined to std::weak_ptr
CL_SharedPtr has been #defined to std:shared_ptr
CL_AutoPtr has been removed. Use CL_UniquePtr instead (Use cl_move to transfer ownership)
"weakptr->foobar()" --> "weakptr.lock()->foobar()"
"if (myshared_ptr.is_null())" --> "if ( ! my_new_shared )"
Removed CL_UnknownSharedPtr, use cl_dynamic_pointer_cast instead (defined to std::dynamic_pointer_cast)
Changed cl_clamp to use (val,min,max) parameter order instead of (min,max,val) to match OpenGL
CL_MemoryPool removed
For OpenCL compatibility, cl_int8 now represents 8 cl_int's with 32 byte alignment.
Renamed cl_int8-->cl_char, cl_int16-->cl_short, cl_int32->cl_int, cl_int64->cl_long. NOTE: ClanLib 2.3.1, this changed again to "cl_byte8, cl_ubyte16..." datatypes. Use these instead of ClanLib 2.2.x "cl_int8, cl_uint16..." datatypes
CL_GraphicContext::create_worker_gc() removed. This function did not work, also it makes ClanLib implementation more complex. We currently share data between different OpenGL contexts using CL_SharedGCData and wglShareLists. It will be tricky to get it right when also using multiple threads. That is also assuming Windows and Linux graphic card drivers fully support it.
Removed the graphic context from CL_Font::get_font_metrics. It was not required
CL_TextureGroup no longer requires a CL_GraphicContext in constructor.
CL_Font_Freetype no longer requires a CL_GraphicContext in constructor.
CL_Sprite no longer has a constructor that only takes a CL_GraphicContext.
CL_Font's by default have sub-pixel rendering enabled. To disable it, use CL_FontDescription set_subpixel(false)
CL_Font's have antialias enabled by default (not applicable when sub-pixel rendering enabled). Thus, CL_FontDescription get_anti_alias_set() function was removed.
Removed CL_PolygonRasterizer::get_face_fill_mode_front() and CL_PolygonRasterizer::get_face_fill_mode_back(), replaced with CL_PolygonRasterizer::get_face_fill_mode() (Changed for OpenGL 3.0).
CL_GUIManager::exec() no longer accepts the "loop_until_complete" parameter. If you still require this functionality. Use CL_GUIWindowManagerTexture's process() function. Remember to call CL_KeepAlive::process() manually.
CL_NetGameServer::get_event_arrived was removed.
CL_NetGameServer is now CL_KeepAlive enabled, so just by calling CL_KeepAlive::process() the network events will be processed. Remember to create the CL_NetGameServer object in the same thread that calls CL_KeepAlive::process()!
The "CL_" OpenGL defines have been renamed to use the "GL_" prefix. Also updated to the OpenGL 4.1 specification.
The "CL" OpenGL datatype prefix now use the "GL" prefix. For example, CLint was changed to GLint
The "cl" OpenGL functions have been renamed use the standard gl prefix. For example, clBindBuffer is now glBindBuffer
The "CL_" OpenGL defines have been renamed to use the "GL_" prefix.
The "CL" OpenGL datatype prefix now use the "GL" prefix. For example, CLint was changed to GLint
Numerious breaking changes. Treat this ClanLib component as rewritten. It is now stable.

Version 2.2.13: Not released yet

Version 2.2.12: Release 19 August 2011

Version 2.2.11: Release 29 July 2011

Version 2.2.10: Release 20 July 2011

Version 2.2.9: Release 10 June 2011

Version 2.2.8: Release 08 April 2011

Version 2.2.7: Release 21 March 2011

Version 2.2.6: Release 14 January 2011

Version 2.2.5: Released 5 November 2010

Version 2.2.4: Released 6 October 2010

Version 2.2.3: Released 21 September 2010

Version 2.2.2: Released 24 August 2010

Version 2.2.1: Released 5 August 2010

Version 2.2.0: Released 20 July 2010

CL_String is now an utf-8 string on all platforms. No need for cl_text wrapper around text, and there are no more -uc libraries generated.
If you use cl_text a lot in your code. Visual Studio Find/Replace can remove them for you: Find="cl_text\({:q}\)", Replace="\1", Regular expressions enabled.
If strings contain unicode. Save the source code as: UNICODE(UTF-8 without signature)
Under Visual Studio, the default location for the compiled libraries have changed. The 32 and 64 bit versions of ClanLib libraries are now located under Win32 / x64 subdirectories in the selected target directory. You will need to change the Visual Studio VC++ Directories settings; adding Win32 and/or x64 dirs under Library Directories.
Instead, use CL_PixelBuffer and specify the source rectangle.
Instead, use CL_PixelBuffer.get_format() to obtain the format enum (for example cl_rgba8) and if you require the pixel masks etc, these have been moved into the CL_PixelBuffer API.
If you use this class then you will need to set it to equal the desired rectangle of "buffer"
If you use CL_ProgramObjects with the GL target, you have to modify your programs if they contain gl_ModelViewMatrix, gl_ProjectionMatrix, gl_ModelViewProjectionMatrix, gl_NormalMatrix. Change these to cl_ModelViewMatrix, cl_ProjectionMatrix, cl_ModelViewProjectionMatrix, cl_NormalMatrix
Remember to add:
 "uniform mat4 cl_ModelViewMatrix;"
 "uniform mat4 cl_ProjectionMatrix;"
 "uniform mat4 cl_ModelViewProjectionMatrix;"
 "uniform mat3 cl_NormalMatrix;"
If you don't require all these uniforms, you can select which ones use want via the CL_ProgramMatrixFlags in gc.set_program_object(program, program_matrix_flags);
(Note, program_matrix_flags defaults to cl_program_matrix_all_standard)
If you require it, copy it directly into your application.
Return value false = Entire buffer updated, because the target does not support partial updates
Legacy defines and functions have been removed.
(From deprecated and removed features in OpenGL 3.3 Specification)
Templates defined for: int (CL_Circle), float (CL_Circlef), double (CL_Circled)
Note, CL_ScreenInfo still exists, to returns the geometries of the attached screens and the index of the primary screen in the returned array (although, currently this is not implemented on linux)
It changed from
 dest.rgba = src.a*src.rgba + (1-src.a)*dest.rgba
to:
 dest.rgb = src.a*src.rgb + (1-src.a)*dest.rgb
 dest.a = src.a + (1-src.a)*dest.a

Version 2.1.3: Not released yet

Version 2.1.2: Released 19 July 2010

Version 2.1.1: Released 10 December 2009

On linux, this function does not do anything. It used to use the libxxf86vm library, but this caused various problems. It would only report the current mode on most system, and xf86vidmode is considered sort of deprecated by upstream xorg.
(Note, since clanlib v2.x no longer changes the video resolution, CL_DisplayWindowMode has no real use).
There was no requirement to link with this library
Instead internally, ClanLib uses dlopen(). Your application now can use the libgl.so local on the machine it runs on (so it uses the configured driver on the machine, not the driver that the application was compiled with)
Instead, a free GUI theme (GUIThemeBasic) is included for use with the ClanLib examples (or your application).
"CL_Mat2<float> CL_Mat2d;" was changed to "CL_Mat2<double> CL_Mat2d;"

Version 2.1.0: Released 20 October 2009

There was a discrepancy between the documentation and what it actually did. Previously, using floats, we lost accuracy. Now control of animation speed should now be 100% accurate.
If you previously did sprite.update(float), you now need to feed it a number 1000 as large (or stop dividing CL_System::get_time() by 1000.0f when calculating delta time). If you don't use a time parameter to sprite.update() it is calculated automatically as before.
To solve some problems with co-hosting different versions of ClanLib, and to better support breaking changes in the future, we've changed how ClanLib names its libraries under Unix. ClanLib now creates libclan21Core.so, libclan21Display.so (and so on), instead of naming it libclanCore.so and libclanDisplay.so. Every breaking release will increase the 2.x.0 number. Every backward compatible release will get a 2.1.x version.
This was done because clanGDI is better and faster. ClanSDL is still available in the Contrib repository - read more about it on http://clanlib.org/development.html
It was placed in the wrong class in the last release. CL_Line is an line with an infinite length, thus requires a different clipping method.
The image is now no longer upside-down.
It's now always successful.
Add CL_File::access_read, CL_File::access_write or CL_File::access_read_write.

Version 2.0.4: Released 17 September 2009

Use CL_KeepAlive::process() instead
It was a bug with it being optional.
Thus positions may be different.
Use func_close() (from CL_GUIComponent), but note, it returns a bool (true = message consumed) so you need to change your signature to bool on_close();
Use CL_PopupMenuItem's func_clicked() instead (returned from CL_PopupMenu::insert_item()).
Use CL_GUIComponent::func_activated and func_deactivated instead.
Use set_accelerator_table(const CL_AcceleratorTable &table) instead if you use accelerators.

Version 2.0.3: Released 15 July 2009

Example before: CL_RGB8 Now: cl_rgb8
The CL_Timer implementation no longer require any knowledge of the windowing system message queue, and therefore no longer requires any CL_DisplayWindow for creation. As a consequence of this change, CL_Timer has been moved to <ClanLib/Core/System/timer.h> and now uses the CL_KeepAlive system to invoke the timer callback.
As it is no longer required (see CL_Timer post above). To create a timer object, simply construct the CL_Timer object and start using it.
Use the CL_GUITopLevelDescription to set wanted geometry, either using set_position on it, or using the new convenience constructors including position.

Version 2.0.2 Released 18 May 2009

- No breaking changes since 2.0.1

Version 2.0.1 Released 28 April 2009

CL_Contour no longer exposes internal variables - use getter functions instead.

Version 2.0.0 Released 22 April 2009