5 #ifndef _MGRenderAttr_HH_
6 #define _MGRenderAttr_HH_
8 #include "mgGL/Color.h"
37 FRONT_AND_BACK=GL_FRONT_AND_BACK
46 m_material(0),m_back_material(0){;};
51 ):
MGGLAttrib(static_cast<int>(FRONT)),m_color(solid_color),
52 m_material(0),m_back_material(0){;};
74 void exec(
mgVBO& vbo)
const;
77 bool is_color_shading()
const;
83 bool is_texture_shading()
const;
86 bool material_defined()
const;
94 const float ambient[3],
95 const float diffuse[3],
96 const float specular[3],
97 const float emission[3],
106 void set_back_material(
107 const float ambient[3],
108 const float diffuse[3],
109 const float specular[3],
110 const float emission[3],
112 float transparency=0.
132 void set_color_shading(
const MGColor& colr);
158 std::string
whoami()
const{
return "RenderAttr";};
166 std::ostream&
out(std::ostream&)
const;
MGRenderAttr(const MGColor &solid_color)
Defines a solid color MGRenderAttr(that is, no texture mapping) of solid_color.
Definition: RenderAttr.h:49
virtual void set_draw_attrib_mask(unsigned int &mask) const =0
Turn on the appropriate mask bit for this attribute. See glPushAttrib().
RENDERSIDE render_side() const
Definition: RenderAttr.h:127
MGGLAttrib is an abstract class which defines the enum of undefined or disabled.
Definition: GLAttrib.h:35
Definition: GLAttrib.h:41
virtual bool operator<(const MGGel &gel2) const
virtual MGGLAttrib * clone() const =0
Generate a newed clone object.
virtual void WriteMembers(MGOfstream &buf) const
Write all member data.
void render(mgVBO &vbo) const
render GLAttribute process.
Definition: RenderAttr.h:141
RENDERSIDE
Definition: RenderAttr.h:32
MGRenderAttr(RENDERSIDE rs=FRONT)
Defines context solid color MGRenderAttr(that is, no texture mapping).
Definition: RenderAttr.h:43
virtual void ReadMembers(MGIfstream &buf)
Read all member data.
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual MGGLAttrib & operator=(const MGGLAttrib &gel2)
Definition: GLAttrib.h:70
MG_DLL_DECLR friend GLenum GLrender_side(RENDERSIDE rs)
Definition: RenderAttr.h:40
long identify_type() const
Return This object's typeID.
Definition: RenderAttr.h:156
Definition: GLAttrib.h:40
void set_render_side(RENDERSIDE side=FRONT)
Set the render side.
Definition: RenderAttr.h:116
MGRenderAttr defines the attributes of rendering attributes.
Definition: RenderAttr.h:28
MGColor defines the OpenGL color (R,G,B,A).
Definition: Color.h:26
virtual void reset_render_attrib_mask(unsigned int &mask) const =0
Turn off the appropriate mask bit for this attribute. See glPushAttrib().
void reset_draw_attrib_mask(unsigned int &mask) const
Turn off the appropriate mask bit for this attribute. See glPushAttrib().
Definition: RenderAttr.h:147
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
bool is_highlight_attrib() const
Test if this is highlight attrib or not.
Definition: RenderAttr.h:80
virtual std::ostream & out(std::ostream &) const
Output virtual function.
const MGMaterial * material() const
Definition: RenderAttr.h:87
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
virtual void set_render_attrib_mask(unsigned int &mask) const =0
Turn on the appropriate mask bit for this attribute. See glPushAttrib().
MGMaterial defines OpenGL's Material attributes.
Definition: Material.h:24
int m_flag
Definition: GLAttrib.h:129
GLenum GLrender_side() const
Definition: RenderAttr.h:128
A container class to hold MGGLAttrib objects.
Definition: Appearance.h:33
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
void drawAttrib(mgVBO &vbo, bool no_color=false) const
draw GLAttribute process.
Definition: RenderAttr.h:135
std::string whoami() const
Definition: RenderAttr.h:158