Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

util.c 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Mesa 3-D graphics library
  3. * Version: 3.4
  4. * Copyright (C) 1995-1998 Brian Paul
  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. * DOS/DJGPP glut driver v1.4 for Mesa
  22. *
  23. * Copyright (C) 2002 - Daniel Borca
  24. * Email : dborca@yahoo.com
  25. * Web : http://www.geocities.com/dborca
  26. */
  27. #include "glutint.h"
  28. #include "glutbitmap.h"
  29. #include "glutstroke.h"
  30. #ifdef GLUT_IMPORT_LIB
  31. extern StrokeFontRec glutStrokeRoman, glutStrokeMonoRoman;
  32. extern BitmapFontRec glutBitmap8By13, glutBitmap9By15, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18;
  33. /* To get around the fact that DJGPP DXEs only allow functions
  34. to be exported and no data addresses (as Unix DSOs support), the
  35. GLUT API constants such as GLUT_STROKE_ROMAN have to get passed
  36. through a case statement to get mapped to the actual data structure
  37. address. */
  38. void *
  39. __glutFont (void *font)
  40. {
  41. switch ((int)font) {
  42. case (int)GLUT_STROKE_ROMAN:
  43. return &glutStrokeRoman;
  44. case (int)GLUT_STROKE_MONO_ROMAN:
  45. return &glutStrokeMonoRoman;
  46. case (int)GLUT_BITMAP_9_BY_15:
  47. return &glutBitmap9By15;
  48. case (int)GLUT_BITMAP_8_BY_13:
  49. return &glutBitmap8By13;
  50. case (int)GLUT_BITMAP_TIMES_ROMAN_10:
  51. return &glutBitmapTimesRoman10;
  52. case (int)GLUT_BITMAP_TIMES_ROMAN_24:
  53. return &glutBitmapTimesRoman24;
  54. case (int)GLUT_BITMAP_HELVETICA_10:
  55. return &glutBitmapHelvetica10;
  56. case (int)GLUT_BITMAP_HELVETICA_12:
  57. return &glutBitmapHelvetica12;
  58. case (int)GLUT_BITMAP_HELVETICA_18:
  59. return &glutBitmapHelvetica18;
  60. default: /* NOTREACHED */
  61. __glutFatalError("bad font!");
  62. return NULL;
  63. }
  64. }
  65. #endif