diff --git a/.gitignore b/.gitignore
index e430d78f..7c3945ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,9 +6,13 @@ x64/
 Debug/
 Release/
 
+# CMake folders
+/cmake-build-release/
+/cmake-build-debug/
+
 # Application folders
 .vs
-.vscode
+.idea
 
 # vs2010
 ipch/
@@ -28,4 +32,8 @@ packages/
 # Resources bin
 *.aps
 
-docs/
\ No newline at end of file
+# Mac cache files
+.DS_Store
+
+# Documents
+docs/
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
new file mode 100644
index 00000000..de7425e9
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,32 @@
+{
+    "configurations": [
+        {
+            "name": "Mac",
+            "includePath": [
+                "${workspaceFolder}/src/**"
+            ],
+            "defines": [
+                "TARGET_OS_MAC"
+            ],
+            "macFrameworkPath": [
+                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
+            ],
+            "compilerPath": "/usr/bin/clang",
+            "cStandard": "c11",
+            "cppStandard": "c++14",
+            "intelliSenseMode": "clang-x64"
+        },
+        {
+            "name": "Linux",
+            "includePath": [
+                "${workspaceFolder}/src/**"
+            ],
+            "defines": [],
+            "compilerPath": "/usr/bin/gcc",
+            "cStandard": "c11",
+            "cppStandard": "c++14",
+            "intelliSenseMode": "clang-x64"
+        }
+    ],
+    "version": 4
+}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..cfc8e1f0
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,4 @@
+{
+    "files.autoGuessEncoding": true,
+    "files.encoding": "gb2312"
+}
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000..cd27226e
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 3.16)
+project(Kiwano C CXX)
+
+set(CMAKE_CXX_STANDARD 17)
+
+if (WIN32)
+    message(STATUS "Building on Windows platform.")
+elseif (APPLE)
+    message(STATUS "Building on MacOS platform.")
+    add_compile_definitions(TARGET_OS_MAC)
+elseif (UNIX)
+    message(STATUS "Building on UNIX-like OS platform.")
+endif ()
+
+include_directories(src/3rd-party)
+include_directories(src)
+
+add_subdirectory(src/kiwano)
+add_subdirectory(src/kiwano-audio)
+add_subdirectory(src/kiwano-imgui)
+add_subdirectory(src/kiwano-network)
+add_subdirectory(src/kiwano-physics)
+add_subdirectory(src/3rd-party/Box2D)
+add_subdirectory(src/3rd-party/curl)
+add_subdirectory(src/3rd-party/nlohmann)
+add_subdirectory(src/3rd-party/pugixml)
diff --git a/Doxyfile b/Doxyfile
index 8d683bfe..56599aa5 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -5,7 +5,7 @@
 #---------------------------------------------------------------------------
 
 PROJECT_NAME           = "Kiwano Engine"
-PROJECT_NUMBER         = v1.0.14
+PROJECT_NUMBER         = v1.0.x
 PROJECT_BRIEF          =
 PROJECT_LOGO           = logo/logo_tiny.png
 
@@ -81,6 +81,7 @@ HTML_HEADER            =
 HTML_FOOTER            =
 HTML_STYLESHEET        =
 HTML_EXTRA_STYLESHEET  =
+HTML_EXTRA_FILES       = logo/favicon.ico
 
 GENERATE_TREEVIEW      = YES
 ENUM_VALUES_PER_LINE   = 4
diff --git a/logo/icon.ico b/logo/favicon.ico
similarity index 100%
rename from logo/icon.ico
rename to logo/favicon.ico
diff --git a/projects/kiwano/cpp.hint b/projects/kiwano/cpp.hint
deleted file mode 100644
index 6e489168..00000000
--- a/projects/kiwano/cpp.hint
+++ /dev/null
@@ -1,5 +0,0 @@
-// 提示文件帮助 Visual Studio IDE 解释 Visual C++ 标识符,
-// 如函数和宏的名称。
-// 有关详细信息,请参见 https://go.microsoft.com/fwlink/?linkid=865984
-
-#define KGE_API
diff --git a/projects/kiwano/kiwano.vcxproj b/projects/kiwano/kiwano.vcxproj
index 06c49d61..06fa487e 100644
--- a/projects/kiwano/kiwano.vcxproj
+++ b/projects/kiwano/kiwano.vcxproj
@@ -5,58 +5,53 @@
     
     
     
-    
+    
     
     
     
-    
-    
-    
+    
     
+    
+    
+    
+    
+    
+    
+    
     
     
     
     
-    
-    
-    
-    
-    
-    
     
     
     
-    
     
     
     
     
     
     
-    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
     
     
-    
     
     
-    
     
     
     
     
-    
-    
-    
-    
-    
-    
     
     
-    
-    
     
     
     
@@ -78,6 +73,7 @@
     
     
     
+    
     
     
     
@@ -86,6 +82,8 @@
     
     
     
+    
+    
     
     
     
@@ -98,51 +96,55 @@
     
     
     
+    
+    
     
+    
     
+    
+    
+    
+    
     
+    
   
   
     
     
     
-    
+    
     
     
     
-    
+    
     
-    
     
-    
-    
     
     
     
-    
     
     
     
     
+    
+    
+    
+    
+    
+    
+    
     
-    
-    
-    
-    
-    
-    
-    
-    
     
     
-    
-    
-    
     
     
     
-    
-    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -160,6 +162,8 @@
     
     
     
+    
+    
     
     
     
@@ -170,8 +174,14 @@
     
     
     
+    
     
+    
     
+    
+    
+    
+    
     
   
   
@@ -185,7 +195,7 @@
     
   
   
-    
+    
   
   
     {FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}
diff --git a/projects/kiwano/kiwano.vcxproj.filters b/projects/kiwano/kiwano.vcxproj.filters
index 034a860a..9a950f94 100644
--- a/projects/kiwano/kiwano.vcxproj.filters
+++ b/projects/kiwano/kiwano.vcxproj.filters
@@ -22,15 +22,21 @@
     
       {e84dcf9a-e650-473e-8c9c-193804ab9e76}
     
-    
-      {c629aedd-ffb9-4bc1-82c3-f50e77c82e77}
-    
     
       {adb44ca9-674a-4b77-993f-d65193d8ab06}
     
     
       {fd281702-0006-46d2-8fd1-28c502464164}
     
+    
+      {f514ae4f-2f6a-4d47-aa38-245628d6e01c}
+    
+    
+      {b0d28d20-bfaf-4816-8415-28c20ecf9fac}
+    
+    
+      {d15f4de1-7c2c-40d6-a3ce-68860b95a61e}
+    
   
   
     
@@ -42,12 +48,6 @@
     
       2d
     
-    
-      core
-    
-    
-      core
-    
     
       core
     
@@ -69,24 +69,12 @@
       core
     
     
-    
-      core
-    
-    
-      core
-    
     
       2d
     
-    
-      2d
-    
     
       2d
     
-    
-      2d
-    
     
       2d\action
     
@@ -99,18 +87,12 @@
     
       2d\action
     
-    
-      2d\action
-    
     
       2d\action
     
     
       utils
     
-    
-      2d
-    
     
       2d
     
@@ -123,12 +105,6 @@
     
       2d\action
     
-    
-      core
-    
-    
-      core
-    
     
       utils
     
@@ -150,36 +126,12 @@
     
       2d
     
-    
-      core
-    
     
       platform\win32
     
     
       platform\win32
     
-    
-      core\event
-    
-    
-      core\event
-    
-    
-      core\event
-    
-    
-      core\event
-    
-    
-      core\event
-    
-    
-      2d
-    
-    
-      core
-    
     
       core
     
@@ -282,9 +234,6 @@
     
       render
     
-    
-      core
-    
     
       platform
     
@@ -297,12 +246,6 @@
     
       core
     
-    
-      core
-    
-    
-      core
-    
     
       core
     
@@ -315,9 +258,6 @@
     
       render
     
-    
-      2d
-    
     
       core
     
@@ -327,6 +267,90 @@
     
       core
     
+    
+      render
+    
+    
+      render
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      2d\action
+    
+    
+      render\DirectX
+    
+    
+      utils
+    
+    
+      base
+    
+    
+      base
+    
+    
+      base
+    
+    
+      base
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      2d
+    
+    
+      base\component
+    
+    
+      base\component
+    
+    
+      base\component
+    
   
   
     
@@ -338,36 +362,18 @@
     
       2d
     
-    
-      core
-    
-    
-      core
-    
     
       core
     
     
       platform
     
-    
-      core
-    
-    
-      core
-    
     
       2d
     
-    
-      2d
-    
     
       2d
     
-    
-      2d
-    
     
       2d\action
     
@@ -377,18 +383,12 @@
     
       2d\action
     
-    
-      2d\action
-    
     
       2d\action
     
     
       utils
     
-    
-      2d
-    
     
       2d
     
@@ -401,12 +401,6 @@
     
       2d\action
     
-    
-      core
-    
-    
-      core
-    
     
       utils
     
@@ -428,30 +422,9 @@
     
       2d
     
-    
-      core
-    
     
       platform\win32
     
-    
-      core\event
-    
-    
-      core\event
-    
-    
-      core\event
-    
-    
-      core\event
-    
-    
-      2d
-    
-    
-      core
-    
     
       platform\win32
     
@@ -521,9 +494,6 @@
     
       render
     
-    
-      core
-    
     
       platform
     
@@ -533,14 +503,80 @@
     
       render
     
-    
-      2d
-    
     
       core
     
+    
+      render
+    
+    
+      render
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      utils
+    
+    
+      2d\action
+    
+    
+      utils
+    
+    
+      base
+    
+    
+      base
+    
+    
+      base
+    
+    
+      base
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      event
+    
+    
+      2d
+    
+    
+      base\component
+    
+    
+      base\component
+    
+    
+      base\component
+    
   
   
-    
+    
   
 
\ No newline at end of file
diff --git a/projects/kiwano/suppress_warning.ruleset b/projects/kiwano/suppress_warning.ruleset
new file mode 100644
index 00000000..f2abaa0a
--- /dev/null
+++ b/projects/kiwano/suppress_warning.ruleset
@@ -0,0 +1,7 @@
+
+
+  
+  
+    
+  
+
\ No newline at end of file
diff --git a/src/3rd-party/Box2D/CMakeLists.txt b/src/3rd-party/Box2D/CMakeLists.txt
new file mode 100644
index 00000000..17f90b54
--- /dev/null
+++ b/src/3rd-party/Box2D/CMakeLists.txt
@@ -0,0 +1,98 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        Collision/Shapes/b2ChainShape.cpp
+        Collision/Shapes/b2ChainShape.h
+        Collision/Shapes/b2CircleShape.cpp
+        Collision/Shapes/b2CircleShape.h
+        Collision/Shapes/b2EdgeShape.cpp
+        Collision/Shapes/b2EdgeShape.h
+        Collision/Shapes/b2PolygonShape.cpp
+        Collision/Shapes/b2PolygonShape.h
+        Collision/Shapes/b2Shape.h
+        Collision/b2BroadPhase.cpp
+        Collision/b2BroadPhase.h
+        Collision/b2CollideCircle.cpp
+        Collision/b2CollideEdge.cpp
+        Collision/b2CollidePolygon.cpp
+        Collision/b2Collision.cpp
+        Collision/b2Collision.h
+        Collision/b2Distance.cpp
+        Collision/b2Distance.h
+        Collision/b2DynamicTree.cpp
+        Collision/b2DynamicTree.h
+        Collision/b2TimeOfImpact.cpp
+        Collision/b2TimeOfImpact.h
+        Common/b2BlockAllocator.cpp
+        Common/b2BlockAllocator.h
+        Common/b2Draw.cpp
+        Common/b2Draw.h
+        Common/b2GrowableStack.h
+        Common/b2Math.cpp
+        Common/b2Math.h
+        Common/b2Settings.cpp
+        Common/b2Settings.h
+        Common/b2StackAllocator.cpp
+        Common/b2StackAllocator.h
+        Common/b2Timer.cpp
+        Common/b2Timer.h
+        Dynamics/Contacts/b2ChainAndCircleContact.cpp
+        Dynamics/Contacts/b2ChainAndCircleContact.h
+        Dynamics/Contacts/b2ChainAndPolygonContact.cpp
+        Dynamics/Contacts/b2ChainAndPolygonContact.h
+        Dynamics/Contacts/b2CircleContact.cpp
+        Dynamics/Contacts/b2CircleContact.h
+        Dynamics/Contacts/b2Contact.cpp
+        Dynamics/Contacts/b2Contact.h
+        Dynamics/Contacts/b2ContactSolver.cpp
+        Dynamics/Contacts/b2ContactSolver.h
+        Dynamics/Contacts/b2EdgeAndCircleContact.cpp
+        Dynamics/Contacts/b2EdgeAndCircleContact.h
+        Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
+        Dynamics/Contacts/b2EdgeAndPolygonContact.h
+        Dynamics/Contacts/b2PolygonAndCircleContact.cpp
+        Dynamics/Contacts/b2PolygonAndCircleContact.h
+        Dynamics/Contacts/b2PolygonContact.cpp
+        Dynamics/Contacts/b2PolygonContact.h
+        Dynamics/Joints/b2DistanceJoint.cpp
+        Dynamics/Joints/b2DistanceJoint.h
+        Dynamics/Joints/b2FrictionJoint.cpp
+        Dynamics/Joints/b2FrictionJoint.h
+        Dynamics/Joints/b2GearJoint.cpp
+        Dynamics/Joints/b2GearJoint.h
+        Dynamics/Joints/b2Joint.cpp
+        Dynamics/Joints/b2Joint.h
+        Dynamics/Joints/b2MotorJoint.cpp
+        Dynamics/Joints/b2MotorJoint.h
+        Dynamics/Joints/b2MouseJoint.cpp
+        Dynamics/Joints/b2MouseJoint.h
+        Dynamics/Joints/b2PrismaticJoint.cpp
+        Dynamics/Joints/b2PrismaticJoint.h
+        Dynamics/Joints/b2PulleyJoint.cpp
+        Dynamics/Joints/b2PulleyJoint.h
+        Dynamics/Joints/b2RevoluteJoint.cpp
+        Dynamics/Joints/b2RevoluteJoint.h
+        Dynamics/Joints/b2RopeJoint.cpp
+        Dynamics/Joints/b2RopeJoint.h
+        Dynamics/Joints/b2WeldJoint.cpp
+        Dynamics/Joints/b2WeldJoint.h
+        Dynamics/Joints/b2WheelJoint.cpp
+        Dynamics/Joints/b2WheelJoint.h
+        Dynamics/b2Body.cpp
+        Dynamics/b2Body.h
+        Dynamics/b2ContactManager.cpp
+        Dynamics/b2ContactManager.h
+        Dynamics/b2Fixture.cpp
+        Dynamics/b2Fixture.h
+        Dynamics/b2Island.cpp
+        Dynamics/b2Island.h
+        Dynamics/b2TimeStep.h
+        Dynamics/b2World.cpp
+        Dynamics/b2World.h
+        Dynamics/b2WorldCallbacks.cpp
+        Dynamics/b2WorldCallbacks.h
+        Rope/b2Rope.cpp
+        Rope/b2Rope.h
+        Box2D.h)
+
+add_library(libbox2d ${SOURCE_FILES})
diff --git a/src/3rd-party/Box2D/Common/b2Math.h b/src/3rd-party/Box2D/Common/b2Math.h
index 236c1a4a..ee6d56d7 100644
--- a/src/3rd-party/Box2D/Common/b2Math.h
+++ b/src/3rd-party/Box2D/Common/b2Math.h
@@ -20,7 +20,7 @@
 #define B2_MATH_H
 
 #include "b2Settings.h"
-#include 
+#include 
 
 /// This function is used to ensure that a floating point number is not a NaN or infinity.
 inline bool b2IsValid(float32 x)
diff --git a/src/3rd-party/curl/CMakeLists.txt b/src/3rd-party/curl/CMakeLists.txt
new file mode 100644
index 00000000..523ca79c
--- /dev/null
+++ b/src/3rd-party/curl/CMakeLists.txt
@@ -0,0 +1,18 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        curl.h
+        curlbuild.h
+        curlrules.h
+        curlver.h
+        easy.h
+        mprintf.h
+        multi.h
+        stdcheaders.h
+        typecheck-gcc.h)
+
+add_library(libcurl ${SOURCE_FILES})
+
+target_link_libraries(libcurl ./libs/libcurl.lib)
+
+set_target_properties(libcurl PROPERTIES LINKER_LANGUAGE CXX)
diff --git a/src/3rd-party/imgui/CMakeLists.txt b/src/3rd-party/imgui/CMakeLists.txt
new file mode 100644
index 00000000..50957205
--- /dev/null
+++ b/src/3rd-party/imgui/CMakeLists.txt
@@ -0,0 +1,15 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        imconfig.h
+        imgui.cpp
+        imgui.h
+        imgui_demo.cpp
+        imgui_draw.cpp
+        imgui_internal.h
+        imgui_widgets.cpp
+        imstb_rectpack.h
+        imstb_textedit.h
+        imstb_truetype.h)
+
+add_library(libimgui ${SOURCE_FILES})
diff --git a/src/3rd-party/nlohmann/CMakeLists.txt b/src/3rd-party/nlohmann/CMakeLists.txt
new file mode 100644
index 00000000..5d706720
--- /dev/null
+++ b/src/3rd-party/nlohmann/CMakeLists.txt
@@ -0,0 +1,9 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        json.hpp)
+
+add_library(libnlohmann ${SOURCE_FILES})
+
+set_target_properties(libnlohmann PROPERTIES LINKER_LANGUAGE CXX)
+
diff --git a/src/3rd-party/pugixml/CMakeLists.txt b/src/3rd-party/pugixml/CMakeLists.txt
new file mode 100644
index 00000000..d6a7efaf
--- /dev/null
+++ b/src/3rd-party/pugixml/CMakeLists.txt
@@ -0,0 +1,10 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        pugiconfig.hpp
+        pugixml-impl.hpp
+        pugixml.hpp)
+
+add_library(libpugixml ${SOURCE_FILES})
+
+set_target_properties(libpugixml PROPERTIES LINKER_LANGUAGE CXX)
diff --git a/src/kiwano-audio/AudioModule.cpp b/src/kiwano-audio/AudioModule.cpp
index 8b0fbeb2..d8d2c189 100644
--- a/src/kiwano-audio/AudioModule.cpp
+++ b/src/kiwano-audio/AudioModule.cpp
@@ -20,8 +20,8 @@
 
 #include 
 #include 
-#include 
 #include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano-audio/AudioModule.h b/src/kiwano-audio/AudioModule.h
index 9d69c4de..a97e4078 100644
--- a/src/kiwano-audio/AudioModule.h
+++ b/src/kiwano-audio/AudioModule.h
@@ -22,7 +22,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano-audio/CMakeLists.txt b/src/kiwano-audio/CMakeLists.txt
new file mode 100644
index 00000000..eea58eeb
--- /dev/null
+++ b/src/kiwano-audio/CMakeLists.txt
@@ -0,0 +1,16 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        AudioModule.cpp
+        AudioModule.h
+        kiwano-audio.h
+        libraries.cpp
+        libraries.h
+        Sound.cpp
+        Sound.h
+        SoundPlayer.cpp
+        SoundPlayer.h
+        Transcoder.cpp
+        Transcoder.h)
+
+add_library(libkiwanoaudio ${SOURCE_FILES})
diff --git a/src/kiwano-audio/Sound.cpp b/src/kiwano-audio/Sound.cpp
index f344e118..99a590c3 100644
--- a/src/kiwano-audio/Sound.cpp
+++ b/src/kiwano-audio/Sound.cpp
@@ -20,7 +20,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano-audio/Sound.h b/src/kiwano-audio/Sound.h
index 375da28d..299d9083 100644
--- a/src/kiwano-audio/Sound.h
+++ b/src/kiwano-audio/Sound.h
@@ -20,8 +20,8 @@
 
 #pragma once
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/src/kiwano-audio/SoundPlayer.h b/src/kiwano-audio/SoundPlayer.h
index 62d4e25c..789c66b5 100644
--- a/src/kiwano-audio/SoundPlayer.h
+++ b/src/kiwano-audio/SoundPlayer.h
@@ -20,7 +20,7 @@
 
 #pragma once
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano-audio/Transcoder.cpp b/src/kiwano-audio/Transcoder.cpp
index 64af27c7..448e999e 100644
--- a/src/kiwano-audio/Transcoder.cpp
+++ b/src/kiwano-audio/Transcoder.cpp
@@ -25,9 +25,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/src/kiwano-audio/libraries.cpp b/src/kiwano-audio/libraries.cpp
index 9c124cd9..dc954079 100644
--- a/src/kiwano-audio/libraries.cpp
+++ b/src/kiwano-audio/libraries.cpp
@@ -19,7 +19,7 @@
 // THE SOFTWARE.
 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano-imgui/CMakeLists.txt b/src/kiwano-imgui/CMakeLists.txt
new file mode 100644
index 00000000..6296cac1
--- /dev/null
+++ b/src/kiwano-imgui/CMakeLists.txt
@@ -0,0 +1,15 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        imgui_impl/imgui_impl.h
+        imgui_impl/imgui_impl_dx10.cpp
+        imgui_impl/imgui_impl_dx10.h
+        imgui_impl/imgui_impl_dx11.cpp
+        imgui_impl/imgui_impl_dx11.h
+        ImGuiLayer.cpp
+        ImGuiLayer.h
+        ImGuiModule.cpp
+        ImGuiModule.h
+        kiwano-imgui.h)
+
+add_library(libkiwanoimgui ${SOURCE_FILES})
diff --git a/src/kiwano-imgui/ImGuiModule.cpp b/src/kiwano-imgui/ImGuiModule.cpp
index 4d9763f9..d5025254 100644
--- a/src/kiwano-imgui/ImGuiModule.cpp
+++ b/src/kiwano-imgui/ImGuiModule.cpp
@@ -2,8 +2,7 @@
 
 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/src/kiwano-imgui/ImGuiModule.h b/src/kiwano-imgui/ImGuiModule.h
index ce4ac610..b5c2d159 100644
--- a/src/kiwano-imgui/ImGuiModule.h
+++ b/src/kiwano-imgui/ImGuiModule.h
@@ -20,7 +20,7 @@
 
 #pragma once
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano-imgui/imgui_impl/imgui_impl.h b/src/kiwano-imgui/imgui_impl/imgui_impl.h
index bd98a2c5..24008337 100644
--- a/src/kiwano-imgui/imgui_impl/imgui_impl.h
+++ b/src/kiwano-imgui/imgui_impl/imgui_impl.h
@@ -7,13 +7,12 @@
 #if !defined(KGE_USE_DIRECTX10)
 
 #include 
