#pragma once #include "fbo.hpp" #include #include #include #include #include #include // Used for the bare points using GLPoint = moggle::hvector4; // Used for rendering a textured quad struct Vertex { moggle::vector2 pos; moggle::vector2 tex; }; struct App { size_t W = 128; size_t H = 128; size_t N = 1 << 18; float time = 0; float p_s = 10.962073; float p_r = 31.211250; float p_b = 1.537946; float p_dt = 0.013040; float maxf = 500; App(GLContext & gl_context); void draw(std::function bind, std::function flush); void resize(size_t w, size_t h); private: moggle::vbo gl_vbo; moggle::vao gl_vao; moggle::vbo gl_quad_vbo; moggle::vao gl_quad_vao; moggle::shader_program gl_points_program; moggle::shader_program gl_texture_program; moggle::fbo gl_fbo; cl::Context cl_context; cl::Device cl_device; cl::CommandQueue cl_queue; cl::BufferGL cl_buffer; cl::Program cl_program; KernelOp k_update; cl::Program create_cl_program(std::string file); };