[DEV] missing somme element

This commit is contained in:
Edouard DUPIN 2013-02-18 17:25:45 +01:00
parent 1598324f57
commit 01e5b2dc2a
7 changed files with 46 additions and 33 deletions

View File

@ -53,3 +53,9 @@ void ewol::Compositing::Clear(void)
{ {
m_matrixApply.Identity(); m_matrixApply.Identity();
} }
void ewol::Compositing::SetMatrix(mat4 mat)
{
m_matrixApply = mat;
}

View File

@ -55,6 +55,11 @@ namespace ewol
* @param[in] vect The scaling vector to apply at the transformation matrix * @param[in] vect The scaling vector to apply at the transformation matrix
*/ */
virtual void Scale(vec3 vect); virtual void Scale(vec3 vect);
/**
* @brief set the transformation matrix
* @param[in] mat The new matrix.
*/
virtual void SetMatrix(mat4 mat);
}; };
}; };

View File

@ -447,7 +447,8 @@ void ewol::Drawing::LineTo(vec3 dest)
{ {
ResetCount(); ResetCount();
InternalSetColor(m_color); InternalSetColor(m_color);
if (m_position.x() == dest.x() && m_position.y() == dest.y()) { EWOL_DEBUG("DrawLine : " << m_position << " to " << dest);
if (m_position.x() == dest.x() && m_position.y() == dest.y() && m_position.z() == dest.z()) {
EWOL_WARNING("Try to draw an line width 0"); EWOL_WARNING("Try to draw an line width 0");
return; return;
} }
@ -467,13 +468,13 @@ void ewol::Drawing::LineTo(vec3 dest)
float offsety = sin(teta-M_PI/2) * (m_thickness/2); float offsety = sin(teta-M_PI/2) * (m_thickness/2);
float offsetx = cos(teta-M_PI/2) * (m_thickness/2); float offsetx = cos(teta-M_PI/2) * (m_thickness/2);
SetPoint(vec3(m_position.x() - offsetx, m_position.y() - offsety, (float)0.0) ); SetPoint(vec3(m_position.x() - offsetx, m_position.y() - offsety, m_position.z()) );
SetPoint(vec3(m_position.x() + offsetx, m_position.y() + offsety, (float)0.0) ); SetPoint(vec3(m_position.x() + offsetx, m_position.y() + offsety, m_position.z()) );
SetPoint(vec3(dest.x() + offsetx, dest.y() + offsety, (float)0.0) ); SetPoint(vec3(dest.x() + offsetx, dest.y() + offsety, m_position.z()) );
SetPoint(vec3(dest.x() + offsetx, dest.y() + offsety, (float)0.0) ); SetPoint(vec3(dest.x() + offsetx, dest.y() + offsety, dest.z()) );
SetPoint(vec3(dest.x() - offsetx, dest.y() - offsety, (float)0.0) ); SetPoint(vec3(dest.x() - offsetx, dest.y() - offsety, dest.z()) );
SetPoint(vec3(m_position.x() - offsetx, m_position.y() - offsety, (float)0.0) ); SetPoint(vec3(m_position.x() - offsetx, m_position.y() - offsety, dest.z()) );
// update the system position : // update the system position :
m_position = dest; m_position = dest;
} }

View File

