Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

iphone - Marrying Core Animation with OpenGL ES -


edit: suppose instead of long explanation below might ask: sending -setneedsdisplay instance of caeagllayer not cause layer redraw (i.e., -drawincontext: not called). instead, console message:

<gllayer: 0x4d500b0>: calling -display has no effect. 

is there way around issue? can invoke -drawincontext: when -setneedsdisplay called? long explanation below:


i have opengl scene animate using core animation animations.

following standard approach animate custom properties in calayer, created subclass of caeagllayer , defined property scenecenterpoint in value should animated. layer holds reference opengl renderer:

#import <uikit/uikit.h> #import <quartzcore/quartzcore.h> #import "es2renderer.h"  @interface gllayer : caeagllayer {     es2renderer *renderer; }  @property (nonatomic, retain) es2renderer *renderer; @property (nonatomic, assign) cgpoint scenecenterpoint; 

i declare property @dynamic let ca create accessors, override +needsdisplayforkey: , implement -drawincontext: pass current value of scenecenterpoint property renderer , ask render scene:

#import "gllayer.h"  @implementation gllayer  @synthesize renderer; @dynamic scenecenterpoint;  + (bool) needsdisplayforkey:(nsstring *)key {     if ([key isequaltostring:@"scenecenterpoint"]) {         return yes;     } else {         return [super needsdisplayforkey:key];     } }  - (void) drawincontext:(cgcontextref)ctx {     self.renderer.centerpoint = self.scenecenterpoint;     [self.renderer render]; } ... 

(if have access wwdc 2009 session videos, can review technique in session 303 ("animated drawing")).

now, when create explicit animation layer on keypath @"scenecenterpoint", core animation should calculate interpolated values custom properties , call -drawincontext: each step of animation:

- (ibaction)animatebuttontapped:(id)sender {     cabasicanimation *animation = [cabasicanimation animationwithkeypath:@"scenecenterpoint"];     animation.duration = 1.0;     animation.fromvalue = [nsvalue valuewithcgpoint:cgpointzero];     animation.tovalue = [nsvalue valuewithcgpoint:cgpointmake(1.0f, 1.0f)];     [self.glview.layer addanimation:animation forkey:nil]; } 

at least happen normal calayer subclass. when subclass caeagllayer, output on console each step of animation:

2010-12-21 13:59:22.180 coreanimationopengl[7496:207] <gllayer: 0x4e0be20>: calling -display has no effect. 2010-12-21 13:59:22.198 coreanimationopengl[7496:207] <gllayer: 0x4e0be20>: calling -display has no effect. 2010-12-21 13:59:22.216 coreanimationopengl[7496:207] <gllayer: 0x4e0be20>: calling -display has no effect. 2010-12-21 13:59:22.233 coreanimationopengl[7496:207] <gllayer: 0x4e0be20>: calling -display has no effect. ... 

so seems that, possibly performance reasons, opengl layers, -drawincontext: not getting called because these layers not use standard -display method draw themselves. can confirm that? there way around it?

or can not use technique laid out above? mean have implement animations manually in opengl renderer (which possible not elegant imo).

have tried making parent layer above opengl layer , animating instead?


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -