2012-11-09 12:08:18 +08:00
|
|
|
/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software
|
|
|
|
* Copyright (c) 2012 cocos2d-x.org
|
2014-01-07 11:25:07 +08:00
|
|
|
* Copyright (c) 2013-2014 Chukong Technologies Inc.
|
2012-11-09 12:08:18 +08:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Code copied & pasted from SpacePatrol game https://github.com/slembcke/SpacePatrol
|
|
|
|
*
|
|
|
|
* Renamed and added some changes for cocos2d
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CCDRAWNODES_CCDRAW_NODE_H__
|
|
|
|
#define __CCDRAWNODES_CCDRAW_NODE_H__
|
|
|
|
|
2014-04-27 01:11:22 +08:00
|
|
|
#include "2d/CCNode.h"
|
2014-04-30 08:37:36 +08:00
|
|
|
#include "base/ccTypes.h"
|
|
|
|
#include "renderer/CCCustomCommand.h"
|
2014-09-11 15:39:56 +08:00
|
|
|
#include "math/CCMath.h"
|
2012-11-09 12:08:18 +08:00
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
2015-11-25 23:26:57 +08:00
|
|
|
static const int DEFAULT_LINE_WIDTH = 2;
|
|
|
|
|
2014-09-11 15:39:56 +08:00
|
|
|
class PointArray;
|
2015-03-21 17:06:26 +08:00
|
|
|
/**
|
|
|
|
* @addtogroup _2d
|
|
|
|
* @{
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** @class DrawNode
|
|
|
|
* @brief Node that draws dots, segments and polygons.
|
|
|
|
* Faster than the "drawing primitives" since they draws everything in one single batch.
|
|
|
|
* @since v2.1
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL DrawNode : public Node
|
2012-11-09 12:08:18 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 17:06:26 +08:00
|
|
|
/** creates and initialize a DrawNode node.
|
|
|
|
*
|
|
|
|
* @return Return an autorelease object.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
static DrawNode* create();
|
2015-03-21 17:06:26 +08:00
|
|
|
|
|
|
|
/** Draw a point.
|
|
|
|
*
|
|
|
|
* @param point A Vec2 used to point.
|
|
|
|
* @param pointSize The point size.
|
|
|
|
* @param color The point color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawPoint(const Vec2& point, const float pointSize, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draw a group point.
|
|
|
|
*
|
|
|
|
* @param position A Vec2 pointer.
|
|
|
|
* @param numberOfPoints The number of points.
|
|
|
|
* @param color The point color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawPoints(const Vec2 *position, unsigned int numberOfPoints, const Color4F &color);
|
2015-03-21 17:06:26 +08:00
|
|
|
|
|
|
|
/** Draw a group point.
|
|
|
|
*
|
|
|
|
* @param position A Vec2 pointer.
|
|
|
|
* @param numberOfPoints The number of points.
|
|
|
|
* @param pointSize The point size.
|
|
|
|
* @param color The point color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2015-01-07 11:02:31 +08:00
|
|
|
void drawPoints(const Vec2 *position, unsigned int numberOfPoints, const float pointSize, const Color4F &color);
|
2014-09-11 15:39:56 +08:00
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draw an line from origin to destination with color.
|
|
|
|
*
|
|
|
|
* @param origin The line origin.
|
|
|
|
* @param destination The line destination.
|
|
|
|
* @param color The line color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawLine(const Vec2 &origin, const Vec2 &destination, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a rectangle given the origin and destination point measured in points.
|
|
|
|
* The origin and the destination can not have the same x and y coordinate.
|
|
|
|
*
|
|
|
|
* @param origin The rectangle origin.
|
|
|
|
* @param destination The rectangle destination.
|
|
|
|
* @param color The rectangle color.
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawRect(const Vec2 &origin, const Vec2 &destination, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a polygon given a pointer to point coordinates and the number of vertices measured in points.
|
|
|
|
* The polygon can be closed or open.
|
|
|
|
*
|
|
|
|
* @param poli A pointer to point coordinates.
|
|
|
|
* @param numberOfPoints The number of vertices measured in points.
|
|
|
|
* @param closePolygon The polygon can be closed or open.
|
|
|
|
* @param color The polygon color.
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawPoly(const Vec2 *poli, unsigned int numberOfPoints, bool closePolygon, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a circle given the center, radius and number of segments.
|
|
|
|
*
|
|
|
|
* @param center The circle center point.
|
|
|
|
* @param radius The circle rotate of radius.
|
2015-05-21 08:22:59 +08:00
|
|
|
* @param angle The circle angle.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param segments The number of segments.
|
|
|
|
* @param drawLineToCenter Whether or not draw the line from the origin to center.
|
|
|
|
* @param scaleX The scale value in x.
|
|
|
|
* @param scaleY The scale value in y.
|
|
|
|
* @param color Set the circle color.
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawCircle( const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a circle given the center, radius and number of segments.
|
|
|
|
*
|
|
|
|
* @param center The circle center point.
|
|
|
|
* @param radius The circle rotate of radius.
|
2015-05-21 08:22:59 +08:00
|
|
|
* @param angle The circle angle.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param segments The number of segments.
|
|
|
|
* @param drawLineToCenter Whether or not draw the line from the origin to center.
|
|
|
|
* @param color Set the circle color.
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawCircle(const Vec2 ¢er, float radius, float angle, unsigned int segments, bool drawLineToCenter, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a quad bezier path.
|
|
|
|
*
|
|
|
|
* @param origin The origin of the bezier path.
|
|
|
|
* @param control The control of the bezier path.
|
|
|
|
* @param destination The destination of the bezier path.
|
2015-11-04 16:09:58 +08:00
|
|
|
* @param segments The number of segments.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param color Set the quad bezier color.
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawQuadBezier(const Vec2 &origin, const Vec2 &control, const Vec2 &destination, unsigned int segments, const Color4F &color);
|
2014-09-12 07:33:34 +08:00
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draw a cubic bezier curve with color and number of segments
|
|
|
|
*
|
|
|
|
* @param origin The origin of the bezier path.
|
|
|
|
* @param control1 The first control of the bezier path.
|
|
|
|
* @param control2 The second control of the bezier path.
|
|
|
|
* @param destination The destination of the bezier path.
|
2015-11-04 16:09:58 +08:00
|
|
|
* @param segments The number of segments.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param color Set the cubic bezier color.
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawCubicBezier(const Vec2 &origin, const Vec2 &control1, const Vec2 &control2, const Vec2 &destination, unsigned int segments, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a Cardinal Spline path.
|
|
|
|
*
|
|
|
|
* @param config A array point.
|
|
|
|
* @param tension The tension of the spline.
|
2015-11-04 16:09:58 +08:00
|
|
|
* @param segments The number of segments.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param color Set the Spline color.
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawCardinalSpline(PointArray *config, float tension, unsigned int segments, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a Catmull Rom path.
|
|
|
|
*
|
|
|
|
* @param points A point array of control point.
|
2015-11-04 16:09:58 +08:00
|
|
|
* @param segments The number of segments.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param color The Catmull Rom color.
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawCatmullRom(PointArray *points, unsigned int segments, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** draw a dot at a position, with a given radius and color.
|
|
|
|
*
|
|
|
|
* @param pos The dot center.
|
|
|
|
* @param radius The dot radius.
|
|
|
|
* @param color The dot color.
|
|
|
|
*/
|
2014-05-15 01:07:09 +08:00
|
|
|
void drawDot(const Vec2 &pos, float radius, const Color4F &color);
|
2012-11-09 12:08:18 +08:00
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a rectangle with 4 points.
|
|
|
|
*
|
|
|
|
* @param p1 The rectangle vertex point.
|
|
|
|
* @param p2 The rectangle vertex point.
|
|
|
|
* @param p3 The rectangle vertex point.
|
|
|
|
* @param p4 The rectangle vertex point.
|
|
|
|
* @param color The rectangle color.
|
|
|
|
*/
|
2015-01-07 11:44:16 +08:00
|
|
|
void drawRect(const Vec2 &p1, const Vec2 &p2, const Vec2 &p3, const Vec2& p4, const Color4F &color);
|
2014-09-11 15:39:56 +08:00
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a solid rectangle given the origin and destination point measured in points.
|
|
|
|
* The origin and the destination can not have the same x and y coordinate.
|
|
|
|
*
|
|
|
|
* @param origin The rectangle origin.
|
|
|
|
* @param destination The rectangle destination.
|
|
|
|
* @param color The rectangle color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawSolidRect(const Vec2 &origin, const Vec2 &destination, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.
|
|
|
|
*
|
|
|
|
* @param poli A solid polygon given a pointer to CGPoint coordinates.
|
|
|
|
* @param numberOfPoints The number of vertices measured in points.
|
|
|
|
* @param color The solid polygon color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawSolidPoly(const Vec2 *poli, unsigned int numberOfPoints, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a solid circle given the center, radius and number of segments.
|
|
|
|
* @param center The circle center point.
|
|
|
|
* @param radius The circle rotate of radius.
|
2015-05-21 08:22:59 +08:00
|
|
|
* @param angle The circle angle.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param segments The number of segments.
|
|
|
|
* @param scaleX The scale value in x.
|
|
|
|
* @param scaleY The scale value in y.
|
|
|
|
* @param color The solid circle color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY, const Color4F &color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Draws a solid circle given the center, radius and number of segments.
|
|
|
|
* @param center The circle center point.
|
|
|
|
* @param radius The circle rotate of radius.
|
2015-05-21 08:22:59 +08:00
|
|
|
* @param angle The circle angle.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param segments The number of segments.
|
|
|
|
* @param color The solid circle color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawSolidCircle(const Vec2& center, float radius, float angle, unsigned int segments, const Color4F& color);
|
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** draw a segment with a radius and color.
|
|
|
|
*
|
|
|
|
* @param from The segment origin.
|
|
|
|
* @param to The segment destination.
|
|
|
|
* @param radius The segment radius.
|
|
|
|
* @param color The segment color.
|
|
|
|
*/
|
2014-05-15 01:07:09 +08:00
|
|
|
void drawSegment(const Vec2 &from, const Vec2 &to, float radius, const Color4F &color);
|
2012-11-09 12:08:18 +08:00
|
|
|
|
2013-09-13 11:41:20 +08:00
|
|
|
/** draw a polygon with a fill color and line color
|
|
|
|
* @code
|
|
|
|
* When this function bound into js or lua,the parameter will be changed
|
|
|
|
* In js: var drawPolygon(var Arrayofpoints, var fillColor, var width, var borderColor)
|
|
|
|
* In lua:local drawPolygon(local pointTable,local tableCount,local fillColor,local width,local borderColor)
|
|
|
|
* @endcode
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param verts A pointer to point coordinates.
|
|
|
|
* @param count The number of verts measured in points.
|
|
|
|
* @param fillColor The color will fill in polygon.
|
|
|
|
* @param borderWidth The border of line width.
|
|
|
|
* @param borderColor The border of line color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2013-09-13 11:41:20 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void drawPolygon(const Vec2 *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor);
|
2013-10-14 11:41:55 +08:00
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** draw a triangle with color.
|
|
|
|
*
|
|
|
|
* @param p1 The triangle vertex point.
|
|
|
|
* @param p2 The triangle vertex point.
|
|
|
|
* @param p3 The triangle vertex point.
|
|
|
|
* @param color The triangle color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-05-15 01:07:09 +08:00
|
|
|
void drawTriangle(const Vec2 &p1, const Vec2 &p2, const Vec2 &p3, const Color4F &color);
|
2013-10-14 11:41:55 +08:00
|
|
|
|
2015-03-21 17:06:26 +08:00
|
|
|
/** draw a quadratic bezier curve with color and number of segments, use drawQuadBezier instead.
|
|
|
|
*
|
|
|
|
* @param from The origin of the bezier path.
|
|
|
|
* @param control The control of the bezier path.
|
|
|
|
* @param to The destination of the bezier path.
|
2015-11-04 16:09:58 +08:00
|
|
|
* @param segments The number of segments.
|
2015-03-21 17:06:26 +08:00
|
|
|
* @param color The quadratic bezier color.
|
2015-03-28 14:28:16 +08:00
|
|
|
* @js NA
|
2015-03-21 17:06:26 +08:00
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
CC_DEPRECATED_ATTRIBUTE void drawQuadraticBezier(const Vec2& from, const Vec2& control, const Vec2& to, unsigned int segments, const Color4F &color);
|
2012-11-09 12:08:18 +08:00
|
|
|
|
|
|
|
/** Clear the geometry in the node's buffer. */
|
|
|
|
void clear();
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Get the color mixed mode.
|
2013-09-13 11:41:20 +08:00
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-05 16:49:22 +08:00
|
|
|
const BlendFunc& getBlendFunc() const;
|
2015-03-21 17:06:26 +08:00
|
|
|
/** Set the color mixed mode.
|
2013-09-13 11:41:20 +08:00
|
|
|
* @code
|
|
|
|
* When this function bound into js or lua,the parameter will be changed
|
|
|
|
* In js: var setBlendFunc(var src, var dst)
|
|
|
|
* @endcode
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-05 16:49:22 +08:00
|
|
|
void setBlendFunc(const BlendFunc &blendFunc);
|
2013-07-18 07:56:19 +08:00
|
|
|
|
2015-03-28 14:28:16 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
*/
|
|
|
|
void onDraw(const Mat4 &transform, uint32_t flags);
|
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
*/
|
|
|
|
void onDrawGLLine(const Mat4 &transform, uint32_t flags);
|
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
*/
|
2014-09-11 15:39:56 +08:00
|
|
|
void onDrawGLPoint(const Mat4 &transform, uint32_t flags);
|
2013-12-19 03:43:45 +08:00
|
|
|
|
2013-07-18 07:56:19 +08:00
|
|
|
// Overrides
|
2014-05-31 07:42:05 +08:00
|
|
|
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
|
2014-03-24 17:44:01 +08:00
|
|
|
|
2015-07-07 17:47:20 +08:00
|
|
|
void setLineWidth(int lineWidth);
|
2015-11-12 09:49:49 +08:00
|
|
|
|
2015-11-12 18:23:56 +08:00
|
|
|
// Set enable or disable multisampling effect on CocosStudio guide lines.
|
|
|
|
void setLineSmooth(bool enable);
|
2015-11-12 09:49:49 +08:00
|
|
|
|
2015-11-12 18:23:56 +08:00
|
|
|
// Get multisampling effect on CocosStudio guide lines mode.
|
|
|
|
bool isLineSmooth();
|
2015-11-12 09:49:49 +08:00
|
|
|
|
2015-11-12 18:23:56 +08:00
|
|
|
// Get CocosStudio guide lines width.
|
|
|
|
float getLineWidth();
|
2015-11-12 09:49:49 +08:00
|
|
|
|
2014-03-24 17:44:01 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS:
|
2015-11-25 23:26:57 +08:00
|
|
|
DrawNode(int lineWidth = DEFAULT_LINE_WIDTH);
|
2013-11-15 08:21:49 +08:00
|
|
|
virtual ~DrawNode();
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual bool init() override;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2014-03-24 17:44:01 +08:00
|
|
|
protected:
|
2013-12-05 17:19:01 +08:00
|
|
|
void ensureCapacity(int count);
|
2014-09-11 15:39:56 +08:00
|
|
|
void ensureCapacityGLPoint(int count);
|
|
|
|
void ensureCapacityGLLine(int count);
|
2013-07-18 07:56:19 +08:00
|
|
|
|
|
|
|
GLuint _vao;
|
|
|
|
GLuint _vbo;
|
2014-09-11 15:39:56 +08:00
|
|
|
GLuint _vaoGLPoint;
|
|
|
|
GLuint _vboGLPoint;
|
|
|
|
GLuint _vaoGLLine;
|
|
|
|
GLuint _vboGLLine;
|
2013-07-18 07:56:19 +08:00
|
|
|
|
2013-12-05 17:19:01 +08:00
|
|
|
int _bufferCapacity;
|
2013-07-20 13:01:27 +08:00
|
|
|
GLsizei _bufferCount;
|
|
|
|
V2F_C4B_T2F *_buffer;
|
2014-09-11 15:39:56 +08:00
|
|
|
|
|
|
|
int _bufferCapacityGLPoint;
|
|
|
|
GLsizei _bufferCountGLPoint;
|
2015-01-20 16:50:51 +08:00
|
|
|
V2F_C4B_T2F *_bufferGLPoint;
|
2014-09-11 15:39:56 +08:00
|
|
|
Color4F _pointColor;
|
|
|
|
int _pointSize;
|
|
|
|
|
|
|
|
int _bufferCapacityGLLine;
|
|
|
|
GLsizei _bufferCountGLLine;
|
|
|
|
V2F_C4B_T2F *_bufferGLLine;
|
2013-07-18 07:56:19 +08:00
|
|
|
|
2013-07-20 13:01:27 +08:00
|
|
|
BlendFunc _blendFunc;
|
2013-12-26 21:19:12 +08:00
|
|
|
CustomCommand _customCommand;
|
2014-09-11 15:39:56 +08:00
|
|
|
CustomCommand _customCommandGLPoint;
|
|
|
|
CustomCommand _customCommandGLLine;
|
2013-07-18 07:56:19 +08:00
|
|
|
|
2013-07-20 13:01:27 +08:00
|
|
|
bool _dirty;
|
2014-09-11 15:39:56 +08:00
|
|
|
bool _dirtyGLPoint;
|
|
|
|
bool _dirtyGLLine;
|
2015-07-07 17:47:20 +08:00
|
|
|
|
|
|
|
int _lineWidth;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2015-11-12 09:49:49 +08:00
|
|
|
bool _lineSmoothEnable;
|
2015-11-25 23:26:57 +08:00
|
|
|
int _defaultLineWidth;
|
2013-11-15 08:21:49 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(DrawNode);
|
2012-11-09 12:08:18 +08:00
|
|
|
};
|
2015-03-21 17:06:26 +08:00
|
|
|
/** @} */
|
2012-11-09 12:08:18 +08:00
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
#endif // __CCDRAWNODES_CCDRAW_NODE_H__
|