-#include 
+#include 
 
 inline bool ImGui_Impl_Init()
 {
-    ::kiwano::RendererImpl& renderer = ::kiwano::RendererImpl::GetInstance();
-    return ImGui_ImplDX11_Init(renderer.GetD3DDeviceResources()->GetDevice(),
-                               renderer.GetD3DDeviceResources()->GetDeviceContext());
+    auto d3d = kiwano::graphics::directx::GetD3DDeviceResources();
+    return ImGui_ImplDX11_Init(d3d->GetDevice(), d3d->GetDeviceContext());
 }
 
 inline void ImGui_Impl_Shutdown()
@@ -44,11 +43,12 @@ inline bool ImGui_Impl_CreateDeviceObjects()
 #else
 
 #include 
+#include 
 
 inline bool ImGui_Impl_Init()
 {
-    ::kiwano::RendererImpl& renderer = ::kiwano::RendererImpl::GetInstance();
-    return ImGui_ImplDX10_Init(renderer.GetD3DDeviceResources()->GetDevice());
+    auto d3d = kiwano::graphics::directx::GetD3DDeviceResources();
+    return ImGui_ImplDX10_Init(d3d->GetDevice());
 }
 
 inline void ImGui_Impl_Shutdown()
diff --git a/src/kiwano-network/CMakeLists.txt b/src/kiwano-network/CMakeLists.txt
new file mode 100644
index 00000000..f804e7ff
--- /dev/null
+++ b/src/kiwano-network/CMakeLists.txt
@@ -0,0 +1,11 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        HttpModule.cpp
+        HttpModule.h
+        HttpRequest.cpp
+        HttpRequest.h
+        HttpResponse.hpp
+        kiwano-network.h)
+
+add_library(libkiwanonetwork ${SOURCE_FILES})
diff --git a/src/kiwano-network/HttpModule.cpp b/src/kiwano-network/HttpModule.cpp
index 6b3865e2..7bd9f26a 100644
--- a/src/kiwano-network/HttpModule.cpp
+++ b/src/kiwano-network/HttpModule.cpp
@@ -20,7 +20,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/src/kiwano-network/HttpModule.h b/src/kiwano-network/HttpModule.h
index 59264e64..60d326d2 100644
--- a/src/kiwano-network/HttpModule.h
+++ b/src/kiwano-network/HttpModule.h
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano-network/HttpRequest.h b/src/kiwano-network/HttpRequest.h
index fe8bdd6c..1760c3ea 100644
--- a/src/kiwano-network/HttpRequest.h
+++ b/src/kiwano-network/HttpRequest.h
@@ -20,8 +20,8 @@
 
 #pragma once
 #include 
-#include 
-#include 
+#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano-physics/CMakeLists.txt b/src/kiwano-physics/CMakeLists.txt
new file mode 100644
index 00000000..7dabf36d
--- /dev/null
+++ b/src/kiwano-physics/CMakeLists.txt
@@ -0,0 +1,25 @@
+include_directories(..)
+include_directories(../3rd-party)
+
+set(SOURCE_FILES
+        Contact.cpp
+        Contact.h
+        ContactEdge.cpp
+        ContactEdge.h
+        ContactEvent.cpp
+        ContactEvent.h
+        Fixture.cpp
+        Fixture.h
+        Global.cpp
+        Global.h
+        Joint.cpp
+        Joint.h
+        kiwano-physics.h
+        PhysicBody.cpp
+        PhysicBody.h
+        PhysicWorld.cpp
+        PhysicWorld.h)
+
+add_library(libkiwanophysics ${SOURCE_FILES})
+
+target_link_libraries(libkiwanophysics libbox2d)
diff --git a/src/kiwano-physics/Global.cpp b/src/kiwano-physics/Global.cpp
index ce6eeeba..4c6ee2da 100644
--- a/src/kiwano-physics/Global.cpp
+++ b/src/kiwano-physics/Global.cpp
@@ -18,7 +18,6 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#pragma once
 #include 
 
 namespace kiwano
diff --git a/src/kiwano-physics/PhysicWorld.cpp b/src/kiwano-physics/PhysicWorld.cpp
index afe7406e..e97384b7 100644
--- a/src/kiwano-physics/PhysicWorld.cpp
+++ b/src/kiwano-physics/PhysicWorld.cpp
@@ -32,25 +32,23 @@ public:
     DebugDrawer(const Size& size)
     {
         canvas_ = Canvas::Create(size);
+        ctx_    = canvas_->GetContext2D();
 
         fill_brush_ = Brush::Create(Color::White);
         line_brush_ = Brush::Create(Color::White);
 
-        canvas_->SetFillBrush(fill_brush_);
-        canvas_->SetStrokeBrush(line_brush_);
-
         b2Draw::SetFlags(b2Draw::e_shapeBit | b2Draw::e_jointBit | b2Draw::e_jointBit | b2Draw::e_centerOfMassBit);
     }
 
     void BeginDraw()
     {
-        canvas_->BeginDraw();
-        canvas_->Clear();
+        ctx_->BeginDraw();
+        ctx_->Clear();
     }
 
     void EndDraw()
     {
-        canvas_->EndDraw();
+        ctx_->EndDraw();
     }
 
     void Render(RenderContext& ctx)
@@ -61,11 +59,13 @@ public:
     void SetFillColor(const b2Color& color)
     {
         fill_brush_->SetColor(reinterpret_cast(color));
+        ctx_->SetCurrentBrush(fill_brush_);
     }
 
     void SetLineColor(const b2Color& color)
     {
         line_brush_->SetColor(reinterpret_cast(color));
+        ctx_->SetCurrentBrush(line_brush_);
     }
 
     void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) override
@@ -76,7 +76,7 @@ public:
         for (int32 i = 0; i < vertexCount; ++i)
         {
             b2Vec2 p2 = vertices[i];
-            canvas_->DrawLine(global::WorldToLocal(p1), global::WorldToLocal(p2));
+            ctx_->DrawLine(global::WorldToLocal(p1), global::WorldToLocal(p2));
             p1 = p2;
         }
     }
@@ -92,25 +92,25 @@ public:
         maker.EndPath(true);
 
         SetFillColor(color);
-        canvas_->FillShape(maker.GetShape());
+        ctx_->FillShape(*maker.GetShape());
     }
 
     void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) override
     {
         SetLineColor(color);
-        canvas_->DrawCircle(global::WorldToLocal(center), global::WorldToLocal(radius));
+        ctx_->DrawCircle(global::WorldToLocal(center), global::WorldToLocal(radius));
     }
 
     void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) override
     {
         SetFillColor(color);
-        canvas_->FillCircle(global::WorldToLocal(center), global::WorldToLocal(radius));
+        ctx_->FillCircle(global::WorldToLocal(center), global::WorldToLocal(radius));
     }
 
     void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) override
     {
         SetLineColor(color);
-        canvas_->DrawLine(global::WorldToLocal(p1), global::WorldToLocal(p2));
+        ctx_->DrawLine(global::WorldToLocal(p1), global::WorldToLocal(p2));
     }
 
     void DrawTransform(const b2Transform& xf) override
@@ -124,24 +124,25 @@ public:
         p2 = p1 + k_axisScale * xf.q.GetXAxis();
 
         SetLineColor(red);
-        canvas_->DrawLine(global::WorldToLocal(p1), global::WorldToLocal(p2));
+        ctx_->DrawLine(global::WorldToLocal(p1), global::WorldToLocal(p2));
 
         p2 = p1 + k_axisScale * xf.q.GetYAxis();
 
         SetLineColor(green);
-        canvas_->DrawLine(global::WorldToLocal(p1), global::WorldToLocal(p2));
+        ctx_->DrawLine(global::WorldToLocal(p1), global::WorldToLocal(p2));
     }
 
     void DrawPoint(const b2Vec2& p, float32 size, const b2Color& color) override
     {
         SetFillColor(color);
-        canvas_->FillCircle(global::WorldToLocal(p), global::WorldToLocal(size));
+        ctx_->FillCircle(global::WorldToLocal(p), global::WorldToLocal(size));
     }
 
 private:
-    CanvasPtr canvas_;
-    BrushPtr  fill_brush_;
-    BrushPtr  line_brush_;
+    CanvasPtr        canvas_;
+    RenderContextPtr ctx_;
+    BrushPtr         fill_brush_;
+    BrushPtr         line_brush_;
 };
 
 class DestructionListener : public b2DestructionListener
diff --git a/src/kiwano/2d/Actor.cpp b/src/kiwano/2d/Actor.cpp
index 3eca99a6..5f54647c 100644
--- a/src/kiwano/2d/Actor.cpp
+++ b/src/kiwano/2d/Actor.cpp
@@ -20,7 +20,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
@@ -46,7 +46,8 @@ ActorPtr Actor::Create()
 }
 
 Actor::Actor()
-    : visible_(true)
+    : ComponentManager(this)
+    , visible_(true)
     , visible_in_rt_(true)
     , update_pausing_(false)
     , hover_(false)
@@ -77,9 +78,9 @@ Actor::~Actor()
 
 void Actor::Update(Duration dt)
 {
-    UpdateActions(this, dt);
-    UpdateComponents(dt);
-    UpdateTimers(dt);
+    ActionScheduler::Update(this, dt);
+    TaskScheduler::Update(dt);
+    ComponentManager::Update(dt);
 
     if (!update_pausing_)
     {
@@ -112,7 +113,7 @@ void Actor::Render(RenderContext& ctx)
         if (CheckVisibility(ctx))
         {
             PrepareToRender(ctx);
-            RenderComponents(ctx);
+            ComponentManager::Render(ctx);
             OnRender(ctx);
         }
     }
@@ -132,7 +133,7 @@ void Actor::Render(RenderContext& ctx)
         if (CheckVisibility(ctx))
         {
             PrepareToRender(ctx);
-            RenderComponents(ctx);
+            ComponentManager::Render(ctx);
             OnRender(ctx);
         }
 
@@ -242,19 +243,7 @@ void Actor::DoDeserialize(Deserializer* deserializer)
 
 bool Actor::HandleEvent(Event* evt)
 {
-    if (!components_.IsEmpty())
-    {
-        ComponentPtr next;
-        for (auto component = components_.GetFirst(); component; component = next)
-        {
-            next = component->GetNext();
-
-            if (component->IsEnable())
-            {
-                component->HandleEvent(evt);
-            }
-        }
-    }
+    ComponentManager::DispatchToComponents(evt);
 
     if (!EventDispatcher::DispatchEvent(evt))
         return false;
@@ -304,40 +293,6 @@ bool Actor::HandleEvent(Event* evt)
     return true;
 }
 
-void Actor::UpdateComponents(Duration dt)
-{
-    if (!components_.IsEmpty())
-    {
-        ComponentPtr next;
-        for (auto component = components_.GetFirst(); component; component = next)
-        {
-            next = component->GetNext();
-
-            if (component->IsEnable())
-            {
-                component->OnUpdate(dt);
-            }
-        }
-    }
-}
-
-void Actor::RenderComponents(RenderContext& ctx)
-{
-    if (!components_.IsEmpty())
-    {
-        ComponentPtr next;
-        for (auto component = components_.GetFirst(); component; component = next)
-        {
-            next = component->GetNext();
-
-            if (component->IsEnable())
-            {
-                component->OnRender(ctx);
-            }
-        }
-    }
-}
-
 const Matrix3x2& Actor::GetTransformMatrix() const
 {
     UpdateTransform();
@@ -657,72 +612,6 @@ void Actor::RemoveFromParent()
     }
 }
 
