Skip to content

whitglint/cccoroutine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

CCCoroutine

Cocos2d-x Coroutine Action for C++ Coroutines TS.

Build

  • Header only
  • C++ compiler with Coroutines TS support
    • Visual C++: /await
    • Clang: -fcoroutines-ts -stdlib=libc++

Example

#include <CCCoroutine.h>

USING_NS_CC;

void FooLayer::bar()
{
    startCoroutine(this, barCoroutine());
}

cocos2d::Coroutine FooLayer::barCoroutine()
{
    // Will wait until next frame
    co_yield nullptr;
    // Will wait until the DelayTime action finish
    co_yield DelayTime::create(1000);
}

License

MIT

About

Cocos2d-x Coroutine Action for C++ Coroutines TS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages