an animation layer engine on windows platform some like Core Animation in cocoa frameworks.
newest
photo below is shown for wall-behive.
- attach a
CARootLayerto win32 window handle addSublayer()CALayerto thisCARootLayerdisplay()thisCARootLayerin the win32 window'sWM_PAINTwndproc.setFrame()while this win32 window'sWM_SIZEetc.
-
use
CAAnimationtocommit()a animation job. -
implement your own
CALayer, override the virtual methodCALayer::applyAnimating()to control every frame.
-
Frame.
-
opacity.
-
transform matrix.
- derived Layer from
CALayer - override the virtual method
CALayer::drawInContext()
-
NSAutoreleasePoolAttachCurrentThread()before any_0_autoreleasein the thread. -
scope between
_0_autoreleaseand_1_autorelease -
NSObjects can use
autorelease()method. -
NSAutoreleasePoolDettachCurrentThread()after any_1_autoreleasein the thread.
- all the NSObjects only allowed to be created by
NSObject::allocT<Ty>(), anynewor scoped creation would throw. release()by hand, orautorelease()- use
__strong<Ty>, itretain()when the pointer checks in andrelease()when the pointer checks out.
- implement as
NSDispatcherwhich associate to HWND, anddispatch_async()to UI thread which the HWND belongs to. - this
NSDispatcherhelp you changeCALayerin UI thread rather than a non UI thread. - you should process
process_dispatch_on_message()in the HWND'sWM_NS_DIPATCH_NOTIRYwndporc.
CGContextPolicyForceSpeed()CGContextPolicyPreferSpeed()CGContextPolicyDefault()CGContextPolicyBalance()
https://github.com/bbqz007/KTL




