File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
code_blocks/example_opengl Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ using namespace std;
66
77int main (int argc, char * argv[]) {
88 easy_plot::init (&argc, argv);
9- // cout << "Hello world !" << endl;
9+ cout << " Hello plot !" << endl;
1010
1111 easy_plot::WindowSpec wstyle0;
1212 wstyle0.is_zero_x_line = true ;
Original file line number Diff line number Diff line change 55#include < string>
66#include < vector>
77#include < thread>
8+ #include < future>
89#include < atomic>
910#include < mutex>
1011#include < stdarg.h>
@@ -622,13 +623,15 @@ namespace easy_plot {
622623 };
623624// ------------------------------------------------------------------------------
624625 static std::mutex drawings_mutex;
626+ static std::future<void > drawings_future;
625627// ------------------------------------------------------------------------------
626628 /* * \brief Инициализировать работу с графиками
627- * \param argc
628- * \param argv
629+ * \param argc аргумент командной строки
630+ * \param argv аргумент командной строки
629631 */
630632 void init (int *argc, char *argv[]) {
631- std::thread glut_thread ([&, argc, argv]() {
633+ drawings_future = std::async (std::launch::async,[&, argc, argv]() {
634+ // std::thread glut_thread([&, argc, argv]() {
632635 // инициализируем FREEGLUT
633636 glutInit (argc, argv);
634637 // чтобы можно было закрывать окна
@@ -648,7 +651,7 @@ namespace easy_plot {
648651 std::this_thread::yield ();
649652 }
650653 });
651- glut_thread.detach ();
654+ // glut_thread.detach();
652655 }
653656// ------------------------------------------------------------------------------
654657 int get_pos_plot (std::string name) {
You can’t perform that action at this time.
0 commit comments