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

Author Topic: making menu with different files  (Read 57 times)

0 Members and 1 Guest are viewing this topic.

voptik123

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
making menu with different files
« on: February 26, 2026, 08:26:58 am »
im new to sfml and is it possible to make main menu with a cpp file for menu thats links you to the game file ???

Hapax

  • Hero Member
  • *****
  • Posts: 3462
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: making menu with different files
« Reply #1 on: March 09, 2026, 11:58:23 pm »
It sounds like you want to write a program (menu) that can execute another program (game)...

I would question this design.
It's likely that the main menu (or similar) would be accessible from within the game (paused, for example) anyway but, even if not, you'll likely be returning to the menu after the game has been played.
So, it's probably better to include the menu "program" and game "program" into just one executable.

You can still access files from within C++ so you can always load main menu (or other menu) data from a separate file, if required.


With that being said, if you do need to launch another executable from within your program, you can do this but you'll need OS-specific code.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything