xw
an animation layer engine on windows platform some like Core Animation in cocoa frameworks.
newest
photo below is shown for wall-behive.
ChangeLog
classes
use animation engine
- 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.
two way to write animations
-
use
CAAnimation
tocommit()
a animation job. -
implement your own
CALayer
, override the virtual methodCALayer::applyAnimating()
to control every frame.
properties of CALayer for animation
-
Frame.
-
opacity.
-
transform matrix.
custom draw CALayer
- derived Layer from
CALayer
- override the virtual method
CALayer::drawInContext()
autorelease
-
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.
lifetime
- 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.
dispatch_queue
- 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.
performance
CGContextPolicyForceSpeed()
CGContextPolicyPreferSpeed()
CGContextPolicyDefault()
CGContextPolicyBalance()
projects
https://github.com/bbqz007/KTL