plib-cvs Mailing List for PLIB (Page 13)
Brought to you by:
sjbaker
You can subscribe to this list here.
2002 |
Jan
(25) |
Feb
(10) |
Mar
(60) |
Apr
(49) |
May
(54) |
Jun
(94) |
Jul
(82) |
Aug
(251) |
Sep
(366) |
Oct
(17) |
Nov
(20) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(8) |
Mar
(2) |
Apr
(4) |
May
(5) |
Jun
(8) |
Jul
(23) |
Aug
(8) |
Sep
(7) |
Oct
(5) |
Nov
(20) |
Dec
(20) |
2004 |
Jan
(19) |
Feb
(70) |
Mar
(108) |
Apr
(24) |
May
(6) |
Jun
(5) |
Jul
|
Aug
(8) |
Sep
(18) |
Oct
(27) |
Nov
|
Dec
(13) |
2005 |
Jan
(19) |
Feb
(13) |
Mar
(1) |
Apr
|
May
(10) |
Jun
(1) |
Jul
(10) |
Aug
(5) |
Sep
(2) |
Oct
(2) |
Nov
(6) |
Dec
(4) |
2006 |
Jan
(9) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Steve B. <sj...@us...> - 2004-02-28 01:08:34
|
Update of /cvsroot/plib/plib/doc/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24913/puAux Log Message: Directory /cvsroot/plib/plib/doc/puAux added to the repository |
From: Steve B. <sj...@us...> - 2004-02-28 01:03:10
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23821/plib/src/pui Modified Files: pu.h Log Message: Added puAux library. Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.144 retrieving revision 1.145 diff -u -d -r1.144 -r1.145 --- pu.h 17 Feb 2004 01:43:21 -0000 1.144 +++ pu.h 28 Feb 2004 00:54:04 -0000 1.145 @@ -1,340 +1,341 @@ -/* - PLIB - A Suite of Portable Game Libraries - Copyright (C) 1998,2002 Steve Baker - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of [...4040 lines suppressed...] + + puSelectBox ( int minx, int miny, int maxx, int maxy, + char **list ) ; +} ; @@ -2078,9 +2129,9 @@ #else # define PU_USE_GLUT #endif - -#endif - + +#endif + // Roll out the code and define puInit |
From: Steve B. <sj...@us...> - 2004-02-28 01:03:10
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23821/plib/src/puAux Added Files: Makefile.am puAux.cxx puAux.h puAuxBiSlider.cxx puAuxBiSliderWithEnds.cxx puAuxComboBox.cxx puAuxCompass.cxx puAuxFileSelector.cxx puAuxLargeInput.cxx puAuxScrollBar.cxx puAuxSelectBox.cxx puAuxSliderWithInput.cxx puAuxSpinBox.cxx puAuxTriSlider.cxx puAuxVerticalMenu.cxx Log Message: Added puAux library. --- NEW FILE: Makefile.am --- if BUILD_PUAUX lib_LIBRARIES = libplibpuaux.a include_HEADERS = puAux.h libplibpuaux_a_SOURCES = puAux.cxx \ puAuxBiSlider.cxx \ puAuxBiSliderWithEnds.cxx \ puAuxComboBox.cxx \ puAuxCompass.cxx \ puAuxFileSelector.cxx \ puAuxLargeInput.cxx \ puAuxScrollBar.cxx \ puAuxSelectBox.cxx \ puAuxSliderWithInput.cxx \ puAuxSpinBox.cxx \ puAuxTriSlider.cxx \ puAuxVerticalMenu.cxx INCLUDES = -I$(top_srcdir)/src/sg \ -I$(top_srcdir)/src/pui \ -I$(top_srcdir)/src/fnt \ -I$(top_srcdir)/src/util endif EXTRA_DIST = puAux.dsp --- NEW FILE: puAux.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net $Id: puAux.cxx,v 1.1 2004/02/28 00:54:03 sjbaker Exp $ */ #include "puAux.h" void puaInit () { /* Nothing to see here - move along. */ } --- NEW FILE: puAux.h --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...744 lines suppressed...] // Accessors and mutators void getRotation ( sgQuat q ) const { memcpy ( q, rotation, 4 * sizeof(sgFloat) ) ; } void setRotation ( sgQuat q ) { memcpy ( rotation, q, 4 * sizeof(sgFloat) ) ; } void getTranslation ( sgVec3 t ) const { memcpy ( t, translation, 3 * sizeof(sgFloat) ) ; } void setTranslation ( sgVec3 t ) { memcpy ( translation, t, 3 * sizeof(sgFloat) ) ; } float getPointSize () const { return point_size ; } void setPointSize ( float p ) { point_size = p ; } int getTriggerButton () const { return trigger_button ; } void setTriggerButton ( int b ) { trigger_button = b ; } float getTranslationSensitivity () const { return translation_sensitivity ; } void setTranslationSensitivity ( float t ) { translation_sensitivity = t ; } } ; #endif --- NEW FILE: puAuxBiSlider.cxx --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. Copyright (C) 1998,2002,2004 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA [...131 lines suppressed...] break ; case PUSLIDER_DELTA :/* Deprecated! */ if ( fabs ( last_cb_value - next_value ) >= cb_delta ) { last_cb_value = next_value ; puSetActiveWidget ( this, x, y ) ; invokeCallback () ; } break ; case PUSLIDER_ALWAYS : default : last_cb_value = next_value ; puSetActiveWidget ( this, x, y ) ; invokeCallback () ; break ; } } } --- NEW FILE: puAuxBiSliderWithEnds.cxx --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. Copyright (C) 1998,2002,2004 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA [...61 lines suppressed...] void puaBiSliderWithEnds::draw ( int dx, int dy ) { if ( !visible || ( window != puGetWindow () ) ) return ; draw_label ( dx, dy ) ; puGroup::draw ( dx, dy ) ; } int puaBiSliderWithEnds::checkKey ( int key, int updown ) { if ( ! isVisible () || ! isActive () || ( window != puGetWindow () ) ) return FALSE ; return ( max_box->checkKey ( key, updown ) + min_box->checkKey ( key, updown ) ) ; } --- NEW FILE: puAuxComboBox.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...231 lines suppressed...] /* Share 'string' value with input box */ input -> getValue ( &stringval ) ; setValuator ( stringval ) ; arrow_btn = new puArrowButton ( maxx-minx - arrow_width, 0, maxx-minx, maxy-miny, PUARROW_DOWN ) ; arrow_btn -> setStyle ( PUSTYLE_SMALL_SHADED ) ; arrow_btn -> setUserData ( this ) ; arrow_btn -> setCallback ( handle_arrow ) ; popup_menu = new puPopupMenu ( 0, 0 ) ; popup_menu -> close () ; close () ; newList ( entries ) ; } --- NEW FILE: puAuxCompass.cxx --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. Copyright (C) 1998,2002,2004 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA [...615 lines suppressed...] translation[1] += translation_sensitivity * displacement[1] ; translation[2] += translation_sensitivity * displacement[2] ; break ; case PUACOMPASS_TRANSLATE_Z_X : translation[2] += translation_sensitivity * displacement[2] ; translation[0] += translation_sensitivity * displacement[0] ; break ; } mouse_x = xm * size / new_size ; mouse_y = ym * size / new_size ; mouse_z = zm * size / new_size ; // if ( rot[0] < 1.5 ) // { // sgPostMultQuat ( rotation, rot ) ; // prev_angle += angle ; // printf ( "Rotation %f %f %f %f %f\n", prev_angle, rotation[SG_W], rotation[SG_X], rotation[SG_Y], rotation[SG_Z] ) ; // } } } --- NEW FILE: puAuxFileSelector.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...653 lines suppressed...] } else { files[ ifile ] = new char[ name_len + 1 ] ; memcpy ( files [ ifile ], dp->d_name, name_len + 1 ) ; /* Plus one to include the final '\0' */ } ifile++ ; } } files [ ifile ] = NULL ; ulCloseDir ( dirp ) ; puaFileSelectorSort( files, dflag, num_files ) ; list_box -> newList ( files ) ; } --- NEW FILE: puAuxLargeInput.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...1231 lines suppressed...] of string fits in area (space_ptr == NULL). */ { wrapped_text_wp += strlen (wrapped_text_wp) ; if ( space_ptr != NULL ) /* Advance past the NULL since there's more string left */ wrapped_text_wp += 1 ; } else { if ( space_ptr != NULL ) *space_ptr = ' ' ; *old_space_ptr = '\n' ; wrapped_text_wp = old_space_ptr + 1 ; } } } --- NEW FILE: puAuxScrollBar.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...192 lines suppressed...] case PUSLIDER_DELTA : /* Deprecated! */ if ( fabs ( last_cb_value - next_value ) >= cb_delta ) { last_cb_value = next_value ; puSetActiveWidget ( this, x, y ) ; invokeCallback () ; } break ; case PUSLIDER_ALWAYS : default : last_cb_value = next_value ; puSetActiveWidget ( this, x, y ) ; invokeCallback () ; break ; } } } --- NEW FILE: puAuxSelectBox.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...147 lines suppressed...] down_arrow = new puArrowButton ( maxx-minx - arrow_size, 0, maxx-minx, arrow_size, PUARROW_DOWN ) ; down_arrow -> setStyle ( PUSTYLE_SMALL_SHADED ) ; down_arrow -> setUserData ( this ) ; down_arrow -> setCallback ( handle_arrow ) ; up_arrow = new puArrowButton ( maxx-minx - arrow_size, arrow_size, maxx-minx, maxy-miny, PUARROW_UP ) ; up_arrow -> setStyle ( PUSTYLE_SMALL_SHADED ) ; up_arrow -> setUserData ( this ) ; up_arrow -> setCallback ( handle_arrow ) ; newList ( entries ) ; close () ; } --- NEW FILE: puAuxSliderWithInput.cxx --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. Copyright (C) 1998,2002,2004 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net $Id: puAuxSliderWithInput.cxx,v 1.1 2004/02/28 00:54:03 sjbaker Exp $ */ #include "puAux.h" UL_RTTI_DEF1(puaSliderWithInput,puGroup) void puaSliderWithInput::handle_slider ( puObject *obj ) { puaSliderWithInput *sl = (puaSliderWithInput *)obj->getUserData () ; sl->setValue ( obj->getFloatValue () ) ; sl->__setInputBox ( obj->getFloatValue () ) ; sl->invokeCallback () ; } void puaSliderWithInput::handle_input ( puObject *obj ) { puaSliderWithInput *sl = (puaSliderWithInput *)obj->getUserData () ; sl->setValue ( obj->getFloatValue () ) ; sl->invokeCallback () ; } puaSliderWithInput::puaSliderWithInput ( int minx, int miny, int maxx, int maxy, int above ) : puGroup ( minx, miny ) { type |= PUCLASS_SLIDERWITHINPUT ; slider = new puSlider ( (maxx - minx)/2-10, above ? 0 : 20, maxy-miny-20, TRUE ) ; input_box = new puInput ( 0, above ? maxy - miny - 20 : 0, maxx-minx, above ? maxy - miny : 20 ) ; input_box->setValue ( 0 ) ; slider->setUserData ( this ) ; slider->setCallback ( handle_slider ) ; input_box->setUserData ( this ) ; input_box->setCallback ( handle_input ) ; close () ; input_position = above ; } void puaSliderWithInput::setSize ( int w, int h ) { slider->setSize ( 20, h-40 ) ; slider->setPosition ( w/2-10, input_position ? 0 : 20 ) ; input_box->setSize ( w, 20 ) ; input_box->setPosition ( 0, input_position ? h-20 : 0 ) ; } void puaSliderWithInput::draw ( int dx, int dy ) { if ( !visible || ( window != puGetWindow () ) ) return ; draw_label ( dx, dy ) ; puGroup::draw ( dx, dy ) ; } int puaSliderWithInput::checkKey ( int key, int updown ) { if ( ! isVisible () || ! isActive () || ( window != puGetWindow () ) ) return FALSE ; return ( input_box->checkKey ( key, updown ) ) ; } --- NEW FILE: puAuxSpinBox.cxx --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. Copyright (C) 1998,2002,2004 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net $Id: puAuxSpinBox.cxx,v 1.1 2004/02/28 00:54:03 sjbaker Exp $ */ #include "puAux.h" UL_RTTI_DEF2(puaSpinBox,puRange,puGroup) puaSpinBox::puaSpinBox ( int minx, int miny, int maxx, int maxy, int arrow_pos ) : puRange ( 1.0f, 10.0f, 1.0f ), puGroup ( minx, miny ) { extern void puaSpinBox_handle_input ( puObject* ob ) ; extern void puaSpinBox_handle_input_active ( puObject* ob ) ; extern void puaSpinBox_handle_arrow ( puObject* ob ) ; type |= PUCLASS_SPINBOX ; arrow_position = arrow_pos ; int arrow_size = ( maxy - miny ) / 2 ; if ( arrow_pos == 1 ) input_box = new puInput ( 0, 0, maxx - minx - arrow_size, maxy - miny ) ; else input_box = new puInput ( arrow_size, 0, maxx - minx, maxy - miny ) ; input_box->setCallback ( puaSpinBox_handle_input ) ; input_box->setActiveCallback ( puaSpinBox_handle_input_active ) ; input_box->setDownCallback ( puaSpinBox_handle_input ) ; input_box->setUserData ( this ) ; up_arrow = new puArrowButton ( arrow_position?maxx-minx-arrow_size:0, arrow_size, arrow_position?maxx-minx:arrow_size, maxy-miny, PUARROW_UP ) ; up_arrow->setCallback ( puaSpinBox_handle_arrow ) ; up_arrow->setUserData ( this ) ; down_arrow = new puArrowButton ( arrow_position?maxx-minx-arrow_size:0, 0, arrow_position?maxx-minx:arrow_size, arrow_size, PUARROW_DOWN ) ; down_arrow->setCallback ( puaSpinBox_handle_arrow ) ; down_arrow->setUserData ( this ) ; close () ; } void puaSpinBox_handle_arrow ( puObject *ob ) { puaSpinBox *master = (puaSpinBox *)(ob->getUserData ()) ; float val = master->getFloatValue () ; if ( ((puArrowButton *)ob)->getArrowType () == PUARROW_UP ) val += master->getStepSize () ; else val -= master->getStepSize () ; if ( val > master->getMaxValue () ) val = master->getMaxValue () ; if ( val < master->getMinValue () ) val = master->getMinValue () ; master->setValue ( val ) ; master->invokeCallback () ; } void puaSpinBox_handle_input ( puObject *ob ) { puaSpinBox *master = (puaSpinBox *)(ob->getUserData ()) ; float val = ob->getFloatValue () ; if ( val > master->getMaxValue () ) val = master->getMaxValue () ; if ( val < master->getMinValue () ) val = master->getMinValue () ; master->setValue ( val ) ; master->invokeCallback () ; } void puaSpinBox_handle_input_active ( puObject *ob ) { puaSpinBox *master = (puaSpinBox *)(ob->getUserData ()) ; float val = ob->getFloatValue () ; if ( val > master->getMaxValue () ) val = master->getMaxValue () ; if ( val < master->getMinValue () ) val = master->getMinValue () ; master->setValue ( val ) ; master->invokeActiveCallback () ; } --- NEW FILE: puAuxTriSlider.cxx --- /* PUI Auxiliary Widget Library Derived from PLIB, the Portable Game Library by Steve Baker. Copyright (C) 1998,2002,2004 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA [...172 lines suppressed...] break ; case PUSLIDER_DELTA :/* Deprecated! */ if ( fabs ( last_cb_value - next_value ) >= cb_delta ) { last_cb_value = next_value ; puSetActiveWidget ( this, x, y ) ; invokeCallback () ; } break ; case PUSLIDER_ALWAYS : default : last_cb_value = next_value ; puSetActiveWidget ( this, x, y ) ; invokeCallback () ; break ; } } } --- NEW FILE: puAuxVerticalMenu.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...134 lines suppressed...] } recalc_bbox () ; // If in its own window (its window number is not the same as its parent's // window number), then resize the window if (window != parent -> getWindow () ) { int temp_window = puGetWindow () ; puSetWindow ( window ) ; puSetWindowSize ( bbox.max[0] - bbox.min[0], bbox.max[1] - bbox.min[1] ) ; setPosition ( 0, 0 ) ; puSetWindow ( temp_window ) ; } } |
From: Steve B. <sj...@us...> - 2004-02-28 01:03:09
|
Update of /cvsroot/plib/plib/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23821/plib/src Modified Files: Makefile.am Log Message: Added puAux library. Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 16 Feb 2004 02:26:27 -0000 1.7 +++ Makefile.am 28 Feb 2004 00:54:03 -0000 1.8 @@ -1 +1 @@ -SUBDIRS = util js sl pui sg ssg fnt ssgAux net psl pw +SUBDIRS = util js sl pui puAux sg ssg fnt ssgAux net psl pw |
From: Steve B. <sj...@us...> - 2004-02-28 01:03:09
|
Update of /cvsroot/plib/plib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23821/plib Modified Files: configure.in Log Message: Added puAux library. Index: configure.in =================================================================== RCS file: /cvsroot/plib/plib/configure.in,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- configure.in 16 Feb 2004 13:49:23 -0000 1.55 +++ configure.in 28 Feb 2004 00:54:02 -0000 1.56 @@ -72,6 +72,10 @@ [ --enable-ssg build SSG library (OpenGL needed) default: yes],, enable_ssg=yes) +AC_ARG_ENABLE(puaux, +[ --enable-puaux build puAux library (OpenGL needed) default: yes],, +enable_puaux=yes) + AC_ARG_ENABLE(ssgaux, [ --enable-ssgaux build ssgAux library (OpenGL needed) default: yes],, enable_ssgaux=yes) @@ -168,6 +172,23 @@ fi fi +if test "x$enable_puaux" = "xyes"; then + need_opengl=yes + + if test "x$enable_pui" = "xno"; then + AC_MSG_WARN([cannot build puAux library without PUI library enabled]) + dependancy_problem=yes + fi + if test "x$enable_sg" = "xno"; then + AC_MSG_WARN([cannot build puAux library without SG library enabled]) + dependancy_problem=yes + fi + if test "x$enable_ul" = "xno"; then + AC_MSG_WARN([cannot build puAux library without UL library enabled]) + dependancy_problem=yes + fi +fi + if test "x$enable_ssgaux" = "xyes"; then need_opengl=yes @@ -195,6 +216,7 @@ AM_CONDITIONAL(BUILD_PW, test "x$enable_pw" = "xyes") AM_CONDITIONAL(BUILD_NET, test "x$enable_net" = "xyes") AM_CONDITIONAL(BUILD_PUI, test "x$enable_pui" = "xyes") +AM_CONDITIONAL(BUILD_PUAUX, test "x$enable_puaux" = "xyes") AM_CONDITIONAL(BUILD_SG, test "x$enable_sg" = "xyes") AM_CONDITIONAL(BUILD_PSL, test "x$enable_psl" = "xyes") AM_CONDITIONAL(BUILD_SL, test "x$enable_sl" = "xyes") @@ -361,6 +383,7 @@ src/js/Makefile \ src/util/Makefile \ src/pui/Makefile \ + src/puAux/Makefile \ src/sg/Makefile \ src/sl/Makefile \ src/psl/Makefile \ @@ -377,6 +400,7 @@ Building JS library: $enable_js Building NET library: $enable_net Building PUI library: $enable_pui + Building puAux library: $enable_puaux Building SG library: $enable_sg Building PSL library: $enable_psl Building SL library: $enable_sl |
From: Steve B. <sj...@us...> - 2004-02-28 00:39:07
|
Update of /cvsroot/plib/plib/src/puAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19915/puAux Log Message: Directory /cvsroot/plib/plib/src/puAux added to the repository |
From: Steve B. <sj...@us...> - 2004-02-25 15:46:52
|
Update of /cvsroot/plib/plib/src/ssgAux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13982/plib/src/ssgAux Modified Files: ssgaBillboards.cxx Log Message: Fixed some compilation problems for AIX (and added UL_AIX). Fixed some warnings in ssgLoadMDL.cxx Index: ssgaBillboards.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaBillboards.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ssgaBillboards.cxx 21 Jan 2004 22:33:46 -0000 1.3 +++ ssgaBillboards.cxx 25 Feb 2004 15:39:34 -0000 1.4 @@ -22,6 +22,7 @@ */ +#include <math.h> #include "ssgaBillboards.h" @@ -244,7 +245,7 @@ // fast path when Z is up - float wx, wy, hz, len; + float wx, wy, heightz, len; wx = z_axis[1]; wy = -z_axis[0]; @@ -254,7 +255,7 @@ wx *= 0.5f * width / len; wy *= 0.5f * width / len; - hz = height; + heightz = height; for (int i = 0; i < n; i++) { float x, y, z, s, dx, dy; @@ -273,7 +274,7 @@ glTexCoord2f(1, 0); glVertex3f(x + dx, y + dy, z); - z += s * hz; + z += s * heightz; glTexCoord2f(1, 1); glVertex3f(x + dx, y + dy, z); @@ -292,15 +293,15 @@ float len = sgLengthVec3(xy); if (len > 1e-6f) { - float wx, wy, wz, hx, hy, hz; + float wx, wy, wz, heightx, heighty, heightz; wx = 0.5f * width * xy[0] / len; wy = 0.5f * width * xy[1] / len; wz = 0.5f * width * xy[2] / len; - hx = height * up[0]; - hy = height * up[1]; - hz = height * up[2]; + heightx = height * up[0]; + heighty = height * up[1]; + heightz = height * up[2]; for (int i = 0; i < n; i++) { float x, y, z, s, dx, dy, dz; @@ -320,9 +321,9 @@ glTexCoord2f(1, 0); glVertex3f(x + dx, y + dy, z + dz); - x += s * hx; - y += s * hy; - z += s * hz; + x += s * heightx; + y += s * heighty; + z += s * heightz; glTexCoord2f(1, 1); glVertex3f(x + dx, y + dy, z + dz); |
From: Steve B. <sj...@us...> - 2004-02-25 15:46:51
|
Update of /cvsroot/plib/plib/src/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13982/plib/src/util Modified Files: ul.h Log Message: Fixed some compilation problems for AIX (and added UL_AIX). Fixed some warnings in ssgLoadMDL.cxx Index: ul.h =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- ul.h 16 Feb 2004 02:26:29 -0000 1.62 +++ ul.h 25 Feb 2004 15:39:34 -0000 1.63 @@ -80,6 +80,10 @@ #define UL_IRIX 1 +#elif defined(_AIX) + +#define UL_AIX 1 + #elif defined(SOLARIS) || defined(sun) #define UL_SOLARIS 1 @@ -126,7 +130,7 @@ #define UL_CGL 1 #endif -#if defined(UL_LINUX) || defined(UL_BSD) || defined(UL_IRIX) || defined(UL_SOLARIS) +#if defined(UL_LINUX) || defined(UL_BSD) || defined(UL_IRIX) || defined(UL_SOLARIS) || defined(UL_AIX) #include <unistd.h> #include <dlfcn.h> #include <fcntl.h> |
From: Steve B. <sj...@us...> - 2004-02-25 15:46:51
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13982/plib/src/ssg Modified Files: ssgLoadMDL.cxx Log Message: Fixed some compilation problems for AIX (and added UL_AIX). Fixed some warnings in ssgLoadMDL.cxx Index: ssgLoadMDL.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadMDL.cxx,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- ssgLoadMDL.cxx 11 Jan 2004 23:14:38 -0000 1.52 +++ ssgLoadMDL.cxx 25 Feb 2004 15:39:33 -0000 1.53 @@ -1439,10 +1439,14 @@ case 0xB3: //ifinf(1) { - long offset = ulEndianReadLittle32(fp); - unsigned short v = ulEndianReadLittle16(fp); - float low = ulEndianReadLittleFloat(fp); - float high = ulEndianReadLittleFloat(fp); + // long offset = ulEndianReadLittle32(fp); + // unsigned short v = ulEndianReadLittle16(fp); + // float low = ulEndianReadLittleFloat(fp); + // float high = ulEndianReadLittleFloat(fp); + ulEndianReadLittle32(fp); + ulEndianReadLittle16(fp); + ulEndianReadLittleFloat(fp); + ulEndianReadLittleFloat(fp); } break; @@ -1539,7 +1543,8 @@ //assert(curr_part_->getState()->getTexture() != NULL); int base = ulEndianReadLittle16(fp); - int vertexcount = ulEndianReadLittle16(fp); // seems to say how many vertices are used in this part + // int vertexcount = ulEndianReadLittle16(fp); + ulEndianReadLittle16(fp); int wkcount = ulEndianReadLittle16(fp); wkcount = wkcount / 3; // tri assert(wkcount>0); @@ -1574,8 +1579,11 @@ case 0xBA: //, DrawLineList, anaDrawLineList, 0 ) { - int base = ulEndianReadLittle16(fp); - int dummycount = ulEndianReadLittle16(fp); + // int base = ulEndianReadLittle16(fp); + // int dummycount = ulEndianReadLittle16(fp); + ulEndianReadLittle16(fp); + ulEndianReadLittle16(fp); + int wkcount = ulEndianReadLittle16(fp); wkcount = wkcount / 2; fseek(fp, 2*2*wkcount, SEEK_CUR); @@ -1584,8 +1592,11 @@ case 0xBB: //, DrawPointList, anaDrawPointList, 0 ) { - int base = ulEndianReadLittle16(fp); - int dummycount = ulEndianReadLittle16(fp); + // int base = ulEndianReadLittle16(fp); + // int dummycount = ulEndianReadLittle16(fp); + ulEndianReadLittle16(fp); + ulEndianReadLittle16(fp); + int wkcount = ulEndianReadLittle16(fp); wkcount = wkcount / 1; fseek(fp, 2*1*wkcount, SEEK_CUR); @@ -1594,8 +1605,8 @@ case 0xBC: // BGL_BEGIN / BGLVersion { - //DEBUGPRINT( "BGL_CASE\n" ); - long v = ulEndianReadLittle32(fp); + // long v = ulEndianReadLittle32(fp); + ulEndianReadLittle32(fp); PRINT_STRUCTURE("BGLVersion %lx\n", v) } |
From: Steve B. <sj...@us...> - 2004-02-25 15:46:51
|
Update of /cvsroot/plib/plib/src/sl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13982/plib/src/sl Modified Files: sl.h Log Message: Fixed some compilation problems for AIX (and added UL_AIX). Fixed some warnings in ssgLoadMDL.cxx Index: sl.h =================================================================== RCS file: /cvsroot/plib/plib/src/sl/sl.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- sl.h 18 May 2003 13:45:04 -0000 1.23 +++ sl.h 25 Feb 2004 15:39:33 -0000 1.24 @@ -35,6 +35,8 @@ #define SLDSP_DEFAULT_DEVICE "/dev/audio" #elif defined(UL_IRIX) #define SLDSP_DEFAULT_DEVICE "dsp" // dummy ... +#elif defined(UL_AIX) +#define SLDSP_DEFAULT_DEVICE "dsp" // dummy ... #elif defined(UL_SOLARIS) #define SLDSP_DEFAULT_DEVICE "/dev/audio" #elif defined(UL_HPUX) |
From: M?rten Str?m. <str...@us...> - 2004-02-25 11:08:38
|
Update of /cvsroot/plib/plib/examples/src/pui/fltk_demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23110 Added Files: Makefile gui.fl main.cxx puf.cxx puf.h Log Message: fltk_demo initial checkin --- NEW FILE: Makefile --- # -*-Makefile-*- $Id: Makefile,v 1.1 2004/02/25 11:01:30 stromberg Exp $ CXXFLAGS = $(shell fltk-config --use-gl --cxxflags) -Wall -O2 -DPU_USE_FLTK LDFLAGS = $(shell fltk-config --use-gl --ldflags) -lplibpu -lplibfnt -lplibul OBJS = main.o gui.o puf.o fltk_demo: $(OBJS) g++ $(OBJS) $(LDFLAGS) -o $@ clean: rm -f gui.{h,cxx} *.o *~ %.o: %.cxx g++ $(CXXFLAGS) -c $< %.h %.cxx: %.fl fluid -c $< main.o gui.o: gui.h puf.h puf.o: puf.h --- NEW FILE: gui.fl --- # data file for the Fltk User Interface Designer (fluid) version 1.0104 header_name {.h} code_name {.cxx} Function {make_window()} {open } { Fl_Window main_window { label {fluid window} open xywh {544 347 265 285} type Double hide } { Fl_Box gl_area {selected xywh {15 50 235 180} labelsize 12 align 1 code0 {\#include "puf.h"} class Puf_Window } Fl_Menu_Bar {} {open xywh {0 0 265 20} labelsize 12 textsize 12 } { submenu {} { label File open xywh {0 0 100 20} labelsize 12 } { menuitem {} { label Quit callback {exit(0);} xywh {0 0 100 20} labelsize 12 code0 {\#include <stdlib.h>} } } submenu {} { label Edit open xywh {0 0 100 20} labelsize 12 } {} submenu {} { label View open xywh {15 15 100 20} labelsize 12 } {} } Fl_Box {} { label {OpenGL Area} xywh {15 30 235 20} labelfont 1 labelsize 12 } Fl_Button toggle_other { label {Show / Hide} xywh {70 250 120 25} labelsize 12 } } } --- NEW FILE: main.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 Steve Baker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...104 lines suppressed...] make_window()->show(); window2 = gl_area; init_pui(); toggle_other->callback(toggle_fl); Fl::add_timeout(3.0, refresh); return Fl::run(); } /* Local Variables: mode: C++ c-basic-offset: 4 c-file-offsets: ((substatement-open 0) (case-label 0)) End: */ --- NEW FILE: puf.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 Steve Baker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net [...147 lines suppressed...] glBegin(GL_LINE_LOOP); glVertex2f(x0, y0); glVertex2f(x1, y0); glVertex2f(x1, y1); glVertex2f(x0, y1); glEnd(); #endif puDisplay(); } /* Local Variables: mode: C++ c-basic-offset: 4 c-file-offsets: ((substatement-open 0) (case-label 0)) End: */ --- NEW FILE: puf.h --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 Steve Baker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net $Id: puf.h,v 1.1 2004/02/25 11:01:31 stromberg Exp $ */ #ifndef puf_h #define puf_h #include <FL/Fl_Gl_Window.H> // Functions for passing FLTK events to PUI int puf_translate_key(int key_code); int puf_handle_event(Fl_Gl_Window *, int event); // An FLTK window class for simple PUI integration class Puf_Window : public Fl_Gl_Window { protected: virtual int handle(int); virtual void draw(); public: Puf_Window(int X, int Y, int W, int H, const char *L = 0) : Fl_Gl_Window(X, Y, W, H, L) {} Puf_Window(int W, int H, const char *L = 0) : Fl_Gl_Window(W, H, L) {} }; #endif /* Local Variables: mode: C++ c-basic-offset: 4 c-file-offsets: ((substatement-open 0) (case-label 0)) End: */ |
From: M?rten Str?m. <str...@us...> - 2004-02-25 11:07:49
|
Update of /cvsroot/plib/plib/examples/src/pui/fltk_demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22961/fltk_demo Log Message: Directory /cvsroot/plib/plib/examples/src/pui/fltk_demo added to the repository |
From: Steve B. <sj...@us...> - 2004-02-24 02:41:50
|
Update of /cvsroot/plib/plib/examples/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24540/plib/examples/src/pui Modified Files: complex.cxx Log Message: Fixed problem with complex.cxx crashing when run with freeglut. Index: complex.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pui/complex.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- complex.cxx 1 Sep 2002 12:04:51 -0000 1.22 +++ complex.cxx 24 Feb 2004 02:35:44 -0000 1.23 @@ -391,7 +391,8 @@ static void savereshapefn ( int w, int h ) { - file_selector->setSize ( w, h ) ; + if ( file_selector ) + file_selector->setSize ( w, h ) ; } static void coordreshapefn ( int w, int h ) |
From: Steve B. <sj...@us...> - 2004-02-24 02:34:24
|
Update of /cvsroot/plib/plib/examples/src/pui/sdl_example In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23399/plib/examples/src/pui/sdl_example Added Files: Demo.cxx Demo.h EventLoopSDL.cxx EventLoopSDL.h Makefile mainSDL.cxx Log Message: Added an example program for using PLIB in SDL. --- NEW FILE: Demo.cxx --- #include <stdio.h> #include <GL/gl.h> #include <plib/pu.h> #include "Demo.h" static puInput* input = NULL; static void on_quit(puObject*) { exit(0); } static void on_say_hello(puObject*) { printf("Hello World!\n"); } static void on_print_text(puObject*) { printf("Input text: %s\n", input->getStringValue()); } void initPUI() { puInit(); puSetDefaultStyle(PUSTYLE_SMALL_BEVELLED); puSetDefaultColourScheme(0.75f, 0.75f, 0.75f, 1.0f); } void createInterface() { // menu bar puMenuBar* menu = new puMenuBar(); char* menu_text[] = { "Quit", "----", "Say Hello", "Print text", NULL }; puCallback menu_cb[] = { on_quit, NULL, on_say_hello, on_print_text, NULL }; menu->add_submenu("Demo", menu_text, menu_cb); menu->close(); // input and buttons puButton* button; button = new puOneShot(100, 200, 220, 225); button->setLegend("Quit"); button->setCallback(on_quit); button = new puOneShot(100, 250, 220, 275); button->setLegend("Say Hello"); button->setCallback(on_say_hello); button = new puOneShot(100, 300, 220, 325); button->setLegend("Print text"); button->setCallback(on_print_text); input = new puInput(250, 300, 450, 325); } --- NEW FILE: Demo.h --- #ifndef DEMO_H #define DEMO_H void initPUI(); void createInterface(); #endif --- NEW FILE: EventLoopSDL.cxx --- #include <GL/gl.h> #include <SDL/SDL_keysym.h> #include <plib/pu.h> #include "EventLoopSDL.h" static bool stop_requested; void EventLoopSDL::run() { SDL_Event event; stop_requested = false; while (!stop_requested) { // process events [...141 lines suppressed...] int EventLoopSDL::onMouseDown(int btn, int x, int y) { return puMouse(translateMouse(btn), PU_DOWN, x, y); } int EventLoopSDL::onMouseUp(int btn, int x, int y) { return puMouse(translateMouse(btn), PU_UP, x, y); } int EventLoopSDL::onKeyDown(const SDL_keysym& keysym) { return puKeyboard(translateKey(keysym), PU_DOWN); } int EventLoopSDL::onKeyUp(const SDL_keysym& keysym) { return puKeyboard(translateKey(keysym), PU_UP); } --- NEW FILE: EventLoopSDL.h --- #ifndef EVENTLOOPSDL_H #define EVENTLOOPSDL_H class EventLoopSDL { public: // starts the main loop static void run(); // requests main loop termination static void stop(); // draw one frame static void draw(); // translates an SDL keysym to the PUI equivalent static int translateKey(const SDL_keysym& keysym); // translates an SDL mouse button to the PUI equivalent static int translateMouse(int btn); // event handlers static int onMouseMove(char state, int x, int y); static int onMouseDown(int btn, int x, int y); static int onMouseUp(int btn, int x, int y); static int onKeyDown(const SDL_keysym& keysym); static int onKeyUp(const SDL_keysym& keysym); }; #endif --- NEW FILE: Makefile --- SDL_LDFLAGS := $(shell sdl-config --libs) OGL_LDFLAGS := -lGL -lGLU PUI_LDFLAGS := -lplibpu -lplibfnt -lplibsg -lplibul LDFLAGS := $(OGL_LDFLAGS) $(SDL_LDFLAGS) $(PUI_LDFLAGS) -lm SDL_CFLAGS := $(shell sdl-config --cflags) PUI_CFLAGS := -DPU_USE_SDL CXXFLAGS := -Wall -g $(SDL_CFLAGS) $(PUI_CFLAGS) CXX := g++ OBJECT := mainSDL.o EventLoopSDL.o Demo.o %.o : %.cxx $(CXX) $(CXXFLAGS) -c $< sdl_example: $(OBJECT) $(CXX) -o $@ $+ $(LDFLAGS) .PHONY: clean depend clean: rm -f *.o sdl_example depend: makedepend -Y *.cxx >/dev/null 2>&1 # Do 'make depend' to regenerate dependencies. # DO NOT DELETE Demo.o: Demo.h EventLoopSDL.o: EventLoopSDL.h mainSDL.o: Demo.h EventLoopSDL.h --- NEW FILE: mainSDL.cxx --- #include <stdlib.h> #include <plib/pu.h> #include "SDL.h" #include "Demo.h" #include "EventLoopSDL.h" // default window size static const int WIDTH = 640; static const int HEIGHT = 480; static void initSDL(int w, int h, const char *title) { if (SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError()); exit(1); } atexit(SDL_Quit); if (SDL_SetVideoMode(w, h, 0, SDL_OPENGL | SDL_ANYFORMAT/* | SDL_FULLSCREEN*/) == NULL) { fprintf(stderr, "Unable to create OpenGL screen: %s\n", SDL_GetError()); exit(1); } if (title) SDL_WM_SetCaption(title, NULL); SDL_EnableKeyRepeat(150, 75); SDL_EnableUNICODE(true); } void initOGL(int w, int h) { glViewport(0, 0, w, h); glClearColor(0.1f, 0.4f, 0.1f, 1.0f); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glAlphaFunc(GL_GREATER, 0.1f); } int main(int argc, char *argv[]) { initSDL(WIDTH, HEIGHT, "PUI with SDL sample"); initOGL(WIDTH, HEIGHT); initPUI(); createInterface(); EventLoopSDL::run(); return 0; } |
From: Steve B. <sj...@us...> - 2004-02-24 02:30:52
|
Update of /cvsroot/plib/plib/examples/src/pui/sdl_example In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22837/sdl_example Log Message: Directory /cvsroot/plib/plib/examples/src/pui/sdl_example added to the repository |
From: Steve B. <sj...@us...> - 2004-02-24 02:16:44
|
Update of /cvsroot/plib/plib/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20388/plib/src/pw Modified Files: pwWindows.cxx pwX11.cxx Log Message: Oops! Left the clear-screen stuff in the wrong place. Index: pwWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwWindows.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- pwWindows.cxx 24 Feb 2004 02:06:03 -0000 1.4 +++ pwWindows.cxx 24 Feb 2004 02:10:40 -0000 1.5 @@ -149,11 +149,6 @@ mpCB = mp ; resizeCB = rcb ; exitCB = ecb ? ecb : defaultExitFunc ; - - glClear ( GL_COLOR_BUFFER_BIT ) ; - pwSwapBuffers () ; - glClear ( GL_COLOR_BUFFER_BIT ) ; - pwSwapBuffers () ; } @@ -291,6 +286,11 @@ resizeCB = NULL ; exitCB = defaultExitFunc ; initialised = 1 ; + + glClear ( GL_COLOR_BUFFER_BIT ) ; + pwSwapBuffers () ; + glClear ( GL_COLOR_BUFFER_BIT ) ; + pwSwapBuffers () ; } Index: pwX11.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwX11.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- pwX11.cxx 24 Feb 2004 02:06:03 -0000 1.4 +++ pwX11.cxx 24 Feb 2004 02:10:40 -0000 1.5 @@ -194,11 +194,6 @@ mpCB = mp ; resizeCB = rcb ; exitCB = ecb ? ecb : defaultExitFunc ; - - glClear ( GL_COLOR_BUFFER_BIT ) ; - pwSwapBuffers () ; - glClear ( GL_COLOR_BUFFER_BIT ) ; - pwSwapBuffers () ; } @@ -361,6 +356,11 @@ exitCB = defaultExitFunc ; initialised = 1 ; + + glClear ( GL_COLOR_BUFFER_BIT ) ; + pwSwapBuffers () ; + glClear ( GL_COLOR_BUFFER_BIT ) ; + pwSwapBuffers () ; } |
From: Steve B. <sj...@us...> - 2004-02-24 02:12:07
|
Update of /cvsroot/plib/plib/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19578/plib/src/pw Modified Files: pw.h pwMacOSX.cxx pwWindows.cxx pwX11.cxx Log Message: Changed pwOpenWindow to pwSetCallbacks Index: pw.h =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pw.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pw.h 24 Feb 2004 01:52:06 -0000 1.3 +++ pw.h 24 Feb 2004 02:06:03 -0000 1.4 @@ -15,9 +15,9 @@ int multisample, char *title, int border, int num_samples ) ; -void pwOpenWindow ( pwKeybdFunc *kb = NULL, pwMouseFunc *ms = NULL, - pwMousePosFunc *mp = NULL, pwResizeCB *rcb = NULL, - pwExitCB *ecb = NULL ) ; +void pwSetCallbacks ( pwKeybdFunc *kb = NULL, pwMouseFunc *ms = NULL, + pwMousePosFunc *mp = NULL, pwResizeCB *rcb = NULL, + pwExitCB *ecb = NULL ) ; int pwGetModifiers () ; void pwSwapBuffers () ; Index: pwMacOSX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwMacOSX.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pwMacOSX.cxx 24 Feb 2004 01:55:37 -0000 1.2 +++ pwMacOSX.cxx 24 Feb 2004 02:06:03 -0000 1.3 @@ -13,9 +13,9 @@ exit ( 0 ) ; } -void pwOpenWindow ( pwKeybdFunc *kb, pwMouseFunc *ms, - pwMousePosFunc *mp, pwResizeCB *rcb, - pwExitCB *ecb ) +void pwSetCallbacks ( pwKeybdFunc *kb, pwMouseFunc *ms, + pwMousePosFunc *mp, pwResizeCB *rcb, + pwExitCB *ecb ) { fprintf ( stderr, "PW: ***** NOT IMPLEMENTED FOR OS-X YET!! *****\n" ) ; } Index: pwWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwWindows.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pwWindows.cxx 24 Feb 2004 01:52:06 -0000 1.3 +++ pwWindows.cxx 24 Feb 2004 02:06:03 -0000 1.4 @@ -135,12 +135,12 @@ } -void pwOpenWindow ( pwKeybdFunc *kb, pwMouseFunc *ms, - pwMousePosFunc *mp, pwResizeCB *rcb, pwExitCB *ecb ) +void pwSetCallbacks ( pwKeybdFunc *kb, pwMouseFunc *ms, + pwMousePosFunc *mp, pwResizeCB *rcb, pwExitCB *ecb ) { if ( ! initialised ) { - fprintf ( stderr, "PW: You must not call pwOpenWindow before pwInit.\n" ) ; + fprintf ( stderr, "PW: You must not call pwSetCallbacks before pwInit.\n"); exit ( 1 ) ; } Index: pwX11.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwX11.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pwX11.cxx 24 Feb 2004 01:52:06 -0000 1.3 +++ pwX11.cxx 24 Feb 2004 02:06:03 -0000 1.4 @@ -179,13 +179,13 @@ } -void pwOpenWindow ( pwKeybdFunc *kb, pwMouseFunc *ms, - pwMousePosFunc *mp, pwResizeCB *rcb, - pwExitCB *ecb ) +void pwSetCallbacks ( pwKeybdFunc *kb, pwMouseFunc *ms, + pwMousePosFunc *mp, pwResizeCB *rcb, + pwExitCB *ecb ) { if ( ! initialised ) { - fprintf ( stderr, "PW: You must not call pwOpenWindow before pwInit.\n" ) ; + fprintf ( stderr, "PW: You must not call pwSetCallbacks before pwInit.\n"); exit ( 1 ) ; } |
From: Steve B. <sj...@us...> - 2004-02-24 02:12:06
|
Update of /cvsroot/plib/plib/examples/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19578/plib/examples/src/pw Modified Files: pw_demo.cxx pw_pui.cxx Log Message: Changed pwOpenWindow to pwSetCallbacks Index: pw_demo.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pw/pw_demo.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pw_demo.cxx 24 Feb 2004 01:52:06 -0000 1.3 +++ pw_demo.cxx 24 Feb 2004 02:06:03 -0000 1.4 @@ -55,7 +55,7 @@ { pwInit ( 100, 100, 640, 480, false, "PLIB Window Demo", true, 0 ) ; - pwOpenWindow ( kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; + pwSetCallbacks ( kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; while ( 1 ) { Index: pw_pui.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pw/pw_pui.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pw_pui.cxx 24 Feb 2004 01:52:06 -0000 1.3 +++ pw_pui.cxx 24 Feb 2004 02:06:03 -0000 1.4 @@ -60,7 +60,7 @@ b -> setLegend ( "Say Hello" ) ; b -> setCallback ( button_cb ) ; - pwOpenWindow ( kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; + pwSetCallbacks ( kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; while ( 1 ) { glClearColor ( 0.5, 0.1, 0.1, 1.0 ) ; |
From: Steve B. <sj...@us...> - 2004-02-24 02:12:06
|
Update of /cvsroot/plib/plib/doc/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19578/plib/doc/pw Modified Files: index.html Log Message: Changed pwOpenWindow to pwSetCallbacks Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/doc/pw/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.html 24 Feb 2004 01:52:06 -0000 1.2 +++ index.html 24 Feb 2004 02:06:03 -0000 1.3 @@ -65,9 +65,9 @@ is complete, call this function: <pre> -void pwOpenWindow ( pwKeybdFunc *kb = NULL, pwMouseFunc *ms = NULL, - pwMousePosFunc *mp = NULL, pwResizeCB *rcb = NULL, - pwExitCB *ecb = NULL ) ; +void pwCallbacks ( pwKeybdFunc *kb = NULL, pwMouseFunc *ms = NULL, + pwMousePosFunc *mp = NULL, pwResizeCB *rcb = NULL, + pwExitCB *ecb = NULL ) ; </pre> These parameters are callback functions for (repectively) @@ -79,9 +79,8 @@ occurs after the window has been successfully opened. <p> Your application has to be prepared for these callbacks to be invoked -at any time after pwOpenWindow. PW doesn't guarantee that the window -won't be opened before pwOpenWindow - but the window will certainly -be opened after it returns. +at any time after pwCallbacks. PW allows you to issue OpenGL calls +any time after pwInit(). <p> The specifications of these various callbacks are: <pre> |
From: Steve B. <sj...@us...> - 2004-02-24 02:01:55
|
Update of /cvsroot/plib/plib/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17565/plib/src/pw Modified Files: pwMacOSX.cxx Log Message: Updated stubs for Mac OSX. Index: pwMacOSX.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwMacOSX.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pwMacOSX.cxx 16 Feb 2004 02:26:28 -0000 1.1 +++ pwMacOSX.cxx 24 Feb 2004 01:55:37 -0000 1.2 @@ -13,11 +13,14 @@ exit ( 0 ) ; } +void pwOpenWindow ( pwKeybdFunc *kb, pwMouseFunc *ms, + pwMousePosFunc *mp, pwResizeCB *rcb, + pwExitCB *ecb ) +{ + fprintf ( stderr, "PW: ***** NOT IMPLEMENTED FOR OS-X YET!! *****\n" ) ; +} - -void pwInit ( int multisample, int num_samples, - pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, - pwResizeCB *rcb, pwExitCB *ecb ) +void pwInit ( int multisample, int num_samples ) ; { /* Open a full-screen window here please. */ fprintf ( stderr, "PW: ***** NOT IMPLEMENTED FOR OS-X YET!! *****\n" ) ; @@ -25,9 +28,7 @@ void pwInit ( int x, int y, int w, int h, int multisample, - char *title, int border, int num_samples, - pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, - pwResizeCB *rcb, pwExitCB *ecb ) + char *title, int border, int num_samples ) { /* Open a regular window here please. */ fprintf ( stderr, "PW: ***** NOT IMPLEMENTED FOR OS-X YET!! *****\n" ) ; |
From: Steve B. <sj...@us...> - 2004-02-24 01:58:10
|
Update of /cvsroot/plib/plib/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16914/plib/src/pw Modified Files: pw.h pwWindows.cxx pwX11.cxx Log Message: Added pwOpenWindow to avoid some nasty race conditions. Index: pw.h =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pw.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pw.h 17 Feb 2004 01:43:21 -0000 1.2 +++ pw.h 24 Feb 2004 01:52:06 -0000 1.3 @@ -9,16 +9,15 @@ typedef void pwMouseFunc ( int key, int updown, int x, int y ) ; typedef void pwMousePosFunc ( int x, int y ) ; -void pwInit ( int multisample, int num_samples, - pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, - pwResizeCB *rcb = NULL, pwExitCB *ecb = NULL ) ; +void pwInit ( int multisample, int num_samples ) ; void pwInit ( int x, int y, int w, int h, int multisample, - char *title, int border, int num_samples, - pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, - pwResizeCB *rcb = NULL, pwExitCB *ecb = NULL ) ; + char *title, int border, int num_samples ) ; +void pwOpenWindow ( pwKeybdFunc *kb = NULL, pwMouseFunc *ms = NULL, + pwMousePosFunc *mp = NULL, pwResizeCB *rcb = NULL, + pwExitCB *ecb = NULL ) ; int pwGetModifiers () ; void pwSwapBuffers () ; Index: pwWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwWindows.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pwWindows.cxx 23 Feb 2004 11:43:36 -0000 1.2 +++ pwWindows.cxx 24 Feb 2004 01:52:06 -0000 1.3 @@ -11,6 +11,8 @@ #include "pw.h" +static int initialised = 0 ; + static int origin [2] = { 0, 0 } ; static int size [2] = { 640, 480 } ; @@ -133,19 +135,36 @@ } -void pwInit ( int multisample, int num_samples, - pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, - pwResizeCB *rcb, pwExitCB *ecb ) +void pwOpenWindow ( pwKeybdFunc *kb, pwMouseFunc *ms, + pwMousePosFunc *mp, pwResizeCB *rcb, pwExitCB *ecb ) +{ + if ( ! initialised ) + { + fprintf ( stderr, "PW: You must not call pwOpenWindow before pwInit.\n" ) ; + exit ( 1 ) ; + } + + kbCB = kb ; + msCB = ms ; + mpCB = mp ; + resizeCB = rcb ; + exitCB = ecb ? ecb : defaultExitFunc ; + + glClear ( GL_COLOR_BUFFER_BIT ) ; + pwSwapBuffers () ; + glClear ( GL_COLOR_BUFFER_BIT ) ; + pwSwapBuffers () ; +} + + +void pwInit ( int multisample, int num_samples ) { pwInit ( 0, 0, -1, -1, multisample, "NoName", FALSE, num_samples, - kb, ms, mp, rcb, ecb ) ; } void pwInit ( int x, int y, int w, int h, int multisample, - char *title, int border, int num_samples, - pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, - pwResizeCB *rcb, pwExitCB *ecb ) + char *title, int border, int num_samples ) { currInstance = GetModuleHandleA( NULL ) ; @@ -266,16 +285,12 @@ exit ( 1 ) ; } - kbCB = kb ; - msCB = ms ; - mpCB = mp ; - resizeCB = rcb ; - exitCB = ecb ? ecb : defaultExitFunc ; - - glClear ( GL_COLOR_BUFFER_BIT ) ; - pwSwapBuffers () ; - glClear ( GL_COLOR_BUFFER_BIT ) ; - pwSwapBuffers () ; + kbCB = NULL ; + msCB = NULL ; + mpCB = NULL ; + resizeCB = NULL ; + exitCB = defaultExitFunc ; + initialised = 1 ; } Index: pwX11.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwX11.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pwX11.cxx 18 Feb 2004 00:28:58 -0000 1.2 +++ pwX11.cxx 24 Feb 2004 01:52:06 -0000 1.3 @@ -74,13 +74,13 @@ #endif - -static int modifiers = 0 ; -static int origin [2] = { 0, 0 } ; -static int size [2] = { 640, 480 } ; -static int currScreen = 0 ; -static int currConnect = 0 ; -static int currCursor = PW_CURSOR_LEFT ; +static int initialised = 0 ; [...69 lines suppressed...] - kbCB = kb ; - msCB = ms ; - mpCB = mp ; - resizeCB = rcb ; - exitCB = ecb ? ecb : defaultExitFunc ; + kbCB = NULL ; + msCB = NULL ; + mpCB = NULL ; + resizeCB = NULL ; + exitCB = defaultExitFunc ; - glClear ( GL_COLOR_BUFFER_BIT ) ; - pwSwapBuffers () ; - glClear ( GL_COLOR_BUFFER_BIT ) ; - pwSwapBuffers () ; + initialised = 1 ; } |
From: Steve B. <sj...@us...> - 2004-02-24 01:58:10
|
Update of /cvsroot/plib/plib/examples/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16914/plib/examples/src/pw Modified Files: pw_demo.cxx pw_pui.cxx Log Message: Added pwOpenWindow to avoid some nasty race conditions. Index: pw_demo.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pw/pw_demo.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pw_demo.cxx 23 Feb 2004 11:50:50 -0000 1.2 +++ pw_demo.cxx 24 Feb 2004 01:52:06 -0000 1.3 @@ -53,8 +53,9 @@ int main ( int, char ** ) { - pwInit ( 100, 100, 640, 480, false, "PLIB Window Demo", true, 0, - kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; + pwInit ( 100, 100, 640, 480, false, "PLIB Window Demo", true, 0 ) ; + + pwOpenWindow ( kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; while ( 1 ) { Index: pw_pui.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pw/pw_pui.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pw_pui.cxx 23 Feb 2004 11:50:50 -0000 1.2 +++ pw_pui.cxx 24 Feb 2004 01:52:06 -0000 1.3 @@ -52,8 +52,7 @@ int main ( int, char ** ) { - pwInit ( 100, 100, 640, 480, false, "PLIB Window Demo", true, 0, - kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; + pwInit ( 100, 100, 640, 480, false, "PLIB Window Demo", true, 0 ) ; puInit () ; puOneShot *b = new puOneShot ( 50, 50, 200, 80 ) ; @@ -61,6 +60,7 @@ b -> setLegend ( "Say Hello" ) ; b -> setCallback ( button_cb ) ; + pwOpenWindow ( kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; while ( 1 ) { glClearColor ( 0.5, 0.1, 0.1, 1.0 ) ; |
From: Steve B. <sj...@us...> - 2004-02-24 01:58:10
|
Update of /cvsroot/plib/plib/doc/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16914/plib/doc/pw Modified Files: index.html Log Message: Added pwOpenWindow to avoid some nasty race conditions. Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/doc/pw/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.html 16 Feb 2004 02:26:27 -0000 1.1 +++ index.html 24 Feb 2004 01:52:06 -0000 1.2 @@ -36,9 +36,7 @@ library by calling either: <pre> -void pwInit ( int multisample, int num_samples, - pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, - pwResizeCB *rcb = NULL, pwExitCB *ecb = NULL ) ; +void pwInit ( int multisample, int num_samples ) ; </pre> ...or: @@ -46,9 +44,7 @@ void pwInit ( int x, int y, int w, int h, int multisample, - char *title, int border, int num_samples, - pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, - pwResizeCB *rcb = NULL, pwExitCB *ecb = NULL ) ; + char *title, int border, int num_samples ) ; </pre> The first version creates a full-screen window with no borders, @@ -65,7 +61,16 @@ system cannot produce the number of samples requested, pwInit will fall back to the best it can do. <p> -The final five parameters are callback functions for (repectively) +Then, initialise other PLIB components such as PUI. When initialisation +is complete, call this function: +<pre> + +void pwOpenWindow ( pwKeybdFunc *kb = NULL, pwMouseFunc *ms = NULL, + pwMousePosFunc *mp = NULL, pwResizeCB *rcb = NULL, + pwExitCB *ecb = NULL ) ; + +</pre> +These parameters are callback functions for (repectively) incoming keyboard keystrokes, incoming mouse button press or release events, mouse movements, window resize events and finally, a window close callback. (That's invoked by PW when the user attempts @@ -73,6 +78,11 @@ PW also calls the exit function when it detects a fatal error that occurs after the window has been successfully opened. <p> +Your application has to be prepared for these callbacks to be invoked +at any time after pwOpenWindow. PW doesn't guarantee that the window +won't be opened before pwOpenWindow - but the window will certainly +be opened after it returns. +<p> The specifications of these various callbacks are: <pre> |
From: Nick M. <nm...@us...> - 2004-02-23 12:13:02
|
Update of /cvsroot/plib/plib/examples/src/ssg/sky In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27376/examples/src/ssg/sky Modified Files: sky.dsp Log Message: Removed unnecessary folders Index: sky.dsp =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/sky/sky.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sky.dsp 26 Jul 2003 06:19:47 -0000 1.1 +++ sky.dsp 23 Feb 2004 11:59:29 -0000 1.2 @@ -44,13 +44,13 @@ # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\..\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" -# ADD RSC /l 0xc09 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg.lib ssg.lib pui.lib fnt.lib ul.lib ssgAux.lib opengl32.lib glu32.lib glut32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\..\plib" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg.lib ssg.lib pui.lib fnt.lib ul.lib ssgAux.lib opengl32.lib glu32.lib glut32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\..\plib" !ELSEIF "$(CFG)" == "sky - Win32 Debug" @@ -64,16 +64,16 @@ # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" -# ADD RSC /l 0xc09 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg_d.lib ssg_d.lib pui_d.lib fnt_d.lib ul_d.lib ssgAux_d.lib opengl32.lib glu32.lib glut32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\plib" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg_d.lib ssg_d.lib pui_d.lib fnt_d.lib ul_d.lib ssgAux_d.lib opengl32.lib glu32.lib glut32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\plib" !ENDIF @@ -81,21 +81,9 @@ # Name "sky - Win32 Release" # Name "sky - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\sky.cxx # End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group # End Target # End Project |
From: Nick M. <nm...@us...> - 2004-02-23 12:12:31
|
Update of /cvsroot/plib/plib/examples/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27244/examples/src/pw Modified Files: pw_demo.dsp pw_pui.dsp Log Message: Removed unnecessary folders Index: pw_demo.dsp =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pw/pw_demo.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pw_demo.dsp 23 Feb 2004 11:50:50 -0000 1.1 +++ pw_demo.dsp 23 Feb 2004 11:58:57 -0000 1.2 @@ -49,8 +49,8 @@ # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ul.lib pw.lib opengl32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\plib" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ul.lib pw.lib opengl32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\plib" !ELSEIF "$(CFG)" == "pw_demo - Win32 Debug" @@ -65,16 +65,16 @@ # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ul_d.lib pw_d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\plib" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ul_d.lib pw_d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\plib" !ENDIF @@ -82,21 +82,9 @@ # Name "pw_demo - Win32 Release" # Name "pw_demo - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\pw_demo.cxx # End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group # End Target # End Project Index: pw_pui.dsp =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pw/pw_pui.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pw_pui.dsp 23 Feb 2004 11:50:50 -0000 1.1 +++ pw_pui.dsp 23 Feb 2004 11:58:57 -0000 1.2 @@ -49,8 +49,8 @@ # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg.lib fnt.lib pui.lib ul.lib pw.lib opengl32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\plib" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg.lib fnt.lib pui.lib ul.lib pw.lib opengl32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\plib" !ELSEIF "$(CFG)" == "pw_pui - Win32 Debug" @@ -65,16 +65,16 @@ # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg_d.lib fnt_d.lib pui_d.lib ul_d.lib pw_d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\plib" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib sg_d.lib fnt_d.lib pui_d.lib ul_d.lib pw_d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\plib" !ENDIF @@ -82,21 +82,9 @@ # Name "pw_pui - Win32 Release" # Name "pw_pui - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\pw_pui.cxx # End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group # End Target # End Project |