renderer: remove old r_screenshot() API
This commit is contained in:
parent
f11a09649d
commit
8d5ffe4b91
8 changed files with 0 additions and 39 deletions
|
@ -841,10 +841,6 @@ void r_swap(SDL_Window *window) {
|
|||
B.swap(window);
|
||||
}
|
||||
|
||||
bool r_screenshot(Pixmap *out) {
|
||||
return B.screenshot(out);
|
||||
}
|
||||
|
||||
// uniforms garbage; hope your compiler is smart enough to inline most of this
|
||||
|
||||
// TODO: verify sampler-to-texture type consistency?
|
||||
|
|
|
@ -823,8 +823,6 @@ VsyncMode r_vsync_current(void);
|
|||
|
||||
void r_swap(SDL_Window *window);
|
||||
|
||||
bool r_screenshot(Pixmap *dest) attr_nodiscard attr_nonnull(1);
|
||||
|
||||
void r_mat_mv_push(void);
|
||||
void r_mat_mv_push_premade(mat4 mat);
|
||||
void r_mat_mv_push_identity(void);
|
||||
|
|
|
@ -132,8 +132,6 @@ typedef struct RendererFuncs {
|
|||
VsyncMode (*vsync_current)(void);
|
||||
|
||||
void (*swap)(SDL_Window *window);
|
||||
|
||||
bool (*screenshot)(Pixmap *dst);
|
||||
} RendererFuncs;
|
||||
|
||||
typedef struct RendererBackend {
|
||||
|
|
|
@ -1426,18 +1426,6 @@ static DepthTestFunc gl33_depth_func_current(void) {
|
|||
return R.depth_test.func.pending;
|
||||
}
|
||||
|
||||
static bool gl33_screenshot(Pixmap *out) {
|
||||
FloatRect *vp = &R.viewport.default_framebuffer;
|
||||
out->width = vp->w;
|
||||
out->height = vp->h;
|
||||
out->format = PIXMAP_FORMAT_RGB8;
|
||||
out->origin = PIXMAP_ORIGIN_BOTTOMLEFT;
|
||||
out->data.untyped = pixmap_alloc_buffer_for_copy(out, &out->data_size);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glReadPixels(vp->x, vp->y, vp->w, vp->h, GL_RGB, GL_UNSIGNED_BYTE, out->data.untyped);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gl33_scissor(IntRect scissor) {
|
||||
R.scissor.pending = scissor;
|
||||
}
|
||||
|
@ -1542,7 +1530,6 @@ RendererBackend _r_backend_gl33 = {
|
|||
.vsync = gl33_vsync,
|
||||
.vsync_current = gl33_vsync_current,
|
||||
.swap = gl33_swap,
|
||||
.screenshot = gl33_screenshot,
|
||||
},
|
||||
.custom = &(GLBackendData) {
|
||||
.vtable = {
|
||||
|
|
|
@ -46,7 +46,6 @@ RendererBackend _r_backend_gles30 = {
|
|||
.funcs = {
|
||||
.init = gles30_init,
|
||||
.texture_dump = gles_texture_dump,
|
||||
.screenshot = gles_screenshot,
|
||||
|
||||
#if BROKEN_GL_BLIT_FRAMEBUFFER
|
||||
.shutdown = gles30_shutdown,
|
||||
|
|
|
@ -71,19 +71,6 @@ void gles_init_context(SDL_Window *w) {
|
|||
GLVT_OF(_r_backend_gl33).init_context(w);
|
||||
}
|
||||
|
||||
bool gles_screenshot(Pixmap *out) {
|
||||
FloatRect vp;
|
||||
r_framebuffer_viewport_current(NULL, &vp);
|
||||
out->width = vp.w;
|
||||
out->height = vp.h;
|
||||
out->format = PIXMAP_FORMAT_RGBA8;
|
||||
out->origin = PIXMAP_ORIGIN_BOTTOMLEFT;
|
||||
out->data.untyped = pixmap_alloc_buffer_for_copy(out, &out->data_size);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glReadPixels(vp.x, vp.y, vp.w, vp.h, GL_RGBA, GL_UNSIGNED_BYTE, out->data.untyped);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool gles_texture_dump(Texture *tex, uint mipmap, uint layer, Pixmap *dst) {
|
||||
// No glGetTexImage in GLES
|
||||
// TODO maybe set up a transient framebuffer to read from?
|
||||
|
|
|
@ -13,5 +13,4 @@
|
|||
|
||||
void gles_init(RendererBackend *gles_backend, int major, int minor);
|
||||
void gles_init_context(SDL_Window *w);
|
||||
bool gles_screenshot(Pixmap *out);
|
||||
bool gles_texture_dump(Texture *tex, uint mipmap, uint layer, Pixmap *dst);
|
||||
|
|
|
@ -194,8 +194,6 @@ static VsyncMode null_vsync_current(void) { return VSYNC_NONE; }
|
|||
|
||||
static void null_swap(SDL_Window *window) { }
|
||||
|
||||
static bool null_screenshot(Pixmap *dest) { return false; }
|
||||
|
||||
RendererBackend _r_backend_null = {
|
||||
.name = "null",
|
||||
.funcs = {
|
||||
|
@ -292,6 +290,5 @@ RendererBackend _r_backend_null = {
|
|||
.vsync = null_vsync,
|
||||
.vsync_current = null_vsync_current,
|
||||
.swap = null_swap,
|
||||
.screenshot = null_screenshot,
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue