dri/common: add comment about DRISW wrt DRI1 / DRI2
authorGeorge Sapountzis <gsapountzis@gmail.com>
Fri, 26 Mar 2010 16:44:40 +0000 (18:44 +0200)
committerGeorge Sapountzis <gsapountzis@gmail.com>
Fri, 26 Mar 2010 16:44:40 +0000 (18:44 +0200)
src/mesa/drivers/dri/common/drisw_util.h

index c7d1450be132813de62d3f6688afbaf42173e705..08d5a116e96624ff3470349cd8d9f343182944b0 100644 (file)
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+/**
+ * @file
+ * Binding of the DRI interface (dri_interface.h) for DRISW.
+ *
+ * The DRISW structs are 'base classes' of the corresponding DRI1 / DRI2 (DRM)
+ * structs. The bindings for SW and DRM can be unified by making the DRM structs
+ * 'sub-classes' of the SW structs, either proper or with field re-ordering.
+ *
+ * The code can also be unified but that requires cluttering the common code
+ * with ifdef's and guarding with (__DRIscreen::fd >= 0) for DRM.
+ */
 
-#ifndef _DRI_SW_H
-#define _DRI_SW_H
+#ifndef _DRISW_UTIL_H
+#define _DRISW_UTIL_H
 
 #include <GL/gl.h>
 #include <GL/internal/glcore.h>
@@ -38,6 +49,39 @@ extern const __DRIcoreExtension driCoreExtension;
 extern const __DRIswrastExtension driSWRastExtension;
 
 
+/**
+ * Driver callback functions
+ */
+struct __DriverAPIRec {
+    const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
+
+    void (*DestroyScreen)(__DRIscreen *driScrnPriv);
+
+    GLboolean (*CreateContext)(const __GLcontextModes *glVis,
+                               __DRIcontext *driContextPriv,
+                               void *sharedContextPrivate);
+
+    void (*DestroyContext)(__DRIcontext *driContextPriv);
+
+    GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
+                              __DRIdrawable *driDrawPriv,
+                              const __GLcontextModes *glVis,
+                              GLboolean pixmapBuffer);
+
+    void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
+
+    void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
+
+    GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
+                             __DRIdrawable *driDrawPriv,
+                             __DRIdrawable *driReadPriv);
+
+    GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
+};
+
+extern const struct __DriverAPIRec driDriverAPI;
+
+
 /**
  * Data types
  */
@@ -85,37 +129,4 @@ struct __DRIdrawableRec {
     int h;
 };
 
-
-/**
- * Driver callback functions
- */
-struct __DriverAPIRec {
-    const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
-
-    void (*DestroyScreen)(__DRIscreen *driScrnPriv);
-
-    GLboolean (*CreateContext)(const __GLcontextModes *glVis,
-                               __DRIcontext *driContextPriv,
-                               void *sharedContextPrivate);
-
-    void (*DestroyContext)(__DRIcontext *driContextPriv);
-
-    GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
-                              __DRIdrawable *driDrawPriv,
-                              const __GLcontextModes *glVis,
-                              GLboolean pixmapBuffer);
-
-    void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
-
-    void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
-
-    GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
-                             __DRIdrawable *driDrawPriv,
-                             __DRIdrawable *driReadPriv);
-
-    GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
-};
-
-extern const struct __DriverAPIRec driDriverAPI;
-
-#endif /* _DRI_SW_H */
+#endif /* _DRISW_UTIL_H */