├── README.md └── rippledemo ├── Classes ├── AppDelegate.cpp ├── AppDelegate.h ├── CCRippleSprite.cpp ├── CCRippleSprite.h ├── HelloWorldScene.cpp └── HelloWorldScene.h ├── Resources ├── CloseNormal.png ├── CloseSelected.png ├── HelloWorld.png ├── fonts │ └── Marker Felt.ttf ├── image.png └── rippleShader.fsh ├── proj.android ├── .classpath ├── .cproject ├── .project ├── AndroidManifest.xml ├── README.md ├── ant.properties ├── assets │ ├── CloseNormal.png │ ├── CloseSelected.png │ ├── HelloWorld.png │ ├── fonts │ │ └── Marker Felt.ttf │ ├── image.png │ └── rippleShader.fsh ├── build.xml ├── build_native.sh ├── gen │ ├── R.java.d │ └── com │ │ └── zilong │ │ └── rippledemo │ │ ├── BuildConfig.java │ │ └── R.java ├── jni │ ├── Android.mk │ ├── Application.mk │ └── hellocpp │ │ └── main.cpp ├── libs │ └── armeabi │ │ └── libcocos2dcpp.so ├── local.properties ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-ldpi │ │ └── icon.png │ ├── drawable-mdpi │ │ └── icon.png │ └── values │ │ └── strings.xml └── src │ └── com │ └── zilong │ └── rippledemo │ └── rippledemo.java ├── proj.blackberry ├── .cproject ├── .project ├── bar-descriptor.xml ├── empty │ └── empty ├── icon.png └── main.cpp ├── proj.ios ├── AppController.h ├── AppController.mm ├── Default-568h@2x.png ├── Default.png ├── Default@2x.png ├── Icon-114.png ├── Icon-144.png ├── Icon-57.png ├── Icon-72.png ├── Info.plist ├── Prefix.pch ├── RootViewController.h ├── RootViewController.mm ├── main.m └── rippledemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── guanghui.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ └── guanghui.xcuserdatad │ └── xcschemes │ ├── rippledemo.xcscheme │ └── xcschememanagement.plist ├── proj.linux ├── .cproject ├── .project ├── Makefile ├── build.sh └── main.cpp ├── proj.mac ├── AppController.h ├── AppController.mm ├── Icon.icns ├── Info.plist ├── Prefix.pch ├── en.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib ├── main.m └── rippledemo.xcodeproj │ └── project.pbxproj ├── proj.marmalade ├── rippledemo.mkb └── src │ ├── Main.cpp │ └── Main.h └── proj.win32 ├── main.cpp ├── main.h ├── rippledemo.sln ├── rippledemo.vcxproj ├── rippledemo.vcxproj.filters └── rippledemo.vcxproj.user /README.md: -------------------------------------------------------------------------------- 1 | The ripple shader effect is inspired from [Panajav](https://github.com/Panajev/rippleDemo). 2 | 3 | # How to Use 4 | 5 | You can put this project under your cocos2d-x root's projects folder.(I use Walzer's amazing create_project.py to create these cross-platform projects. You can refer to [this wiki page](http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_create_a_multi-platform_project_in_one_command_line) for more information.) 6 | 7 | Now I only add ios and android support, more version will be added in the future. Hope you guys will contribute. 8 | 9 | TODO: 10 | 11 | 1. add my own fork of cocos2d-x as a submodule 12 | 2. convert the ripple demo to support v2.x and v3.x 13 | 3. port all of my book's shaders with cocos2d-x v2.x and v3.x 14 | 4. write some more shaders 15 | 16 | **Licence:** 17 | 18 | Do What The Fuck You Want To Public License ([WTFPL](http://www.wtfpl.net/)). 19 | -------------------------------------------------------------------------------- /rippledemo/Classes/AppDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "HelloWorldScene.h" 3 | 4 | USING_NS_CC; 5 | 6 | AppDelegate::AppDelegate() { 7 | 8 | } 9 | 10 | AppDelegate::~AppDelegate() 11 | { 12 | } 13 | 14 | bool AppDelegate::applicationDidFinishLaunching() { 15 | // initialize director 16 | CCDirector* pDirector = CCDirector::sharedDirector(); 17 | CCEGLView* pEGLView = CCEGLView::sharedOpenGLView(); 18 | 19 | pDirector->setOpenGLView(pEGLView); 20 | 21 | // turn on display FPS 22 | pDirector->setDisplayStats(true); 23 | 24 | // set FPS. the default value is 1.0/60 if you don't call this 25 | pDirector->setAnimationInterval(1.0 / 30); 26 | 27 | // create a scene. it's an autorelease object 28 | CCScene *pScene = HelloWorld::scene(); 29 | 30 | // run 31 | pDirector->runWithScene(pScene); 32 | 33 | return true; 34 | } 35 | 36 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too 37 | void AppDelegate::applicationDidEnterBackground() { 38 | CCDirector::sharedDirector()->stopAnimation(); 39 | 40 | // if you use SimpleAudioEngine, it must be pause 41 | // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); 42 | } 43 | 44 | // this function will be called when the app is active again 45 | void AppDelegate::applicationWillEnterForeground() { 46 | CCDirector::sharedDirector()->startAnimation(); 47 | 48 | // if you use SimpleAudioEngine, it must resume here 49 | // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); 50 | } 51 | -------------------------------------------------------------------------------- /rippledemo/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef _APP_DELEGATE_H_ 2 | #define _APP_DELEGATE_H_ 3 | 4 | #include "cocos2d.h" 5 | 6 | /** 7 | @brief The cocos2d Application. 8 | 9 | The reason for implement as private inheritance is to hide some interface call by CCDirector. 10 | */ 11 | class AppDelegate : private cocos2d::CCApplication 12 | { 13 | public: 14 | AppDelegate(); 15 | virtual ~AppDelegate(); 16 | 17 | /** 18 | @brief Implement CCDirector and CCScene init code here. 19 | @return true Initialize success, app continue. 20 | @return false Initialize failed, app terminate. 21 | */ 22 | virtual bool applicationDidFinishLaunching(); 23 | 24 | /** 25 | @brief The function be called when the application enter background 26 | @param the pointer of the application 27 | */ 28 | virtual void applicationDidEnterBackground(); 29 | 30 | /** 31 | @brief The function be called when the application enter foreground 32 | @param the pointer of the application 33 | */ 34 | virtual void applicationWillEnterForeground(); 35 | }; 36 | 37 | #endif // _APP_DELEGATE_H_ 38 | 39 | -------------------------------------------------------------------------------- /rippledemo/Classes/CCRippleSprite.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CCRippleSprite.cpp 3 | // RippleDemo-x 4 | // 5 | // Created by guanghui on 7/30/13. 6 | // 7 | // 8 | 9 | #include "CCRippleSprite.h" 10 | #include 11 | 12 | using namespace std; 13 | 14 | 15 | 16 | 17 | pgeRippleSprite* pgeRippleSprite::create(const char * filename) 18 | { 19 | pgeRippleSprite *pSprite = new pgeRippleSprite(); 20 | if (pSprite && pSprite->initWithFile(filename)) { 21 | pSprite->autorelease(); 22 | return pSprite; 23 | } 24 | else 25 | { 26 | delete pSprite; 27 | pSprite = NULL; 28 | return NULL; 29 | } 30 | } 31 | 32 | 33 | pgeRippleSprite::pgeRippleSprite() 34 | :m_texture(NULL), 35 | m_quadCountX(0), 36 | m_quadCountY(0), 37 | m_VerticesPrStrip(0), 38 | m_bufferSize(0), 39 | m_vertice(NULL), 40 | m_textureCoordinate(NULL), 41 | m_rippleCoordinate(NULL), 42 | m_edgeVertice(NULL), 43 | scaleRTT(0), 44 | screenSize(CCPointZero), 45 | runTime(0) 46 | { 47 | 48 | } 49 | pgeRippleSprite::~pgeRippleSprite() 50 | { 51 | rippleData* runningRipple; 52 | 53 | free(m_vertice); 54 | free(m_textureCoordinate); 55 | free(m_rippleCoordinate); 56 | free(m_edgeVertice); 57 | 58 | for (int count = 0; count < m_rippleList.size(); count++) { 59 | runningRipple = m_rippleList.at(count); 60 | free(runningRipple); 61 | } 62 | 63 | m_texture->release(); 64 | 65 | 66 | } 67 | bool pgeRippleSprite::initWithFile(const char* filename) 68 | { 69 | bool bRet = true; 70 | 71 | do { 72 | 73 | if (!CCSprite::init()) { 74 | bRet = false; 75 | break; 76 | } 77 | 78 | scaleRTT = 1.0f; 79 | 80 | 81 | //load texture 82 | m_texture = CCTextureCache::sharedTextureCache()->addImage(filename); 83 | m_texture->retain(); 84 | 85 | 86 | 87 | //reset internal data 88 | m_vertice = NULL; 89 | m_textureCoordinate = NULL; 90 | //builds the vertice and texture-coordinate array 91 | m_quadCountX = RIPPLE_DEFAULT_QUAD_COUNT_X; 92 | m_quadCountY = RIPPLE_DEFAULT_QUAD_COUNT_Y; 93 | this->tesselate(); 94 | 95 | screenSize = ccp(m_texture->getContentSize().width / scaleRTT, 96 | m_texture->getContentSize().height / scaleRTT); 97 | 98 | this->setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTexture)); 99 | 100 | 101 | } while (0); 102 | 103 | 104 | return bRet; 105 | 106 | 107 | } 108 | 109 | 110 | void pgeRippleSprite::tesselate() 111 | { 112 | int vertexPos = 0; 113 | CCPoint normalized; 114 | 115 | // clear buffers ( yeah, clearing nil buffers first time around ) 116 | free( m_vertice ); 117 | free( m_textureCoordinate ); 118 | free( m_rippleCoordinate ); 119 | free( m_edgeVertice ); 120 | 121 | // calculate vertices pr strip 122 | m_VerticesPrStrip = 2 * ( m_quadCountX + 1 ); 123 | 124 | // calculate buffer size 125 | m_bufferSize = m_VerticesPrStrip * m_quadCountY; 126 | 127 | // allocate buffers 128 | m_vertice = (CCPoint*)malloc( m_bufferSize * sizeof( CCPoint ) ); 129 | m_textureCoordinate = (CCPoint*)malloc( m_bufferSize * sizeof( CCPoint ) ); 130 | m_rippleCoordinate = (CCPoint*)malloc( m_bufferSize * sizeof( CCPoint ) ); 131 | m_edgeVertice = (bool*)malloc( m_bufferSize * sizeof( bool ) ); 132 | 133 | // reset vertice pointer 134 | vertexPos = 0; 135 | 136 | // create all vertices and default texture coordinates 137 | // scan though y quads, and create an x-oriented triangle strip for each 138 | for ( int y = 0; y < m_quadCountY; y ++ ) { 139 | 140 | // x counts to quadcount + 1, because number of vertices is number of quads + 1 141 | for ( int x = 0; x < ( m_quadCountX + 1 ); x ++ ) { 142 | 143 | // for each x vertex, an upper and lower y position is calculated, to create the triangle strip 144 | // upper + lower + upper + lower 145 | for ( int yy = 0; yy < 2; yy ++ ) { 146 | 147 | // first simply calculate a normalized position into rectangle 148 | normalized.x = ( float )x / ( float )m_quadCountX; 149 | normalized.y = ( float )( y + yy ) / ( float )m_quadCountY; 150 | 151 | // calculate vertex by multiplying rectangle ( texture ) size 152 | m_vertice[vertexPos] = ccp(normalized.x * m_texture->getContentSize().width / scaleRTT, normalized.y * 153 | m_texture->getContentSize().height / scaleRTT ); 154 | 155 | // adjust texture coordinates according to texture size 156 | // as a texture is always in the power of 2, maxS and maxT are the fragment of the size actually used 157 | // invert y on texture coordinates 158 | m_textureCoordinate[vertexPos] = ccp(normalized.x * m_texture->getMaxS(), m_texture->getMaxT() - normalized.y * 159 | m_texture->getMaxT()); 160 | 161 | // check if vertice is an edge vertice, because edge vertices are never modified to keep outline consistent 162 | m_edgeVertice[ vertexPos ] = ( 163 | ( x == 0 ) || 164 | ( x == m_quadCountX ) || 165 | ( ( y == 0 ) && ( yy == 0 ) ) || 166 | ( ( y == ( m_quadCountY - 1 ) ) && ( yy > 0 ) ) ); 167 | 168 | // next buffer pos 169 | vertexPos ++; 170 | 171 | } 172 | } 173 | } 174 | 175 | } 176 | void pgeRippleSprite::addRipple(CCPoint pos, RIPPLE_TYPE type, float strength) 177 | { 178 | rippleData* newRipple; 179 | 180 | // allocate new ripple 181 | newRipple = (rippleData*)malloc( sizeof( rippleData ) ); 182 | 183 | // initialize ripple 184 | newRipple->parent = true; 185 | for ( int count = 0; count < 4; count ++ ) newRipple->childCreated[ count ] = false; 186 | newRipple->rippleType = type; 187 | newRipple->center = pos; 188 | newRipple->centerCoordinate = ccp(pos.x / m_texture->getContentSize().width * m_texture->getMaxS() / scaleRTT , 189 | m_texture->getMaxT() - (pos.y / m_texture->getContentSize().height * m_texture->getMaxT()/scaleRTT)); 190 | newRipple->radius = RIPPLE_DEFAULT_RADIUS; // * strength; 191 | newRipple->strength = strength; 192 | newRipple->runtime = 0; 193 | newRipple->currentRadius = 0; 194 | newRipple->rippleCycle = RIPPLE_DEFAULT_RIPPLE_CYCLE; 195 | newRipple->lifespan = RIPPLE_DEFAULT_LIFESPAN; 196 | 197 | // add ripple to running list 198 | m_rippleList.push_back(newRipple); 199 | 200 | 201 | } 202 | void pgeRippleSprite::addRippleChild(rippleData* parent, RIPPLE_CHILD type) 203 | { 204 | rippleData* newRipple; 205 | CCPoint pos; 206 | 207 | //CGSize screenSize = [CCDirector sharedDirector].winSize; 208 | 209 | // allocate new ripple 210 | newRipple = (rippleData*)malloc( sizeof( rippleData ) ); 211 | 212 | // new ripple is pretty much a copy of its parent 213 | memcpy( newRipple, parent, sizeof( rippleData ) ); 214 | 215 | // not a parent 216 | newRipple->parent = false; 217 | 218 | // mirror position 219 | switch ( type ) { 220 | case RIPPLE_CHILD_LEFT: 221 | pos = ccp( -parent->center.x, parent->center.y ); 222 | break; 223 | case RIPPLE_CHILD_TOP: 224 | pos = ccp( parent->center.x, screenSize.y + ( screenSize.y - parent->center.y ) ); 225 | break; 226 | case RIPPLE_CHILD_RIGHT: 227 | pos = ccp( screenSize.x + ( screenSize.x - parent->center.x ), parent->center.y ); 228 | break; 229 | case RIPPLE_CHILD_BOTTOM: 230 | default: 231 | pos = ccp( parent->center.x, -parent->center.y ); 232 | break; 233 | } 234 | 235 | newRipple->center = pos; 236 | newRipple->centerCoordinate = ccp(pos.x / m_texture->getContentSize().width * m_texture->getMaxS(), 237 | m_texture->getMaxT() - (pos.y / m_texture->getContentSize().height * m_texture->getMaxT())); 238 | newRipple->strength *= RIPPLE_CHILD_MODIFIER; 239 | 240 | // indicate child used 241 | parent->childCreated[ type ] = true; 242 | 243 | // add ripple to running list 244 | m_rippleList.push_back(newRipple); 245 | } 246 | 247 | void pgeRippleSprite::update(float dt) 248 | { 249 | 250 | //runTime += dt; 251 | 252 | rippleData* ripple; 253 | CCPoint pos; 254 | float distance, correction; 255 | //CGSize screenSize = [CCDirector sharedDirector].winSize; 256 | 257 | // test if any ripples at all 258 | if ( m_rippleList.size() == 0 ) return; 259 | 260 | // ripples are simulated by altering texture coordinates 261 | // on all updates, an entire new array is calculated from the base array 262 | // not maintainng an original set of texture coordinates, could result in accumulated errors 263 | memcpy( m_rippleCoordinate, m_textureCoordinate, m_bufferSize * sizeof( CCPoint ) ); 264 | 265 | // scan through running ripples 266 | // the scan is backwards, so that ripples can be removed on the fly 267 | for ( int count = ( m_rippleList.size() - 1 ); count >= 0; count -- ) { 268 | 269 | // get ripple data 270 | ripple = m_rippleList[count]; 271 | 272 | // scan through all texture coordinates 273 | for ( int count = 0; count < m_bufferSize; count ++ ) { 274 | 275 | // dont modify edge vertices 276 | if ( m_edgeVertice[ count ] == false ) { 277 | 278 | // calculate distance 279 | // you might think it would be faster to do a box check first 280 | // but it really isnt, 281 | // ccpDistance is like my sexlife - BAM! - and its all over 282 | distance = ccpDistance( ripple->center, m_vertice[ count ] ); 283 | 284 | // only modify vertices within range 285 | if ( distance <= ripple->currentRadius ) { 286 | 287 | // load the texture coordinate into an easy to use var 288 | pos = m_rippleCoordinate[ count ]; 289 | 290 | // calculate a ripple 291 | switch ( ripple->rippleType ) { 292 | 293 | case RIPPLE_TYPE_RUBBER: 294 | // method A 295 | // calculate a sinus, based only on time 296 | // this will make the ripples look like poking a soft rubber sheet, since sinus position is fixed 297 | correction = sinf( 2 * M_PI * ripple->runtime / ripple->rippleCycle ); 298 | break; 299 | 300 | case RIPPLE_TYPE_GEL: 301 | // method B 302 | // calculate a sinus, based both on time and distance 303 | // this will look more like a high viscosity fluid, since sinus will travel with radius 304 | correction = sinf( 2 * M_PI * ( ripple->currentRadius - distance ) / ripple->radius * ripple->lifespan / ripple->rippleCycle ); 305 | break; 306 | 307 | case RIPPLE_TYPE_WATER: 308 | default: 309 | // method c 310 | // like method b, but faded for time and distance to center 311 | // this will look more like a low viscosity fluid, like water 312 | 313 | correction = ( ripple->radius * ripple->rippleCycle / ripple->lifespan ) / ( ripple->currentRadius - distance ); 314 | if ( correction > 1.0f ) correction = 1.0f; 315 | 316 | // fade center of quicker 317 | correction *= correction; 318 | 319 | correction *= sinf( 2 * M_PI * ( ripple->currentRadius - distance ) / ripple->radius * ripple->lifespan / ripple->rippleCycle ); 320 | break; 321 | 322 | } 323 | 324 | // fade with distance 325 | correction *= 1 - ( distance / ripple->currentRadius ); 326 | 327 | // fade with time 328 | correction *= 1 - ( ripple->runtime / ripple->lifespan ); 329 | 330 | // adjust for base gain and user strength 331 | correction *= RIPPLE_BASE_GAIN; 332 | correction *= ripple->strength; 333 | 334 | // finally modify the coordinate by interpolating 335 | // because of interpolation, adjustment for distance is needed, 336 | correction /= ccpDistance( ripple->centerCoordinate, pos ); 337 | pos = ccpAdd( pos, ccpMult( ccpSub( pos, ripple->centerCoordinate ), correction ) ); 338 | 339 | // another approach for applying correction, would be to calculate slope from center to pos 340 | // and then adjust based on this 341 | 342 | // clamp texture coordinates to avoid artifacts 343 | pos = ccpClamp( pos, CCPointZero, ccp( m_texture->getMaxS(), m_texture->getMaxT() ) ); 344 | 345 | // save modified coordinate 346 | m_rippleCoordinate[ count ] = pos; 347 | 348 | } 349 | } 350 | } 351 | 352 | // calculate radius 353 | ripple->currentRadius = ripple->radius * ripple->runtime / ripple->lifespan; 354 | 355 | // check if ripple should expire 356 | ripple->runtime += dt; 357 | if ( ripple->runtime >= ripple->lifespan ) { 358 | 359 | // free memory, and remove from list 360 | free( ripple ); 361 | m_rippleList.erase(m_rippleList.begin() + count); 362 | 363 | } else { 364 | 365 | #ifdef RIPPLE_BOUNCE 366 | // check for creation of child ripples 367 | if ( ripple->parent == true ) { 368 | 369 | // left ripple 370 | if ( ( ripple->childCreated[ RIPPLE_CHILD_LEFT ] == false ) && ( ripple->currentRadius > ripple->center.x ) ) { 371 | this->addRippleChild(ripple, RIPPLE_CHILD_LEFT); 372 | } 373 | 374 | // top ripple 375 | if ( ( ripple->childCreated[ RIPPLE_CHILD_TOP ] == false ) && ( ripple->currentRadius > screenSize.y - ripple->center.y ) ) { 376 | this->addRippleChild(ripple, RIPPLE_CHILD_TOP); 377 | } 378 | 379 | // right ripple 380 | if ( ( ripple->childCreated[ RIPPLE_CHILD_RIGHT ] == false ) && ( ripple->currentRadius > screenSize.x - ripple->center.x ) ) { 381 | this->addRippleChild(ripple, RIPPLE_CHILD_RIGHT); 382 | } 383 | 384 | // bottom ripple 385 | if ( ( ripple->childCreated[ RIPPLE_CHILD_BOTTOM ] == false ) && ( ripple->currentRadius > ripple->center.y ) ) { 386 | this->addRippleChild(ripple, RIPPLE_CHILD_BOTTOM); 387 | } 388 | 389 | 390 | 391 | } 392 | #endif 393 | 394 | } 395 | 396 | } 397 | 398 | 399 | } 400 | CCTexture2D* pgeRippleSprite::spriteTexture() 401 | { 402 | return m_texture; 403 | } 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | void pgeRippleSprite::draw() 412 | { 413 | 414 | if (!this->isVisible()) { 415 | return; 416 | } 417 | 418 | CC_NODE_DRAW_SETUP(); 419 | ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords ); 420 | 421 | ccGLBindTexture2D(m_texture->getName() ); 422 | 423 | 424 | // vertex 425 | glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, (void*) m_vertice); 426 | 427 | // if no ripples running, use original coordinates ( Yay, dig that kewl old school C syntax ) 428 | glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, ( m_rippleList.size() == 0 ) ? m_textureCoordinate : m_rippleCoordinate); 429 | 430 | // draw as many triangle fans, as quads in y direction 431 | for ( int strip = 0; strip < m_quadCountY; strip++ ) { 432 | glDrawArrays( GL_TRIANGLE_STRIP, strip * m_VerticesPrStrip, m_VerticesPrStrip ); 433 | } 434 | 435 | } 436 | 437 | 438 | 439 | 440 | 441 | bool pgeRippleSprite::isPointInsideSprite(cocos2d::CCPoint pos) 442 | { 443 | float maxX = m_texture->getContentSize().width / scaleRTT; 444 | float maxY = m_texture->getContentSize().height / scaleRTT; 445 | 446 | 447 | if(pos.x < 0 || pos.y < 0 || 448 | pos.x > maxX || pos.y > maxY) { 449 | return false; 450 | } 451 | else { 452 | return true; 453 | } 454 | 455 | } 456 | 457 | bool pgeRippleSprite::isTouchInsideSprite(cocos2d::CCTouch *pTouch) 458 | { 459 | CCPoint pos; 460 | pos = pTouch->getLocationInView(); 461 | pos = CCDirector::sharedDirector()->convertToGL(pos); 462 | pos = this->convertToNodeSpace(pos); 463 | 464 | return this->isPointInsideSprite(pos); 465 | } 466 | 467 | #pragma mark - touch events 468 | 469 | bool pgeRippleSprite::ccTouchBegan(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent) 470 | { 471 | if (!this->isTouchInsideSprite(pTouch)) { 472 | return false; 473 | } 474 | 475 | this->ccTouchMoved(pTouch, pEvent); 476 | return true; 477 | } 478 | 479 | 480 | void pgeRippleSprite::ccTouchMoved(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent) 481 | { 482 | CCPoint pos; 483 | pos = pTouch->getLocationInView(); 484 | pos = CCDirector::sharedDirector()->convertToGL(pos); 485 | pos = this->convertToNodeSpace(pos); 486 | 487 | this->addRipple(pos, RIPPLE_TYPE_WATER, 2.0f); 488 | 489 | //runTime += 1.0 / 60.0f; 490 | 491 | } 492 | 493 | 494 | void pgeRippleSprite::ccTouchCancelled(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent) 495 | { 496 | //no-op 497 | } 498 | 499 | 500 | void pgeRippleSprite::ccTouchEnded(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent) 501 | { 502 | //no-op 503 | } 504 | 505 | 506 | void pgeRippleSprite::onEnterTransitionDidFinish() 507 | { 508 | CCSprite::onEnterTransitionDidFinish(); 509 | 510 | CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, 0, true); 511 | } 512 | 513 | 514 | void pgeRippleSprite::onExit() 515 | { 516 | CCSprite::onExit(); 517 | 518 | CCDirector::sharedDirector()->getTouchDispatcher()->removeDelegate(this); 519 | } -------------------------------------------------------------------------------- /rippledemo/Classes/CCRippleSprite.h: -------------------------------------------------------------------------------- 1 | // 2 | // pgeRippleSprite.h 3 | // rippleDemo 4 | // 5 | // Created by Lars Birkemose on 02/12/11. 6 | // Copyright 2011 Protec Electronics. All rights reserved. 7 | // 8 | // -------------------------------------------------------------------------- 9 | // import headers 10 | 11 | #include "cocos2d.h" 12 | #include 13 | 14 | using namespace std; 15 | 16 | // -------------------------------------------------------------------------- 17 | // defines 18 | 19 | #define RIPPLE_DEFAULT_QUAD_COUNT_X 60 20 | #define RIPPLE_DEFAULT_QUAD_COUNT_Y 40 21 | 22 | #define RIPPLE_BASE_GAIN 0.1f // an internal constant 23 | 24 | #define RIPPLE_DEFAULT_RADIUS 100 25 | #define RIPPLE_DEFAULT_RIPPLE_CYCLE 0.25f // timing on ripple ( 1/frequenzy ) 26 | #define RIPPLE_DEFAULT_LIFESPAN 1.4f // entire ripple lifespan 27 | 28 | // #define RIPPLE_BOUNCE // makes ripples bounce off edges 29 | #define RIPPLE_CHILD_MODIFIER 2.0f // strength modifier 30 | 31 | // -------------------------------------------------------------------------- 32 | // typedefs 33 | 34 | typedef enum { 35 | RIPPLE_TYPE_RUBBER, // a soft rubber sheet 36 | RIPPLE_TYPE_GEL, // high viscosity fluid 37 | RIPPLE_TYPE_WATER, // low viscosity fluid 38 | } RIPPLE_TYPE; 39 | 40 | typedef enum { 41 | RIPPLE_CHILD_LEFT, 42 | RIPPLE_CHILD_TOP, 43 | RIPPLE_CHILD_RIGHT, 44 | RIPPLE_CHILD_BOTTOM, 45 | RIPPLE_CHILD_COUNT 46 | } RIPPLE_CHILD; 47 | 48 | USING_NS_CC; 49 | 50 | typedef struct _rippleData { 51 | bool parent; // ripple is a parent 52 | bool childCreated[ 4 ]; // child created ( in the 4 direction ) 53 | RIPPLE_TYPE rippleType; // type of ripple ( se update: ) 54 | CCPoint center; // ripple center ( but you just knew that, didn't you? ) 55 | CCPoint centerCoordinate; // ripple center in texture coordinates 56 | float radius; // radius at which ripple has faded 100% 57 | float strength; // ripple strength 58 | float runtime; // current run time 59 | float currentRadius; // current radius 60 | float rippleCycle; // ripple cycle timing 61 | float lifespan; // total life span 62 | } rippleData; 63 | 64 | // -------------------------------------------------------------------------- 65 | // interface 66 | 67 | class pgeRippleSprite : public CCSprite, public CCTargetedTouchDelegate { 68 | public: 69 | //static methods: 70 | static pgeRippleSprite* create(const char * filename); 71 | static pgeRippleSprite* create(CCRenderTexture* rtt, float scale); 72 | 73 | pgeRippleSprite(); 74 | ~pgeRippleSprite(); 75 | bool initWithFile(const char* filename); 76 | bool initWithRendertexture(CCRenderTexture* rtt, float scale); 77 | 78 | void tesselate(); 79 | void addRipple(CCPoint pos, RIPPLE_TYPE type, float strength); 80 | void addRippleChild(rippleData* parent, RIPPLE_CHILD type); 81 | void update(float dt); 82 | CCTexture2D* spriteTexture(); 83 | 84 | virtual void draw(); 85 | virtual void onEnterTransitionDidFinish(); 86 | virtual void onExit(); 87 | 88 | 89 | 90 | virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent); 91 | virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent); 92 | virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent); 93 | virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent); 94 | 95 | private: 96 | bool isPointInsideSprite(CCPoint pos); 97 | bool isTouchInsideSprite(CCTouch* pTouch); 98 | 99 | CCTexture2D* m_texture; 100 | int m_quadCountX; // quad count in x and y direction 101 | int m_quadCountY; 102 | int m_VerticesPrStrip; // number of vertices in a strip 103 | int m_bufferSize; // vertice buffer size 104 | CCPoint* m_vertice; // vertices 105 | CCPoint* m_textureCoordinate; // texture coordinates ( original ) 106 | CCPoint* m_rippleCoordinate; // texture coordinates ( ripple corrected ) 107 | bool* m_edgeVertice; // vertice is a border vertice 108 | vector m_rippleList; // list of running ripples 109 | 110 | 111 | CCPoint screenSize; 112 | float scaleRTT; 113 | float runTime; 114 | }; 115 | 116 | -------------------------------------------------------------------------------- /rippledemo/Classes/HelloWorldScene.cpp: -------------------------------------------------------------------------------- 1 | #include "HelloWorldScene.h" 2 | #include "SimpleAudioEngine.h" 3 | 4 | using namespace cocos2d; 5 | using namespace CocosDenshion; 6 | 7 | CCScene* HelloWorld::scene() 8 | { 9 | // 'scene' is an autorelease object 10 | CCScene *scene = CCScene::create(); 11 | 12 | // 'layer' is an autorelease object 13 | HelloWorld *layer = HelloWorld::create(); 14 | 15 | // add layer as a child to scene 16 | scene->addChild(layer); 17 | 18 | // return the scene 19 | return scene; 20 | } 21 | 22 | // on "init" you need to initialize your instance 23 | bool HelloWorld::init() 24 | { 25 | ////////////////////////////// 26 | // 1. super init first 27 | if ( !CCLayer::init() ) 28 | { 29 | return false; 30 | } 31 | 32 | 33 | 34 | rippleSprite = pgeRippleSprite::create("image.png"); 35 | // rippleSprite->setPosition(ccp(160,240)); 36 | // rippleSprite->setScale(0.5); 37 | rippleSprite->setScale(480.0 / 320); 38 | this->addChild(rippleSprite); 39 | 40 | // rippleSprite->setRotation(20); 41 | 42 | 43 | this->scheduleUpdate(); 44 | 45 | 46 | 47 | 48 | return true; 49 | } 50 | 51 | void HelloWorld::menuCloseCallback(CCObject* pSender) 52 | { 53 | CCDirector::sharedDirector()->end(); 54 | 55 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) 56 | exit(0); 57 | #endif 58 | } 59 | 60 | 61 | void HelloWorld::update(float dt) 62 | { 63 | rippleSprite->update(dt); 64 | 65 | } 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /rippledemo/Classes/HelloWorldScene.h: -------------------------------------------------------------------------------- 1 | #ifndef __HELLOWORLD_SCENE_H__ 2 | #define __HELLOWORLD_SCENE_H__ 3 | 4 | #include "cocos2d.h" 5 | #include "CCRippleSprite.h" 6 | 7 | 8 | class HelloWorld : public cocos2d::CCLayer 9 | { 10 | public: 11 | // Method 'init' in cocos2d-x returns bool, instead of 'id' in cocos2d-iphone (an object pointer) 12 | virtual bool init(); 13 | 14 | // there's no 'id' in cpp, so we recommend to return the class instance pointer 15 | static cocos2d::CCScene* scene(); 16 | 17 | // a selector callback 18 | void menuCloseCallback(CCObject* pSender); 19 | 20 | // preprocessor macro for "static create()" constructor ( node() deprecated ) 21 | CREATE_FUNC(HelloWorld); 22 | 23 | 24 | 25 | 26 | 27 | void update(float dt); 28 | 29 | private: 30 | pgeRippleSprite *rippleSprite; 31 | }; 32 | 33 | #endif // __HELLOWORLD_SCENE_H__ 34 | -------------------------------------------------------------------------------- /rippledemo/Resources/CloseNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/Resources/CloseNormal.png -------------------------------------------------------------------------------- /rippledemo/Resources/CloseSelected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/Resources/CloseSelected.png -------------------------------------------------------------------------------- /rippledemo/Resources/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/Resources/HelloWorld.png -------------------------------------------------------------------------------- /rippledemo/Resources/fonts/Marker Felt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/Resources/fonts/Marker Felt.ttf -------------------------------------------------------------------------------- /rippledemo/Resources/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/Resources/image.png -------------------------------------------------------------------------------- /rippledemo/Resources/rippleShader.fsh: -------------------------------------------------------------------------------- 1 | // Shader from http://www.iquilezles.org/apps/shadertoy/ 2 | 3 | #ifdef GL_ES 4 | precision highp float; 5 | #endif 6 | 7 | uniform float time; 8 | uniform vec2 phaseShiftXY; 9 | uniform sampler2D CC_Texture0; 10 | varying vec2 v_texCoord; 11 | 12 | void main(void) { 13 | vec2 resolution = vec2(1.0, 1.0); 14 | vec2 cPos = -1.0 + 2.0 * v_texCoord.xy / resolution.xy; 15 | float cLength = length(cPos); 16 | 17 | vec2 uv = v_texCoord.xy/resolution.xy+(cPos/cLength)*cos((cLength * 12.0 - time * 4.0) + phaseShiftXY.x) * 0.03; 18 | vec3 col = texture2D(CC_Texture0,uv).xyz; 19 | gl_FragColor = vec4(col,1.0); 20 | } -------------------------------------------------------------------------------- /rippledemo/proj.android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /rippledemo/proj.android/.cproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 33 | 34 | 35 | 45 | 48 | 49 | 50 | 51 | 61 | 64 | 65 | 66 | 67 | 75 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /rippledemo/proj.android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | rippledemo 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 25 | clean,full,incremental, 26 | 27 | 28 | ?children? 29 | ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| 30 | 31 | 32 | ?name? 33 | 34 | 35 | 36 | org.eclipse.cdt.make.core.append_environment 37 | true 38 | 39 | 40 | org.eclipse.cdt.make.core.autoBuildTarget 41 | all 42 | 43 | 44 | org.eclipse.cdt.make.core.buildArguments 45 | ${ProjDirPath}/build_native.sh 46 | 47 | 48 | org.eclipse.cdt.make.core.buildCommand 49 | bash 50 | 51 | 52 | org.eclipse.cdt.make.core.buildLocation 53 | ${ProjDirPath} 54 | 55 | 56 | org.eclipse.cdt.make.core.cleanBuildTarget 57 | clean 58 | 59 | 60 | org.eclipse.cdt.make.core.contents 61 | org.eclipse.cdt.make.core.activeConfigSettings 62 | 63 | 64 | org.eclipse.cdt.make.core.enableAutoBuild 65 | false 66 | 67 | 68 | org.eclipse.cdt.make.core.enableCleanBuild 69 | true 70 | 71 | 72 | org.eclipse.cdt.make.core.enableFullBuild 73 | true 74 | 75 | 76 | org.eclipse.cdt.make.core.fullBuildTarget 77 | 78 | 79 | 80 | org.eclipse.cdt.make.core.stopOnError 81 | true 82 | 83 | 84 | org.eclipse.cdt.make.core.useDefaultBuildCmd 85 | false 86 | 87 | 88 | 89 | 90 | com.android.ide.eclipse.adt.ApkBuilder 91 | 92 | 93 | 94 | 95 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 96 | full,incremental, 97 | 98 | 99 | 100 | 101 | 102 | com.android.ide.eclipse.adt.AndroidNature 103 | org.eclipse.jdt.core.javanature 104 | org.eclipse.cdt.core.cnature 105 | org.eclipse.cdt.core.ccnature 106 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 107 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 108 | 109 | 110 | 111 | Classes 112 | 2 113 | COCOS2DX/projects/rippledemo/Classes 114 | 115 | 116 | cocos2dx 117 | 2 118 | COCOS2DX/cocos2dx 119 | 120 | 121 | extensions 122 | 2 123 | COCOS2DX/extensions 124 | 125 | 126 | scripting 127 | 2 128 | COCOS2DX/scripting 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /rippledemo/proj.android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /rippledemo/proj.android/README.md: -------------------------------------------------------------------------------- 1 | ## Prerequisites: 2 | 3 | * Android NDK 4 | * Android SDK **OR** Eclipse ADT Bundle 5 | * Android AVD target installed 6 | 7 | ## Building project 8 | 9 | There are two ways of building Android projects. 10 | 11 | 1. Eclipse 12 | 2. Command Line 13 | 14 | ### Import Project in Eclipse 15 | 16 | #### Features: 17 | 18 | 1. Complete workflow from Eclipse, including: 19 | * Build C++. 20 | * Clean C++. 21 | * Build and Run whole project. 22 | * Logcat view. 23 | * Debug Java code. 24 | * Javascript editor. 25 | * Project management. 26 | 2. True C++ editing, including: 27 | * Code completion. 28 | * Jump to definition. 29 | * Refactoring tools etc. 30 | * Quick open C++ files. 31 | 32 | 33 | #### Setup Eclipse Environment (only once) 34 | 35 | 36 | **NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. 37 | 38 | 1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) 39 | 40 | **OR** 41 | 42 | Install Eclipse with Java. Add ADT and CDT plugins. 43 | 44 | 2. Only for Windows 45 | 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). 46 | 2. Add `Cygwin\bin` directory to system PATH variable. 47 | 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. 48 | 49 | 3. Set up Variables: 50 | 1. Path Variable `COCOS2DX`: 51 | * Eclipse->Preferences->General->Workspace->**Linked Resources** 52 | * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. 53 | ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) 54 | 55 | 2. C/C++ Environment Variable `NDK_ROOT`: 56 | * Eclipse->Preferences->C/C++->Build->**Environment**. 57 | * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. 58 | ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) 59 | * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` 60 | 61 | 4. Import libcocos2dx library project: 62 | 1. File->New->Project->Android Project From Existing Code. 63 | 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. 64 | 3. Click **Finish** to add project. 65 | 66 | #### Adding and running from Eclipse 67 | 68 | ![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) 69 | 70 | 1. File->New->Project->Android Project From Existing Code 71 | 2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` 72 | 3. Add the project 73 | 4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. 74 | 75 | 76 | ### Running project from Command Line 77 | 78 | $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ 79 | $ export NDK_ROOT=/path/to/ndk 80 | $ ./build_native.sh 81 | $ ant debug install 82 | 83 | If the last command results in sdk.dir missing error then do: 84 | 85 | $ android list target 86 | $ android update project -p . -t (id from step 6) 87 | $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) 88 | -------------------------------------------------------------------------------- /rippledemo/proj.android/ant.properties: -------------------------------------------------------------------------------- 1 | # This file is used to override default values used by the Ant build system. 2 | # 3 | # This file must be checked into Version Control Systems, as it is 4 | # integral to the build system of your project. 5 | 6 | # This file is only used by the Ant script. 7 | 8 | # You can use this to override default values such as 9 | # 'source.dir' for the location of your java source folder and 10 | # 'out.dir' for the location of your output folder. 11 | 12 | # You can also use it define how the release builds are signed by declaring 13 | # the following properties: 14 | # 'key.store' for the location of your keystore and 15 | # 'key.alias' for the name of the key to use. 16 | # The password will be asked during the build when you use the 'release' target. 17 | 18 | -------------------------------------------------------------------------------- /rippledemo/proj.android/assets/CloseNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/assets/CloseNormal.png -------------------------------------------------------------------------------- /rippledemo/proj.android/assets/CloseSelected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/assets/CloseSelected.png -------------------------------------------------------------------------------- /rippledemo/proj.android/assets/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/assets/HelloWorld.png -------------------------------------------------------------------------------- /rippledemo/proj.android/assets/fonts/Marker Felt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/assets/fonts/Marker Felt.ttf -------------------------------------------------------------------------------- /rippledemo/proj.android/assets/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/assets/image.png -------------------------------------------------------------------------------- /rippledemo/proj.android/assets/rippleShader.fsh: -------------------------------------------------------------------------------- 1 | // Shader from http://www.iquilezles.org/apps/shadertoy/ 2 | 3 | #ifdef GL_ES 4 | precision highp float; 5 | #endif 6 | 7 | uniform float time; 8 | uniform vec2 phaseShiftXY; 9 | uniform sampler2D CC_Texture0; 10 | varying vec2 v_texCoord; 11 | 12 | void main(void) { 13 | vec2 resolution = vec2(1.0, 1.0); 14 | vec2 cPos = -1.0 + 2.0 * v_texCoord.xy / resolution.xy; 15 | float cLength = length(cPos); 16 | 17 | vec2 uv = v_texCoord.xy/resolution.xy+(cPos/cLength)*cos((cLength * 12.0 - time * 4.0) + phaseShiftXY.x) * 0.03; 18 | vec3 col = texture2D(CC_Texture0,uv).xyz; 19 | gl_FragColor = vec4(col,1.0); 20 | } -------------------------------------------------------------------------------- /rippledemo/proj.android/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 29 | 30 | 31 | 40 | 41 | 42 | 43 | 47 | 48 | 60 | 61 | 62 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /rippledemo/proj.android/build_native.sh: -------------------------------------------------------------------------------- 1 | APPNAME="rippledemo" 2 | 3 | # options 4 | 5 | buildexternalsfromsource= 6 | 7 | usage(){ 8 | cat << EOF 9 | usage: $0 [options] 10 | 11 | Build C/C++ code for $APPNAME using Android NDK 12 | 13 | OPTIONS: 14 | -s Build externals from source 15 | -h this help 16 | EOF 17 | } 18 | 19 | while getopts "sh" OPTION; do 20 | case "$OPTION" in 21 | s) 22 | buildexternalsfromsource=1 23 | ;; 24 | h) 25 | usage 26 | exit 0 27 | ;; 28 | esac 29 | done 30 | 31 | # paths 32 | 33 | if [ -z "${NDK_ROOT+aaa}" ];then 34 | echo "please define NDK_ROOT" 35 | exit 1 36 | fi 37 | 38 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 39 | # ... use paths relative to current directory 40 | COCOS2DX_ROOT="$DIR/../../.." 41 | APP_ROOT="$DIR/.." 42 | APP_ANDROID_ROOT="$DIR" 43 | 44 | echo "NDK_ROOT = $NDK_ROOT" 45 | echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" 46 | echo "APP_ROOT = $APP_ROOT" 47 | echo "APP_ANDROID_ROOT = $APP_ANDROID_ROOT" 48 | 49 | # make sure assets is exist 50 | if [ -d "$APP_ANDROID_ROOT"/assets ]; then 51 | rm -rf "$APP_ANDROID_ROOT"/assets 52 | fi 53 | 54 | mkdir "$APP_ANDROID_ROOT"/assets 55 | 56 | # copy resources 57 | for file in "$APP_ROOT"/Resources/* 58 | do 59 | if [ -d "$file" ]; then 60 | cp -rf "$file" "$APP_ANDROID_ROOT"/assets 61 | fi 62 | 63 | if [ -f "$file" ]; then 64 | cp "$file" "$APP_ANDROID_ROOT"/assets 65 | fi 66 | done 67 | 68 | # run ndk-build 69 | if [[ "$buildexternalsfromsource" ]]; then 70 | echo "Building external dependencies from source" 71 | "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ 72 | "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/source" 73 | else 74 | echo "Using prebuilt externals" 75 | "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ 76 | "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" 77 | fi 78 | -------------------------------------------------------------------------------- /rippledemo/proj.android/gen/R.java.d: -------------------------------------------------------------------------------- 1 | /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/gen/com/zilong/rippledemo/R.java \ 2 | : /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/res/drawable-hdpi/icon.png \ 3 | /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/res/drawable-ldpi/icon.png \ 4 | /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/res/drawable-mdpi/icon.png \ 5 | /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/res/values/strings.xml \ 6 | /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/bin/res/drawable-hdpi/icon.png \ 7 | /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/bin/res/drawable-ldpi/icon.png \ 8 | /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/bin/res/drawable-mdpi/icon.png \ 9 | /Users/guanghui/Github/cocos2d-x/projects/rippledemo/proj.android/bin/AndroidManifest.xml \ 10 | -------------------------------------------------------------------------------- /rippledemo/proj.android/gen/com/zilong/rippledemo/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.zilong.rippledemo; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /rippledemo/proj.android/gen/com/zilong/rippledemo/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.zilong.rippledemo; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static final int icon=0x7f020000; 15 | } 16 | public static final class string { 17 | public static final int app_name=0x7f030000; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /rippledemo/proj.android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := cocos2dcpp_shared 6 | 7 | LOCAL_MODULE_FILENAME := libcocos2dcpp 8 | 9 | LOCAL_SRC_FILES := hellocpp/main.cpp \ 10 | ../../Classes/AppDelegate.cpp \ 11 | ../../Classes/HelloWorldScene.cpp \ 12 | ../../Classes/CCRippleSprite.cpp 13 | 14 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes 15 | 16 | LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static 17 | LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static 18 | LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static 19 | LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static 20 | LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static 21 | 22 | include $(BUILD_SHARED_LIBRARY) 23 | 24 | $(call import-module,cocos2dx) 25 | $(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl) 26 | $(call import-module,CocosDenshion/android) 27 | $(call import-module,extensions) 28 | $(call import-module,external/Box2D) 29 | $(call import-module,external/chipmunk) 30 | -------------------------------------------------------------------------------- /rippledemo/proj.android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | APP_OPTIM := release 3 | APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 4 | -------------------------------------------------------------------------------- /rippledemo/proj.android/jni/hellocpp/main.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "cocos2d.h" 3 | #include "CCEventType.h" 4 | #include "platform/android/jni/JniHelper.h" 5 | #include 6 | #include 7 | 8 | #define LOG_TAG "main" 9 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) 10 | 11 | using namespace cocos2d; 12 | 13 | extern "C" 14 | { 15 | 16 | jint JNI_OnLoad(JavaVM *vm, void *reserved) 17 | { 18 | JniHelper::setJavaVM(vm); 19 | 20 | return JNI_VERSION_1_4; 21 | } 22 | 23 | void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h) 24 | { 25 | if (!CCDirector::sharedDirector()->getOpenGLView()) 26 | { 27 | CCEGLView *view = CCEGLView::sharedOpenGLView(); 28 | view->setFrameSize(w, h); 29 | 30 | AppDelegate *pAppDelegate = new AppDelegate(); 31 | CCApplication::sharedApplication()->run(); 32 | } 33 | /* 34 | else 35 | { 36 | ccDrawInit(); 37 | ccGLInvalidateStateCache(); 38 | 39 | CCShaderCache::sharedShaderCache()->reloadDefaultShaders(); 40 | CCTextureCache::reloadAllTextures(); 41 | CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); 42 | CCDirector::sharedDirector()->setGLDefaultValues(); 43 | } 44 | */ 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /rippledemo/proj.android/libs/armeabi/libcocos2dcpp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/libs/armeabi/libcocos2dcpp.so -------------------------------------------------------------------------------- /rippledemo/proj.android/local.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | 7 | # location of the SDK. This is only used by Ant 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | sdk.dir=/Users/guanghui/AndroidDev/adt-bundle-mac-x86_64-20130522/sdk 11 | -------------------------------------------------------------------------------- /rippledemo/proj.android/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /rippledemo/proj.android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-10 12 | 13 | android.library.reference.1=../../../cocos2dx/platform/android/java 14 | -------------------------------------------------------------------------------- /rippledemo/proj.android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /rippledemo/proj.android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /rippledemo/proj.android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /rippledemo/proj.android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | rippledemo 4 | 5 | -------------------------------------------------------------------------------- /rippledemo/proj.android/src/com/zilong/rippledemo/rippledemo.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | package com.zilong.rippledemo; 25 | 26 | import org.cocos2dx.lib.Cocos2dxActivity; 27 | import org.cocos2dx.lib.Cocos2dxGLSurfaceView; 28 | 29 | import android.os.Bundle; 30 | 31 | public class rippledemo extends Cocos2dxActivity{ 32 | 33 | protected void onCreate(Bundle savedInstanceState){ 34 | super.onCreate(savedInstanceState); 35 | } 36 | 37 | public Cocos2dxGLSurfaceView onCreateView() { 38 | Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); 39 | // rippledemo should create stencil buffer 40 | glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); 41 | 42 | return glSurfaceView; 43 | } 44 | 45 | static { 46 | System.loadLibrary("cocos2dcpp"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /rippledemo/proj.blackberry/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | rippledemo 4 | 5 | 6 | Box2D 7 | chipmunk 8 | cocos2dx 9 | CocosDenshion 10 | extensions 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 15 | clean,full,incremental, 16 | 17 | 18 | ?name? 19 | 20 | 21 | 22 | org.eclipse.cdt.make.core.append_environment 23 | true 24 | 25 | 26 | org.eclipse.cdt.make.core.buildArguments 27 | 28 | 29 | 30 | org.eclipse.cdt.make.core.buildCommand 31 | make 32 | 33 | 34 | org.eclipse.cdt.make.core.buildLocation 35 | ${workspace_loc:/rippledemo/Device-Debug} 36 | 37 | 38 | org.eclipse.cdt.make.core.contents 39 | org.eclipse.cdt.make.core.activeConfigSettings 40 | 41 | 42 | org.eclipse.cdt.make.core.enableAutoBuild 43 | false 44 | 45 | 46 | org.eclipse.cdt.make.core.enableCleanBuild 47 | true 48 | 49 | 50 | org.eclipse.cdt.make.core.enableFullBuild 51 | true 52 | 53 | 54 | org.eclipse.cdt.make.core.stopOnError 55 | true 56 | 57 | 58 | org.eclipse.cdt.make.core.useDefaultBuildCmd 59 | true 60 | 61 | 62 | 63 | 64 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 65 | full,incremental, 66 | 67 | 68 | 69 | 70 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 71 | 72 | 73 | 74 | 75 | 76 | org.eclipse.cdt.core.cnature 77 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 78 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 79 | com.qnx.tools.ide.bbt.core.bbtnature 80 | org.eclipse.cdt.core.ccnature 81 | 82 | 83 | 84 | Classes 85 | 2 86 | PARENT-1-PROJECT_LOC/Classes 87 | 88 | 89 | Resources 90 | 2 91 | PARENT-1-PROJECT_LOC/Resources 92 | 93 | 94 | 95 | 96 | 1345434891844 97 | Classes/ExtensionsTest 98 | 10 99 | 100 | org.eclipse.ui.ide.multiFilter 101 | 1.0-name-matches-true-false-EditBoxTest 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /rippledemo/proj.blackberry/bar-descriptor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 12 | com.zilong.rippledemo 13 | 14 | 16 | rippledemo 17 | 18 | 21 | 1.0.0 22 | 23 | 25 | 1 26 | 27 | 28 | 29 | 30 | 32 | The rippledemo Application 33 | 34 | 35 | 36 | 37 | 38 | Example Inc. 39 | 40 | 41 | 42 | 43 | 44 | none 45 | false 46 | 47 | 48 | 49 | core.games 50 | icon.png 51 | Resources 52 | 53 | 54 | 55 | 56 | armle-v7 57 | lib/libCocosDenshion.so 58 | rippledemo 59 | 60 | 61 | armle-v7 62 | lib/libCocosDenshion.so 63 | rippledemo 64 | 65 | 66 | armle-v7 67 | lib/libCocosDenshion.so 68 | rippledemo 69 | 70 | 71 | armle-v7 72 | lib/libCocosDenshion.so 73 | rippledemo 74 | 75 | 76 | x86 77 | lib/libCocosDenshion.so 78 | rippledemo 79 | 80 | 81 | x86 82 | lib/libCocosDenshion.so 83 | rippledemo 84 | 85 | 86 | x86 87 | lib/libCocosDenshion.so 88 | rippledemo 89 | 90 | 91 | 92 | 93 | icon.png 94 | 95 | 96 | 97 | 98 | 99 | 100 | run_native 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /rippledemo/proj.blackberry/empty/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.blackberry/empty/empty -------------------------------------------------------------------------------- /rippledemo/proj.blackberry/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.blackberry/icon.png -------------------------------------------------------------------------------- /rippledemo/proj.blackberry/main.cpp: -------------------------------------------------------------------------------- 1 | #include "cocos2d.h" 2 | #include "AppDelegate.h" 3 | 4 | USING_NS_CC; 5 | 6 | int main(int argc, char **argv) 7 | { 8 | // create the application instance 9 | AppDelegate app; 10 | 11 | int width, height; 12 | const char *width_str, *height_str; 13 | width_str = getenv("WIDTH"); 14 | height_str = getenv("HEIGHT"); 15 | if (width_str && height_str) 16 | { 17 | width = atoi(width_str); 18 | height = atoi(height_str); 19 | } 20 | else 21 | { 22 | width = 1024; 23 | height = 600; 24 | } 25 | 26 | CCEGLView* eglView = CCEGLView::sharedOpenGLView(); 27 | eglView->setFrameSize(width, height); 28 | 29 | return CCApplication::sharedApplication()->run(); 30 | } 31 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/AppController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class RootViewController; 4 | 5 | @interface AppController : NSObject { 6 | UIWindow *window; 7 | RootViewController *viewController; 8 | } 9 | 10 | @end 11 | 12 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/AppController.mm: -------------------------------------------------------------------------------- 1 | #import "AppController.h" 2 | #import "EAGLView.h" 3 | #import "cocos2d.h" 4 | #import "AppDelegate.h" 5 | #import "RootViewController.h" 6 | 7 | @implementation AppController 8 | 9 | #pragma mark - 10 | #pragma mark Application lifecycle 11 | 12 | // cocos2d application instance 13 | static AppDelegate s_sharedApplication; 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 16 | 17 | // Override point for customization after application launch. 18 | 19 | // Add the view controller's view to the window and display. 20 | window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; 21 | 22 | // Init the EAGLView 23 | EAGLView *__glView = [EAGLView viewWithFrame: [window bounds] 24 | pixelFormat: kEAGLColorFormatRGB565 25 | depthFormat: GL_DEPTH24_STENCIL8_OES 26 | preserveBackbuffer: NO 27 | sharegroup: nil 28 | multiSampling: NO 29 | numberOfSamples: 0]; 30 | 31 | // Use RootViewController manage EAGLView 32 | viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; 33 | viewController.wantsFullScreenLayout = YES; 34 | viewController.view = __glView; 35 | 36 | // Set RootViewController to window 37 | if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) 38 | { 39 | // warning: addSubView doesn't work on iOS6 40 | [window addSubview: viewController.view]; 41 | } 42 | else 43 | { 44 | // use this method on ios6 45 | [window setRootViewController:viewController]; 46 | } 47 | 48 | [window makeKeyAndVisible]; 49 | 50 | [[UIApplication sharedApplication] setStatusBarHidden:true]; 51 | 52 | cocos2d::CCApplication::sharedApplication()->run(); 53 | 54 | return YES; 55 | } 56 | 57 | 58 | - (void)applicationWillResignActive:(UIApplication *)application { 59 | /* 60 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 61 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 62 | */ 63 | cocos2d::CCDirector::sharedDirector()->pause(); 64 | } 65 | 66 | - (void)applicationDidBecomeActive:(UIApplication *)application { 67 | /* 68 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 69 | */ 70 | cocos2d::CCDirector::sharedDirector()->resume(); 71 | } 72 | 73 | - (void)applicationDidEnterBackground:(UIApplication *)application { 74 | /* 75 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 76 | If your application supports background execution, called instead of applicationWillTerminate: when the user quits. 77 | */ 78 | cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); 79 | } 80 | 81 | - (void)applicationWillEnterForeground:(UIApplication *)application { 82 | /* 83 | Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. 84 | */ 85 | cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); 86 | } 87 | 88 | - (void)applicationWillTerminate:(UIApplication *)application { 89 | /* 90 | Called when the application is about to terminate. 91 | See also applicationDidEnterBackground:. 92 | */ 93 | } 94 | 95 | 96 | #pragma mark - 97 | #pragma mark Memory management 98 | 99 | - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 100 | /* 101 | Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. 102 | */ 103 | } 104 | 105 | 106 | - (void)dealloc { 107 | [window release]; 108 | [super dealloc]; 109 | } 110 | 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.ios/Default-568h@2x.png -------------------------------------------------------------------------------- /rippledemo/proj.ios/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.ios/Default.png -------------------------------------------------------------------------------- /rippledemo/proj.ios/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.ios/Default@2x.png -------------------------------------------------------------------------------- /rippledemo/proj.ios/Icon-114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.ios/Icon-114.png -------------------------------------------------------------------------------- /rippledemo/proj.ios/Icon-144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.ios/Icon-144.png -------------------------------------------------------------------------------- /rippledemo/proj.ios/Icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.ios/Icon-57.png -------------------------------------------------------------------------------- /rippledemo/proj.ios/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.ios/Icon-72.png -------------------------------------------------------------------------------- /rippledemo/proj.ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | Icon-57.png 13 | CFBundleIconFiles 14 | 15 | Icon.png 16 | Icon@2x.png 17 | Icon-57.png 18 | Icon-114.png 19 | Icon-72.png 20 | Icon-144.png 21 | 22 | CFBundleIdentifier 23 | com.zilong.rippledemo 24 | CFBundleInfoDictionaryVersion 25 | 6.0 26 | CFBundleName 27 | ${PRODUCT_NAME} 28 | CFBundlePackageType 29 | APPL 30 | CFBundleShortVersionString 31 | 32 | CFBundleSignature 33 | ???? 34 | CFBundleVersion 35 | 1.0 36 | LSRequiresIPhoneOS 37 | 38 | UIAppFonts 39 | 40 | UISupportedInterfaceOrientations 41 | 42 | UIInterfaceOrientationLandscapeLeft 43 | UIInterfaceOrientationLandscapeRight 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'iphone' target in the 'iphone' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/RootViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface RootViewController : UIViewController { 5 | 6 | } 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/RootViewController.mm: -------------------------------------------------------------------------------- 1 | #import "RootViewController.h" 2 | 3 | 4 | @implementation RootViewController 5 | 6 | /* 7 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 8 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 9 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 10 | // Custom initialization 11 | } 12 | return self; 13 | } 14 | */ 15 | 16 | /* 17 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 18 | - (void)loadView { 19 | } 20 | */ 21 | 22 | /* 23 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | } 27 | 28 | */ 29 | // Override to allow orientations other than the default portrait orientation. 30 | // This method is deprecated on ios6 31 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 32 | return UIInterfaceOrientationIsLandscape( interfaceOrientation ); 33 | } 34 | 35 | // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead 36 | - (NSUInteger) supportedInterfaceOrientations{ 37 | #ifdef __IPHONE_6_0 38 | return UIInterfaceOrientationMaskAllButUpsideDown; 39 | #endif 40 | } 41 | 42 | - (BOOL) shouldAutorotate { 43 | return YES; 44 | } 45 | 46 | - (void)didReceiveMemoryWarning { 47 | // Releases the view if it doesn't have a superview. 48 | [super didReceiveMemoryWarning]; 49 | 50 | // Release any cached data, images, etc that aren't in use. 51 | } 52 | 53 | - (void)viewDidUnload { 54 | [super viewDidUnload]; 55 | // Release any retained subviews of the main view. 56 | // e.g. self.myOutlet = nil; 57 | } 58 | 59 | 60 | - (void)dealloc { 61 | [super dealloc]; 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | // Under iOS and the Simulator, we can use an alternate Accelerometer interface 4 | #import "AccelerometerSimulation.h" 5 | 6 | int main(int argc, char *argv[]) { 7 | 8 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 9 | int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); 10 | [pool release]; 11 | return retVal; 12 | } 13 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/rippledemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/rippledemo.xcodeproj/project.xcworkspace/xcuserdata/guanghui.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.ios/rippledemo.xcodeproj/project.xcworkspace/xcuserdata/guanghui.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /rippledemo/proj.ios/rippledemo.xcodeproj/xcuserdata/guanghui.xcuserdatad/xcschemes/rippledemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /rippledemo/proj.ios/rippledemo.xcodeproj/xcuserdata/guanghui.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | rippledemo.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1D6058900D05DD3D006BFB54 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /rippledemo/proj.linux/.cproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 47 | 48 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 69 | 74 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 135 | 139 | 140 | 141 | 142 | 148 | 149 | 150 | 151 | 152 | 161 | 166 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 230 | 234 | 235 | 236 | 237 | 243 | 244 | 245 | 246 | 247 | 256 | 261 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 321 | 325 | 326 | 327 | 328 | 334 | 335 | 336 | 337 | 338 | 347 | 352 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | -------------------------------------------------------------------------------- /rippledemo/proj.linux/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | rippledemo 4 | 5 | 6 | libBox2D 7 | libChipmunk 8 | libcocos2d 9 | libCocosDenshion 10 | libextension 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 15 | clean,full,incremental, 16 | 17 | 18 | ?children? 19 | ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\|| 20 | 21 | 22 | ?name? 23 | 24 | 25 | 26 | org.eclipse.cdt.make.core.append_environment 27 | true 28 | 29 | 30 | org.eclipse.cdt.make.core.autoBuildTarget 31 | all 32 | 33 | 34 | org.eclipse.cdt.make.core.buildArguments 35 | 36 | 37 | 38 | org.eclipse.cdt.make.core.buildCommand 39 | make 40 | 41 | 42 | org.eclipse.cdt.make.core.buildLocation 43 | ${workspace_loc:/rippledemo/Debug} 44 | 45 | 46 | org.eclipse.cdt.make.core.cleanBuildTarget 47 | clean 48 | 49 | 50 | org.eclipse.cdt.make.core.contents 51 | org.eclipse.cdt.make.core.activeConfigSettings 52 | 53 | 54 | org.eclipse.cdt.make.core.enableAutoBuild 55 | false 56 | 57 | 58 | org.eclipse.cdt.make.core.enableCleanBuild 59 | true 60 | 61 | 62 | org.eclipse.cdt.make.core.enableFullBuild 63 | true 64 | 65 | 66 | org.eclipse.cdt.make.core.fullBuildTarget 67 | all 68 | 69 | 70 | org.eclipse.cdt.make.core.stopOnError 71 | true 72 | 73 | 74 | org.eclipse.cdt.make.core.useDefaultBuildCmd 75 | true 76 | 77 | 78 | 79 | 80 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 81 | full,incremental, 82 | 83 | 84 | 85 | 86 | 87 | org.eclipse.cdt.core.cnature 88 | org.eclipse.cdt.core.ccnature 89 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 90 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 91 | 92 | 93 | 94 | Classes 95 | 2 96 | PARENT-1-PROJECT_LOC/Classes 97 | 98 | 99 | 100 | 101 | 1345106176896 102 | Classes/ExtensionsTest 103 | 10 104 | 105 | org.eclipse.ui.ide.multiFilter 106 | 1.0-name-matches-true-false-EditBoxTest 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /rippledemo/proj.linux/Makefile: -------------------------------------------------------------------------------- 1 | EXECUTABLE = rippledemo 2 | 3 | INCLUDES = -I.. -I../Classes 4 | 5 | SOURCES = main.cpp \ 6 | ../Classes/AppDelegate.cpp \ 7 | ../Classes/HelloWorldScene.cpp 8 | 9 | COCOS_ROOT = ../../.. 10 | include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk 11 | 12 | SHAREDLIBS += -lcocos2d 13 | COCOS_LIBS = $(LIB_DIR)/libcocos2d.so 14 | 15 | $(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) 16 | @mkdir -p $(@D) 17 | $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) 18 | 19 | $(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) 20 | @mkdir -p $(@D) 21 | $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ 22 | 23 | $(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) 24 | @mkdir -p $(@D) 25 | $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ 26 | -------------------------------------------------------------------------------- /rippledemo/proj.linux/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TXTCOLOR_DEFAULT="\033[0;m" 4 | TXTCOLOR_RED="\033[0;31m" 5 | TXTCOLOR_GREEN="\033[0;32m" 6 | 7 | COCOS2DX20_TRUNK=`pwd`/../../.. 8 | OUTPUT_DEBUG=$COCOS2DX20_TRUNK/lib/linux/debug/ 9 | OUTPUT_RELEASE=$COCOS2DX20_TRUNK/lib/linux/release/ 10 | 11 | check_make_result() 12 | { 13 | if [ 0 != $? ]; then 14 | exit 1 15 | fi 16 | } 17 | 18 | DEPENDS='libx11-dev' 19 | DEPENDS+=' libxmu-dev' 20 | DEPENDS+=' libglu1-mesa-dev' 21 | DEPENDS+=' libgl2ps-dev' 22 | DEPENDS+=' libxi-dev' 23 | DEPENDS+=' libglfw-dev' 24 | DEPENDS+=' g++' 25 | DEPENDS+=' libzip-dev' 26 | DEPENDS+=' libcurl4-gnutls-dev' 27 | DEPENDS+=' libfontconfig1-dev' 28 | DEPENDS+=' libsqlite3-dev' 29 | DEPENDS+=' libglew-dev' 30 | 31 | for i in $DEPENDS; do 32 | PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed") 33 | echo Checking for $i: $PKG_OK 34 | if [ "" == "$PKG_OK" ]; then 35 | echo -e $TXTCOLOR_GREEN"No $i. Setting up $i, please enter your password:"$TXTCOLOR_DEFAULT 36 | sudo apt-get --force-yes --yes install $i 37 | fi 38 | done 39 | 40 | mkdir -p $OUTPUT_DEBUG 41 | mkdir -p $OUTPUT_RELEASE 42 | 43 | make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux DEBUG=1 44 | check_make_result 45 | 46 | make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux DEBUG=1 47 | check_make_result 48 | 49 | make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux DEBUG=1 50 | check_make_result 51 | 52 | make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux DEBUG=1 53 | check_make_result 54 | 55 | make -C $COCOS2DX20_TRUNK/extensions/proj.linux DEBUG=1 56 | check_make_result 57 | 58 | make DEBUG=1 59 | check_make_result 60 | -------------------------------------------------------------------------------- /rippledemo/proj.linux/main.cpp: -------------------------------------------------------------------------------- 1 | #include "../Classes/AppDelegate.h" 2 | #include "cocos2d.h" 3 | #include "CCEGLView.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | USING_NS_CC; 11 | 12 | int main(int argc, char **argv) 13 | { 14 | // create the application instance 15 | AppDelegate app; 16 | CCEGLView* eglView = CCEGLView::sharedOpenGLView(); 17 | eglView->setFrameSize(800, 480); 18 | return CCApplication::sharedApplication()->run(); 19 | } 20 | -------------------------------------------------------------------------------- /rippledemo/proj.mac/AppController.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #pragma once 26 | 27 | #import "cocos2d.h" 28 | #import "EAGLView.h" 29 | 30 | @interface AppController : NSObject 31 | { 32 | NSWindow *window; 33 | EAGLView *glView; 34 | } 35 | 36 | @property (nonatomic, assign) IBOutlet NSWindow* window; 37 | @property (nonatomic, assign) IBOutlet EAGLView* glView; 38 | 39 | -(IBAction) toggleFullScreen:(id)sender; 40 | -(IBAction) exitFullScreen:(id)sender; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /rippledemo/proj.mac/AppController.mm: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #import "AppController.h" 26 | #import "AppDelegate.h" 27 | 28 | @implementation AppController 29 | 30 | static AppDelegate s_sharedApplication; 31 | 32 | @synthesize window, glView; 33 | 34 | -(void) applicationDidFinishLaunching:(NSNotification *)aNotification 35 | { 36 | // create the window 37 | // note that using NSResizableWindowMask causes the window to be a little 38 | // smaller and therefore ipad graphics are not loaded 39 | NSRect rect = NSMakeRect(200, 200, 480, 320); 40 | window = [[NSWindow alloc] initWithContentRect:rect 41 | styleMask:( NSClosableWindowMask | NSTitledWindowMask ) 42 | backing:NSBackingStoreBuffered 43 | defer:YES]; 44 | 45 | NSOpenGLPixelFormatAttribute attributes[] = { 46 | NSOpenGLPFADoubleBuffer, 47 | NSOpenGLPFADepthSize, 24, 48 | NSOpenGLPFAStencilSize, 8, 49 | 0 50 | }; 51 | 52 | NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease]; 53 | 54 | // allocate our GL view 55 | // (isn't there already a shared EAGLView?) 56 | glView = [[EAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat]; 57 | 58 | // set window parameters 59 | [window becomeFirstResponder]; 60 | [window setContentView:glView]; 61 | [window setTitle:@"HelloCpp"]; 62 | [window makeKeyAndOrderFront:self]; 63 | [window setAcceptsMouseMovedEvents:NO]; 64 | 65 | cocos2d::CCApplication::sharedApplication()->run(); 66 | } 67 | 68 | -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication 69 | { 70 | return YES; 71 | } 72 | 73 | -(void) dealloc 74 | { 75 | cocos2d::CCDirector::sharedDirector()->end(); 76 | [super dealloc]; 77 | } 78 | 79 | #pragma mark - 80 | #pragma mark IB Actions 81 | 82 | -(IBAction) toggleFullScreen:(id)sender 83 | { 84 | EAGLView* pView = [EAGLView sharedEGLView]; 85 | [pView setFullScreen:!pView.isFullScreen]; 86 | } 87 | 88 | -(IBAction) exitFullScreen:(id)sender 89 | { 90 | [[EAGLView sharedEGLView] setFullScreen:NO]; 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /rippledemo/proj.mac/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zilongshanren/cocos2d-x-shader-gallery/1b485a1915fddf9a9b91ff07a1bf81f1cc644fc5/rippledemo/proj.mac/Icon.icns -------------------------------------------------------------------------------- /rippledemo/proj.mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Icon 11 | CFBundleIdentifier 12 | com.zilong.rippledemo 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2012. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /rippledemo/proj.mac/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /rippledemo/proj.mac/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /rippledemo/proj.mac/en.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1060 5 | 10K549 6 | 1938 7 | 1038.36 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.CocoaPlugin 11 | 1938 12 | 13 | 14 | YES 15 | NSMenuItem 16 | NSCustomObject 17 | NSMenu 18 | 19 | 20 | YES 21 | com.apple.InterfaceBuilder.CocoaPlugin 22 | 23 | 24 | PluginDependencyRecalculationVersion 25 | 26 | 27 | 28 | YES 29 | 30 | NSApplication 31 | 32 | 33 | FirstResponder 34 | 35 | 36 | NSApplication 37 | 38 | 39 | AMainMenu 40 | 41 | YES 42 | 43 | 44 | HelloCpp 45 | 46 | 1048576 47 | 2147483647 48 | 49 | NSImage 50 | NSMenuCheckmark 51 | 52 | 53 | NSImage 54 | NSMenuMixedState 55 | 56 | submenuAction: 57 | 58 | HelloCpp 59 | 60 | YES 61 | 62 | 63 | About HelloCpp 64 | 65 | 2147483647 66 | 67 | 68 | 69 | 70 | 71 | YES 72 | YES 73 | 74 | 75 | 1048576 76 | 2147483647 77 | 78 | 79 | 80 | 81 | 82 | Preferences… 83 | , 84 | 1048576 85 | 2147483647 86 | 87 | 88 | 89 | 90 | 91 | YES 92 | YES 93 | 94 | 95 | 1048576 96 | 2147483647 97 | 98 | 99 | 100 | 101 | 102 | Services 103 | 104 | 1048576 105 | 2147483647 106 | 107 | 108 | submenuAction: 109 | 110 | Services 111 | 112 | YES 113 | 114 | _NSServicesMenu 115 | 116 | 117 | 118 | 119 | YES 120 | YES 121 | 122 | 123 | 1048576 124 | 2147483647 125 | 126 | 127 | 128 | 129 | 130 | Hide HelloCpp 131 | h 132 | 1048576 133 | 2147483647 134 | 135 | 136 | 137 | 138 | 139 | Hide Others 140 | h 141 | 1572864 142 | 2147483647 143 | 144 | 145 | 146 | 147 | 148 | Show All 149 | 150 | 1048576 151 | 2147483647 152 | 153 | 154 | 155 | 156 | 157 | YES 158 | YES 159 | 160 | 161 | 1048576 162 | 2147483647 163 | 164 | 165 | 166 | 167 | 168 | Quit HelloCpp 169 | q 170 | 1048576 171 | 2147483647 172 | 173 | 174 | 175 | 176 | _NSAppleMenu 177 | 178 | 179 | 180 | 181 | View 182 | 183 | 1048576 184 | 2147483647 185 | 186 | 187 | submenuAction: 188 | 189 | View 190 | 191 | YES 192 | 193 | 194 | Toggle Fullscreen 195 | f 196 | 1048576 197 | 2147483647 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | Window 207 | 208 | 1048576 209 | 2147483647 210 | 211 | 212 | submenuAction: 213 | 214 | Window 215 | 216 | YES 217 | 218 | 219 | Minimize 220 | m 221 | 1048576 222 | 2147483647 223 | 224 | 225 | 226 | 227 | 228 | Zoom 229 | 230 | 1048576 231 | 2147483647 232 | 233 | 234 | 235 | 236 | 237 | YES 238 | YES 239 | 240 | 241 | 1048576 242 | 2147483647 243 | 244 | 245 | 246 | 247 | 248 | Bring All to Front 249 | 250 | 1048576 251 | 2147483647 252 | 253 | 254 | 255 | 256 | _NSWindowsMenu 257 | 258 | 259 | 260 | 261 | Help 262 | 263 | 2147483647 264 | 265 | 266 | submenuAction: 267 | 268 | Help 269 | 270 | YES 271 | 272 | 273 | HelloCpp Help 274 | ? 275 | 1048576 276 | 2147483647 277 | 278 | 279 | 280 | 281 | _NSHelpMenu 282 | 283 | 284 | 285 | _NSMainMenu 286 | 287 | 288 | AppController 289 | 290 | 291 | NSFontManager 292 | 293 | 294 | 295 | 296 | YES 297 | 298 | 299 | terminate: 300 | 301 | 302 | 303 | 449 304 | 305 | 306 | 307 | orderFrontStandardAboutPanel: 308 | 309 | 310 | 311 | 142 312 | 313 | 314 | 315 | delegate 316 | 317 | 318 | 319 | 495 320 | 321 | 322 | 323 | performMiniaturize: 324 | 325 | 326 | 327 | 37 328 | 329 | 330 | 331 | arrangeInFront: 332 | 333 | 334 | 335 | 39 336 | 337 | 338 | 339 | performZoom: 340 | 341 | 342 | 343 | 240 344 | 345 | 346 | 347 | hide: 348 | 349 | 350 | 351 | 367 352 | 353 | 354 | 355 | hideOtherApplications: 356 | 357 | 358 | 359 | 368 360 | 361 | 362 | 363 | unhideAllApplications: 364 | 365 | 366 | 367 | 370 368 | 369 | 370 | 371 | showHelp: 372 | 373 | 374 | 375 | 493 376 | 377 | 378 | 379 | toggleFullScreen: 380 | 381 | 382 | 383 | 537 384 | 385 | 386 | 387 | 388 | YES 389 | 390 | 0 391 | 392 | YES 393 | 394 | 395 | 396 | 397 | 398 | -2 399 | 400 | 401 | File's Owner 402 | 403 | 404 | -1 405 | 406 | 407 | First Responder 408 | 409 | 410 | -3 411 | 412 | 413 | Application 414 | 415 | 416 | 29 417 | 418 | 419 | YES 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 19 429 | 430 | 431 | YES 432 | 433 | 434 | 435 | 436 | 437 | 56 438 | 439 | 440 | YES 441 | 442 | 443 | 444 | 445 | 446 | 57 447 | 448 | 449 | YES 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 58 466 | 467 | 468 | 469 | 470 | 134 471 | 472 | 473 | 474 | 475 | 150 476 | 477 | 478 | 479 | 480 | 136 481 | 482 | 483 | 484 | 485 | 144 486 | 487 | 488 | 489 | 490 | 129 491 | 492 | 493 | 494 | 495 | 143 496 | 497 | 498 | 499 | 500 | 236 501 | 502 | 503 | 504 | 505 | 131 506 | 507 | 508 | YES 509 | 510 | 511 | 512 | 513 | 514 | 149 515 | 516 | 517 | 518 | 519 | 145 520 | 521 | 522 | 523 | 524 | 130 525 | 526 | 527 | 528 | 529 | 24 530 | 531 | 532 | YES 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 92 542 | 543 | 544 | 545 | 546 | 5 547 | 548 | 549 | 550 | 551 | 239 552 | 553 | 554 | 555 | 556 | 23 557 | 558 | 559 | 560 | 561 | 295 562 | 563 | 564 | YES 565 | 566 | 567 | 568 | 569 | 570 | 296 571 | 572 | 573 | YES 574 | 575 | 576 | 577 | 578 | 579 | 420 580 | 581 | 582 | 583 | 584 | 490 585 | 586 | 587 | YES 588 | 589 | 590 | 591 | 592 | 593 | 491 594 | 595 | 596 | YES 597 | 598 | 599 | 600 | 601 | 602 | 492 603 | 604 | 605 | 606 | 607 | 494 608 | 609 | 610 | 611 | 612 | 536 613 | 614 | 615 | 616 | 617 | 618 | 619 | YES 620 | 621 | YES 622 | -1.IBPluginDependency 623 | -2.IBPluginDependency 624 | -3.IBPluginDependency 625 | 129.IBPluginDependency 626 | 130.IBPluginDependency 627 | 131.IBPluginDependency 628 | 134.IBPluginDependency 629 | 136.IBPluginDependency 630 | 143.IBPluginDependency 631 | 144.IBPluginDependency 632 | 145.IBPluginDependency 633 | 149.IBPluginDependency 634 | 150.IBPluginDependency 635 | 19.IBPluginDependency 636 | 23.IBPluginDependency 637 | 236.IBPluginDependency 638 | 239.IBPluginDependency 639 | 24.IBPluginDependency 640 | 29.IBPluginDependency 641 | 295.IBPluginDependency 642 | 296.IBPluginDependency 643 | 420.IBPluginDependency 644 | 490.IBPluginDependency 645 | 491.IBPluginDependency 646 | 492.IBPluginDependency 647 | 494.IBPluginDependency 648 | 5.IBPluginDependency 649 | 536.IBPluginDependency 650 | 56.IBPluginDependency 651 | 57.IBPluginDependency 652 | 58.IBPluginDependency 653 | 92.IBPluginDependency 654 | 655 | 656 | YES 657 | com.apple.InterfaceBuilder.CocoaPlugin 658 | com.apple.InterfaceBuilder.CocoaPlugin 659 | com.apple.InterfaceBuilder.CocoaPlugin 660 | com.apple.InterfaceBuilder.CocoaPlugin 661 | com.apple.InterfaceBuilder.CocoaPlugin 662 | com.apple.InterfaceBuilder.CocoaPlugin 663 | com.apple.InterfaceBuilder.CocoaPlugin 664 | com.apple.InterfaceBuilder.CocoaPlugin 665 | com.apple.InterfaceBuilder.CocoaPlugin 666 | com.apple.InterfaceBuilder.CocoaPlugin 667 | com.apple.InterfaceBuilder.CocoaPlugin 668 | com.apple.InterfaceBuilder.CocoaPlugin 669 | com.apple.InterfaceBuilder.CocoaPlugin 670 | com.apple.InterfaceBuilder.CocoaPlugin 671 | com.apple.InterfaceBuilder.CocoaPlugin 672 | com.apple.InterfaceBuilder.CocoaPlugin 673 | com.apple.InterfaceBuilder.CocoaPlugin 674 | com.apple.InterfaceBuilder.CocoaPlugin 675 | com.apple.InterfaceBuilder.CocoaPlugin 676 | com.apple.InterfaceBuilder.CocoaPlugin 677 | com.apple.InterfaceBuilder.CocoaPlugin 678 | com.apple.InterfaceBuilder.CocoaPlugin 679 | com.apple.InterfaceBuilder.CocoaPlugin 680 | com.apple.InterfaceBuilder.CocoaPlugin 681 | com.apple.InterfaceBuilder.CocoaPlugin 682 | com.apple.InterfaceBuilder.CocoaPlugin 683 | com.apple.InterfaceBuilder.CocoaPlugin 684 | com.apple.InterfaceBuilder.CocoaPlugin 685 | com.apple.InterfaceBuilder.CocoaPlugin 686 | com.apple.InterfaceBuilder.CocoaPlugin 687 | com.apple.InterfaceBuilder.CocoaPlugin 688 | com.apple.InterfaceBuilder.CocoaPlugin 689 | 690 | 691 | 692 | YES 693 | 694 | 695 | 696 | 697 | 698 | YES 699 | 700 | 701 | 702 | 703 | 541 704 | 705 | 706 | 707 | YES 708 | 709 | AppController 710 | NSObject 711 | 712 | YES 713 | 714 | YES 715 | exitFullScreen: 716 | toggleFullScreen: 717 | 718 | 719 | YES 720 | id 721 | id 722 | 723 | 724 | 725 | YES 726 | 727 | YES 728 | exitFullScreen: 729 | toggleFullScreen: 730 | 731 | 732 | YES 733 | 734 | exitFullScreen: 735 | id 736 | 737 | 738 | toggleFullScreen: 739 | id 740 | 741 | 742 | 743 | 744 | YES 745 | 746 | YES 747 | glView 748 | window 749 | 750 | 751 | YES 752 | EAGLView 753 | NSWindow 754 | 755 | 756 | 757 | YES 758 | 759 | YES 760 | glView 761 | window 762 | 763 | 764 | YES 765 | 766 | glView 767 | EAGLView 768 | 769 | 770 | window 771 | NSWindow 772 | 773 | 774 | 775 | 776 | IBProjectSource 777 | ./Classes/AppController.h 778 | 779 | 780 | 781 | EAGLView 782 | NSOpenGLView 783 | 784 | IBProjectSource 785 | ./Classes/EAGLView.h 786 | 787 | 788 | 789 | 790 | 0 791 | IBCocoaFramework 792 | 793 | com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 794 | 795 | 796 | YES 797 | 3 798 | 799 | YES 800 | 801 | YES 802 | NSMenuCheckmark 803 | NSMenuMixedState 804 | 805 | 806 | YES 807 | {9, 8} 808 | {7, 2} 809 | 810 | 811 | 812 | 813 | -------------------------------------------------------------------------------- /rippledemo/proj.mac/main.m: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #import 26 | 27 | int main(int argc, char *argv[]) 28 | { 29 | return NSApplicationMain(argc, (const char **)argv); 30 | } 31 | -------------------------------------------------------------------------------- /rippledemo/proj.marmalade/rippledemo.mkb: -------------------------------------------------------------------------------- 1 | options 2 | { 3 | module_path="../../../cocos2dx/proj.marmalade/;../../../CocosDenshion/proj.marmalade/;../../../extensions/proj.marmalade/;../../../external/chipmunk/proj.marmalade/;../../../external/Box2D/proj.marmalade/" 4 | s3e-data-dir = "../Resources/" 5 | } 6 | 7 | includepaths 8 | { 9 | ../Classes 10 | } 11 | subprojects 12 | { 13 | IwGL 14 | cocos2dx 15 | cocos2dx-ext 16 | Box2D 17 | CocosDenshion 18 | # chipmunk 19 | } 20 | 21 | defines 22 | { 23 | CC_ENABLE_BOX2D_INTEGRATION=1 24 | } 25 | assets 26 | { 27 | (../Resources) 28 | } 29 | 30 | files 31 | { 32 | [Main] 33 | (src) 34 | Main.h 35 | Main.cpp 36 | 37 | (../Classes) 38 | AppDelegate.cpp 39 | AppDelegate.h 40 | HelloWorldScene.cpp 41 | HelloWorldScene.h 42 | 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /rippledemo/proj.marmalade/src/Main.cpp: -------------------------------------------------------------------------------- 1 | // Application main file. 2 | 3 | #include "Main.h" 4 | #include "../Classes/AppDelegate.h" 5 | 6 | // Cocos2dx headers 7 | #include "cocos2d.h" 8 | 9 | // Marmaladeheaders 10 | #include "IwGL.h" 11 | 12 | USING_NS_CC; 13 | 14 | int main() 15 | { 16 | AppDelegate app; 17 | 18 | return cocos2d::CCApplication::sharedApplication()->Run(); 19 | } 20 | -------------------------------------------------------------------------------- /rippledemo/proj.marmalade/src/Main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H 2 | #define MAIN_H 3 | 4 | #endif 5 | -------------------------------------------------------------------------------- /rippledemo/proj.win32/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include "AppDelegate.h" 3 | #include "CCEGLView.h" 4 | 5 | USING_NS_CC; 6 | 7 | int APIENTRY _tWinMain(HINSTANCE hInstance, 8 | HINSTANCE hPrevInstance, 9 | LPTSTR lpCmdLine, 10 | int nCmdShow) 11 | { 12 | UNREFERENCED_PARAMETER(hPrevInstance); 13 | UNREFERENCED_PARAMETER(lpCmdLine); 14 | 15 | // create the application instance 16 | AppDelegate app; 17 | CCEGLView* eglView = CCEGLView::sharedOpenGLView(); 18 | eglView->setViewName("rippledemo"); 19 | eglView->setFrameSize(480, 320); 20 | return CCApplication::sharedApplication()->run(); 21 | } 22 | -------------------------------------------------------------------------------- /rippledemo/proj.win32/main.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_H__ 2 | #define __MAIN_H__ 3 | 4 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 5 | 6 | // Windows Header Files: 7 | #include 8 | #include 9 | 10 | // C RunTime Header Files 11 | #include "CCStdC.h" 12 | 13 | #endif // __MAIN_H__ 14 | -------------------------------------------------------------------------------- /rippledemo/proj.win32/rippledemo.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rippledemo", "rippledemo.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28} 7 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} 8 | {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} 9 | {929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116} 10 | {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} 11 | EndProjectSection 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\..\cocos2dx\proj.win32\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" 14 | EndProject 15 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosDenshion", "..\..\..\CocosDenshion\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" 16 | ProjectSection(ProjectDependencies) = postProject 17 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} 18 | EndProjectSection 19 | EndProject 20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\..\..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" 21 | ProjectSection(ProjectDependencies) = postProject 22 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} 23 | {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} 24 | {929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116} 25 | {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} 26 | EndProjectSection 27 | EndProject 28 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "..\..\..\external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" 29 | EndProject 30 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\..\..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" 31 | EndProject 32 | Global 33 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 34 | Debug|Win32 = Debug|Win32 35 | Release|Win32 = Release|Win32 36 | EndGlobalSection 37 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 38 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 39 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 40 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 41 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 42 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 43 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 44 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 45 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 46 | {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32 47 | {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32 48 | {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32 49 | {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.Build.0 = Release|Win32 50 | {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32 51 | {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32 52 | {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32 53 | {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32 54 | {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32 55 | {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 56 | {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 57 | {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 58 | {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32 59 | {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 60 | {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 61 | {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32 62 | EndGlobalSection 63 | GlobalSection(SolutionProperties) = preSolution 64 | HideSolutionNode = FALSE 65 | EndGlobalSection 66 | EndGlobal 67 | -------------------------------------------------------------------------------- /rippledemo/proj.win32/rippledemo.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A} 15 | test_win32 16 | Win32Proj 17 | 18 | 19 | 20 | Application 21 | Unicode 22 | true 23 | v100 24 | v110 25 | v110_xp 26 | 27 | 28 | Application 29 | Unicode 30 | v100 31 | v110 32 | v110_xp 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | <_ProjectFileVersion>10.0.40219.1 46 | $(SolutionDir)$(Configuration).win32\ 47 | $(Configuration).win32\ 48 | true 49 | $(SolutionDir)$(Configuration).win32\ 50 | $(Configuration).win32\ 51 | false 52 | AllRules.ruleset 53 | 54 | 55 | AllRules.ruleset 56 | 57 | 58 | 59 | 60 | $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) 61 | 62 | 63 | $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) 64 | 65 | 66 | 67 | Disabled 68 | $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;..\Classes;..;%(AdditionalIncludeDirectories) 69 | WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 70 | true 71 | EnableFastChecks 72 | MultiThreadedDebugDLL 73 | 74 | 75 | Level3 76 | EditAndContinue 77 | 4267;4251;4244;%(DisableSpecificWarnings) 78 | 79 | 80 | libExtensions.lib;libcocos2d.lib;libCocosDenshion.lib;opengl32.lib;glew32.lib;libBox2d.lib;libchipmunk.lib;libcurl_imp.lib;pthreadVCE2.lib;websockets.lib;%(AdditionalDependencies) 81 | $(OutDir)$(ProjectName).exe 82 | $(OutDir);%(AdditionalLibraryDirectories) 83 | true 84 | Windows 85 | MachineX86 86 | 87 | 88 | 89 | 90 | 91 | 92 | if not exist "$(OutDir)" mkdir "$(OutDir)" 93 | xcopy /Y /Q "$(ProjectDir)..\..\..\external\libwebsockets\win32\lib\*.*" "$(OutDir)" 94 | 95 | 96 | 97 | 98 | MaxSpeed 99 | true 100 | $(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;..\Classes;..;%(AdditionalIncludeDirectories) 101 | WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 102 | MultiThreadedDLL 103 | true 104 | 105 | 106 | Level3 107 | ProgramDatabase 108 | 4267;4251;4244;%(DisableSpecificWarnings) 109 | 110 | 111 | libExtensions.lib;libcocos2d.lib;libCocosDenshion.lib;opengl32.lib;glew32.lib;libBox2d.lib;libchipmunk.lib;libcurl_imp.lib;pthreadVCE2.lib;websockets.lib;%(AdditionalDependencies) 112 | $(OutDir)$(ProjectName).exe 113 | $(OutDir);%(AdditionalLibraryDirectories) 114 | true 115 | Windows 116 | true 117 | true 118 | MachineX86 119 | 120 | 121 | 122 | 123 | 124 | 125 | if not exist "$(OutDir)" mkdir "$(OutDir)" 126 | xcopy /Y /Q "$(ProjectDir)..\..\..\external\libwebsockets\win32\lib\*.*" "$(OutDir)" 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} 142 | false 143 | 144 | 145 | {f8edd7fa-9a51-4e80-baeb-860825d2eac6} 146 | false 147 | 148 | 149 | {21b2c324-891f-48ea-ad1a-5ae13de12e28} 150 | false 151 | 152 | 153 | {929480e7-23c0-4df6-8456-096d71547116} 154 | false 155 | 156 | 157 | {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} 158 | false 159 | 160 | 161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /rippledemo/proj.win32/rippledemo.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {84a8ebd7-7cf0-47f6-b75e-d441df67da40} 6 | 7 | 8 | {bb6c862e-70e9-49d9-81b7-3829a6f50471} 9 | 10 | 11 | 12 | 13 | win32 14 | 15 | 16 | Classes 17 | 18 | 19 | Classes 20 | 21 | 22 | 23 | 24 | win32 25 | 26 | 27 | Classes 28 | 29 | 30 | Classes 31 | 32 | 33 | -------------------------------------------------------------------------------- /rippledemo/proj.win32/rippledemo.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(ProjectDir)..\Resources 5 | WindowsLocalDebugger 6 | 7 | 8 | $(ProjectDir)..\Resources 9 | WindowsLocalDebugger 10 | 11 | --------------------------------------------------------------------------------