Created
October 28, 2012 17:34
-
-
Save cheery/3969234 to your computer and use it in GitHub Desktop.
WebGL interface proposal for node-video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LinuxVideoContext : public IVideoContext, public node::ObjectWrap { | |
bool IsCurrent(); | |
void MakeCurrent(); | |
void SwapBuffers(); | |
void Close(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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