* multi-monitor support
* improved pause/frame advance support
* added option to disable video dimming when idle
This commit is contained in:
byuu
2019-08-16 19:44:16 +09:00
parent 252f479b22
commit 0b088b6b55
68 changed files with 2167 additions and 1365 deletions

View File

@@ -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();

View File

@@ -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 {

View File

@@ -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,