home *** CD-ROM | disk | FTP | other *** search
/ Amiga Magazin: Amiga-CD 2000 April & May / AMIGA_2000_04.iso / patches / mesa3.1 / mesa-glut.lha / src-glut.aos / glutGetSetDevice.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-28  |  2.2 KB  |  77 lines

  1. /*
  2.  * Amiga GLUT graphics library toolkit
  3.  * Version:  1.1
  4.  * Copyright (C) 1998 Jarno van der Linden
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Library General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Library General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with this library; if not, write to the Free
  18.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  */
  20.  
  21. /*
  22.  * glutGetDevice.c
  23.  *
  24.  * Version 1.0  27 Jun 1998
  25.  * by Jarno van der Linden
  26.  * jarno@kcbbs.gen.nz
  27.  *
  28.  */
  29.  
  30. #include "glutstuff.h"
  31.  
  32. int glutDeviceGet(GLenum param)
  33. {
  34.  /*
  35.   * TODO: joystick-stuff
  36.   */
  37.   switch (param) {
  38.     case GLUT_HAS_KEYBOARD:
  39.     case GLUT_HAS_MOUSE:
  40.       return TRUE;
  41.     case GLUT_HAS_JOYSTICK:
  42.     case GLUT_HAS_SPACEBALL:
  43.     case GLUT_HAS_DIAL_AND_BUTTON_BOX:
  44.     case GLUT_HAS_TABLET:        /* not really true, intuition supports tablets */
  45.       return FALSE;
  46.     case GLUT_NUM_MOUSE_BUTTONS:
  47.       return 2;                /* not really true, could be 3 button mouse */
  48.     case GLUT_DEVICE_IGNORE_KEY_REPEAT:
  49.       return glutstuff.curwin ? glutstuff.curwin->ignorekeyrepeat : 0;
  50.     case GLUT_DEVICE_KEY_REPEAT:
  51.       return glutstuff.curwin ? glutstuff.curwin->repeatmode : 0;
  52.     case GLUT_JOYSTICK_POLL_RATE:
  53. /*  case GLUT_NUM_JOYSTICK_AXES: */    /* FUTURE: glut 3.8 */
  54. /*  case GLUT_NUM_JOYSTICK_BUTTONS: */    /* FUTURE: glut 3.8 */
  55.     case GLUT_NUM_SPACEBALL_BUTTONS:
  56.     case GLUT_NUM_BUTTON_BOX_BUTTONS:
  57.     case GLUT_NUM_DIALS:
  58.     case GLUT_NUM_TABLET_BUTTONS:
  59.       return -1;
  60.     default:
  61.       break;
  62.   }
  63.   return -1;
  64. }
  65.  
  66. void glutIgnoreKeyRepeat(int ignore)
  67. {
  68.   if (glutstuff.curwin)
  69.     glutstuff.curwin->ignorekeyrepeat = ignore;
  70. }
  71.  
  72. void glutSetKeyRepeat(int repeatmode)
  73. {
  74.   if (glutstuff.curwin)
  75.     glutstuff.curwin->repeatmode = repeatmode;
  76. }
  77.