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.

dmesa.h 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Mesa 3-D graphics library
  3. * Version: 5.0
  4. *
  5. * Copyright (C) 1999-2002 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. /*
  25. * DOS/DJGPP device driver v1.4 for Mesa
  26. *
  27. * Copyright (C) 2002 - Borca Daniel
  28. * Email : dborca@users.sourceforge.net
  29. * Web : http://www.geocities.com/dborca
  30. */
  31. #ifndef DMESA_H_included
  32. #define DMESA_H_included
  33. #define DMESA_MAJOR_VERSION 5
  34. #define DMESA_MINOR_VERSION 0
  35. /* Sample Usage:
  36. *
  37. * 1. Call DMesaCreateVisual() to initialize graphics.
  38. * 2. Call DMesaCreateContext() to create a DMesa rendering context.
  39. * 3. Call DMesaCreateBuffer() to define the window.
  40. * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext.
  41. * 5. Make gl* calls to render your graphics.
  42. * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers.
  43. * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual.
  44. */
  45. typedef struct dmesa_context *DMesaContext;
  46. typedef struct dmesa_visual *DMesaVisual;
  47. typedef struct dmesa_buffer *DMesaBuffer;
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. /*
  52. * Create a new Visual and set graphics mode.
  53. */
  54. DMesaVisual DMesaCreateVisual (GLint width, /* X res */
  55. GLint height, /* Y res */
  56. GLint colDepth, /* BPP */
  57. GLint refresh, /* refresh rate: 0=default */
  58. GLboolean dbFlag, /* double-buffered */
  59. GLboolean rgbFlag, /* RGB mode */
  60. GLint alphaSize, /* requested bits/alpha */
  61. GLint depthSize, /* requested bits/depth */
  62. GLint stencilSize, /* requested bits/stencil */
  63. GLint accumSize); /* requested bits/accum */
  64. /*
  65. * Destroy Visual and restore screen.
  66. */
  67. void DMesaDestroyVisual (DMesaVisual v);
  68. /*
  69. * Create a new Context for rendering.
  70. */
  71. DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
  72. /*
  73. * Destroy Context.
  74. */
  75. void DMesaDestroyContext (DMesaContext c);
  76. /*
  77. * Return a handle to the current context.
  78. */
  79. void *DMesaGetCurrentContext (void);
  80. /*
  81. * Create a new Buffer (window).
  82. */
  83. DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
  84. GLint xpos, GLint ypos,
  85. GLint width, GLint height);
  86. /*
  87. * Destroy Buffer.
  88. */
  89. void DMesaDestroyBuffer (DMesaBuffer b);
  90. /*
  91. * Swap the front and back buffers for the given Buffer.
  92. * No action is taken if the buffer is not double buffered.
  93. */
  94. void DMesaSwapBuffers (DMesaBuffer b);
  95. /*
  96. * Bind Buffer to Context and make the Context the current one.
  97. */
  98. GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
  99. /*
  100. * Move/Resize current Buffer.
  101. */
  102. GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos);
  103. GLboolean DMesaResizeBuffer (GLint width, GLint height);
  104. /*
  105. * Set palette index, using normalized values.
  106. */
  107. void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
  108. /*
  109. * DMesa state retrieval.
  110. */
  111. #define DMESA_GET_SCREEN_SIZE 0x0100
  112. #define DMESA_GET_DRIVER_CAPS 0x0200
  113. #define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */
  114. #define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */
  115. int DMesaGetIntegerv (GLenum pname, GLint *params);
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119. #endif