mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-19 19:01:38 +02:00
v108.9
* multi-monitor support * improved pause/frame advance support * added option to disable video dimming when idle
This commit is contained in:
@@ -148,7 +148,7 @@ auto OpenGL::output() -> void {
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glrParameters(sources[0].filter, sources[0].wrap);
|
||||
p.render(sources[0].width, sources[0].height, targetWidth, targetHeight);
|
||||
p.render(sources[0].width, sources[0].height, 0, 0, targetWidth, targetHeight);
|
||||
glBindTexture(GL_TEXTURE_2D, p.texture);
|
||||
|
||||
p.phase = (p.phase + 1) % p.modulo;
|
||||
@@ -168,7 +168,7 @@ auto OpenGL::output() -> void {
|
||||
glrUniform4f("outputSize", outputWidth, outputHeight, 1.0 / outputWidth, 1.0 / outputHeight);
|
||||
|
||||
glrParameters(sources[0].filter, sources[0].wrap);
|
||||
render(sources[0].width, sources[0].height, outputWidth, outputHeight);
|
||||
render(sources[0].width, sources[0].height, outputX, outputY, outputWidth, outputHeight);
|
||||
|
||||
if(history.size() > 0) {
|
||||
OpenGLTexture frame = history.takeRight();
|
||||
|
@@ -38,7 +38,7 @@ struct OpenGLSurface : OpenGLTexture {
|
||||
auto allocate() -> void;
|
||||
auto size(uint width, uint height) -> void;
|
||||
auto release() -> void;
|
||||
auto render(uint sourceWidth, uint sourceHeight, uint targetWidth, uint targetHeight) -> void;
|
||||
auto render(uint sourceWidth, uint sourceHeight, uint targetX, uint targetY, uint targetWidth, uint targetHeight) -> void;
|
||||
|
||||
GLuint program = 0;
|
||||
GLuint framebuffer = 0;
|
||||
@@ -76,6 +76,8 @@ struct OpenGL : OpenGLProgram {
|
||||
vector<OpenGLProgram> programs;
|
||||
vector<OpenGLTexture> history;
|
||||
GLuint inputFormat = GL_RGBA8;
|
||||
uint outputX = 0;
|
||||
uint outputY = 0;
|
||||
uint outputWidth = 0;
|
||||
uint outputHeight = 0;
|
||||
struct Setting {
|
||||
|
@@ -37,13 +37,14 @@ auto OpenGLSurface::release() -> void {
|
||||
width = 0, height = 0;
|
||||
}
|
||||
|
||||
auto OpenGLSurface::render(uint sourceWidth, uint sourceHeight, uint targetWidth, uint targetHeight) -> void {
|
||||
glViewport(0, 0, targetWidth, targetHeight);
|
||||
auto OpenGLSurface::render(uint sourceWidth, uint sourceHeight, uint targetX, uint targetY, uint targetWidth, uint targetHeight) -> void {
|
||||
glViewport(targetX, targetY, targetWidth, targetHeight);
|
||||
|
||||
float w = (float)sourceWidth / (float)glrSize(sourceWidth);
|
||||
float h = (float)sourceHeight / (float)glrSize(sourceHeight);
|
||||
float u = (float)targetWidth, v = (float)targetHeight;
|
||||
GLint location;
|
||||
|
||||
float u = (float)targetWidth;
|
||||
float v = (float)targetHeight;
|
||||
|
||||
GLfloat modelView[] = {
|
||||
1, 0, 0, 0,
|
||||
|
Reference in New Issue
Block a user