You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
615 B
39 lines
615 B
![]()
8 years ago
|
//
|
||
|
// NSGLWrapper.hpp
|
||
|
// XcodeOpenCL
|
||
|
//
|
||
|
// Created by Joshua Moerman on 13/04/14.
|
||
|
//
|
||
|
//
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <memory>
|
||
|
#include <functional>
|
||
|
|
||
|
#include <OpenGL/OpenGL.h>
|
||
|
#include <CoreVideo/CVDisplayLink.h>
|
||
|
|
||
|
struct GLContext {
|
||
|
GLContext();
|
||
|
~GLContext();
|
||
|
|
||
|
void set_as_current_context() const;
|
||
|
void lock();
|
||
|
void unlock();
|
||
|
|
||
|
CGLContextObj ctx{};
|
||
|
CGLPixelFormatObj pix{};
|
||
|
};
|
||
|
|
||
|
struct CVDisplayLinky {
|
||
|
CVDisplayLinky(GLContext const &);
|
||
|
~CVDisplayLinky();
|
||
|
|
||
|
void start();
|
||
|
void stop();
|
||
|
|
||
|
std::function<void()> callback;
|
||
|
CVDisplayLinkRef displayLink;
|
||
|
};
|