SDL: Add integer scaling

This commit is contained in:
Anty-Lemon 2017-05-06 18:59:53 -04:00 committed by endrift
parent b58d216868
commit 3889fd4d3f
4 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,7 @@ bool mSDLGLInit(struct mSDLRenderer* renderer) {
mGLContextCreate(&renderer->gl); mGLContextCreate(&renderer->gl);
renderer->gl.d.user = renderer; renderer->gl.d.user = renderer;
renderer->gl.d.lockAspectRatio = renderer->lockAspectRatio; renderer->gl.d.lockAspectRatio = renderer->lockAspectRatio;
renderer->gl.d.lockIntegerScaling = renderer->lockIntegerScaling;
renderer->gl.d.filter = renderer->filter; renderer->gl.d.filter = renderer->filter;
renderer->gl.d.swap = mSDLGLCommonSwap; renderer->gl.d.swap = mSDLGLCommonSwap;
renderer->gl.d.init(&renderer->gl.d, 0); renderer->gl.d.init(&renderer->gl.d, 0);

View File

@ -109,6 +109,7 @@ bool mSDLGLES2Init(struct mSDLRenderer* renderer) {
mGLES2ContextCreate(&renderer->gl2); mGLES2ContextCreate(&renderer->gl2);
renderer->gl2.d.user = renderer; renderer->gl2.d.user = renderer;
renderer->gl2.d.lockAspectRatio = renderer->lockAspectRatio; renderer->gl2.d.lockAspectRatio = renderer->lockAspectRatio;
renderer->gl2.d.lockIntegerScaling = renderer->lockIntegerScaling;
renderer->gl2.d.filter = renderer->filter; renderer->gl2.d.filter = renderer->filter;
renderer->gl2.d.swap = mSDLGLCommonSwap; renderer->gl2.d.swap = mSDLGLCommonSwap;
renderer->gl2.d.init(&renderer->gl2.d, 0); renderer->gl2.d.init(&renderer->gl2.d, 0);

View File

@ -114,6 +114,7 @@ int main(int argc, char** argv) {
#endif #endif
renderer.lockAspectRatio = renderer.core->opts.lockAspectRatio; renderer.lockAspectRatio = renderer.core->opts.lockAspectRatio;
renderer.lockIntegerScaling = renderer.core->opts.lockIntegerScaling;
renderer.filter = renderer.core->opts.resampleVideo; renderer.filter = renderer.core->opts.resampleVideo;
if (!mSDLInit(&renderer)) { if (!mSDLInit(&renderer)) {

View File

@ -65,6 +65,7 @@ struct mSDLRenderer {
int ratio; int ratio;
bool lockAspectRatio; bool lockAspectRatio;
bool lockIntegerScaling;
bool filter; bool filter;
#ifdef BUILD_GL #ifdef BUILD_GL