6 #if !defined(_MGVBOLEAFBUILDER__INCLUDED_)
7 #define _MGVBOLEAFBUILDER__INCLUDED_
11 #endif // _MSC_VER > 1000
13 #include "MGCLStdAfx.h"
14 #include "mg/Position.h"
15 #include "mgGL/Color.h"
25 vboFPoint():m_x(0.f),m_y(0.f),m_z(0.f){;};
26 vboFPoint(
float x,
float y,
float z):m_x(x),m_y(y),m_z(z){;};
27 vboFPoint(
double x,
double y,
double z):m_x((float)x),m_y((float)y),m_z((float)z){;};
28 vboFPoint(
const MGPosition& P):m_x((float)P[0]),m_y((float)P[1]),m_z((float)P[2]){;};
29 vboFPoint(
const MGVector& P):m_x((float)P[0]),m_y((float)P[1]),m_z((float)P[2]){;};
34 vboFP2D():m_s(0.f),m_t(0.f){;};
35 vboFP2D(
float s,
float t):m_s(s),m_t(t){;};
36 vboFP2D(
double s,
double t):m_s((float)s),m_t((float)t){;};
37 vboFP2D(
const MGPosition& P):m_s((float)P[0]),m_t((float)P[1]){;};
38 vboFP2D(
const MGVector& P):m_s((float)P[0]),m_t((float)P[1]){;};
43 vboColor(
const float colr[4]){
for(
int i=0; i<4; i++) m_color[i]=colr[i];};
52 class mgVBOLeafBuilder{
59 mgVBOLeafBuilder(GLenum type):m_typeBegin(type),m_drawType(
mgGLSL::
Primitive),m_texture(0)
60 ,m_stippleFactor(-1),m_LineStipplePattern(0),m_lightMode(-1){;};
62 mgVBOLeafBuilder(GLenum type,
const MGColor& colorStatic, GLfloat sizeStatic)
63 :m_typeBegin(type),m_colorStatic(colorStatic),m_sizeStatic(sizeStatic),
65 ,m_stippleFactor(-1),m_LineStipplePattern(0),m_lightMode(-1){;};
67 bool is_null()
const{
return m_VertexData.size()==0;};
69 void setTypeBegin(GLenum typeBegin){m_typeBegin=typeBegin;};
70 unsigned typeBegin()
const{
return m_typeBegin;};
77 m_colorStatic=
MGColor(color[0],color[1],color[2],color[3]);};
80 const MGColor& colorStatic()
const{
return m_colorStatic;};
82 void setStaticAttribSize(GLfloat size){m_sizeStatic=size;};
83 GLfloat sizeStatic()
const{
return m_sizeStatic;};
91 m_stippleFactor=factor;
92 m_LineStipplePattern=pattern;
106 void push_backVertex(
const vboFPoint& v){m_VertexData.push_back(v);};
107 void push_backColor(
const vboColor& c){m_ColorData.push_back(c);};
108 void push_backNormal(
const vboFPoint& n){m_NormalData.push_back(n);};
109 void push_backTexture(
const vboFP2D& t){m_TextureData.push_back(t);};
118 unsigned m_typeBegin;
120 GLfloat m_sizeStatic;
124 short int m_stippleFactor;
125 GLushort m_LineStipplePattern;
132 std::vector<vboFPoint> m_VertexData;
133 std::vector<vboColor> m_ColorData;
134 std::vector<vboFPoint> m_NormalData;
135 std::vector<vboFP2D> m_TextureData;
140 #endif // !defined(_MGVBOLEAFBUILDER__INCLUDED_)
Definition: glslprogram.h:26
void setStaticAttribColor(const MGColor &color)
Definition: VBOLeaf.h:143
void setLightMode(int mode)
Set light mode. mode=-1:undefined, =0:disabled, =1:enabled.
Vector of a general n space dimension.
Definition: Vector.h:26
mgGLSL::DrawType getDrawType() const
Definition: VBOLeaf.h:93
MGColor defines the OpenGL color (R,G,B,A).
Definition: Color.h:26
DrawType
Definition: glslprogram.h:25
Represent a positional data.
Definition: Position.h:28
Texture definition class.
Definition: Texture.h:29
void setTexture(mgTexture *texture)
Definition: glslprogram.h:18
const mgTexture * getTexture() const
Textureをset/getする。
void get_color(float color[4]) const
mgVBOに対して描画データ作成後の情報を保持するためのクラス.
Definition: VBOLeaf.h:38
void setLineStipple(short int factor, GLushort pattern)
void setDrawType(mgGLSL::DrawType drawType)
DrawTypeをセットする
Definition: VBOLeaf.h:92