// // NSWrapper.hpp // XcodeOpenCL // // Created by Joshua Moerman on 13/04/14. // // #pragma once #include #include #include #include #include struct GLContext; struct ContextParameters{ GLContext & context; // These two functions will be set when invoking the draw_callback (and should be used) std::function bind_framebuffer; // function to bind the systems framebuffer and set the viewport std::function flush_drawable; // function to flush the drawable }; struct GLViewFunctionality { // All three will only be called with the current gl context already set // May be called from different threads std::function initialize_callback; std::function draw_callback; std::function resize_callback; }; struct Control { std::string name = "default"; double start = 0, min = 0, max = 1; std::function callback; }; struct ControlFunctionality { std::vector sliders; }; // returns a GLViewFunctionality with only its draw function set. GLViewFunctionality simple_draw(std::function f); struct NSAppWrapper { NSAppWrapper(); ~NSAppWrapper(); void run(); void create_window(GLViewFunctionality const &); void create_window(ControlFunctionality const &); std::unique_ptr impl; };