Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Title bar display and closing problem

Title bar display and closing problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++game-devlinuxtutorial
3 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeanjean Lesage
    wrote on last edited by
    #1

    Hello, I'm a beginner in C++ and SFML for game creation under linux(Pop!_OS 22.04 LTS). I tested the code on the official SFML website, everything seems to work but the title bar doesn't display; it's the same with other codes. I need your help, please. Here is an example of a code I tested:

    #include
    #include
    #include
    #include
    #include

    int main()
    {
    sf::RenderWindow window(sf::VideoMode(640, 480), "SFML works!", sf::Style::Titlebar);
    sf::Event ev;

    while(window.isOpen()){
        
        while(window.pollEvent(ev)){
    
            switch(ev.type){
                case sf::Event::Closed:
                    window.close();
                    break;
                case sf::Event::KeyPressed:
                    if(ev.key.code == sf::Keyboard::Escape){
                        window.close();
                        break;
                    }
                default:
                    break;
            }
             
        }
    
        //Render
        window.clear(sf::Color::Blue);
        window.display();
    }
    
    return 0;
    

    }

    L 1 Reply Last reply
    0
    • J Jeanjean Lesage

      Hello, I'm a beginner in C++ and SFML for game creation under linux(Pop!_OS 22.04 LTS). I tested the code on the official SFML website, everything seems to work but the title bar doesn't display; it's the same with other codes. I need your help, please. Here is an example of a code I tested:

      #include
      #include
      #include
      #include
      #include

      int main()
      {
      sf::RenderWindow window(sf::VideoMode(640, 480), "SFML works!", sf::Style::Titlebar);
      sf::Event ev;

      while(window.isOpen()){
          
          while(window.pollEvent(ev)){
      
              switch(ev.type){
                  case sf::Event::Closed:
                      window.close();
                      break;
                  case sf::Event::KeyPressed:
                      if(ev.key.code == sf::Keyboard::Escape){
                          window.close();
                          break;
                      }
                  default:
                      break;
              }
               
          }
      
          //Render
          window.clear(sf::Color::Blue);
          window.display();
      }
      
      return 0;
      

      }

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Your question is about SFML rather than C++. You are more likely to get an answer at SFML[^]

      J 1 Reply Last reply
      0
      • L Lost User

        Your question is about SFML rather than C++. You are more likely to get an answer at SFML[^]

        J Offline
        J Offline
        Jeanjean Lesage
        wrote on last edited by
        #3

        Ok. I'll post it in SFML forum.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups