Update of /cvsroot/playerstage/code/stage/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32426/src
Modified Files:
Tag: opengl
Makefile.am gui_gl.c model_laser.c p_driver.cc p_driver.h
p_graphics2d.cc
Log Message:
adding g3d interface support
Index: p_driver.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/p_driver.cc,v
retrieving revision 1.37.4.3
retrieving revision 1.37.4.4
diff -C2 -d -r1.37.4.3 -r1.37.4.4
*** p_driver.cc 22 Dec 2006 23:56:57 -0000 1.37.4.3
--- p_driver.cc 19 Jun 2007 02:00:46 -0000 1.37.4.4
***************
*** 393,396 ****
--- 393,400 ----
//break;
+ case PLAYER_GRAPHICS3D_CODE:
+ ifsrc = new InterfaceGraphics3d( player_addr, this, cf, section );
+ break;
+
case PLAYER_GRIPPER_CODE:
ifsrc = new InterfaceGripper( player_addr, this, cf, section );
***************
*** 604,629 ****
continue;
! if( interface->addr.interf == PLAYER_SIMULATION_CODE )
! {
! if( stg_world_update( this->world, FALSE ) )
! player_quit = TRUE; // set Player's global quit flag
! }
! else
! {
! // Has enough time elapsed since the last time we published on this
! // interface? This really needs some thought, as each model/interface
! // should have a configurable publishing rate. For now, I'm using the
! // world's update rate (which appears to be stored as msec). - BPG
! double currtime;
! GlobalTime->GetTimeDouble(&currtime);
! if((currtime - interface->last_publish_time) >=
! (interface->mod->world->sim_interval / 1e3))
{
! interface->Publish();
! interface->last_publish_time = currtime;
}
- }
}
-
// update the world
return;
--- 608,635 ----
continue;
! switch( interface->addr.interf )
{
! case PLAYER_SIMULATION_CODE:
! if( stg_world_update( this->world, FALSE ) )
! player_quit = TRUE; // set Player's global quit flag
! break;
!
! default:
! {
! // Has enough time elapsed since the last time we published on this
! // interface? This really needs some thought, as each model/interface
! // should have a configurable publishing rate. For now, I'm using the
! // world's update rate (which appears to be stored as msec). - BPG
! double currtime;
! GlobalTime->GetTimeDouble(&currtime);
! if((currtime - interface->last_publish_time) >=
! (interface->mod->world->sim_interval / 1e3))
! {
! interface->Publish();
! interface->last_publish_time = currtime;
! }
! }
}
}
// update the world
return;
Index: p_driver.h
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/p_driver.h,v
retrieving revision 1.21
retrieving revision 1.21.4.1
diff -C2 -d -r1.21 -r1.21.4.1
*** p_driver.h 29 Mar 2006 05:11:00 -0000 1.21
--- p_driver.h 19 Jun 2007 02:00:46 -0000 1.21.4.1
***************
*** 281,284 ****
--- 281,310 ----
private:
stg_rtk_fig_t* fig; // a figure we can draw in
+
+ GList* drawlist; // list of drawing commands
+
+ // clear the display
+ void Clear( void );
+ };
+
+ class InterfaceGraphics3d : public InterfaceModel
+ {
+ public:
+ InterfaceGraphics3d( player_devaddr_t addr, StgDriver* driver, ConfigFile*
cf, int section );
+ virtual ~InterfaceGraphics3d( void );
+
+ virtual int ProcessMessage( MessageQueue* resp_queue,
+ player_msghdr * hdr,
+ void * data );
+ virtual void Publish( void );
+
+ private:
+
+ GArray* commands; // array of drawing commands
+ bool rebuild_displaylist;
+ int displaylist;
+
+ // clear the display
+ void Clear( void );
};
Index: gui_gl.c
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/gui_gl.c,v
retrieving revision 1.1.2.16
retrieving revision 1.1.2.17
diff -C2 -d -r1.1.2.16 -r1.1.2.17
*** gui_gl.c 19 May 2007 02:33:28 -0000 1.1.2.16
--- gui_gl.c 19 Jun 2007 02:00:46 -0000 1.1.2.17
***************
*** 27,30 ****
--- 27,32 ----
static GdkGLConfig *gllaser = NULL;
+ GList* dl_list = NULL;
+
#include "stage_internal.h"
#include "gui.h"
***************
*** 1634,1637 ****
--- 1636,1649 ----
g_hash_table_foreach( world->models, (GHFunc)model_draw_data_cb, NULL );
+ // draw anything in the assorted displaylist list
+ GList* it;
+ for( it = dl_list; it; it=it->next )
+ {
+ int dl = (int)it->data;
+ printf( "Calling dl %d\n", dl );
+ glCallList( (int)it->data );
+ }
+
+
if( world->win->selection_active
&& world->win->selection_active->sense_poly )
***************
*** 1844,1847 ****
--- 1856,1860 ----
/* } */
+
if( win->show_thumbnail ) // if drawing the whole world mini-view
draw_thumbnail( world );
Index: Makefile.am
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Makefile.am,v
retrieving revision 1.140.2.5
retrieving revision 1.140.2.6
diff -C2 -d -r1.140.2.5 -r1.140.2.6
*** Makefile.am 18 May 2007 05:21:07 -0000 1.140.2.5
--- Makefile.am 19 Jun 2007 02:00:46 -0000 1.140.2.6
***************
*** 58,61 ****
--- 58,62 ----
+
# TODO
# model_power.c # needs lots of work
***************
*** 69,72 ****
--- 70,74 ----
if HAVE_PLAYER
lib_LTLIBRARIES += libstageplugin.la
+ lib_LTLIBRARIES += libglutgraphics.la
# bin_PROGRAMS += ptest #currently broken
endif
***************
*** 78,81 ****
--- 80,84 ----
p_driver.cc \
p_driver.h \
+ p_graphics3d.cc \
p_laser.cc \
p_ptz.cc \
***************
*** 112,115 ****
--- 115,126 ----
libstageplugin_la_LIBADD = libstage.la @PLAYER_LIBS@ @GUI_LIBS@
+ # build a Player plugin from libstage plus Player driver hooks.
+ libglutgraphics_la_SOURCES = \
+ glutgraphics.cc
+
+ libglutgraphics_la_CPPFLAGS = $(AM_CPPFLAGS) @PLAYER_CFLAGS@
+ libglutgraphics_la_LDFLAGS = -version-info 1:0:0 -rpath $(libdir) -framework
GLUT
+ libglutgraphics_la_LIBADD = libstage.la @PLAYER_LIBS@
+
# build a stand-alone test program using libstage
stest_DEPENDENCIES = libstage.la
Index: model_laser.c
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/model_laser.c,v
retrieving revision 1.89.2.8
retrieving revision 1.89.2.9
diff -C2 -d -r1.89.2.8 -r1.89.2.9
*** model_laser.c 19 May 2007 02:33:28 -0000 1.89.2.8
--- model_laser.c 19 Jun 2007 02:00:46 -0000 1.89.2.9
***************
*** 222,226 ****
assert( mod->polys );
! stg_endpoint_t* ep = ((stg_polygon_t*)mod->polys->data)->epts[1]; // x max
--- 222,226 ----
assert( mod->polys );
! //stg_endpoint_t* ep = ((stg_polygon_t*)mod->polys->data)->epts[1]; // x max
Index: p_graphics2d.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/p_graphics2d.cc,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C2 -d -r1.5.2.1 -r1.5.2.2
*** p_graphics2d.cc 14 Sep 2006 07:03:25 -0000 1.5.2.1
--- p_graphics2d.cc 19 Jun 2007 02:00:46 -0000 1.5.2.2
***************
*** 71,81 ****
stg_rtk_fig_clear( this->fig );
}
InterfaceGraphics2d::~InterfaceGraphics2d( void )
{
stg_rtk_fig_clear( this->fig );
- };
int InterfaceGraphics2d::ProcessMessage(MessageQueue* resp_queue,
--- 71,91 ----
stg_rtk_fig_clear( this->fig );
+
+ list = NULL;
}
InterfaceGraphics2d::~InterfaceGraphics2d( void )
{
+ Clear();
+ }
+
+ void InterfaceGraphics2d::Clear( void )
+ {
stg_rtk_fig_clear( this->fig );
+ // delete all drawlist entries
+ // delete drawlist
+ list = NULL;
+ }
int InterfaceGraphics2d::ProcessMessage(MessageQueue* resp_queue,
***************
*** 89,94 ****
this->addr))
{
! //puts( "g2d: clearing figure" );
! stg_rtk_fig_clear( this->fig );
return 0; //ok
}
--- 99,103 ----
this->addr))
{
! Clear();
return 0; //ok
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit