Skip to content

Instantly share code, notes, and snippets.

Created February 26, 2018 18:00
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 anonymous/ec7aebdcf5202d40724ae528c86ead3d to your computer and use it in GitHub Desktop.
Save anonymous/ec7aebdcf5202d40724ae528c86ead3d to your computer and use it in GitHub Desktop.
void SpoutSingleThread() {
while (true) {
std::vector<SpoutReceiver*> spouts;
for (int i = 0; i < NUM_STREAMS; i++) {
SpoutReceiver* spout_receiver_ = new SpoutReceiver();
spout_receiver_->spout.interop.InitOpenGL();
char name_buffer[256];
std::string name = "spout_test" + std::to_string(i);
std::size_t length = std::string(name).copy(name_buffer, 255);
name_buffer[length] = '\0';
unsigned int width = 28;
unsigned int height = 16;
spout_receiver_->CreateReceiver(name_buffer, width, height);
spouts.push_back(spout_receiver_);
}
for (auto spout : spouts) {
spout->ReleaseReceiver();
spout->spout.interop.CloseOpenGL();
delete spout;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment