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.

glfbdev.h 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. * Mesa 3-D graphics library
  3. * Version: 6.5
  4. *
  5. * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a
  8. * copy of this software and associated documentation files (the "Software"),
  9. * to deal in the Software without restriction, including without limitation
  10. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11. * and/or sell copies of the Software, and to permit persons to whom the
  12. * Software is furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included
  15. * in all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  20. * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  21. * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. */
  24. #ifndef GLFBDEV_H
  25. #define GLFBDEV_H
  26. /* avoid including linux/fb.h */
  27. struct fb_fix_screeninfo;
  28. struct fb_var_screeninfo;
  29. /* public types */
  30. typedef struct GLFBDevVisualRec *GLFBDevVisualPtr;
  31. typedef struct GLFBDevBufferRec *GLFBDevBufferPtr;
  32. typedef struct GLFBDevContextRec *GLFBDevContextPtr;
  33. /* API version */
  34. #define GLFBDEV_VERSION_1_0 1
  35. /* For glFBDevCreateVisual */
  36. #define GLFBDEV_DOUBLE_BUFFER 100
  37. #define GLFBDEV_COLOR_INDEX 101
  38. #define GLFBDEV_DEPTH_SIZE 102
  39. #define GLFBDEV_STENCIL_SIZE 103
  40. #define GLFBDEV_ACCUM_SIZE 104
  41. #define GLFBDEV_LEVEL 105
  42. #define GLFBDEV_MULTISAMPLE 106
  43. #define GLFBDEV_NONE 0
  44. /* For glFBDevGetString */
  45. #define GLFBDEV_VERSION 200
  46. #define GLFBDEV_VENDOR 201
  47. /* Misc functions */
  48. extern const char *
  49. glFBDevGetString( int str );
  50. typedef void (*GLFBDevProc)();
  51. extern GLFBDevProc
  52. glFBDevGetProcAddress( const char *procName );
  53. /**
  54. * Create a GLFBDevVisual.
  55. * \param fixInfo - needed to get the visual types, etc.
  56. * \param varInfo - needed to get the bits_per_pixel, etc.
  57. * \param attribs - for requesting depth, stencil, accum buffers, etc.
  58. */
  59. extern GLFBDevVisualPtr
  60. glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
  61. const struct fb_var_screeninfo *varInfo,
  62. const int *attribs );
  63. extern void
  64. glFBDevDestroyVisual( GLFBDevVisualPtr visual );
  65. extern int
  66. glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib);
  67. /**
  68. * Create a GLFBDevBuffer.
  69. * \param fixInfo, varInfo - needed in order to get the screen size
  70. * (resolution), etc.
  71. * \param visual - as returned by glFBDevCreateVisual()
  72. * \param frontBuffer - address of front color buffer
  73. * \param backBuffer - address of back color buffer (may be NULL)
  74. * \param size - size of the color buffer(s) in bytes.
  75. */
  76. extern GLFBDevBufferPtr
  77. glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
  78. const struct fb_var_screeninfo *varInfo,
  79. const GLFBDevVisualPtr visual,
  80. void *frontBuffer, void *backBuffer, size_t size );
  81. extern void
  82. glFBDevDestroyBuffer( GLFBDevBufferPtr buffer );
  83. extern int
  84. glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib);
  85. extern GLFBDevBufferPtr
  86. glFBDevGetCurrentDrawBuffer( void );
  87. extern GLFBDevBufferPtr
  88. glFBDevGetCurrentReadBuffer( void );
  89. extern void
  90. glFBDevSwapBuffers( GLFBDevBufferPtr buffer );
  91. /**
  92. * Create a GLFBDevContext.
  93. * \param visual - as created by glFBDevCreateVisual.
  94. * \param share - specifies another context with which to share textures,
  95. * display lists, etc. (may be NULL).
  96. */
  97. extern GLFBDevContextPtr
  98. glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share );
  99. extern void
  100. glFBDevDestroyContext( GLFBDevContextPtr context );
  101. extern int
  102. glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib);
  103. extern GLFBDevContextPtr
  104. glFBDevGetCurrentContext( void );
  105. extern int
  106. glFBDevMakeCurrent( GLFBDevContextPtr context,
  107. GLFBDevBufferPtr drawBuffer,
  108. GLFBDevBufferPtr readBuffer );
  109. #endif /* GLFBDEV_H */