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 * 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.
33 struct gl_texture_object
;
37 * Is the given FBO a user-created FBO?
39 static inline GLboolean
40 _mesa_is_user_fbo(const struct gl_framebuffer
*fb
)
47 * Is the given FBO a window system FBO (like an X window)?
49 static inline GLboolean
50 _mesa_is_winsys_fbo(const struct gl_framebuffer
*fb
)
58 _mesa_init_fbobjects(struct gl_context
*ctx
);
60 extern struct gl_framebuffer
*
61 _mesa_get_incomplete_framebuffer(void);
63 extern struct gl_renderbuffer
*
64 _mesa_lookup_renderbuffer(struct gl_context
*ctx
, GLuint id
);
66 extern struct gl_framebuffer
*
67 _mesa_lookup_framebuffer(struct gl_context
*ctx
, GLuint id
);
69 extern struct gl_renderbuffer_attachment
*
70 _mesa_get_attachment(struct gl_context
*ctx
, struct gl_framebuffer
*fb
,
74 /** Return the texture image for a renderbuffer attachment */
75 static inline struct gl_texture_image
*
76 _mesa_get_attachment_teximage(struct gl_renderbuffer_attachment
*att
)
78 assert(att
->Type
== GL_TEXTURE
);
79 return att
->Texture
->Image
[att
->CubeMapFace
][att
->TextureLevel
];
83 /** Return the (const) texture image for a renderbuffer attachment */
84 static inline const struct gl_texture_image
*
85 _mesa_get_attachment_teximage_const(const struct gl_renderbuffer_attachment
*att
)
87 assert(att
->Type
== GL_TEXTURE
);
88 return att
->Texture
->Image
[att
->CubeMapFace
][att
->TextureLevel
];
93 _mesa_remove_attachment(struct gl_context
*ctx
,
94 struct gl_renderbuffer_attachment
*att
);
97 _mesa_set_texture_attachment(struct gl_context
*ctx
,
98 struct gl_framebuffer
*fb
,
99 struct gl_renderbuffer_attachment
*att
,
100 struct gl_texture_object
*texObj
,
101 GLenum texTarget
, GLuint level
, GLuint zoffset
);
104 _mesa_set_renderbuffer_attachment(struct gl_context
*ctx
,
105 struct gl_renderbuffer_attachment
*att
,
106 struct gl_renderbuffer
*rb
);
109 _mesa_framebuffer_renderbuffer(struct gl_context
*ctx
,
110 struct gl_framebuffer
*fb
,
111 GLenum attachment
, struct gl_renderbuffer
*rb
);
114 _mesa_validate_framebuffer(struct gl_context
*ctx
, struct gl_framebuffer
*fb
);
117 _mesa_test_framebuffer_completeness(struct gl_context
*ctx
,
118 struct gl_framebuffer
*fb
);
121 _mesa_is_legal_color_format(const struct gl_context
*ctx
, GLenum baseFormat
);
124 _mesa_base_fbo_format(struct gl_context
*ctx
, GLenum internalFormat
);
126 extern GLboolean GLAPIENTRY
127 _mesa_IsRenderbufferEXT(GLuint renderbuffer
);
129 extern void GLAPIENTRY
130 _mesa_BindRenderbufferEXT(GLenum target
, GLuint renderbuffer
);
132 extern void GLAPIENTRY
133 _mesa_DeleteRenderbuffersEXT(GLsizei n
, const GLuint
*renderbuffers
);
135 extern void GLAPIENTRY
136 _mesa_GenRenderbuffersEXT(GLsizei n
, GLuint
*renderbuffers
);
138 extern void GLAPIENTRY
139 _mesa_RenderbufferStorageEXT(GLenum target
, GLenum internalformat
,
140 GLsizei width
, GLsizei height
);
142 extern void GLAPIENTRY
143 _mesa_RenderbufferStorageMultisample(GLenum target
, GLsizei samples
,
144 GLenum internalformat
,
145 GLsizei width
, GLsizei height
);
147 extern void GLAPIENTRY
148 _es_RenderbufferStorageEXT(GLenum target
, GLenum internalFormat
,
149 GLsizei width
, GLsizei height
);
151 extern void GLAPIENTRY
152 _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target
, GLeglImageOES image
);
154 extern void GLAPIENTRY
155 _mesa_GetRenderbufferParameterivEXT(GLenum target
, GLenum pname
,
158 extern GLboolean GLAPIENTRY
159 _mesa_IsFramebufferEXT(GLuint framebuffer
);
161 extern void GLAPIENTRY
162 _mesa_BindFramebufferEXT(GLenum target
, GLuint framebuffer
);
164 extern void GLAPIENTRY
165 _mesa_DeleteFramebuffersEXT(GLsizei n
, const GLuint
*framebuffers
);
167 extern void GLAPIENTRY
168 _mesa_GenFramebuffersEXT(GLsizei n
, GLuint
*framebuffers
);
170 extern GLenum GLAPIENTRY
171 _mesa_CheckFramebufferStatusEXT(GLenum target
);
173 extern void GLAPIENTRY
174 _mesa_FramebufferTexture1DEXT(GLenum target
, GLenum attachment
,
175 GLenum textarget
, GLuint texture
, GLint level
);
177 extern void GLAPIENTRY
178 _mesa_FramebufferTexture2DEXT(GLenum target
, GLenum attachment
,
179 GLenum textarget
, GLuint texture
, GLint level
);
181 extern void GLAPIENTRY
182 _mesa_FramebufferTexture3DEXT(GLenum target
, GLenum attachment
,
183 GLenum textarget
, GLuint texture
,
184 GLint level
, GLint zoffset
);
186 extern void GLAPIENTRY
187 _mesa_FramebufferTextureLayerEXT(GLenum target
, GLenum attachment
,
188 GLuint texture
, GLint level
, GLint layer
);
190 extern void GLAPIENTRY
191 _mesa_FramebufferRenderbufferEXT(GLenum target
, GLenum attachment
,
192 GLenum renderbuffertarget
,
193 GLuint renderbuffer
);
195 extern void GLAPIENTRY
196 _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target
, GLenum attachment
,
197 GLenum pname
, GLint
*params
);
199 extern void GLAPIENTRY
200 _mesa_GenerateMipmapEXT(GLenum target
);
203 extern void GLAPIENTRY
204 _mesa_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
205 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
206 GLbitfield mask
, GLenum filter
);
208 extern void GLAPIENTRY
209 _mesa_FramebufferTextureARB(GLenum target
, GLenum attachment
,
210 GLuint texture
, GLint level
);
212 extern void GLAPIENTRY
213 _mesa_FramebufferTextureFaceARB(GLenum target
, GLenum attachment
,
214 GLuint texture
, GLint level
, GLenum face
);
217 extern void GLAPIENTRY
218 _mesa_InvalidateSubFramebuffer(GLenum target
, GLsizei numAttachments
,
219 const GLenum
*attachments
, GLint x
, GLint y
,
220 GLsizei width
, GLsizei height
);
222 extern void GLAPIENTRY
223 _mesa_InvalidateFramebuffer(GLenum target
, GLsizei numAttachments
,
224 const GLenum
*attachments
);
226 #endif /* FBOBJECT_H */