Multiple windows : how to know which window is being drawn?

Not sure if it is possible.
I want to programmatically create multiple windows. a lot of them.
I want to know if it is possible to identify which window is being drawn if I bind all windows to the same event.
or any solution which is not declaring a lot of functions like drawSecondWindow1, drawSecondWindow2, etc.

		allWindows.emplace_back(ofCreateWindow(settings));
		ofAddListener(allWindows.back()->events().draw, this, &ofApp::drawSecondWindow);

Not a great solution but you can get the current window shared_ptr from ofMainLoop.

//has to be inside the draw function 
auto mainLoop = ofGetMainLoop();
auto currentWindow = mainLoop->getCurrentWindow();

//You can then compare the pointer address
for( auto & win : allWindows ){
  if( win.get() == currentWindow.get() ){
     //we have matched the window.
     break;
  }
}

thank you, it worked.

I’m still trying to figure out how to focus the main window (focus and keyboard input) after window creation. Is this makeCurrent() ?

		ofGLFWWindowSettings settings;
		settings.windowMode = OF_WINDOW;
		auto mainWindow = ofGetCurrentWindow();
		settings.shareContextWith = mainWindow;
		for (int a=0; a<10; a++) {
			settings.setSize( 200, 200 );
			int spacing = 25;
			settings.setPosition( { a * spacing + 140, a * spacing + 140 });
			allWindows.emplace_back(ofCreateWindow(settings));
			ofAddListener(allWindows.back()->events().draw, this, &ofApp::drawSecondWindow);
		}
		mainWindow.get()->makeCurrent();