2013-11-05 01:14:22 +08:00
|
|
|
//
|
|
|
|
// Created by NiTe Luo on 10/31/13.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __CCRENDERER_H_
|
|
|
|
#define __CCRENDERER_H_
|
|
|
|
|
|
|
|
#include "CCPlatformMacros.h"
|
|
|
|
#include "CCEGLView.h"
|
|
|
|
#include "RenderCommand.h"
|
|
|
|
#include "CCGLProgram.h"
|
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class Renderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static Renderer* getInstance();
|
|
|
|
|
2013-11-08 02:09:53 +08:00
|
|
|
//TODO support multiple viewport
|
2013-11-05 01:14:22 +08:00
|
|
|
void addRenderCommand(RenderCommand* commnad);
|
|
|
|
void render();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Renderer();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
vector<RenderCommand*> _renderQueue;
|
|
|
|
GLProgram* _shaderProgram;
|
2013-11-08 02:09:53 +08:00
|
|
|
int _lastMaterialID;
|
|
|
|
V3F_C4B_T2F_Quad* _quadBuffer;
|
2013-11-05 01:14:22 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
#endif //__CCRENDERER_H_
|