2018-07-04 10:36:16 +02:00
|
|
|
/*
|
2019-08-03 19:43:48 +02:00
|
|
|
* This software is licensed under the terms of the MIT License.
|
2018-07-04 10:36:16 +02:00
|
|
|
* See COPYING for further information.
|
|
|
|
* ---
|
2024-05-16 23:30:41 +02:00
|
|
|
* Copyright (c) 2011-2024, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2024, Andrei Alexeyev <akari@taisei-project.org>.
|
2018-07-04 10:36:16 +02:00
|
|
|
*/
|
|
|
|
|
2021-08-12 23:09:01 +02:00
|
|
|
#pragma once
|
2018-07-04 10:36:16 +02:00
|
|
|
#include "taisei.h"
|
|
|
|
|
2019-08-25 01:28:46 +02:00
|
|
|
#include "fbutil.h"
|
2018-07-04 10:36:16 +02:00
|
|
|
|
|
|
|
typedef struct FBPair {
|
|
|
|
/*
|
|
|
|
* Rule of thumb:
|
|
|
|
* 1. Bind back buffer;
|
|
|
|
* 2. Draw front buffer;
|
|
|
|
* 3. Call fbpair_swap;
|
|
|
|
* 4. Rinse, repeat.
|
|
|
|
*/
|
|
|
|
|
2018-08-27 09:08:14 +02:00
|
|
|
Framebuffer *front;
|
|
|
|
Framebuffer *back;
|
2018-07-04 10:36:16 +02:00
|
|
|
} FBPair;
|
|
|
|
|
2019-02-22 00:56:03 +01:00
|
|
|
void fbpair_create(FBPair *pair, uint num_attachments, FBAttachmentConfig attachments[num_attachments], const char *debug_label) attr_nonnull(1, 3);
|
2018-07-04 10:36:16 +02:00
|
|
|
void fbpair_resize(FBPair *pair, FramebufferAttachment attachment, uint width, uint height) attr_nonnull(1);
|
|
|
|
void fbpair_resize_all(FBPair *pair, uint width, uint height) attr_nonnull(1);
|
|
|
|
void fbpair_destroy(FBPair *pair) attr_nonnull(1);
|
|
|
|
void fbpair_swap(FBPair *pair) attr_nonnull(1);
|
2019-04-04 01:43:03 +02:00
|
|
|
void fbpair_viewport(FBPair *pair, float x, float y, float w, float h) attr_nonnull(1);
|
|
|
|
void fbpair_viewport_rect(FBPair *pair, FloatRect vp) attr_nonnull(1);
|