-Component* Actor::AddComponent(ComponentPtr component)
-{
-    KGE_ASSERT(component && "AddComponent failed, NULL pointer exception");
-
-    if (component)
-    {
-        component->InitComponent(this);
-        components_.PushBack(component);
-    }
-    return component.Get();
-}
-
-ComponentList& Actor::GetAllComponents()
-{
-    return components_;
-}
-
-const ComponentList& Actor::GetAllComponents() const
-{
-    return components_;
-}
-
-void Actor::RemoveComponent(ComponentPtr component)
-{
-    auto iter = std::find(components_.begin(), components_.end(), component);
-    if (iter != components_.end())
-    {
-        component->DestroyComponent();
-        components_.Remove(component);
-    }
-}
-
-void Actor::RemoveComponents(const String& name)
-{
-    if (!components_.IsEmpty())
-    {
-        ComponentPtr next;
-        for (auto component = components_.GetFirst(); component; component = next)
-        {
-            next = component->GetNext();
-
-            if (component->IsName(name))
-            {
-                component->DestroyComponent();
-                components_.Remove(component);
-            }
-        }
-    }
-}
-
-void Actor::RemoveAllComponents()
-{
-    // Destroy all components
-    if (!components_.IsEmpty())
-    {
-        ComponentPtr next;
-        for (auto component = components_.GetFirst(); component; component = next)
-        {
-            next = component->GetNext();
-
-            component->DestroyComponent();
-        }
-    }
-    components_.Clear();
-}
-
 void Actor::RemoveChild(ActorPtr child)
 {
     KGE_ASSERT(child && "Actor::RemoveChild failed, NULL pointer exception");
diff --git a/src/kiwano/2d/Actor.h b/src/kiwano/2d/Actor.h
index 459f1f34..f0e258a0 100644
--- a/src/kiwano/2d/Actor.h
+++ b/src/kiwano/2d/Actor.h
@@ -19,13 +19,13 @@
 // THE SOFTWARE.
 
 #pragma once
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 namespace kiwano
 {
@@ -58,13 +58,14 @@ typedef IntrusiveList ActorList;
  * \~chinese
  * @brief ɫ
  * @details
- * ɫ̨ԪأȾ¡¼ַȹܵСλҲǶʱ¼ȹܵ
+ * ɫ̨ԪأȾ¡¼ַȹܵСλҲǶ¼ȹܵ
  */
 class KGE_API Actor
     : public ObjectBase
-    , public TimerManager
-    , public ActionManager
+    , public TaskScheduler
+    , public ActionScheduler
     , public EventDispatcher
+    , public ComponentManager
     , protected IntrusiveListValue
 {
     friend class Director;
@@ -370,32 +371,6 @@ public:
     /// @brief ӸɫƳ
     void RemoveFromParent();
 
-    /// \~chinese
-    /// @brief 
-    /// @param component 
-    Component* AddComponent(ComponentPtr component);
-
-    /// \~chinese
-    /// @brief ȡ
-    ComponentList& GetAllComponents();
-
-    /// \~chinese
-    /// @brief ȡ
-    const ComponentList& GetAllComponents() const;
-
-    /// \~chinese
-    /// @brief Ƴ
-    void RemoveComponent(ComponentPtr component);
-
-    /// \~chinese
-    /// @brief Ƴ
-    /// @param name 
-    void RemoveComponents(const String& name);
-
-    /// \~chinese
-    /// @brief Ƴ
-    void RemoveAllComponents();
-
     /// \~chinese
     /// @brief ͣɫ
     void PauseUpdating();
@@ -499,14 +474,6 @@ protected:
     /// @brief ¼
     bool HandleEvent(Event* evt);
 
-    /// \~chinese
-    /// @brief 
-    void UpdateComponents(Duration dt);
-
-    /// \~chinese
-    /// @brief Ⱦ
-    void RenderComponents(RenderContext& ctx);
-
 private:
     bool           visible_;
     bool           update_pausing_;
@@ -524,7 +491,6 @@ private:
     Point          anchor_;
     Size           size_;
     ActorList      children_;
-    ComponentList  components_;
     UpdateCallback cb_update_;
     Transform      transform_;
 
diff --git a/src/kiwano/2d/Canvas.cpp b/src/kiwano/2d/Canvas.cpp
index 661c4e60..aa9a0694 100644
--- a/src/kiwano/2d/Canvas.cpp
+++ b/src/kiwano/2d/Canvas.cpp
@@ -19,7 +19,7 @@
 // THE SOFTWARE.
 
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
@@ -42,20 +42,11 @@ CanvasPtr Canvas::Create(const Size& size)
     return ptr;
 }
 
-Canvas::Canvas()
-{
-}
+Canvas::Canvas() {}
 
-void Canvas::BeginDraw()
+RenderContextPtr Canvas::GetContext2D() const
 {
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->BeginDraw();
-}
-
-void Canvas::EndDraw()
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->EndDraw();
+    return render_ctx_;
 }
 
 void Canvas::OnRender(RenderContext& ctx)
@@ -66,232 +57,6 @@ void Canvas::OnRender(RenderContext& ctx)
     }
 }
 
