cocos2d-x节点(CCGrabber.h)API

本文来自http://blog.csdn.net/runaying ,引用必须注明出处!

cocos2d-x节点(CCGrabber.h)API

温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记

FBO 类抓取屏幕上的内容 

///cocos2d-x-3.0alpha0/cocos2dx/effects
/** FBO 类抓取屏幕上的内容 */

#ifndef __EFFECTS_CCGRABBER_H__
#define __EFFECTS_CCGRABBER_H__

#include "CCConfiguration.h"
#include "cocoa/CCObject.h"
#include "CCGL.h"

NS_CC_BEGIN

class Texture2D;

/**
 * @addtogroup effects
 * @{
 */

/** FBO 类抓取屏幕上的内容 */
class Grabber : public Object
{
public:
    /**
     * @js ctor
     */
    Grabber(void);
    /**
     * @js NA
     * @lua NA
     */
    ~Grabber(void);

    void grab(Texture2D *texture);
    void beforeRender(Texture2D *texture);
    void afterRender(Texture2D *texture);

protected:
    GLuint _FBO;
    GLint _oldFBO;
    GLfloat    _oldClearColor[4];
};

// end of effects group
/// @}

NS_CC_END

#endif // __EFFECTS_CCGRABBER_H__


你可能感兴趣的:(cocos2d,cocos2dx,cocos2d-x)