mesa: remove unneeded #include of colormac.h
[mesa.git] / src / mesa / main / fbobject.h
1 /*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25
26 #ifndef FBOBJECT_H
27 #define FBOBJECT_H
28
29 #include "compiler.h"
30 #include "glheader.h"
31 #include <stdbool.h>
32
33 struct gl_context;
34 struct gl_texture_object;
35
36
37 /**
38 * Is the given FBO a user-created FBO?
39 */
40 static inline GLboolean
41 _mesa_is_user_fbo(const struct gl_framebuffer *fb)
42 {
43 return fb->Name != 0;
44 }
45
46
47 /**
48 * Is the given FBO a window system FBO (like an X window)?
49 */
50 static inline GLboolean
51 _mesa_is_winsys_fbo(const struct gl_framebuffer *fb)
52 {
53 return fb->Name == 0;
54 }
55
56
57
58 extern void
59 _mesa_init_fbobjects(struct gl_context *ctx);
60
61 extern struct gl_framebuffer *
62 _mesa_get_incomplete_framebuffer(void);
63
64 extern struct gl_renderbuffer *
65 _mesa_lookup_renderbuffer(struct gl_context *ctx, GLuint id);
66
67 extern struct gl_framebuffer *
68 _mesa_lookup_framebuffer(struct gl_context *ctx, GLuint id);
69
70
71 void
72 _mesa_update_texture_renderbuffer(struct gl_context *ctx,
73 struct gl_framebuffer *fb,
74 struct gl_renderbuffer_attachment *att);
75
76 extern void
77 _mesa_framebuffer_renderbuffer(struct gl_context *ctx,
78 struct gl_framebuffer *fb,
79 GLenum attachment, struct gl_renderbuffer *rb);
80
81 extern void
82 _mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb);
83
84 extern GLboolean
85 _mesa_has_depthstencil_combined(const struct gl_framebuffer *fb);
86
87 extern void
88 _mesa_test_framebuffer_completeness(struct gl_context *ctx,
89 struct gl_framebuffer *fb);
90
91 extern GLboolean
92 _mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat);
93
94 extern GLenum
95 _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat);
96
97 extern bool
98 _mesa_detach_renderbuffer(struct gl_context *ctx,
99 struct gl_framebuffer *fb,
100 const void *att);
101
102 extern GLboolean GLAPIENTRY
103 _mesa_IsRenderbuffer(GLuint renderbuffer);
104
105 extern void GLAPIENTRY
106 _mesa_BindRenderbuffer(GLenum target, GLuint renderbuffer);
107
108 extern void GLAPIENTRY
109 _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer);
110
111 extern void GLAPIENTRY
112 _mesa_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers);
113
114 extern void GLAPIENTRY
115 _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers);
116
117 extern void GLAPIENTRY
118 _mesa_CreateRenderbuffers(GLsizei n, GLuint *renderbuffers);
119
120 extern void GLAPIENTRY
121 _mesa_RenderbufferStorage(GLenum target, GLenum internalformat,
122 GLsizei width, GLsizei height);
123
124 extern void GLAPIENTRY
125 _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
126 GLenum internalformat,
127 GLsizei width, GLsizei height);
128
129 extern void GLAPIENTRY
130 _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
131 GLsizei width, GLsizei height);
132
133 extern void GLAPIENTRY
134 _mesa_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat,
135 GLsizei width, GLsizei height);
136
137 extern void GLAPIENTRY
138 _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples,
139 GLenum internalformat,
140 GLsizei width, GLsizei height);
141
142 extern void GLAPIENTRY
143 _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
144
145 extern void GLAPIENTRY
146 _mesa_GetRenderbufferParameteriv(GLenum target, GLenum pname,
147 GLint *params);
148
149 void GLAPIENTRY
150 _mesa_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum pname,
151 GLint *params);
152
153 extern GLboolean GLAPIENTRY
154 _mesa_IsFramebuffer(GLuint framebuffer);
155
156 extern void GLAPIENTRY
157 _mesa_BindFramebuffer(GLenum target, GLuint framebuffer);
158
159 extern void GLAPIENTRY
160 _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer);
161
162 extern void GLAPIENTRY
163 _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers);
164
165 extern void GLAPIENTRY
166 _mesa_GenFramebuffers(GLsizei n, GLuint *framebuffers);
167
168 extern GLenum GLAPIENTRY
169 _mesa_CheckFramebufferStatus(GLenum target);
170
171 extern void GLAPIENTRY
172 _mesa_FramebufferTexture1D(GLenum target, GLenum attachment,
173 GLenum textarget, GLuint texture, GLint level);
174
175 extern void GLAPIENTRY
176 _mesa_FramebufferTexture2D(GLenum target, GLenum attachment,
177 GLenum textarget, GLuint texture, GLint level);
178
179 extern void GLAPIENTRY
180 _mesa_FramebufferTexture3D(GLenum target, GLenum attachment,
181 GLenum textarget, GLuint texture,
182 GLint level, GLint zoffset);
183
184 extern void GLAPIENTRY
185 _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment,
186 GLuint texture, GLint level, GLint layer);
187
188 extern void GLAPIENTRY
189 _mesa_FramebufferTexture(GLenum target, GLenum attachment,
190 GLuint texture, GLint level);
191
192 extern void GLAPIENTRY
193 _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,
194 GLenum renderbuffertarget,
195 GLuint renderbuffer);
196
197 extern void GLAPIENTRY
198 _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
199 GLenum pname, GLint *params);
200
201 extern void GLAPIENTRY
202 _mesa_InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments,
203 const GLenum *attachments, GLint x, GLint y,
204 GLsizei width, GLsizei height);
205
206 extern void GLAPIENTRY
207 _mesa_InvalidateFramebuffer(GLenum target, GLsizei numAttachments,
208 const GLenum *attachments);
209
210 extern void GLAPIENTRY
211 _mesa_DiscardFramebufferEXT(GLenum target, GLsizei numAttachments,
212 const GLenum *attachments);
213
214 #endif /* FBOBJECT_H */