-void Canvas::SetBrush(BrushPtr brush)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(brush);
-}
-
-void Canvas::SetBrushTransform(const Transform& transform)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetTransform(transform.ToMatrix());
-}
-
-void Canvas::SetBrushTransform(const Matrix3x2& transform)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetTransform(transform);
-}
-
-void Canvas::PushLayer(LayerPtr layer)
-{
-    KGE_ASSERT(render_ctx_);
-    if (layer)
-    {
-        render_ctx_->PushLayer(*layer);
-    }
-}
-
-void Canvas::PopLayer()
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->PopLayer();
-}
-
-void Canvas::PushClipRect(const Rect& clip_rect)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->PushClipRect(clip_rect);
-}
-
-void Canvas::PopClipRect()
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->PopClipRect();
-}
-
-void Canvas::DrawShape(ShapePtr shape)
-{
-    KGE_ASSERT(render_ctx_);
-    if (shape)
-    {
-        render_ctx_->SetCurrentBrush(stroke_brush_);
-        render_ctx_->SetCurrentStrokeStyle(stroke_style_);
-        render_ctx_->DrawShape(*shape);
-    }
-}
-
-void Canvas::DrawLine(const Point& begin, const Point& end)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(stroke_brush_);
-    render_ctx_->SetCurrentStrokeStyle(stroke_style_);
-    render_ctx_->DrawLine(begin, end);
-}
-
-void Canvas::DrawCircle(const Point& center, float radius)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(stroke_brush_);
-    render_ctx_->SetCurrentStrokeStyle(stroke_style_);
-    render_ctx_->DrawEllipse(center, Vec2(radius, radius));
-}
-
-void Canvas::DrawEllipse(const Point& center, const Vec2& radius)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(stroke_brush_);
-    render_ctx_->SetCurrentStrokeStyle(stroke_style_);
-    render_ctx_->DrawEllipse(center, radius);
-}
-
-void Canvas::DrawRect(const Rect& rect)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(stroke_brush_);
-    render_ctx_->SetCurrentStrokeStyle(stroke_style_);
-    render_ctx_->DrawRectangle(rect);
-}
-
-void Canvas::DrawRoundedRect(const Rect& rect, const Vec2& radius)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(stroke_brush_);
-    render_ctx_->SetCurrentStrokeStyle(stroke_style_);
-    render_ctx_->DrawRoundedRectangle(rect, radius);
-}
-
-void Canvas::FillShape(ShapePtr shape)
-{
-    KGE_ASSERT(render_ctx_);
-    if (shape)
-    {
-        render_ctx_->SetCurrentBrush(fill_brush_);
-        render_ctx_->FillShape(*shape);
-    }
-}
-
-void Canvas::FillCircle(const Point& center, float radius)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(fill_brush_);
-    render_ctx_->FillEllipse(center, Vec2(radius, radius));
-}
-
-void Canvas::FillEllipse(const Point& center, const Vec2& radius)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(fill_brush_);
-    render_ctx_->FillEllipse(center, radius);
-}
-
-void Canvas::FillRect(const Rect& rect)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(fill_brush_);
-    render_ctx_->FillRectangle(rect);
-}
-
-void Canvas::FillRoundedRect(const Rect& rect, const Vec2& radius)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(fill_brush_);
-    render_ctx_->FillRoundedRectangle(rect, radius);
-}
-
-void Canvas::DrawFrame(FramePtr frame, const Point& pos)
-{
-    KGE_ASSERT(render_ctx_);
-    if (frame && frame->IsValid())
-    {
-        render_ctx_->DrawTexture(*frame->GetTexture(), &frame->GetCropRect(), &Rect(pos, frame->GetSize()));
-    }
-}
-
-void Canvas::DrawFrame(FramePtr frame, const Point& pos, const Size& size)
-{
-    KGE_ASSERT(render_ctx_);
-    if (frame && frame->IsValid())
-    {
-        render_ctx_->DrawTexture(*frame->GetTexture(), &frame->GetCropRect(), &Rect(pos, size));
-    }
-}
-
-void Canvas::DrawTextLayout(const String& text, const TextStyle& style, const Point& point)
-{
-    if (text.empty())
-        return;
-
-    DrawTextLayout(TextLayout::Create(text, style), point);
-}
-
-void Canvas::DrawTextLayout(TextLayoutPtr layout, const Point& point)
-{
-    KGE_ASSERT(render_ctx_);
-    if (layout)
-    {
-        render_ctx_->DrawTextLayout(*layout, point);
-    }
-}
-
-void Canvas::BeginPath(const Point& begin_pos)
-{
-    shape_maker_.BeginPath(begin_pos);
-}
-
-void Canvas::EndPath(bool closed)
-{
-    shape_maker_.EndPath(closed);
-}
-
-void Canvas::AddLine(const Point& point)
-{
-    shape_maker_.AddLine(point);
-}
-
-void Canvas::AddLines(const Vector& points)
-{
-    shape_maker_.AddLines(points);
-}
-
-void Canvas::AddBezier(const Point& point1, const Point& point2, const Point& point3)
-{
-    shape_maker_.AddBezier(point1, point2, point3);
-}
-
-void Canvas::AddArc(const Point& point, const Size& radius, float rotation, bool clockwise, bool is_small)
-{
-    shape_maker_.AddArc(point, radius, rotation, clockwise, is_small);
-}
-
-void Canvas::StrokePath()
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(stroke_brush_);
-    render_ctx_->SetCurrentStrokeStyle(stroke_style_);
-    render_ctx_->DrawShape(*shape_maker_.GetShape());
-}
-
-void Canvas::FillPath()
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->SetCurrentBrush(fill_brush_);
-    render_ctx_->FillShape(*shape_maker_.GetShape());
-}
-
-void Canvas::Clear()
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->Clear();
-}
-
-void Canvas::Clear(const Color& clear_color)
-{
-    KGE_ASSERT(render_ctx_);
-    render_ctx_->Clear(clear_color);
-}
-
 void Canvas::ResizeAndClear(Size size)
 {
     texture_cached_ = memory::New();
diff --git a/src/kiwano/2d/Canvas.h b/src/kiwano/2d/Canvas.h
index 2c8b46b2..f0f147f0 100644
--- a/src/kiwano/2d/Canvas.h
+++ b/src/kiwano/2d/Canvas.h
@@ -20,7 +20,7 @@
 
 #pragma once
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -48,222 +48,12 @@ public:
     static CanvasPtr Create(const Size& size);
 
     /// \~chinese
-    /// @brief ʼͼ
-    void BeginDraw();
-
-    /// \~chinese
-    /// @brief ͼ
-    void EndDraw();
-
-    /// \~chinese
-    /// @brief ״
-    /// @param shape ״
-    void DrawShape(ShapePtr shape);
-
-    /// \~chinese
-    /// @brief ߶
-    /// @param begin ߶
-    /// @param end ߶յ
-    void DrawLine(const Point& begin, const Point& end);
-
-    /// \~chinese
-    /// @brief Բα߿
-    /// @param center Բԭ
-    /// @param radius Բΰ뾶
-    void DrawCircle(const Point& center, float radius);
-
-    /// \~chinese
-    /// @brief Բα߿
-    /// @param center Բԭ
-    /// @param radius Բ뾶
-    void DrawEllipse(const Point& center, const Vec2& radius);
-
-    /// \~chinese
-    /// @brief α߿
-    /// @param rect 
-    void DrawRect(const Rect& rect);
-
-    /// \~chinese
-    /// @brief ԲǾα߿
-    /// @param rect 
-    /// @param radius Բǰ뾶
-    void DrawRoundedRect(const Rect& rect, const Vec2& radius);
-
-    /// \~chinese
-    /// @brief ״
-    /// @param shape ״
-    void FillShape(ShapePtr shape);
-
-    /// \~chinese
-    /// @brief Բ
-    /// @param center Բԭ
-    /// @param radius Բΰ뾶
-    void FillCircle(const Point& center, float radius);
-
-    /// \~chinese
-    /// @brief Բ
-    /// @param center Բԭ
-    /// @param radius Բ뾶
-    void FillEllipse(const Point& center, const Vec2& radius);
-
-    /// \~chinese
-    /// @brief 
-    /// @param rect 
-    void FillRect(const Rect& rect);
-
-    /// \~chinese
-    /// @brief ԲǾ
-    /// @param rect 
-    /// @param radius Բǰ뾶
-    void FillRoundedRect(const Rect& rect, const Vec2& radius);
-
-    /// \~chinese
-    /// @brief ͼ֡
-    /// @param frame ͼ֡
-    /// @param pos ͼλ
-    void DrawFrame(FramePtr frame, const Point& pos);
-
-    /// \~chinese
-    /// @brief ͼ֡
-    /// @param frame ͼ֡
-    /// @param pos ͼλ
-    /// @param size ȾͼС
-    void DrawFrame(FramePtr frame, const Point& pos, const Size& size);
-
-    /// \~chinese
-    /// @brief ֲ
-    /// @param text 
-    /// @param style ʽ
-    /// @param point ֵλ
-    void DrawTextLayout(const String& text, const TextStyle& style, const Point& point);
-
-    /// \~chinese
-    /// @brief ֲ
-    /// @param layout ֲ
-    /// @param point Ʋֵλ
-    void DrawTextLayout(TextLayoutPtr layout, const Point& point);
-
-    /// \~chinese
-    /// @brief ʼ·
-    /// @param begin_pos ·ʼ
-    void BeginPath(const Point& begin_pos);
-
-    /// \~chinese
-    /// @brief ·
-    /// @param closed ·Ƿպ
-    void EndPath(bool closed = false);
-
-    /// \~chinese
-    /// @brief һ߶
-    /// @param point ˵
-    void AddLine(const Point& point);
-
-    /// \~chinese
-    /// @brief Ӷ߶
-    /// @param points ˵㼯
-    void AddLines(const Vector& points);
-
-    /// \~chinese
-    /// @brief һη
-    /// @param point1 ߵĵһƵ
-    /// @param point2 ߵĵڶƵ
-    /// @param point3 ߵյ
-    void AddBezier(const Point& point1, const Point& point2, const Point& point3);
-
-    /// \~chinese
-    /// @brief ӻ
-    /// @param point յ
-    /// @param radius Բ뾶
-    /// @param rotation ԲתǶ
-    /// @param clockwise ˳ʱ or ʱ
-    /// @param is_small ǷȡС 180 Ļ
-    void AddArc(const Point& point, const Size& radius, float rotation, bool clockwise = true, bool is_small = true);
-
-    /// \~chinese
-    /// @brief ߵķʽ·
-    void StrokePath();
-
-    /// \~chinese
-    /// @brief ķʽ·
-    void FillPath();
-
-    /// \~chinese
-    /// @brief ջ
-    void Clear();
-
-    /// \~chinese
-    /// @brief ջ
-    /// @param clear_color ɫ
-    void Clear(const Color& clear_color);
-
-    /// \~chinese
-    /// @brief ɫ
-    /// @param color ɫ
-    void SetFillColor(const Color& color);
-
-    /// \~chinese
-    /// @brief 仭ˢ
-    /// @param[in] brush 仭ˢ
-    void SetFillBrush(BrushPtr brush);
-
-    /// \~chinese
-    /// @brief ɫ
-    /// @param color ɫ
-    void SetStrokeColor(const Color& color);
-
-    /// \~chinese
-    /// @brief ˢ
-    /// @param[in] brush ˢ
-    void SetStrokeBrush(BrushPtr brush);
-
-    /// \~chinese
-    /// @brief ʽ
-    /// @param stroke_style ʽ
-    void SetStrokeStyle(StrokeStylePtr stroke_style);
-
-    /// \~chinese
-    /// @brief ûˢ
-    /// @param[in] brush ˢ
-    void SetBrush(BrushPtr brush);
-
-    /// \~chinese
-    /// @brief ûˢά任
-    /// @param transform ά任
-    void SetBrushTransform(const Transform& transform);
-
-    /// \~chinese
-    /// @brief ûˢά任
-    /// @param transform ά任
-    void SetBrushTransform(const Matrix3x2& transform);
-
-    /// \~chinese
-    /// @brief һͼ
-    /// @param layer ͼ
-    void PushLayer(LayerPtr layer);
-
-    /// \~chinese
-    /// @brief ɾӵͼ
-    void PopLayer();
-
-    /// \~chinese
-    /// @brief һü
-    /// @param clip_rect ü
-    void PushClipRect(const Rect& clip_rect);
-
-    /// \~chinese
-    /// @brief ɾӵIJü
-    void PopClipRect();
-
-    /// \~chinese
-    /// @brief ȡ仭ˢ
-    BrushPtr GetFillBrush() const;
-
-    /// \~chinese
-    /// @brief ȡˢ
-    BrushPtr GetStrokeBrush() const;
+    /// @brief ȡ2Dͼ
+    RenderContextPtr GetContext2D() const;
 
     /// \~chinese
     /// @brief ջС軭С
+    /// @warning úᵼԭͼʧЧ
     void ResizeAndClear(Size size);
 
     /// \~chinese
@@ -276,57 +66,10 @@ private:
     Canvas();
 
 private:
-    StrokeStylePtr   stroke_style_;
-    ShapeMaker       shape_maker_;
-    BrushPtr         fill_brush_;
-    BrushPtr         stroke_brush_;
     TexturePtr       texture_cached_;
     RenderContextPtr render_ctx_;
 };
 
 /** @} */
 
-inline void Canvas::SetStrokeStyle(StrokeStylePtr stroke_style)
-{
-    stroke_style_ = stroke_style;
-}
-
-inline void Canvas::SetStrokeColor(const Color& color)
-{
-    if (!stroke_brush_)
-    {
-        stroke_brush_ = memory::New();
-    }
-    stroke_brush_->SetColor(color);
-}
-
-inline void Canvas::SetFillColor(const Color& color)
-{
-    if (!fill_brush_)
-    {
-        fill_brush_ = memory::New();
-    }
-    fill_brush_->SetColor(color);
-}
-
-inline void Canvas::SetFillBrush(BrushPtr brush)
-{
-    fill_brush_ = brush;
-}
-
-inline void Canvas::SetStrokeBrush(BrushPtr brush)
-{
-    stroke_brush_ = brush;
-}
-
-inline BrushPtr Canvas::GetFillBrush() const
-{
-    return fill_brush_;
-}
-
-inline BrushPtr Canvas::GetStrokeBrush() const
-{
-    return stroke_brush_;
-}
-
 }  // namespace kiwano
diff --git a/src/kiwano/2d/DebugActor.cpp b/src/kiwano/2d/DebugActor.cpp
index 65d78975..9e39f268 100644
--- a/src/kiwano/2d/DebugActor.cpp
+++ b/src/kiwano/2d/DebugActor.cpp
@@ -19,7 +19,7 @@
 // THE SOFTWARE.
 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/src/kiwano/2d/ShapeActor.cpp b/src/kiwano/2d/ShapeActor.cpp
index a9714e48..5186451a 100644
--- a/src/kiwano/2d/ShapeActor.cpp
+++ b/src/kiwano/2d/ShapeActor.cpp
@@ -19,7 +19,7 @@
 // THE SOFTWARE.
 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano/2d/Sprite.h b/src/kiwano/2d/Sprite.h
index dbadbc6f..934abbac 100644
--- a/src/kiwano/2d/Sprite.h
+++ b/src/kiwano/2d/Sprite.h
@@ -20,7 +20,7 @@
 
 #pragma once
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano/2d/Stage.cpp b/src/kiwano/2d/Stage.cpp
index 24ae8606..ad4b3d36 100644
--- a/src/kiwano/2d/Stage.cpp
+++ b/src/kiwano/2d/Stage.cpp
@@ -19,7 +19,7 @@
 // THE SOFTWARE.
 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano/2d/TextActor.cpp b/src/kiwano/2d/TextActor.cpp
index 5c8b7ea4..dfe0010d 100644
--- a/src/kiwano/2d/TextActor.cpp
+++ b/src/kiwano/2d/TextActor.cpp
@@ -19,7 +19,7 @@
 // THE SOFTWARE.
 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano/2d/Transition.cpp b/src/kiwano/2d/Transition.cpp
index d831bc10..acf0c722 100644
--- a/src/kiwano/2d/Transition.cpp
+++ b/src/kiwano/2d/Transition.cpp
@@ -21,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/src/kiwano/2d/action/Action.cpp b/src/kiwano/2d/action/Action.cpp
index 6dc75105..796fc25b 100644
--- a/src/kiwano/2d/action/Action.cpp
+++ b/src/kiwano/2d/action/Action.cpp
@@ -65,6 +65,9 @@ void Action::UpdateStep(Actor* target, Duration dt)
     case Status::Started:
         Update(target, dt);
         break;
+
+    default:
+        break;
     }
 
     if (status_ == Status::Done)
