Coco2d 2.1 und Xcode iOS 7 9 crash ccShader

Getestet habe ich mit Xcode 7 mit, aber meine cocos2d 2.1 Spiele crash auf simulator oder auf anderen Geräten:

ccShader_PositionColorLenghtTexture_frag.h

2015-06-15 22:36:13.319 NanoWar[18789:456971] cocos2d: ERROR: 0:12: '' : syntax error: #extension must always be before any non-preprocessor tokens

und

cocos2d: ERROR: 0:26: Invalid call of undeclared identifier 'fwidth'

Dieser Klasse das Spiel zum Absturz bringen

#extension GL_OES_standard_derivatives : enable                                                                             

#ifdef GL_ES                                                                                                                
varying mediump vec4 v_color;                                                                                               
varying mediump vec2 v_texcoord;                                                                                            
#else                                                                                                                       
varying vec4 v_color;                                                                                                       
varying vec2 v_texcoord;                                                                                                    
#endif                                                                                                                      

void main()                                                                                                                 
{                                                                                                                           
#ifdef GL_OES_standard_derivatives                                                                                          
#if defined GL_OES_standard_derivatives                                                                                     
    gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord));                           
#else                                                                                                                       
    gl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord));                                                             
#endif                                                                                                                      
#endif                                                                                                                      
}
Schreibe einen Kommentar