@ -21,21 +21,21 @@ namespace ewol
class Drawing : public ewol::Compositing class Drawing : public ewol::Compositing
{ {
private: private:
vec3 m_position; //!< The current position to draw vec3 m_position; //!< The current position to draw
vec3 m_clippingPosStart; //!< Clipping start position vec3 m_clippingPosStart; //!< Clipping start position
vec3 m_clippingPosStop; //!< Clipping stop position vec3 m_clippingPosStop; //!< Clipping stop position
bool m_clippingEnable; //!< true if the clipping must be activated bool m_clippingEnable; //!< true if the clipping must be activated
private: private:
draw::Color m_color; //!< The text foreground color draw::Color m_color; //!< The text foreground color
draw::Color m_colorBg; //!< The text background color draw::Color m_colorBg; //!< The text background color
private: private:
ewol::Program* m_GLprogram; //!< pointer on the opengl display program ewol::Program* m_GLprogram; //!< pointer on the opengl display program
int32_t m_GLPosition; //!< openGL id on the element (vertex buffer) int32_t m_GLPosition; //!< openGL id on the element (vertex buffer)
int32_t m_GLMatrix; //!< openGL id on the element (transformation matrix) int32_t m_GLMatrix; //!< openGL id on the element (transformation matrix)
int32_t m_GLColor; //!< openGL id on the element (color buffer) int32_t m_GLColor; //!< openGL id on the element (color buffer)
private: // Background Color (display only when needed) private: // Background Color (display only when needed)
etk::Vector<vec3 > m_coord; //!< internal position for the text display etk::Vector<vec3 > m_coord; //!< internal position for the text display
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the background etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the background
public: public:
/** /**
* @brief Basic constructor * @brief Basic constructor
@ -54,10 +54,10 @@ namespace ewol
* @brief Un-Load the openGL program and get all the ID needed * @brief Un-Load the openGL program and get all the ID needed
*/ */
void UnLoadProgram(void); void UnLoadProgram(void);
float m_thickness; //!< when drawing line and other things float m_thickness; //!< when drawing line and other things
int32_t m_triElement; //!< special counter of the single dot generated int32_t m_triElement; //!< special counter of the single dot generated
vec3 m_triangle[3]; //!< Register every system with a combinaison of tiangle vec3 m_triangle[3]; //!< Register every system with a combinaison of tiangle
draw::Colorf m_tricolor[3]; //!< Register every the associated color foreground draw::Colorf m_tricolor[3]; //!< Register every the associated color foreground
// internal API for the generation abstraction of triangles // internal API for the generation abstraction of triangles
/** /**
* @brief Lunch the generation of triangle * @brief Lunch the generation of triangle

View File

@ -33,7 +33,7 @@ ewol::Colored3DObject::~Colored3DObject(void)
void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices, void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
draw::Colorf& color, const draw::Colorf& color,
bool updateDepthBuffer) bool updateDepthBuffer)
{ {
if (vertices.Size()<=0) { if (vertices.Size()<=0) {
@ -55,7 +55,7 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
mat4 tmpMatrix = projMatrix * camMatrix; mat4 tmpMatrix = projMatrix * camMatrix;
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
// position : // position :
m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z,unused*/, &vertices[0], 4); m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z,unused*/, &vertices[0], 4*sizeof(float));
// color : // color :
m_GLprogram->Uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&color); m_GLprogram->Uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&color);
// Request the draw od the elements : // Request the draw od the elements :
@ -71,7 +71,7 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
} }
void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices, void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
draw::Colorf& color, const draw::Colorf& color,
mat4& transformationMatrix) mat4& transformationMatrix)
{ {
if (vertices.Size()<=0) { if (vertices.Size()<=0) {
@ -90,7 +90,7 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
mat4 tmpMatrix = projMatrix * camMatrix * transformationMatrix; mat4 tmpMatrix = projMatrix * camMatrix * transformationMatrix;
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
// position : // position :
m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z*/, &vertices[0]); m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z*/, &vertices[0], 4*sizeof(float));
// color : // color :
m_GLprogram->Uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&color); m_GLprogram->Uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&color);
// Request the draw od the elements : // Request the draw od the elements :
@ -100,7 +100,7 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
} }
void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices, void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
draw::Colorf& color, const draw::Colorf& color,
mat4& transformationMatrix) mat4& transformationMatrix)
{ {
if (vertices.Size()<=0) { if (vertices.Size()<=0) {
@ -119,7 +119,7 @@ void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
mat4 tmpMatrix = projMatrix * camMatrix * transformationMatrix; mat4 tmpMatrix = projMatrix * camMatrix * transformationMatrix;
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
// position : // position :
m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z*/, &vertices[0]); m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z*/, &vertices[0], 4*sizeof(float));
// color : // color :
m_GLprogram->Uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&color); m_GLprogram->Uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&color);
// Request the draw od the elements : // Request the draw od the elements :

View File

@ -29,13 +29,13 @@ namespace ewol
virtual ~Colored3DObject(void); virtual ~Colored3DObject(void);
virtual const char* GetType(void) { return "ewol::Colored3DObject"; }; virtual const char* GetType(void) { return "ewol::Colored3DObject"; };
virtual void Draw(etk::Vector<vec3>& vertices, virtual void Draw(etk::Vector<vec3>& vertices,
draw::Colorf& color, const draw::Colorf& color,
bool updateDepthBuffer=true); bool updateDepthBuffer=true);
virtual void Draw(etk::Vector<vec3>& vertices, virtual void Draw(etk::Vector<vec3>& vertices,
draw::Colorf& color, const draw::Colorf& color,
mat4& transformationMatrix); mat4& transformationMatrix);
virtual void DrawLine(etk::Vector<vec3>& vertices, virtual void DrawLine(etk::Vector<vec3>& vertices,
draw::Colorf& color, const draw::Colorf& color,
mat4& transformationMatrix); mat4& transformationMatrix);
}; };

View File

@ -280,7 +280,8 @@ void widget::Button::OnRegenerateDisplay(void)
bool widget::Button::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) bool widget::Button::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{ {
bool previousHoverState = m_mouseHover; bool previousHoverState = m_mouseHover;
if(ewol::keyEvent::statusLeave == typeEvent) { if( ewol::keyEvent::statusLeave == typeEvent
|| ewol::keyEvent::statusAbort == typeEvent) {
m_mouseHover = false; m_mouseHover = false;
m_buttonPressed = false; m_buttonPressed = false;
} else { } else {