10 #include "mgGL/GLAttrib.h"
44 float ambientIntensity,
67 virtual int exec()
const;
69 static void ResetLight(GLint lightNo);
78 GLenum get_light_num()
const;
112 m_ambientIntensity=ambientIntensity;
117 for(
int i=0;i<3; i++) m_color[i]=color[i];
120 for(
int i=0;i<3; i++) color[i]=m_color[i];
133 virtual std::string
whoami()
const{
return "Light";};
147 virtual std::ostream&
out(std::ostream&)
const;
161 #endif // _MGLIGHT_HH_
void reset_Amask(unsigned int &mask, MGGLAttrib::ATTRIB_MASK bit)
MGPointLight is a point light source that radiates equally in all directions.
Definition: PointLight.h:24
MGGLAttrib is an abstract class which defines the enum of undefined or disabled.
Definition: GLAttrib.h:35
void set_Amask(unsigned int &mask, MGGLAttrib::ATTRIB_MASK bit)
Set or reset the bit of mask.
Definition: GLAttrib.h:41
virtual bool operator<(const MGGel &gel2) const
LIGHT_MODE
Definition: Light.h:31
virtual MGGLAttrib * clone() const =0
Generate a newed clone object.
virtual void WriteMembers(MGOfstream &buf) const
Write all member data.
float m_ambientIntensity
applied to GL_AMBIENT
Definition: Light.h:152
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
void getColor(float &v0, float &v1, float &v2)
Definition: Light.h:127
Definition: GLAttrib.h:40
A directional light source.
Definition: SpotLight.h:22
virtual std::string whoami() const
Definition: Light.h:133
virtual void reset_render_attrib_mask(unsigned int &mask) const
Turn off the appropriate mask bit for this attribute. See glPushAttrib().
Definition: Light.h:104
MGLight is an abstract base class for light sources.
Definition: Light.h:27
virtual void render(mgVBO &vbo) const
render GLAttribute process.
Definition: Light.h:85
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
unsigned int m_lightNum
Definition: Light.h:150
virtual void set_draw_attrib_mask(unsigned int &mask) const
Turn on the appropriate mask bit for this attribute. See glPushAttrib().
Definition: Light.h:88
void setColor(const float color[3])
Definition: Light.h:116
float getIntensity() const
Definition: Light.h:109
float m_intensity
Color number of this light.
Definition: Light.h:151
virtual std::ostream & out(std::ostream &) const
Output virtual function.
MG_DLL_DECLR friend std::ostream & operator<<(std::ostream &ostrm, const MGGel &gel)
string stream function
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
virtual void reset_draw_attrib_mask(unsigned int &mask) const
Turn off the appropriate mask bit for this attribute. See glPushAttrib().
Definition: Light.h:96
void set_light_number(int lnum)
Set light number.
Definition: Light.h:93
virtual void set_render_attrib_mask(unsigned int &mask) const
Turn on the appropriate mask bit for this attribute. See glPushAttrib().
Definition: Light.h:101
virtual void drawAttrib(mgVBO &vbo, bool no_color=false) const
draw GLAttribute process.
Definition: Light.h:72
void setColor(float v0, float v1, float v2)
Definition: Light.h:122
void setAmbientIntensity(float ambientIntensity)
Definition: Light.h:111
void setIntensity(float intensity)
Definition: Light.h:108
void getColor(float color[3])
Definition: Light.h:119
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
float getAmbientIntensity() const
Definition: Light.h:114
MGDirectionalLight is a directional light source that approximates infinite light sources as the sun...
Definition: DirectionalLight.h:25
bool light_is_on() const
Definition: Light.h:82
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30