2018-08-22 04:08:40 +00:00
|
|
|
#include "graphics/texture.h"
|
|
|
|
|
2018-02-15 08:37:02 +00:00
|
|
|
#pragma once
|
2017-12-07 07:50:52 +00:00
|
|
|
|
2018-08-24 01:28:37 +00:00
|
|
|
#define MAX_CANVAS_ATTACHMENTS 4
|
2018-08-22 04:08:40 +00:00
|
|
|
|
2018-08-24 21:43:39 +00:00
|
|
|
typedef enum {
|
|
|
|
DEPTH_D16,
|
|
|
|
DEPTH_D32,
|
|
|
|
DEPTH_D24S8,
|
|
|
|
DEPTH_NONE
|
|
|
|
} DepthFormat;
|
|
|
|
|
2018-08-22 04:08:40 +00:00
|
|
|
typedef struct {
|
|
|
|
Texture* texture;
|
|
|
|
int slice;
|
|
|
|
int level;
|
|
|
|
} Attachment;
|
|
|
|
|
2018-08-24 21:43:39 +00:00
|
|
|
typedef struct {
|
|
|
|
DepthFormat depth;
|
2018-08-25 01:38:46 +00:00
|
|
|
bool stereo;
|
2018-08-24 21:43:39 +00:00
|
|
|
} CanvasFlags;
|
|
|
|
|
2018-07-09 07:51:09 +00:00
|
|
|
typedef struct Canvas Canvas;
|
|
|
|
|
2018-08-24 21:43:39 +00:00
|
|
|
Canvas* lovrCanvasCreate(int width, int height, CanvasFlags flags);
|
2018-02-26 08:59:03 +00:00
|
|
|
void lovrCanvasDestroy(void* ref);
|
2018-08-24 01:28:37 +00:00
|
|
|
const Attachment* lovrCanvasGetAttachments(Canvas* canvas, int* count);
|
|
|
|
void lovrCanvasSetAttachments(Canvas* canvas, Attachment* attachments, int count);
|
|
|
|
void lovrCanvasBind(Canvas* canvas);
|
2018-08-29 04:16:19 +00:00
|
|
|
bool lovrCanvasIsStereo(Canvas* canvas);
|
2018-08-27 19:42:18 +00:00
|
|
|
uint32_t lovrCanvasGetWidth(Canvas* canvas);
|
|
|
|
uint32_t lovrCanvasGetHeight(Canvas* canvas);
|