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_has_depthstencil_combined(const struct gl_framebuffer
*fb
);
120 _mesa_test_framebuffer_completeness(struct gl_context
*ctx
,
121 struct gl_framebuffer
*fb
);
124 _mesa_is_legal_color_format(const struct gl_context
*ctx
, GLenum baseFormat
);
127 _mesa_base_fbo_format(struct gl_context
*ctx
, GLenum internalFormat
);
129 extern GLboolean GLAPIENTRY
130 _mesa_IsRenderbuffer(GLuint renderbuffer
);
132 extern void GLAPIENTRY
133 _mesa_BindRenderbuffer(GLenum target
, GLuint renderbuffer
);
135 extern void GLAPIENTRY
136 _mesa_DeleteRenderbuffers(GLsizei n
, const GLuint
*renderbuffers
);
138 extern void GLAPIENTRY
139 _mesa_GenRenderbuffers(GLsizei n
, GLuint
*renderbuffers
);
141 extern void GLAPIENTRY
142 _mesa_RenderbufferStorage(GLenum target
, GLenum internalformat
,
143 GLsizei width
, GLsizei height
);
145 extern void GLAPIENTRY
146 _mesa_RenderbufferStorageMultisample(GLenum target
, GLsizei samples
,
147 GLenum internalformat
,
148 GLsizei width
, GLsizei height
);
150 extern void GLAPIENTRY
151 _es_RenderbufferStorageEXT(GLenum target
, GLenum internalFormat
,
152 GLsizei width
, GLsizei height
);
154 extern void GLAPIENTRY
155 _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target
, GLeglImageOES image
);
157 extern void GLAPIENTRY
158 _mesa_GetRenderbufferParameteriv(GLenum target
, GLenum pname
,
161 extern GLboolean GLAPIENTRY
162 _mesa_IsFramebuffer(GLuint framebuffer
);
164 extern void GLAPIENTRY
165 _mesa_BindFramebuffer(GLenum target
, GLuint framebuffer
);
167 extern void GLAPIENTRY
168 _mesa_DeleteFramebuffers(GLsizei n
, const GLuint
*framebuffers
);
170 extern void GLAPIENTRY
171 _mesa_GenFramebuffers(GLsizei n
, GLuint
*framebuffers
);
173 extern GLenum GLAPIENTRY
174 _mesa_CheckFramebufferStatus(GLenum target
);
176 extern void GLAPIENTRY
177 _mesa_FramebufferTexture1D(GLenum target
, GLenum attachment
,
178 GLenum textarget
, GLuint texture
, GLint level
);
180 extern void GLAPIENTRY
181 _mesa_FramebufferTexture2D(GLenum target
, GLenum attachment
,
182 GLenum textarget
, GLuint texture
, GLint level
);
184 extern void GLAPIENTRY
185 _mesa_FramebufferTexture3D(GLenum target
, GLenum attachment
,
186 GLenum textarget
, GLuint texture
,
187 GLint level
, GLint zoffset
);
189 extern void GLAPIENTRY
190 _mesa_FramebufferTextureLayer(GLenum target
, GLenum attachment
,
191 GLuint texture
, GLint level
, GLint layer
);
193 extern void GLAPIENTRY
194 _mesa_FramebufferRenderbuffer(GLenum target
, GLenum attachment
,
195 GLenum renderbuffertarget
,
196 GLuint renderbuffer
);
198 extern void GLAPIENTRY
199 _mesa_GetFramebufferAttachmentParameteriv(GLenum target
, GLenum attachment
,
200 GLenum pname
, GLint
*params
);
202 extern void GLAPIENTRY
203 _mesa_GenerateMipmap(GLenum target
);
206 extern void GLAPIENTRY
207 _mesa_BlitFramebuffer(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
208 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
209 GLbitfield mask
, GLenum filter
);
211 extern void GLAPIENTRY
212 _mesa_InvalidateSubFramebuffer(GLenum target
, GLsizei numAttachments
,
213 const GLenum
*attachments
, GLint x
, GLint y
,
214 GLsizei width
, GLsizei height
);
216 extern void GLAPIENTRY
217 _mesa_InvalidateFramebuffer(GLenum target
, GLsizei numAttachments
,
218 const GLenum
*attachments
);
220 extern void GLAPIENTRY
221 _mesa_DiscardFramebufferEXT(GLenum target
, GLsizei numAttachments
,
222 const GLenum
*attachments
);
224 #endif /* FBOBJECT_H */