2017-12-07 07:50:52 +00:00
|
|
|
#include "graphics/texture.h"
|
|
|
|
#include "util.h"
|
2018-03-22 16:40:35 +00:00
|
|
|
#include <stdbool.h>
|
2017-12-07 07:50:52 +00:00
|
|
|
|
2018-02-15 08:37:02 +00:00
|
|
|
#pragma once
|
2017-12-07 07:50:52 +00:00
|
|
|
|
2018-03-22 17:58:53 +00:00
|
|
|
typedef struct {
|
|
|
|
int msaa;
|
|
|
|
bool depth;
|
|
|
|
bool stencil;
|
|
|
|
bool stereo;
|
|
|
|
bool mipmaps;
|
|
|
|
} CanvasFlags;
|
|
|
|
|
2017-12-07 07:50:52 +00:00
|
|
|
typedef struct {
|
|
|
|
Texture texture;
|
|
|
|
GLuint framebuffer;
|
|
|
|
GLuint resolveFramebuffer;
|
2017-12-09 18:49:37 +00:00
|
|
|
GLuint depthStencilBuffer;
|
2017-12-07 07:50:52 +00:00
|
|
|
GLuint msaaTexture;
|
2018-03-22 17:58:53 +00:00
|
|
|
CanvasFlags flags;
|
2017-12-07 07:50:52 +00:00
|
|
|
} Canvas;
|
|
|
|
|
2017-12-09 18:49:37 +00:00
|
|
|
bool lovrCanvasSupportsFormat(TextureFormat format);
|
|
|
|
|
2018-03-22 17:58:53 +00:00
|
|
|
Canvas* lovrCanvasCreate(int width, int height, TextureFormat format, CanvasFlags flags);
|
2018-02-26 08:59:03 +00:00
|
|
|
void lovrCanvasDestroy(void* ref);
|
2018-03-05 10:48:36 +00:00
|
|
|
void lovrCanvasResolve(Canvas* canvas);
|
2017-12-09 18:52:46 +00:00
|
|
|
TextureFormat lovrCanvasGetFormat(Canvas* canvas);
|
2017-12-08 02:14:24 +00:00
|
|
|
int lovrCanvasGetMSAA(Canvas* canvas);
|