Skip to content

Commit

Permalink
2.0.8.0 (Version 12)
Browse files Browse the repository at this point in the history
  • Loading branch information
leadedge committed Aug 27, 2024
1 parent b04ffc9 commit 4a0209a
Show file tree
Hide file tree
Showing 11 changed files with 1,053 additions and 47 deletions.
71 changes: 42 additions & 29 deletions examples/SpoutSender/SpoutSender.pde
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,24 @@ void setup() {
size(640, 360, P3D);
textureMode(NORMAL);

// Screen text size
textSize(18);

// Create a graphics object
pgr = createGraphics(1280, 720, P3D);

// Load an image
img = loadImage("data/SpoutLogoMarble3.jpg");

// The dimensions of graphics or image objects
// do not have to be the same as the sketch window

// CREATE A NEW SPOUT OBJECT
spout = new Spout(this);

// Option - enable Spout logging to detect warnings and errors.
// Note that the concolelogs will only show up in the sketch console
// window after the sketch is closed and not while the sketch is running.
spout.setSenderName("Spout Sender");

//
// Option - logging
//
// Enable Spout logging to detect warnings and errors.
//
// Note that the logs will show up in the sketch console
// window only after the sketch is closed and not while
// the sketch is running.
//
// spout.enableSpoutLog();
//
// You can set the level above which the logs are shown
// Set the level above which the logs are shown
// 0 : SPOUT_LOG_SILENT
// 1 : SPOUT_LOG_VERBOSE
// 2 : SPOUT_LOG_NOTICE (default)
Expand Down Expand Up @@ -82,29 +79,20 @@ void setup() {
// spout.spoutLogVerbose("Message");
//

// GIVE THE SENDER A NAME
// A sender can be given any name.
// Otherwise the sketch folder name is used
// the first time "sendTexture" is called.
spout.setSenderName("Spout Processing Sender");

// Option - set the sketch frame rate.
// Receivers 2.007 or higher will detect this rate
// frameRate(30);

//
// Option - infoBox, messageBox, optionBox, inputBox
// Can be used within the sketch as required
// Refer to Spout for Processing, Spout class library reference

}
// Refer to the "SpoutUtils" example for details
// of logging and messagebox utility functions

} // end setup

void draw() {

background(0, 90, 100);
noStroke();

// OPTION 1: SEND THE TEXTURE OF THE DRAWING SURFACE
// Draw the rotating cube
pushMatrix();
translate(width/2.0, height/2.0, -100);
Expand All @@ -114,6 +102,18 @@ void draw() {
TexturedCube(img);
popMatrix();

background(0, 90, 100);
noStroke();

// OPTION 1: SEND THE TEXTURE OF THE DRAWING SURFACE
// Draw the rotating cube
pushMatrix();
translate(width/2.0, height/2.0, -100);
rotateX(frameCount/100.0);
rotateY(frameCount/100.0);
scale(110);
TexturedCube(img);
popMatrix();
// Send at the size of the window
spout.sendTexture();

Expand Down Expand Up @@ -142,7 +142,7 @@ void draw() {
// Send at the size of the image
spout.sendTexture(img);
*/

// Display info
text("Sending as : "
+ spout.getSenderName() + " ("
Expand All @@ -152,9 +152,22 @@ void draw() {
text("fps " + spout.getSenderFps() + " : frame "
+ spout.getSenderFrame(), 15, 50);
}
text("'n' - change sender name", 15, height-10);

}

void keyReleased()
{
if(key == 'n') {
String name = spout.spoutEditBox("Enter a new sender name");
if(name != null) {
spout.closeSender();
spout.setSenderName(name);
}
}
}


void TexturedCube(PImage tex) {

beginShape(QUADS);
Expand Down
Binary file added examples/SpoutSender/data/Spout.ico
Binary file not shown.
Loading

0 comments on commit 4a0209a

Please sign in to comment.