1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-05 13:53:38 +00:00
lovr/src/graphics/canvas.h

35 lines
769 B
C
Raw Normal View History

#include "graphics/texture.h"
#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-24 21:43:39 +00:00
typedef enum {
DEPTH_D16,
DEPTH_D32,
DEPTH_D24S8,
DEPTH_NONE
} DepthFormat;
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;
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);