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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * Mesa 3-D graphics library
  3. * Version: 5.1
  4. *
  5. * Copyright (C) 1999-2003 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_NONE 0
  43. /* For glFBDevGetString */
  44. #define GLFBDEV_VERSION 200
  45. #define GLFBDEV_VENDOR 201
  46. /* Misc functions */
  47. extern const char *
  48. glFBDevGetString( int str );
  49. extern const void *
  50. glFBDevGetProcAddress( const char *procName );
  51. /**
  52. * Create a GLFBDevVisual.
  53. * \param fixInfo - needed to get the visual types, etc.
  54. * \param varInfo - needed to get the bits_per_pixel, etc.
  55. * \param attribs - for requesting depth, stencil, accum buffers, etc.
  56. */
  57. extern GLFBDevVisualPtr
  58. glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
  59. const struct fb_var_screeninfo *varInfo,
  60. const int *attribs );
  61. extern void
  62. glFBDevDestroyVisual( GLFBDevVisualPtr visual );
  63. extern int
  64. glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib);
  65. /**
  66. * Create a GLFBDevBuffer.
  67. * \param fixInfo, varInfo - needed in order to get the screen size
  68. * (resolution), etc.
  69. * \param visual - as returned by glFBDevCreateVisual()
  70. * \param frontBuffer - address of front color buffer
  71. * \param backBuffer - address of back color buffer (may be NULL)
  72. * \param size - size of the color buffer(s) in bytes.
  73. */
  74. extern GLFBDevBufferPtr
  75. glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
  76. const struct fb_var_screeninfo *varInfo,
  77. const GLFBDevVisualPtr visual,
  78. void *frontBuffer, void *backBuffer, size_t size );
  79. extern void
  80. glFBDevDestroyBuffer( GLFBDevBufferPtr buffer );
  81. extern int
  82. glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib);
  83. extern GLFBDevBufferPtr
  84. glFBDevGetCurrentDrawBuffer( void );
  85. extern GLFBDevBufferPtr
  86. glFBDevGetCurrentReadBuffer( void );
  87. extern void
  88. glFBDevSwapBuffers( GLFBDevBufferPtr buffer );
  89. /**
  90. * Create a GLFBDevContext.
  91. * \param visual - as created by glFBDevCreateVisual.
  92. * \param share - specifies another context with which to share textures,
  93. * display lists, etc. (may be NULL).
  94. */
  95. extern GLFBDevContextPtr
  96. glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share );
  97. extern void
  98. glFBDevDestroyContext( GLFBDevContextPtr context );
  99. extern int
  100. glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib);
  101. extern GLFBDevContextPtr
  102. glFBDevGetCurrentContext( void );
  103. extern int
  104. glFBDevMakeCurrent( GLFBDevContextPtr context,
  105. GLFBDevBufferPtr drawBuffer,
  106. GLFBDevBufferPtr readBuffer );
  107. #endif /* GLFBDEV_H */