2023-02-21 07:12:30 +00:00
|
|
|
/* Copyright (c) 2013-2023 Jeffrey Pfau
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2023-04-19 12:35:36 +00:00
|
|
|
#include <mgba/feature/video-backend.h>
|
2023-02-21 07:12:30 +00:00
|
|
|
|
2023-03-19 10:03:55 +00:00
|
|
|
void VideoBackendGetFrame(const struct VideoBackend* v, struct mRectangle* frame) {
|
2023-03-01 07:34:55 +00:00
|
|
|
memset(frame, 0, sizeof(*frame));
|
2023-02-21 07:12:30 +00:00
|
|
|
int i;
|
|
|
|
for (i = 0; i < VIDEO_LAYER_MAX; ++i) {
|
2023-03-19 10:03:55 +00:00
|
|
|
struct mRectangle dims;
|
2023-02-21 07:12:30 +00:00
|
|
|
v->layerDimensions(v, i, &dims);
|
2023-03-19 10:03:55 +00:00
|
|
|
mRectangleUnion(frame, &dims);
|
2023-02-21 07:12:30 +00:00
|
|
|
}
|
|
|
|
}
|
2023-03-01 07:34:55 +00:00
|
|
|
|
|
|
|
void VideoBackendGetFrameSize(const struct VideoBackend* v, unsigned* width, unsigned* height) {
|
2023-03-19 10:03:55 +00:00
|
|
|
struct mRectangle frame;
|
2023-03-01 07:34:55 +00:00
|
|
|
VideoBackendGetFrame(v, &frame);
|
|
|
|
*width = frame.width;
|
|
|
|
*height = frame.height;
|
|
|
|
}
|