all repos — mgba @ 50402c830729f2ba5a6fc3e6facfd8b258f7f97d

mGBA Game Boy Advance Emulator

src/platform/3ds/ctr-gpu.h (view raw)

 1/* Copyright (c) 2015 Yuri Kunde Schlesner
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6
 7#ifndef GUI_GPU_H
 8#define GUI_GPU_H
 9
10#include <3ds.h>
11
12struct ctrTexture {
13	void* data;
14	u32 format;
15	u32 filter;
16	u16 width;
17	u16 height;
18};
19
20inline void ctrTexture_Init(struct ctrTexture* tex) {
21	tex->data = NULL;
22	tex->format = GPU_RGB565;
23	tex->filter = GPU_NEAREST;
24	tex->width = 0;
25	tex->height = 0;
26}
27
28Result ctrInitGpu(void);
29void ctrDeinitGpu(void);
30
31void ctrGpuBeginDrawing(void);
32void ctrGpuBeginFrame(int screen);
33void ctrGpuEndFrame(int screen, void* outputFramebuffer, int w, int h);
34void ctrGpuEndDrawing(void);
35
36void ctrSetViewportSize(s16 w, s16 h);
37
38void ctrActivateTexture(const struct ctrTexture* texture);
39void ctrAddRectScaled(u32 color, s16 x, s16 y, s16 w, s16 h, s16 u, s16 v, s16 uw, s16 vh);
40void ctrAddRect(u32 color, s16 x, s16 y, s16 u, s16 v, s16 w, s16 h);
41void ctrFlushBatch(void);
42
43#endif