diff --git a/src/kiwano/2d/action/Action.h b/src/kiwano/2d/action/Action.h
index f8d79e4a..0de9a0a4 100644
--- a/src/kiwano/2d/action/Action.h
+++ b/src/kiwano/2d/action/Action.h
@@ -21,7 +21,7 @@
 #pragma once
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -30,14 +30,10 @@
 namespace kiwano
 {
 class Actor;
-class ActionManager;
+class ActionScheduler;
 
 KGE_DECLARE_SMART_PTR(Action);
 
-/// \~chinese
-/// @brief б
-typedef IntrusiveList ActionList;
-
 /**
  * \~chinese
  * \defgroup Actions 
@@ -55,7 +51,7 @@ class KGE_API Action
     , public Cloneable
     , protected IntrusiveListValue
 {
-    friend class ActionManager;
+    friend class ActionScheduler;
     friend class ActionGroup;
     friend IntrusiveList;
 
diff --git a/src/kiwano/2d/action/ActionGroup.cpp b/src/kiwano/2d/action/ActionGroup.cpp
index 520065c3..3aa633d5 100644
--- a/src/kiwano/2d/action/ActionGroup.cpp
+++ b/src/kiwano/2d/action/ActionGroup.cpp
@@ -20,7 +20,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano/2d/action/ActionManager.cpp b/src/kiwano/2d/action/ActionScheduler.cpp
similarity index 84%
rename from src/kiwano/2d/action/ActionManager.cpp
rename to src/kiwano/2d/action/ActionScheduler.cpp
index 8c79bfe2..4e1fb3fb 100644
--- a/src/kiwano/2d/action/ActionManager.cpp
+++ b/src/kiwano/2d/action/ActionScheduler.cpp
@@ -19,12 +19,13 @@
 // THE SOFTWARE.
 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 namespace kiwano
 {
-void ActionManager::UpdateActions(Actor* target, Duration dt)
+
+void ActionScheduler::Update(Actor* target, Duration dt)
 {
     if (actions_.IsEmpty() || !target)
         return;
@@ -42,7 +43,7 @@ void ActionManager::UpdateActions(Actor* target, Duration dt)
     }
 }
 
-Action* ActionManager::AddAction(ActionPtr action)
+Action* ActionScheduler::AddAction(ActionPtr action)
 {
     KGE_ASSERT(action && "AddAction failed, NULL pointer exception");
 
@@ -53,7 +54,7 @@ Action* ActionManager::AddAction(ActionPtr action)
     return action.Get();
 }
 
-void ActionManager::ResumeAllActions()
+void ActionScheduler::ResumeAllActions()
 {
     if (actions_.IsEmpty())
         return;
@@ -64,7 +65,7 @@ void ActionManager::ResumeAllActions()
     }
 }
 
-void ActionManager::PauseAllActions()
+void ActionScheduler::PauseAllActions()
 {
     if (actions_.IsEmpty())
         return;
@@ -75,7 +76,7 @@ void ActionManager::PauseAllActions()
     }
 }
 
-void ActionManager::StopAllActions()
+void ActionScheduler::StopAllActions()
 {
     if (actions_.IsEmpty())
         return;
@@ -86,7 +87,7 @@ void ActionManager::StopAllActions()
     }
 }
 
-ActionPtr ActionManager::GetAction(const String& name)
+ActionPtr ActionScheduler::GetAction(const String& name)
 {
     if (actions_.IsEmpty())
         return nullptr;
@@ -97,7 +98,7 @@ ActionPtr ActionManager::GetAction(const String& name)
     return nullptr;
 }
 
-const ActionList& ActionManager::GetAllActions() const
+const ActionList& ActionScheduler::GetAllActions() const
 {
     return actions_;
 }
diff --git a/src/kiwano/2d/action/ActionManager.h b/src/kiwano/2d/action/ActionScheduler.h
similarity index 91%
rename from src/kiwano/2d/action/ActionManager.h
rename to src/kiwano/2d/action/ActionScheduler.h
index 841a4611..1cc4f26f 100644
--- a/src/kiwano/2d/action/ActionManager.h
+++ b/src/kiwano/2d/action/ActionScheduler.h
@@ -23,16 +23,21 @@
 
 namespace kiwano
 {
+
 /**
  * \addtogroup Actions
  * @{
  */
 
+/// \~chinese
+/// @brief б
+typedef IntrusiveList ActionList;
+
 /**
  * \~chinese
- * @brief 
+ * @brief 
  */
-class KGE_API ActionManager
+class KGE_API ActionScheduler
 {
 public:
     /// \~chinese
@@ -60,10 +65,9 @@ public:
     /// @brief ȡж
     const ActionList& GetAllActions() const;
 
-protected:
     /// \~chinese
     /// @brief ¶
-    void UpdateActions(Actor* target, Duration dt);
+    void Update(Actor* target, Duration dt);
 
 private:
     ActionList actions_;
diff --git a/src/kiwano/2d/action/ActionTween.h b/src/kiwano/2d/action/ActionTween.h
index 6f271cd9..82b777ed 100644
--- a/src/kiwano/2d/action/ActionTween.h
+++ b/src/kiwano/2d/action/ActionTween.h
@@ -20,7 +20,7 @@
 
 #pragma once
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano/2d/action/Animation.cpp b/src/kiwano/2d/action/Animation.cpp
index 1abdaae1..bb52344a 100644
--- a/src/kiwano/2d/action/Animation.cpp
+++ b/src/kiwano/2d/action/Animation.cpp
@@ -18,7 +18,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/src/kiwano/2d/action/Animation.h b/src/kiwano/2d/action/Animation.h
index 769b7386..7e991c72 100644
--- a/src/kiwano/2d/action/Animation.h
+++ b/src/kiwano/2d/action/Animation.h
@@ -19,7 +19,7 @@
 // THE SOFTWARE.
 
 #pragma once
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano/CMakeLists.txt b/src/kiwano/CMakeLists.txt
new file mode 100644
index 00000000..cbb8d953
--- /dev/null
+++ b/src/kiwano/CMakeLists.txt
@@ -0,0 +1,175 @@
+include_directories(..)
+
+set(SOURCE_FILES
+        2d/action/Action.cpp
+        2d/action/Action.h
+        2d/action/ActionDelay.cpp
+        2d/action/ActionDelay.h
+        2d/action/ActionGroup.cpp
+        2d/action/ActionGroup.h
+        2d/action/ActionHelper.h
+        2d/action/ActionManager.cpp
+        2d/action/ActionManager.h
+        2d/action/ActionTween.cpp
+        2d/action/ActionTween.h
+        2d/action/ActionWalk.cpp
+        2d/action/ActionWalk.h
+        2d/action/Animation.cpp
+        2d/action/Animation.h
+        2d/Actor.cpp
+        2d/Actor.h
+        2d/Button.cpp
+        2d/Button.h
+        2d/Canvas.cpp
+        2d/Canvas.h
+        2d/Component.cpp
+        2d/Component.h
+        2d/DebugActor.cpp
+        2d/DebugActor.h
+        2d/GifSprite.cpp
+        2d/GifSprite.h
+        2d/LayerActor.cpp
+        2d/LayerActor.h
+        2d/ShapeActor.cpp
+        2d/ShapeActor.h
+        2d/Sprite.cpp
+        2d/Sprite.h
+        2d/Stage.cpp
+        2d/Stage.h
+        2d/TextActor.cpp
+        2d/TextActor.h
+        2d/Transition.cpp
+        2d/Transition.h
+        core/event/Event.cpp
+        core/event/Event.h
+        core/event/EventType.h
+        core/event/KeyEvent.cpp
+        core/event/KeyEvent.h
+        core/event/MouseEvent.cpp
+        core/event/MouseEvent.h
+        core/event/WindowEvent.cpp
+        core/event/WindowEvent.h
+        core/Allocator.cpp
+        core/Allocator.h
+        core/Any.h
+        core/Cloneable.h
+        core/Common.h
+        core/Director.cpp
+        core/Director.h
+        core/EventDispatcher.cpp
+        core/EventDispatcher.h
+        core/EventListener.cpp
+        core/EventListener.h
+        core/Exception.cpp
+        core/Exception.h
+        core/Function.h
+        core/IntrusiveList.h
+        core/Json.h
+        core/Keys.h
+        core/Library.cpp
+        core/Library.h
+        core/Logger.cpp
+        core/Logger.h
+        core/Module.cpp
+        core/Module.h
+        core/ObjectBase.cpp
+        core/ObjectBase.h
+        core/RefCounter.cpp
+        core/RefCounter.h
+        core/Resource.cpp
+        core/Resource.h
+        core/Serializable.h
+        core/Singleton.h
+        core/SmartPtr.hpp
+        core/String.cpp
+        core/String.h
+        core/Time.cpp
+        core/Time.h
+        core/Timer.cpp
+        core/Timer.h
+        core/TimerManager.cpp
+        core/TimerManager.h
+        core/Xml.h
+        math/Constants.h
+        math/EaseFunctions.h
+        math/Math.h
+        math/Matrix.hpp
+        math/Random.h
+        math/Rect.hpp
+        math/Scalar.h
+        math/Transform.hpp
+        math/Vec2.hpp
+        platform/win32/ComPtr.hpp
+        platform/win32/libraries.cpp
+        platform/win32/libraries.h
+        platform/win32/WindowImpl.cpp
+        platform/Application.cpp
+        platform/Application.h
+        platform/FileSystem.cpp
+        platform/FileSystem.h
+        platform/Input.cpp
+        platform/Input.h
+        platform/Runner.cpp
+        platform/Runner.h
+        platform/Window.cpp
+        platform/Window.h
+        render/DirectX/D2DDeviceResources.cpp
+        render/DirectX/D2DDeviceResources.h
+        render/DirectX/D3D10DeviceResources.cpp
+        render/DirectX/D3D10DeviceResources.h
+        render/DirectX/D3D11DeviceResources.cpp
+        render/DirectX/D3D11DeviceResources.h
+        render/DirectX/D3DDeviceResourcesBase.h
+        render/DirectX/FontCollectionLoader.cpp
+        render/DirectX/FontCollectionLoader.h
+        render/DirectX/helper.h
+        render/DirectX/NativePtr.h
+        render/DirectX/RenderContextImpl.cpp
+        render/DirectX/RenderContextImpl.h
+        render/DirectX/RendererImpl.cpp
+        render/DirectX/RendererImpl.h
+        render/DirectX/TextRenderer.cpp
+        render/DirectX/TextRenderer.h
+        render/Brush.cpp
+        render/Brush.h
+        render/Color.cpp
+        render/Color.h
+        render/Font.cpp
+        render/Font.h
+        render/Frame.cpp
+        render/Frame.h
+        render/FrameSequence.cpp
+        render/FrameSequence.h
+        render/GifImage.cpp
+        render/GifImage.h
+        render/Layer.cpp
+        render/Layer.h
+        render/NativeObject.h
+        render/RenderContext.cpp
+        render/RenderContext.h
+        render/Renderer.cpp
+        render/Renderer.h
+        render/Shape.cpp
+        render/Shape.h
+        render/ShapeMaker.cpp
+        render/ShapeMaker.h
+        render/StrokeStyle.cpp
+        render/StrokeStyle.h
+        render/TextLayout.cpp
+        render/TextLayout.h
+        render/TextStyle.hpp
+        render/Texture.cpp
+        render/Texture.h
+        render/TextureCache.cpp
+        render/TextureCache.h
+        utils/LocalStorage.cpp
+        utils/LocalStorage.h
+        utils/ResourceCache.cpp
+        utils/ResourceCache.h
+        utils/UserData.cpp
+        utils/UserData.h
+        config.h
+        kiwano.h
+        macros.h)
+
+add_library(libkiwano ${SOURCE_FILES})
diff --git a/src/kiwano/core/Director.cpp b/src/kiwano/base/Director.cpp
similarity index 99%
rename from src/kiwano/core/Director.cpp
rename to src/kiwano/base/Director.cpp
index 84f4612f..6b221030 100644
--- a/src/kiwano/core/Director.cpp
+++ b/src/kiwano/base/Director.cpp
@@ -22,7 +22,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano/core/Director.h b/src/kiwano/base/Director.h
similarity index 98%
rename from src/kiwano/core/Director.h
rename to src/kiwano/base/Director.h
index 8aca9387..fd054672 100644
--- a/src/kiwano/core/Director.h
+++ b/src/kiwano/base/Director.h
@@ -22,7 +22,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano/core/Module.cpp b/src/kiwano/base/Module.cpp
similarity index 97%
rename from src/kiwano/core/Module.cpp
rename to src/kiwano/base/Module.cpp
index 38a3182b..009100bb 100644
--- a/src/kiwano/core/Module.cpp
+++ b/src/kiwano/base/Module.cpp
@@ -18,7 +18,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano/core/Module.h b/src/kiwano/base/Module.h
similarity index 100%
rename from src/kiwano/core/Module.h
rename to src/kiwano/base/Module.h
diff --git a/src/kiwano/core/ObjectBase.cpp b/src/kiwano/base/ObjectBase.cpp
similarity index 97%
rename from src/kiwano/core/ObjectBase.cpp
rename to src/kiwano/base/ObjectBase.cpp
index 9423407c..588e0a6e 100644
--- a/src/kiwano/core/ObjectBase.cpp
+++ b/src/kiwano/base/ObjectBase.cpp
@@ -18,9 +18,9 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano/core/ObjectBase.h b/src/kiwano/base/ObjectBase.h
similarity index 98%
rename from src/kiwano/core/ObjectBase.h
rename to src/kiwano/base/ObjectBase.h
index 38f3d653..6761c77c 100644
--- a/src/kiwano/core/ObjectBase.h
+++ b/src/kiwano/base/ObjectBase.h
@@ -19,11 +19,11 @@
 // THE SOFTWARE.
 
 #pragma once
+#include 
 #include 
 #include 
-#include 
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano/core/RefCounter.cpp b/src/kiwano/base/RefCounter.cpp
similarity index 97%
rename from src/kiwano/core/RefCounter.cpp
rename to src/kiwano/base/RefCounter.cpp
index dec905ba..27e44e5e 100644
--- a/src/kiwano/core/RefCounter.cpp
+++ b/src/kiwano/base/RefCounter.cpp
@@ -18,7 +18,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#include 
+#include 
 
 namespace kiwano
 {
diff --git a/src/kiwano/core/RefCounter.h b/src/kiwano/base/RefCounter.h
similarity index 100%
rename from src/kiwano/core/RefCounter.h
rename to src/kiwano/base/RefCounter.h
diff --git a/src/kiwano/2d/Button.cpp b/src/kiwano/base/component/Button.cpp
similarity index 98%
rename from src/kiwano/2d/Button.cpp
rename to src/kiwano/base/component/Button.cpp
index 061c87fb..c37e207b 100644
--- a/src/kiwano/2d/Button.cpp
+++ b/src/kiwano/base/component/Button.cpp
@@ -18,7 +18,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/src/kiwano/2d/Button.h b/src/kiwano/base/component/Button.h
similarity index 98%
rename from src/kiwano/2d/Button.h
rename to src/kiwano/base/component/Button.h
index 946f40dc..197be05b 100644
--- a/src/kiwano/2d/Button.h
+++ b/src/kiwano/base/component/Button.h
@@ -26,6 +26,11 @@ namespace kiwano
 
 KGE_DECLARE_SMART_PTR(Button);
 
+/**
+ * \addtogroup Component
+ * @{
+ */
+
 /**
  * \~chinese
  * @brief ť
@@ -109,6 +114,8 @@ private:
     Callback mouse_out_callback_;
 };
 
+/** @} */
+
 inline void Button::SetClickCallback(const Callback& func)
 {
     click_callback_ = func;
diff --git a/src/kiwano/2d/Component.cpp b/src/kiwano/base/component/Component.cpp
similarity index 97%
rename from src/kiwano/2d/Component.cpp
rename to src/kiwano/base/component/Component.cpp
index a22a9c22..7fbdb59e 100644
--- a/src/kiwano/2d/Component.cpp
+++ b/src/kiwano/base/component/Component.cpp
@@ -18,7 +18,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano/2d/Component.h b/src/kiwano/base/component/Component.h
similarity index 93%
rename from src/kiwano/2d/Component.h
rename to src/kiwano/base/component/Component.h
index 8e62ca30..c48a168a 100644
--- a/src/kiwano/2d/Component.h
+++ b/src/kiwano/base/component/Component.h
@@ -20,7 +20,7 @@
 
 #pragma once
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -29,12 +29,19 @@ namespace kiwano
 
 class Actor;
 class Event;
+class ComponentManager;
 
 KGE_DECLARE_SMART_PTR(Component);
 
-/// \~chinese
-/// @brief б
-typedef IntrusiveList ComponentList;
+/**
+ * \~chinese
+ * \defgroup Component 
+ */
+
+/**
+ * \addtogroup Component
+ * @{
+ */
 
 /**
  * \~chinese
@@ -44,7 +51,7 @@ class KGE_API Component
     : public ObjectBase
     , protected IntrusiveListValue
 {
-    friend class Actor;
+    friend class ComponentManager;
     friend IntrusiveList;
 
 public:
@@ -94,6 +101,8 @@ private:
     Actor* actor_;
 };
 
+/** @} */
+
 inline bool Component::IsEnable() const
 {
     return enabled_;
diff --git a/src/kiwano/base/component/ComponentManager.cpp b/src/kiwano/base/component/ComponentManager.cpp
new file mode 100644
index 00000000..8f99ce75
--- /dev/null
+++ b/src/kiwano/base/component/ComponentManager.cpp
@@ -0,0 +1,148 @@
+// Copyright (c) 2016-2018 Kiwano - Nomango
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#include 
+
+namespace kiwano
+{
+
+ComponentManager::ComponentManager(Actor* target)
+    : target_(target)
+{
+}
+
+Component* ComponentManager::AddComponent(ComponentPtr component)
+{
+    KGE_ASSERT(component && "AddComponent failed, NULL pointer exception");
+
+    if (component)
+    {
+        component->InitComponent(target_);
+        components_.PushBack(component);
+    }
+    return component.Get();
+}
+
+ComponentList& ComponentManager::GetAllComponents()
+{
+    return components_;
+}
+
+const ComponentList& ComponentManager::GetAllComponents() const
+{
+    return components_;
+}
+
+void ComponentManager::RemoveComponent(ComponentPtr component)
+{
+    auto iter = std::find(components_.begin(), components_.end(), component);
+    if (iter != components_.end())
+    {
+        component->DestroyComponent();
+        components_.Remove(component);
+    }
+}
+
+void ComponentManager::RemoveComponents(const String& name)
+{
+    if (!components_.IsEmpty())
+    {
+        ComponentPtr next;
+        for (auto component = components_.GetFirst(); component; component = next)
+        {
+            next = component->GetNext();
+
+            if (component->IsName(name))
+            {
+                component->DestroyComponent();
+                components_.Remove(component);
+            }
+        }
+    }
+}
+
+void ComponentManager::RemoveAllComponents()
+{
+    // Destroy all components
+    if (!components_.IsEmpty())
+    {
+        ComponentPtr next;
+        for (auto component = components_.GetFirst(); component; component = next)
+        {
+            next = component->GetNext();
+
+            component->DestroyComponent();
+        }
+    }
+    components_.Clear();
+}
+
+void ComponentManager::Update(Duration dt)
+{
+    if (!components_.IsEmpty())
+    {
+        ComponentPtr next;
+        for (auto component = components_.GetFirst(); component; component = next)
+        {
+            next = component->GetNext();
+
+            if (component->IsEnable())
+            {
+                component->OnUpdate(dt);
+            }
+        }
+    }
+}
+
+void ComponentManager::Render(RenderContext& ctx)
+{
+    if (!components_.IsEmpty())
+    {
+        ComponentPtr next;
+        for (auto component = components_.GetFirst(); component; component = next)
+        {
+            next = component->GetNext();
+
+            if (component->IsEnable())
+            {
+                component->OnRender(ctx);
+            }
+        }
+    }
+}
+
+void ComponentManager::DispatchToComponents(Event* evt)
+{
+    if (!components_.IsEmpty())
+    {
+        ComponentPtr next;
+        for (auto component = components_.GetFirst(); component; component = next)
+        {
+            next = component->GetNext();
+
+            if (component->IsEnable())
+            {
+                component->HandleEvent(evt);
+            }
+        }
+    }
+}
+
+}  // namespace kiwano
diff --git a/src/kiwano/core/TimerManager.h b/src/kiwano/base/component/ComponentManager.h
similarity index 53%
rename from src/kiwano/core/TimerManager.h
rename to src/kiwano/base/component/ComponentManager.h
index 5834e424..469e7eaa 100644
--- a/src/kiwano/core/TimerManager.h
+++ b/src/kiwano/base/component/ComponentManager.h
@@ -19,70 +19,74 @@
 // THE SOFTWARE.
 
 #pragma once
-#include 
+#include 
+#include 
 
 namespace kiwano
 {
+
+/**
+ * \addtogroup Component
+ * @{
+ */
+
+/// \~chinese
+/// @brief б
+typedef IntrusiveList ComponentList;
+
 /**
  * \~chinese
- * @brief ʱ
+ * @brief 
  */
-class KGE_API TimerManager
+class KGE_API ComponentManager
 {
 public:
     /// \~chinese
-    /// @brief Ӷʱ
-    /// @param cb ص
-    /// @param interval ʱ
-    /// @param times ִд -1 ΪִУ
-    Timer* AddTimer(const Timer::Callback& cb, Duration interval, int times = -1);
+    /// @brief 
+    /// @param component 
+    Component* AddComponent(ComponentPtr component);
 
     /// \~chinese
-    /// @brief Ӷʱ
-    /// @param name ʱ
-    /// @param cb ص
-    /// @param interval ʱ
-    /// @param times ִд -1 ΪִУ
-    Timer* AddTimer(const String& name, const Timer::Callback& cb, Duration interval, int times = -1);
+    /// @brief ȡ
+    ComponentList& GetAllComponents();
 
     /// \~chinese
-    /// @brief Ӷʱ
-    Timer* AddTimer(TimerPtr timer);
+    /// @brief ȡ
+    const ComponentList& GetAllComponents() const;
 
     /// \~chinese
-    /// @brief ʱ
-    void StartTimers(const String& timer_name);
+    /// @brief Ƴ
+    void RemoveComponent(ComponentPtr component);
 
     /// \~chinese
-    /// @brief ֹͣʱ
-    void StopTimers(const String& timer_name);
+    /// @brief Ƴ
+    /// @param name 
+    void RemoveComponents(const String& name);
 
     /// \~chinese
-    /// @brief Ƴʱ
-    void RemoveTimers(const String& timer_name);
+    /// @brief Ƴ
+    void RemoveAllComponents();
 
     /// \~chinese
-    /// @brief жʱ
-    void StartAllTimers();
+    /// @brief 
+    void Update(Duration dt);
 
     /// \~chinese
-    /// @brief ֹͣжʱ
-    void StopAllTimers();
+    /// @brief Ⱦ
+    void Render(RenderContext& ctx);
 
     /// \~chinese
-    /// @brief Ƴжʱ
-    void RemoveAllTimers();
-
-    /// \~chinese
-    /// @brief ȡжʱ
-    const TimerList& GetAllTimers() const;
+    /// @brief ַ¼
+    void DispatchToComponents(Event* evt);
 
 protected:
-    /// \~chinese
-    /// @brief ¶ʱ
-    void UpdateTimers(Duration dt);
+    ComponentManager(Actor* target);
 
 private:
-    TimerList timers_;
+    Actor*        target_;
+    ComponentList components_;
 };
+
+/** @} */
+
 }  // namespace kiwano
diff --git a/src/kiwano/core/Allocator.cpp b/src/kiwano/core/Allocator.cpp
index 7b890e6a..99c37088 100644
--- a/src/kiwano/core/Allocator.cpp
+++ b/src/kiwano/core/Allocator.cpp
@@ -25,10 +25,14 @@ namespace kiwano
 namespace memory
 {
 
-MemoryAllocator* current_allocator_ = GetGlobalAllocator();
+MemoryAllocator* current_allocator_ = nullptr;
 
 MemoryAllocator* GetAllocator()
 {
+    if (!current_allocator_)
+    {
+        current_allocator_ = GetGlobalAllocator();
+    }
     return current_allocator_;
 }
 
diff --git a/src/kiwano/core/Any.h b/src/kiwano/core/Any.h
index f530ddb1..461895bf 100644
--- a/src/kiwano/core/Any.h
+++ b/src/kiwano/core/Any.h
@@ -73,9 +73,9 @@ public:
 
     /// \~chinese
     /// @brief ȡж
-    inline const type_info& GetType() const noexcept
+    inline const std::type_info& GetType() const noexcept
     {
-        const type_info* const info = GetTypeinfo();
+        const std::type_info* const info = GetTypeinfo();
         if (info)
         {
             return *info;
@@ -132,7 +132,7 @@ public:
     {
         static_assert(!std::is_void<_Ty>::value, "oc::Any cannot contain void");
 
-        const type_info* const info = GetTypeinfo();
+        const std::type_info* const info = GetTypeinfo();
         if (info && (*info == typeid(std::decay<_Ty>::type)))
         {
             if (HasSmallType())
@@ -193,12 +193,12 @@ public:
     }
 
 private:
-    const type_info*& GetTypeinfo()
+    const std::type_info*& GetTypeinfo()
     {
         return storage_.small_.info_;
     }
 
-    const type_info* GetTypeinfo() const
+    const std::type_info* GetTypeinfo() const
     {
         return storage_.small_.info_;
     }
@@ -430,14 +430,14 @@ private:
 private:
     struct SmallStorage
     {
-        const type_info* info_;
+        const std::type_info* info_;
         SmallStorageRTTI rtti_;
         char             buffer_[ANY_SMALL_SPACE_SIZE];
     };
 
     struct BigStorage
     {
-        const type_info* info_;
+        const std::type_info* info_;
         BigStorageRTTI   rtti_;
         void*            ptr_;
     };
diff --git a/src/kiwano/core/Exception.cpp b/src/kiwano/core/Exception.cpp
index 09f454ac..f5346406 100644
--- a/src/kiwano/core/Exception.cpp
+++ b/src/kiwano/core/Exception.cpp
@@ -20,7 +20,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #if defined(KGE_PLATFORM_WINDOWS)
 #include 
diff --git a/src/kiwano/core/Exception.h b/src/kiwano/core/Exception.h
index 91cbfda4..3ad24cfc 100644
--- a/src/kiwano/core/Exception.h
+++ b/src/kiwano/core/Exception.h
@@ -20,19 +20,22 @@
 
 #pragma once
 #include 
+#include 
 #include 
 #include 
 
-#define KGE_THROW(MESSAGE)                   \
-    do                                       \
-    {                                        \
-        kiwano::StackTracer().Print();       \
-        throw kiwano::RuntimeError(MESSAGE); \
+#define KGE_THROW(MESSAGE)                               \
+    do                                                   \
+    {                                                    \
+        KGE_ERROR("An exception occurred: %s", MESSAGE); \
+        kiwano::StackTracer().Print();                   \
+        throw kiwano::RuntimeError(MESSAGE);             \
     } while (0)
 
 #define KGE_THROW_SYSTEM_ERROR(ERRCODE, MESSAGE)                                          \
     do                                                                                    \
     {                                                                                     \
+        KGE_ERROR("An exception occurred (%#x): %s", ERRCODE, MESSAGE);                   \
         kiwano::StackTracer().Print();                                                    \
         throw kiwano::SystemError(std::error_code(kiwano::error_enum(ERRCODE)), MESSAGE); \
     } while (0)
diff --git a/src/kiwano/core/Function.h b/src/kiwano/core/Function.h
index 0f85e1af..8cfcce51 100644
--- a/src/kiwano/core/Function.h
+++ b/src/kiwano/core/Function.h
@@ -75,9 +75,9 @@ public:
     virtual void Release()                     = 0;
     virtual _Ret Invoke(_Args&&... args) const = 0;
 
-    virtual const type_info& TargetType() const noexcept = 0;
+    virtual const std::type_info& TargetType() const noexcept = 0;
 
-    virtual const void* Target(const type_info& type) const noexcept = 0;
+    virtual const void* Target(const std::type_info& type) const noexcept = 0;
 };
 
 template 
@@ -121,12 +121,12 @@ public:
         return std::invoke(callee_, std::forward<_Args>(args)...);
     }
 
-    virtual const type_info& TargetType() const noexcept
+    virtual const std::type_info& TargetType() const noexcept
     {
         return typeid(_Ty);
     }
 
-    virtual const void* Target(const type_info& type) const noexcept
+    virtual const void* Target(const std::type_info& type) const noexcept
     {
         if (type == this->TargetType())
             return &callee_;
@@ -153,12 +153,12 @@ public:
         return std::invoke(func_, ptr_, std::forward<_Args>(args)...);
     }
 
-    virtual const type_info& TargetType() const noexcept
+    virtual const std::type_info& TargetType() const noexcept
     {
         return typeid(ProxyMemCallable);
     }
 
-    virtual const void* Target(const type_info& type) const noexcept
+    virtual const void* Target(const std::type_info& type) const noexcept
     {
         if (type == this->TargetType())
             return this;
@@ -193,12 +193,12 @@ public:
         return std::invoke(func_, ptr_, std::forward<_Args>(args)...);
     }
 
-    virtual const type_info& TargetType() const noexcept
+    virtual const std::type_info& TargetType() const noexcept
     {
         return typeid(ProxyConstMemCallable);
     }
 
-    virtual const void* Target(const type_info& type) const noexcept
+    virtual const void* Target(const std::type_info& type) const noexcept
     {
         if (type == this->TargetType())
             return this;
@@ -321,7 +321,7 @@ public:
         std::swap(callable_, rhs.callable_);
     }
 
-    const type_info& target_type() const noexcept
+    const std::type_info& target_type() const noexcept
     {
         return callable_->TargetType();
     }
diff --git a/src/kiwano/core/IntrusiveList.h b/src/kiwano/core/IntrusiveList.h
index 3fe724ed..651e2830 100644
--- a/src/kiwano/core/IntrusiveList.h
+++ b/src/kiwano/core/IntrusiveList.h
@@ -246,13 +246,13 @@ public:
     }
 
 public:
-    template 
+    template 
     struct Iterator
     {
         using iterator_category = std::bidirectional_iterator_tag;
-        using value_type        = _PtrTy;
-        using pointer           = _PtrTy*;
-        using reference         = _PtrTy&;
+        using value_type        = _IterPtrTy;
+        using pointer           = _IterPtrTy*;
+        using reference         = _IterPtrTy&;
         using difference_type   = ptrdiff_t;
 
         inline Iterator(value_type ptr = nullptr, bool is_end = false)
diff --git a/src/kiwano/core/Resource.cpp b/src/kiwano/core/Resource.cpp
index ad44a5ff..99424288 100644
--- a/src/kiwano/core/Resource.cpp
+++ b/src/kiwano/core/Resource.cpp
@@ -19,7 +19,7 @@
 // THE SOFTWARE.
 
 #include 
-#include 
+#include 
 #include 
 
 namespace kiwano
diff --git a/src/kiwano/core/Serializable.h b/src/kiwano/core/Serializable.h
index 821865cc..c160cf7d 100644
--- a/src/kiwano/core/Serializable.h
+++ b/src/kiwano/core/Serializable.h
@@ -24,6 +24,15 @@
 
 namespace kiwano
 {
+/**
+ * \~chinese
+ * \defgroup Serialization л
+ */
+
+/**
+ * \addtogroup Serialization
+ * @{
+ */
 
 /// \~chinese
 /// @brief л
@@ -230,7 +239,7 @@ class Serializable
 {
 public:
     /// \~chinese
-    /// @brief лΪַ
+    /// @brief лΪֽڴ
     inline Vector Serialize() const
     {
         Vector data;
@@ -240,7 +249,7 @@ public:
     }
 
     /// \~chinese
-    /// @brief ַл
+    /// @brief ֽڴл
     inline void Deserialize(const Vector& data)
     {
         ByteDeserializer deserializer(data);
@@ -438,4 +447,7 @@ inline Deserializer& operator>>(Deserializer& deserializer, math::TransformT> transform.position >> transform.rotation >> transform.scale >> transform.skew;
 }
 
+/** @} */
+
+
 }  // namespace kiwano
diff --git a/src/kiwano/core/SmartPtr.hpp b/src/kiwano/core/SmartPtr.hpp
index ba73c09a..f569bb2b 100644
--- a/src/kiwano/core/SmartPtr.hpp
+++ b/src/kiwano/core/SmartPtr.hpp
@@ -22,7 +22,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace kiwano
 {
@@ -73,13 +73,13 @@ public:
     SmartPtr(pointer_type p)
         : ptr_(p)
     {
-        typename _ProxyTy::Retain(ptr_);
+        _ProxyTy::Retain(ptr_);
     }
 
     SmartPtr(const SmartPtr& other)
         : ptr_(other.ptr_)
     {
-        typename _ProxyTy::Retain(ptr_);
+        _ProxyTy::Retain(ptr_);
     }
 
     SmartPtr(SmartPtr&& other) noexcept
@@ -97,7 +97,7 @@ public:
     SmartPtr(const SmartPtr<_UTy, _ProxyTy>& other)
     {
         ptr_ = const_cast(dynamic_cast(other.Get()));
-        typename _ProxyTy::Retain(ptr_);
+        _ProxyTy::Retain(ptr_);
     }
 
     inline pointer_type Get() noexcept
@@ -193,7 +193,7 @@ public:
 private:
     void Tidy()
     {
-        typename _ProxyTy::Release(ptr_);
+        _ProxyTy::Release(ptr_);
         ptr_ = nullptr;
     }
 
@@ -268,7 +268,7 @@ inline bool operator<(const SmartPtr<_Ty, _ProxyTy>& lhs, const SmartPtr<_UTy, _
 }
 
 // template class cannot specialize std::swap,
-// so implement a Swap Function in kiwano namespace
+// so implement a swap function in kiwano namespace
 template 
 inline void swap(SmartPtr<_Ty, _ProxyTy>& lhs, SmartPtr<_Ty, _ProxyTy>& rhs) noexcept
 {
diff --git a/src/kiwano/core/Time.cpp b/src/kiwano/core/Time.cpp
index 49a31ee5..33b120d8 100644
--- a/src/kiwano/core/Time.cpp
+++ b/src/kiwano/core/Time.cpp
@@ -19,10 +19,12 @@
 // THE SOFTWARE.
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 namespace kiwano
 {
@@ -35,7 +37,7 @@ Time::Time()
 {
 }
 
-Time::Time(long dur)
+Time::Time(int64_t dur)
     : dur_(dur)
 {
 }
@@ -69,19 +71,114 @@ const Duration Time::operator-(const Time& other) const
 
 Time Time::Now() noexcept
 {
-    static LARGE_INTEGER freq = {};
-    if (freq.QuadPart == 0LL)
+#if defined(KGE_PLATFORM_WINDOWS)
+
+    static double millisecs_per_count = {};
+    if (millisecs_per_count == 0)
     {
+        LARGE_INTEGER freq = {};
         // the Function will always succceed on systems that run Windows XP or later
         QueryPerformanceFrequency(&freq);
+        millisecs_per_count = 1000.0 / static_cast(freq.QuadPart);
     }
 
     LARGE_INTEGER count;
     QueryPerformanceCounter(&count);
+    return Time{ static_cast