an animation layer engine on windows platform some like Core Animation in cocoa frameworks.
newest
photo below is shown for wall-behive.
- attach a
CARootLayer
to win32 window handle addSublayer()
CALayer
to thisCARootLayer
display()
thisCARootLayer
in the win32 window'sWM_PAINT
wndproc.setFrame()
while this win32 window'sWM_SIZE
etc.
-
use
CAAnimation
tocommit()
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_autorelease
in the thread. -
scope between
_0_autorelease
and_1_autorelease
-
NSObjects can use
autorelease()
method. -
NSAutoreleasePoolDettachCurrentThread()
after any_1_autorelease
in the thread.
- all the NSObjects only allowed to be created by
NSObject::allocT<Ty>()
, anynew
or 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
NSDispatcher
which associate to HWND, anddispatch_async()
to UI thread which the HWND belongs to. - this
NSDispatcher
help you changeCALayer
in UI thread rather than a non UI thread. - you should process
process_dispatch_on_message()
in the HWND'sWM_NS_DIPATCH_NOTIRY
wndporc.
CGContextPolicyForceSpeed()
CGContextPolicyPreferSpeed()
CGContextPolicyDefault()
CGContextPolicyBalance()
https://github.com/bbqz007/KTL