Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Keep Window Opened, but continue to use terminal  (Read 1104 times)

0 Members and 1 Guest are viewing this topic.

Romans

  • Newbie
  • *
  • Posts: 5
    • View Profile
Keep Window Opened, but continue to use terminal
« on: February 13, 2019, 03:38:03 pm »
Hello! I need to create a basic plotting program (already realized). But now i need to create a second Window, that needs to be opened during all the program use, in order to retrive the information (Observer). So, when i close my first window, i return on terminal, but this window need to rest opened.

I tried to declare it in an other function and put it in the first while of the first win, but nothing.

It's possible to do that? Thank you

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10821
    • View Profile
    • development blog
    • Email
Re: Keep Window Opened, but continue to use terminal
« Reply #1 on: February 13, 2019, 04:11:52 pm »
You're kind of vague on what window you're referring to.

If you want to keep the console window open after you close your SFML window, then you have to make sure, your code doesn't just exit the main() function.

If your goal is to return to a normal command/terminal but have the output of the application remain displayed, then you may need to pipe the output to the right buffer, which would be completely unrelated to SFML and you may find better help on StackOverflow or SuperUser.

So what exactly are you trying to achieve again?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Romans

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Keep Window Opened, but continue to use terminal
« Reply #2 on: February 13, 2019, 05:39:30 pm »
sorry, i need to keep actived a windows, but continue to use the terminal console. I'm trying using the threads that execute a function with a while(window.isopen()). But when i close it, also if i do thread.detach(), the console retrives: Failed to activate OpenGL context: the resource is already utilized

 

anything