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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/********************************************************************
*
*	File:		fsCRenderCommandLine.h
*
*	Purpose:	cocos2d-x line renderer commands
*
*********************************************************************/

#ifndef fsCRenderCommandLinehdr
#define fsCRenderCommandLinehdr

#include <renderer/CCCustomCommand.h>

#include "../../../fsIRenderer.h"
#include "fsIRenderCommand.h"

class fsIRenderData;

class fsCRenderCommandLine : public fsIRendererCommand
{
	friend class fsCRenderer;

public:

	void init(fsS32 pLines);

	fsCRenderCommandLine(fsS32 pLines);
	~fsCRenderCommandLine();<--- Destructor in derived class

protected:
private:

	void batchDataRender() override;
	void batchDataPopulate(fsIRenderData const* pRenderData, fsS32 pOffest,
	                       fsIRenderer::eSPRITE_STRIP_PLACE pPlace) override;

	void pipelineSetup(cocos2d::PipelineDescriptor& pPipelineDescriptor, cocos2d::backend::ProgramType pProgram);
	void buffersCreate(fsS32 pCount);

	cocos2d::CustomCommand _customCommandGLLine;
	cocos2d::V2F_C4B_T2F* _bufferGLLine = nullptr;

	int _bufferCapacityGLLine = 0;
	int _bufferCountGLLine = 0;
};

#endif