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.

svgamesa.h 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Mesa 3-D graphics library
  3. * Version: 4.0
  4. * Copyright (C) 1995-2001 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. * SVGA/Mesa interface for Linux.
  22. */
  23. /*
  24. * Intro to using the VGA/Mesa interface
  25. *
  26. * 1. #include the <vga.h> file
  27. * 2. Call vga_init() to initialize the SVGA library.
  28. * 3. Call vga_setmode() to specify the screen size and color depth.
  29. * 4. Call SVGAMesaCreateContext() to setup a Mesa context. If using 8-bit
  30. * color Mesa assumes color index mode, if using 16-bit or deeper color
  31. * Mesa assumes RGB mode.
  32. * 5. Call SVGAMesaMakeCurrent() to activate the Mesa context.
  33. * 6. You can now use the Mesa API functions.
  34. * 7. Before exiting, call SVGAMesaDestroyContext() then vga_setmode(TEXT)
  35. * to restore the original text screen.
  36. *
  37. * Notes
  38. * 1. You must run your executable as root (or use the set UID-bit) because
  39. * the SVGA library requires it.
  40. * 2. The SVGA driver is not fully implemented yet. See svgamesa.c for what
  41. * has to be done yet.
  42. */
  43. #ifndef SVGAMESA_H
  44. #define SVGAMESA_H
  45. #define SVGAMESA_MAJOR_VERSION 4
  46. #define SVGAMESA_MINOR_VERSION 0
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. #include "GL/gl.h"
  51. /*
  52. * This is the SVGAMesa context 'handle':
  53. */
  54. typedef struct svgamesa_context *SVGAMesaContext;
  55. /*
  56. * doubleBuffer flag new in version 2.4
  57. */
  58. extern int SVGAMesaInit( int GraphMode );
  59. extern int SVGAMesaClose( void );
  60. extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer );
  61. extern void SVGAMesaDestroyContext( SVGAMesaContext ctx );
  62. extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx );
  63. extern void SVGAMesaSwapBuffers( void );
  64. extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue);
  65. extern SVGAMesaContext SVGAMesaGetCurrentContext( void );
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif