]> git.sesse.net Git - nageru/blobdiff - flow.cpp
Support other streams than the default file.
[nageru] / flow.cpp
index 71b0b23c6f85033f10cdbe93fb12798e2649778e..e672fe6f6d8fefb8ecc97935b73af79ee3495f8e 100644 (file)
--- a/flow.cpp
+++ b/flow.cpp
@@ -1,21 +1,20 @@
 #define NO_SDL_GLEXT 1
 
-#include <epoxy/gl.h>
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
 #include "flow.h"
+
 #include "gpu_timers.h"
 #include "util.h"
 
 #include <algorithm>
+#include <assert.h>
 #include <deque>
-#include <memory>
+#include <epoxy/gl.h>
 #include <map>
+#include <memory>
 #include <stack>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
 #include <vector>
 
 #define BUFFER_OFFSET(i) ((char *)nullptr + (i))
@@ -80,7 +79,7 @@ string read_file(const string &filename)
        }
        if (ret == 0) {
                fprintf(stderr, "Short read when trying to read %d bytes from %s\n",
-                               size, filename.c_str());
+                       size, filename.c_str());
                exit(1);
        }
        fclose(fp);
@@ -88,11 +87,10 @@ string read_file(const string &filename)
        return str;
 }
 
-
 GLuint compile_shader(const string &shader_src, GLenum type)
 {
        GLuint obj = glCreateShader(type);
-       const GLcharsource[] = { shader_src.data() };
+       const GLchar *source[] = { shader_src.data() };
        const GLint length[] = { (GLint)shader_src.size() };
        glShaderSource(obj, 1, source, length);
        glCompileShader(obj);
@@ -953,11 +951,8 @@ void Blend::exec(GLuint image_tex, GLuint flow_tex, GLuint output_tex, GLuint ou
        glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 }
 
-Interpolate::Interpolate(int width, int height, const OperatingPoint &op, bool split_ycbcr_output)
-       : width(width),
-         height(height),
-         flow_level(op.finest_level),
-         op(op),
+Interpolate::Interpolate(const OperatingPoint &op, bool split_ycbcr_output)
+       : flow_level(op.finest_level),
          split_ycbcr_output(split_ycbcr_output),
          splat(op),
          blend(split_ycbcr_output) {