EgtGraphics 1.5c8 :

- gestione stato Mark con disegno alone attorno ad oggetto
- modifiche ad esecutore.
This commit is contained in:
Dario Sassi
2014-03-23 12:37:45 +00:00
parent 4a23361b97
commit 51052ede7c
11 changed files with 139 additions and 64 deletions
+13 -12
View File
@@ -51,11 +51,12 @@ Scene::Scene( void)
m_nViewportW = 0 ;
m_nViewportH = 0 ;
// Sfondo
m_BackTop.Set( 128, 128, 128) ;
m_BackBottom.Set( 128, 128, 128) ;
m_colBackTop.Set( 128, 128, 128) ;
m_colBackBottom.Set( 128, 128, 128) ;
// GeomData
m_pGeomDB = nullptr ;
m_colDef.Set( 0, 0, 0) ;
m_colMark.Set( 192, 192, 0) ;
// Extension
SetExtension( BBox3d( -MIN_EXTENSION, -MIN_EXTENSION, -MIN_EXTENSION,
MIN_EXTENSION, MIN_EXTENSION, MIN_EXTENSION)) ;
@@ -474,10 +475,10 @@ Scene::Reshape( int nW, int nH)
//----------------------------------------------------------------------------
bool
Scene::SetBackground( Color BackTop, Color BackBottom)
Scene::SetBackground( Color colBackTop, Color colBackBottom)
{
m_BackTop = BackTop ;
m_BackBottom = BackBottom ;
m_colBackTop = colBackTop ;
m_colBackBottom = colBackBottom ;
return true ;
}
@@ -495,9 +496,9 @@ Scene::Background( void)
glClear( GL_DEPTH_BUFFER_BIT) ;
// se lo sfondo ha un colore uniforme
if ( m_BackTop == m_BackBottom) {
if ( m_colBackTop == m_colBackBottom) {
// imposto il colore dello sfondo e lo cancello
glClearColor( m_BackTop.GetRed(), m_BackTop.GetGreen(), m_BackTop.GetBlue(), m_BackTop.GetAlpha()) ;
glClearColor( m_colBackTop.GetRed(), m_colBackTop.GetGreen(), m_colBackTop.GetBlue(), 1) ;
glClear( GL_COLOR_BUFFER_BIT) ;
return true ;
}
@@ -514,10 +515,10 @@ Scene::Background( void)
// disegno lo sfondo con due colori
if ( ! m_bNewWay) {
glBegin( GL_TRIANGLE_STRIP) ;
glColor3f( m_BackBottom.GetRed(), m_BackBottom.GetGreen(), m_BackBottom.GetBlue()) ;
glColor3f( m_colBackBottom.GetRed(), m_colBackBottom.GetGreen(), m_colBackBottom.GetBlue()) ;
glVertex3f( -1, -1, 0.5) ;
glVertex3f( 1, -1, 0.5) ;
glColor3f( m_BackTop.GetRed(), m_BackTop.GetGreen(), m_BackTop.GetBlue()) ;
glColor3f( m_colBackTop.GetRed(), m_colBackTop.GetGreen(), m_colBackTop.GetBlue()) ;
glVertex3f( -1, 1, 0.5) ;
glVertex3f( 1, 1, 0.5) ;
glEnd() ;
@@ -542,7 +543,7 @@ Scene::Background( void)
// bottom left
v3V.Set( -1, -1, 0.5) ;
glBufferSubData( GL_ARRAY_BUFFER, 0 * SIZEV3F, SIZEV3F, &v3V) ;
v3C.Set( m_BackBottom.GetRed(), m_BackBottom.GetGreen(), m_BackBottom.GetBlue()) ;
v3C.Set( m_colBackBottom.GetRed(), m_colBackBottom.GetGreen(), m_colBackBottom.GetBlue()) ;
glBufferSubData( GL_ARRAY_BUFFER, 1 * SIZEV3F, SIZEV3F, &v3C) ;
// bottom right
v3V.Set( 1, -1, 0.5) ;
@@ -552,7 +553,7 @@ Scene::Background( void)
// top left
v3V.Set( -1, 1, 0.5) ;
glBufferSubData( GL_ARRAY_BUFFER, 4 * SIZEV3F, SIZEV3F, &v3V) ;
v3C.Set( m_BackTop.GetRed(), m_BackTop.GetGreen(), m_BackTop.GetBlue()) ;
v3C.Set( m_colBackTop.GetRed(), m_colBackTop.GetGreen(), m_colBackTop.GetBlue()) ;
glBufferSubData( GL_ARRAY_BUFFER, 5 * SIZEV3F, SIZEV3F, &v3C) ;
// top right
v3V.Set( 1, 1, 0.5) ;
@@ -629,7 +630,7 @@ Scene::Draw( void)
glPointSize( 3) ;
// disegno le geometrie del DB
DrawGroup( GDB_ID_ROOT, GDB_MD_STD, GDB_ST_ON) ;
DrawGroup( GDB_ID_ROOT, GDB_MD_STD, GDB_ST_ON, GDB_MK_OFF) ;
// aggiungo disegni diretti (senza test Zbuffer)
glDisable( GL_DEPTH_TEST) ;