Merge branch '7.8' into master
[mesa.git] / src / mesa / drivers / dri / common / dri_sw.h
1 /*
2 * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
3 * All Rights Reserved.
4 * Copyright 2010 George Sapountzis <gsapountzis@gmail.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24
25 #ifndef _DRI_SW_H
26 #define _DRI_SW_H
27
28 #include <GL/gl.h>
29 #include <GL/internal/glcore.h>
30 #include <GL/internal/dri_interface.h>
31
32
33 /**
34 * Extensions
35 */
36 extern const __DRIcoreExtension driCoreExtension;
37 extern const __DRIswrastExtension driSWRastExtension;
38
39
40 /**
41 * Data types
42 */
43 struct __DRIscreenRec {
44 int myNum;
45
46 int fd;
47
48 void *private;
49
50 const __DRIextension **extensions;
51
52 const __DRIswrastLoaderExtension *swrast_loader;
53 };
54
55 struct __DRIcontextRec {
56
57 void *driverPrivate;
58
59 void *loaderPrivate;
60
61 __DRIdrawable *driDrawablePriv;
62
63 __DRIdrawable *driReadablePriv;
64
65 __DRIscreen *driScreenPriv;
66 };
67
68 struct __DRIdrawableRec {
69
70 void *driverPrivate;
71
72 void *loaderPrivate;
73
74 __DRIscreen *driScreenPriv;
75
76 int refcount;
77 };
78
79
80 /**
81 * Driver callback functions
82 */
83 struct __DriverAPIRec {
84 const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
85
86 void (*DestroyScreen)(__DRIscreen *driScrnPriv);
87
88 GLboolean (*CreateContext)(const __GLcontextModes *glVis,
89 __DRIcontext *driContextPriv,
90 void *sharedContextPrivate);
91
92 void (*DestroyContext)(__DRIcontext *driContextPriv);
93
94 GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
95 __DRIdrawable *driDrawPriv,
96 const __GLcontextModes *glVis,
97 GLboolean pixmapBuffer);
98
99 void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
100
101 void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
102
103 GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
104 __DRIdrawable *driDrawPriv,
105 __DRIdrawable *driReadPriv);
106
107 GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
108 };
109
110 extern const struct __DriverAPIRec driDriverAPI;
111
112 #endif /* _DRI_SW_H */