You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
1.9 KiB
90 lines
1.9 KiB
/*
|
|
Copyright 2020-2021 Brad Parker
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
#include "video.h"
|
|
|
|
VideoState::VideoState(QObject *parent) :
|
|
QObject(parent)
|
|
,m_context(nullptr)
|
|
,m_aspectCorrectedRect()
|
|
,m_avInfo()
|
|
,m_baseWidth(0)
|
|
,m_baseHeight(0)
|
|
,m_aspect(1.0f)
|
|
,m_fbo(nullptr)
|
|
{
|
|
}
|
|
|
|
VideoState* VideoState::instance() {
|
|
static VideoState instance;
|
|
return &instance;
|
|
}
|
|
|
|
void VideoState::setContext(QOpenGLContext *context) {
|
|
m_context = context;
|
|
}
|
|
|
|
QOpenGLContext* VideoState::context() {
|
|
return m_context;
|
|
}
|
|
|
|
void VideoState::setAspectCorrectedRect(QRect r) {
|
|
m_aspectCorrectedRect = r;
|
|
}
|
|
|
|
QRect VideoState::aspectCorrectedRect() {
|
|
return m_aspectCorrectedRect;
|
|
}
|
|
|
|
QOpenGLFramebufferObject* VideoState::fbo() {
|
|
return m_fbo;
|
|
}
|
|
|
|
void VideoState::setFBO(QOpenGLFramebufferObject *fbo) {
|
|
m_fbo = fbo;
|
|
}
|
|
|
|
unsigned VideoState::baseWidth() {
|
|
return m_baseWidth;
|
|
}
|
|
|
|
void VideoState::setBaseWidth(unsigned width) {
|
|
m_baseWidth = width;
|
|
}
|
|
|
|
unsigned VideoState::baseHeight() {
|
|
return m_baseHeight;
|
|
}
|
|
|
|
void VideoState::setBaseHeight(unsigned height) {
|
|
m_baseHeight = height;
|
|
}
|
|
|
|
float VideoState::aspect() {
|
|
return m_aspect;
|
|
}
|
|
|
|
void VideoState::setAspect(float aspect) {
|
|
m_aspect = aspect;
|
|
}
|
|
|
|
struct retro_system_av_info* VideoState::avInfo() {
|
|
return &m_avInfo;
|
|
}
|
|
|
|
void VideoState::setAvInfo(struct retro_system_av_info info) {
|
|
m_avInfo = info;
|
|
}
|
|
|