Scale line width with the internal upscaling

This commit is contained in:
Lionel Flandrin 2016-01-25 00:54:07 +01:00
parent 5e35aabdde
commit 466e9a914b
3 changed files with 16 additions and 2 deletions

View File

@ -4,6 +4,9 @@ This is an implementation of the [libretro](http://www.libretro.com/)
API for the [Rustation PlayStation
emulator](https://github.com/simias/rustation).
If you want to submit an issue please do so in the main Rustation
repository. I'm going to try to gather everything there.
## Build
You'll need [Rust and its package manager

@ -1 +1 @@
Subproject commit 2aa7799e5bb5b486004b8b711de26cae15e8071a
Subproject commit 1daf4faaade3c0fd1e9deace8e309e91303f1b46

View File

@ -2,7 +2,7 @@ use std::rc::Rc;
use std::default::Default;
use gl;
use gl::types::{GLuint, GLint, GLsizei, GLenum};
use gl::types::{GLuint, GLint, GLsizei, GLenum, GLfloat};
use arrayvec::ArrayVec;
use libc::c_uint;
use rustation::gpu::renderer::{Renderer, Vertex, PrimitiveAttributes};
@ -289,6 +289,12 @@ impl State for GlState {
self.apply_scissor();
// In case we're upscaling we need to increase the line width
// proportionally
unsafe {
gl::LineWidth(self.internal_upscaling as GLfloat);
}
// Bind `fb_texture` to texture unit 0
self.fb_texture.bind(gl::TEXTURE0);
}
@ -347,6 +353,10 @@ impl State for GlState {
self.command_buffer.program()
.uniform1ui("dither_scaling", dither_scaling).unwrap();
unsafe {
gl::LineWidth(upscaling as GLfloat);
}
// If the scaling factor has changed the frontend should be
// reconfigured. We can't do that here because it could
// destroy the OpenGL context which would destroy `self`
@ -420,6 +430,7 @@ impl State for GlState {
gl::UseProgram(0);
gl::BindVertexArray(0);
gl::BindFramebuffer(gl::DRAW_FRAMEBUFFER, 0);
gl::LineWidth(1.);
}
libretro::gl_frame_done(self.frontend_resolution.0,