Skip to content

Instantly share code, notes, and snippets.

@cheery
Created October 28, 2012 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheery/3969234 to your computer and use it in GitHub Desktop.
Save cheery/3969234 to your computer and use it in GitHub Desktop.
WebGL interface proposal for node-video
class LinuxVideoContext : public IVideoContext, public node::ObjectWrap {
bool IsCurrent();
void MakeCurrent();
void SwapBuffers();
void Close();
};
class IVideoContext {
public:
virtual bool IsCurrent() = 0;
virtual void MakeCurrent() = 0;
virtual void SwapBuffers() = 0;
virtual void Close() = 0;
};
class WebGL : public node::ObjectWrap {
private:
IVideoContext* context;
inline MakeCurrentLazy() {
if (!context->IsCurrent()) context->MakeCurrent();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment