2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
34 struct gl_texture_object
;
38 * Is the given FBO a user-created FBO?
40 static inline GLboolean
41 _mesa_is_user_fbo(const struct gl_framebuffer
*fb
)
48 * Is the given FBO a window system FBO (like an X window)?
50 static inline GLboolean
51 _mesa_is_winsys_fbo(const struct gl_framebuffer
*fb
)
59 _mesa_init_fbobjects(struct gl_context
*ctx
);
61 extern struct gl_framebuffer
*
62 _mesa_get_incomplete_framebuffer(void);
64 extern struct gl_renderbuffer
*
65 _mesa_lookup_renderbuffer(struct gl_context
*ctx
, GLuint id
);
67 extern struct gl_framebuffer
*
68 _mesa_lookup_framebuffer(struct gl_context
*ctx
, GLuint id
);
70 extern struct gl_renderbuffer_attachment
*
71 _mesa_get_attachment(struct gl_context
*ctx
, struct gl_framebuffer
*fb
,
75 /** Return the texture image for a renderbuffer attachment */
76 static inline struct gl_texture_image
*
77 _mesa_get_attachment_teximage(struct gl_renderbuffer_attachment
*att
)
79 assert(att
->Type
== GL_TEXTURE
);
80 return att
->Texture
->Image
[att
->CubeMapFace
][att
->TextureLevel
];
84 /** Return the (const) texture image for a renderbuffer attachment */
85 static inline const struct gl_texture_image
*
86 _mesa_get_attachment_teximage_const(const struct gl_renderbuffer_attachment
*att
)
88 assert(att
->Type
== GL_TEXTURE
);
89 return att
->Texture
->Image
[att
->CubeMapFace
][att
->TextureLevel
];
94 _mesa_remove_attachment(struct gl_context
*ctx
,
95 struct gl_renderbuffer_attachment
*att
);
98 _mesa_set_texture_attachment(struct gl_context
*ctx
,
99 struct gl_framebuffer
*fb
,
100 struct gl_renderbuffer_attachment
*att
,
101 struct gl_texture_object
*texObj
,
102 GLenum texTarget
, GLuint level
, GLuint zoffset
);
105 _mesa_set_renderbuffer_attachment(struct gl_context
*ctx
,
106 struct gl_renderbuffer_attachment
*att
,
107 struct gl_renderbuffer
*rb
);
110 _mesa_framebuffer_renderbuffer(struct gl_context
*ctx
,
111 struct gl_framebuffer
*fb
,
112 GLenum attachment
, struct gl_renderbuffer
*rb
);
115 _mesa_validate_framebuffer(struct gl_context
*ctx
, struct gl_framebuffer
*fb
);
118 _mesa_has_depthstencil_combined(const struct gl_framebuffer
*fb
);
121 _mesa_test_framebuffer_completeness(struct gl_context
*ctx
,
122 struct gl_framebuffer
*fb
);
125 _mesa_is_legal_color_format(const struct gl_context
*ctx
, GLenum baseFormat
);
128 _mesa_base_fbo_format(struct gl_context
*ctx
, GLenum internalFormat
);
130 extern GLboolean GLAPIENTRY
131 _mesa_IsRenderbuffer(GLuint renderbuffer
);
133 extern void GLAPIENTRY
134 _mesa_BindRenderbuffer(GLenum target
, GLuint renderbuffer
);
136 extern void GLAPIENTRY
137 _mesa_DeleteRenderbuffers(GLsizei n
, const GLuint
*renderbuffers
);
139 extern void GLAPIENTRY
140 _mesa_GenRenderbuffers(GLsizei n
, GLuint
*renderbuffers
);
142 extern void GLAPIENTRY
143 _mesa_RenderbufferStorage(GLenum target
, GLenum internalformat
,
144 GLsizei width
, GLsizei height
);
146 extern void GLAPIENTRY
147 _mesa_RenderbufferStorageMultisample(GLenum target
, GLsizei samples
,
148 GLenum internalformat
,
149 GLsizei width
, GLsizei height
);
151 extern void GLAPIENTRY
152 _es_RenderbufferStorageEXT(GLenum target
, GLenum internalFormat
,
153 GLsizei width
, GLsizei height
);
155 extern void GLAPIENTRY
156 _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target
, GLeglImageOES image
);
158 extern void GLAPIENTRY
159 _mesa_GetRenderbufferParameteriv(GLenum target
, GLenum pname
,
162 extern GLboolean GLAPIENTRY
163 _mesa_IsFramebuffer(GLuint framebuffer
);
165 extern void GLAPIENTRY
166 _mesa_BindFramebuffer(GLenum target
, GLuint framebuffer
);
168 extern void GLAPIENTRY
169 _mesa_DeleteFramebuffers(GLsizei n
, const GLuint
*framebuffers
);
171 extern void GLAPIENTRY
172 _mesa_GenFramebuffers(GLsizei n
, GLuint
*framebuffers
);
174 extern GLenum GLAPIENTRY
175 _mesa_CheckFramebufferStatus(GLenum target
);
177 extern void GLAPIENTRY
178 _mesa_FramebufferTexture1D(GLenum target
, GLenum attachment
,
179 GLenum textarget
, GLuint texture
, GLint level
);
181 extern void GLAPIENTRY
182 _mesa_FramebufferTexture2D(GLenum target
, GLenum attachment
,
183 GLenum textarget
, GLuint texture
, GLint level
);
185 extern void GLAPIENTRY
186 _mesa_FramebufferTexture3D(GLenum target
, GLenum attachment
,
187 GLenum textarget
, GLuint texture
,
188 GLint level
, GLint zoffset
);
190 extern void GLAPIENTRY
191 _mesa_FramebufferTextureLayer(GLenum target
, GLenum attachment
,
192 GLuint texture
, GLint level
, GLint layer
);
194 extern void GLAPIENTRY
195 _mesa_FramebufferRenderbuffer(GLenum target
, GLenum attachment
,
196 GLenum renderbuffertarget
,
197 GLuint renderbuffer
);
199 extern void GLAPIENTRY
200 _mesa_GetFramebufferAttachmentParameteriv(GLenum target
, GLenum attachment
,
201 GLenum pname
, GLint
*params
);
203 extern void GLAPIENTRY
204 _mesa_GenerateMipmap(GLenum target
);
207 extern void GLAPIENTRY
208 _mesa_BlitFramebuffer(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
209 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
210 GLbitfield mask
, GLenum filter
);
212 extern void GLAPIENTRY
213 _mesa_InvalidateSubFramebuffer(GLenum target
, GLsizei numAttachments
,
214 const GLenum
*attachments
, GLint x
, GLint y
,
215 GLsizei width
, GLsizei height
);
217 extern void GLAPIENTRY
218 _mesa_InvalidateFramebuffer(GLenum target
, GLsizei numAttachments
,
219 const GLenum
*attachments
);
221 extern void GLAPIENTRY
222 _mesa_DiscardFramebufferEXT(GLenum target
, GLsizei numAttachments
,
223 const GLenum
*attachments
);
225 #endif /* FBOBJECT_H */