test version of startmenu root with big icons
[reactos.git] / reactos / lib / mesa32 / src / drivers / common / driverfuncs.c
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.1
4 *
5 * Copyright (C) 1999-2004 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
26 #include "glheader.h"
27 #include "imports.h"
28 #include "buffers.h"
29 #include "context.h"
30 #include "program.h"
31 #include "texcompress.h"
32 #include "texformat.h"
33 #include "teximage.h"
34 #include "texobj.h"
35 #include "texstore.h"
36 #include "bufferobj.h"
37
38 #include "driverfuncs.h"
39 #include "swrast/swrast.h"
40
41
42
43 /**
44 * Plug in default functions for all pointers in the dd_function_table
45 * structure.
46 * Device drivers should call this function and then plug in any
47 * functions which it wants to override.
48 * Some functions (pointers) MUST be implemented by all drivers (REQUIRED).
49 *
50 * \param table the dd_function_table to initialize
51 */
52 void
53 _mesa_init_driver_functions(struct dd_function_table *driver)
54 {
55 _mesa_bzero(driver, sizeof(*driver));
56
57 driver->GetString = NULL; /* REQUIRED! */
58 driver->UpdateState = NULL; /* REQUIRED! */
59 driver->GetBufferSize = NULL; /* REQUIRED! */
60 driver->ResizeBuffers = _swrast_alloc_buffers;
61 driver->Error = NULL;
62
63 driver->Finish = NULL;
64 driver->Flush = NULL;
65
66 /* framebuffer/image functions */
67 driver->Clear = _swrast_Clear;
68 driver->Accum = _swrast_Accum;
69 driver->DrawPixels = _swrast_DrawPixels;
70 driver->ReadPixels = _swrast_ReadPixels;
71 driver->CopyPixels = _swrast_CopyPixels;
72 driver->Bitmap = _swrast_Bitmap;
73
74 /* Texture functions */
75 driver->ChooseTextureFormat = _mesa_choose_tex_format;
76 driver->TexImage1D = _mesa_store_teximage1d;
77 driver->TexImage2D = _mesa_store_teximage2d;
78 driver->TexImage3D = _mesa_store_teximage3d;
79 driver->TexSubImage1D = _mesa_store_texsubimage1d;
80 driver->TexSubImage2D = _mesa_store_texsubimage2d;
81 driver->TexSubImage3D = _mesa_store_texsubimage3d;
82 driver->CopyTexImage1D = _swrast_copy_teximage1d;
83 driver->CopyTexImage2D = _swrast_copy_teximage2d;
84 driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d;
85 driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d;
86 driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d;
87 driver->TestProxyTexImage = _mesa_test_proxy_teximage;
88 driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d;
89 driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d;
90 driver->CompressedTexImage3D = _mesa_store_compressed_teximage3d;
91 driver->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d;
92 driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d;
93 driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d;
94 driver->CompressedTextureSize = _mesa_compressed_texture_size;
95 driver->BindTexture = NULL;
96 driver->NewTextureObject = _mesa_new_texture_object;
97 driver->DeleteTexture = _mesa_delete_texture_object;
98 driver->NewTextureImage = _mesa_new_texture_image;
99 driver->IsTextureResident = NULL;
100 driver->PrioritizeTexture = NULL;
101 driver->ActiveTexture = NULL;
102 driver->UpdateTexturePalette = NULL;
103
104 /* imaging */
105 driver->CopyColorTable = _swrast_CopyColorTable;
106 driver->CopyColorSubTable = _swrast_CopyColorSubTable;
107 driver->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
108 driver->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
109
110 /* Vertex/fragment programs */
111 driver->BindProgram = NULL;
112 driver->NewProgram = _mesa_new_program;
113 driver->DeleteProgram = _mesa_delete_program;
114
115 /* simple state commands */
116 driver->AlphaFunc = NULL;
117 driver->BlendColor = NULL;
118 driver->BlendEquationSeparate = NULL;
119 driver->BlendFuncSeparate = NULL;
120 driver->ClearColor = NULL;
121 driver->ClearDepth = NULL;
122 driver->ClearIndex = NULL;
123 driver->ClearStencil = NULL;
124 driver->ClipPlane = NULL;
125 driver->ColorMask = NULL;
126 driver->ColorMaterial = NULL;
127 driver->CullFace = NULL;
128 driver->DrawBuffer = _swrast_DrawBuffer;
129 driver->FrontFace = NULL;
130 driver->DepthFunc = NULL;
131 driver->DepthMask = NULL;
132 driver->DepthRange = NULL;
133 driver->Enable = NULL;
134 driver->Fogfv = NULL;
135 driver->Hint = NULL;
136 driver->IndexMask = NULL;
137 driver->Lightfv = NULL;
138 driver->LightModelfv = NULL;
139 driver->LineStipple = NULL;
140 driver->LineWidth = NULL;
141 driver->LogicOpcode = NULL;
142 driver->PointParameterfv = NULL;
143 driver->PointSize = NULL;
144 driver->PolygonMode = NULL;
145 driver->PolygonOffset = NULL;
146 driver->PolygonStipple = NULL;
147 driver->ReadBuffer = NULL;
148 driver->RenderMode = NULL;
149 driver->Scissor = NULL;
150 driver->ShadeModel = NULL;
151 driver->StencilFunc = NULL;
152 driver->StencilMask = NULL;
153 driver->StencilOp = NULL;
154 driver->ActiveStencilFace = NULL;
155 driver->TexGen = NULL;
156 driver->TexEnv = NULL;
157 driver->TexParameter = NULL;
158 driver->TextureMatrix = NULL;
159 driver->Viewport = NULL;
160
161 /* vertex arrays */
162 driver->VertexPointer = NULL;
163 driver->NormalPointer = NULL;
164 driver->ColorPointer = NULL;
165 driver->FogCoordPointer = NULL;
166 driver->IndexPointer = NULL;
167 driver->SecondaryColorPointer = NULL;
168 driver->TexCoordPointer = NULL;
169 driver->EdgeFlagPointer = NULL;
170 driver->VertexAttribPointer = NULL;
171 driver->LockArraysEXT = NULL;
172 driver->UnlockArraysEXT = NULL;
173
174 /* state queries */
175 driver->GetBooleanv = NULL;
176 driver->GetDoublev = NULL;
177 driver->GetFloatv = NULL;
178 driver->GetIntegerv = NULL;
179 driver->GetPointerv = NULL;
180
181 #if FEATURE_ARB_vertex_buffer_object
182 driver->NewBufferObject = _mesa_new_buffer_object;
183 driver->DeleteBuffer = _mesa_delete_buffer_object;
184 driver->BindBuffer = NULL;
185 driver->BufferData = _mesa_buffer_data;
186 driver->BufferSubData = _mesa_buffer_subdata;
187 driver->GetBufferSubData = _mesa_buffer_get_subdata;
188 driver->MapBuffer = _mesa_buffer_map;
189 driver->UnmapBuffer = NULL;
190 #endif
191
192 /* T&L stuff */
193 driver->NeedValidate = GL_FALSE;
194 driver->ValidateTnlModule = NULL;
195 driver->CurrentExecPrimitive = 0;
196 driver->CurrentSavePrimitive = 0;
197 driver->NeedFlush = 0;
198 driver->SaveNeedFlush = 0;
199
200 driver->FlushVertices = NULL;
201 driver->SaveFlushVertices = NULL;
202 driver->NotifySaveBegin = NULL;
203 driver->LightingSpaceChange = NULL;
204 driver->MakeCurrent = NULL;
205
206 /* display list */
207 driver->NewList = NULL;
208 driver->EndList = NULL;
209 driver->BeginCallList = NULL;
210 driver->EndCallList = NULL;
211 }