Add way to query the size of an FBO

This commit is contained in:
Henrik Rydgard 2013-02-02 12:36:09 +01:00
parent 09a37c4e28
commit f22ad17d40
2 changed files with 8 additions and 0 deletions

View File

@ -170,3 +170,8 @@ void fbo_destroy(FBO *fbo) {
glDeleteTextures(1, &fbo->color_texture);
glDeleteRenderbuffers(1, &fbo->z_stencil_buffer);
}
void fbo_get_dimensions(FBO *fbo, int *w, int *h) {
*w = fbo->width;
*h = fbo->height;
}

View File

@ -1,6 +1,8 @@
#pragma once
// Simple wrapper around FBO functionality.
// Very C-ish API because that's what I felt like, and it's cool to completely
// hide the data from callers...
struct FBO;
@ -29,3 +31,4 @@ void fbo_bind_color_as_texture(FBO *fbo, int color);
void fbo_bind_for_read(FBO *fbo);
void fbo_unbind();
void fbo_destroy(FBO *fbo);
void fbo_get_dimensions(FBO *fbo, int *w, int *h);