2023-01-12 20:49:14 +01:00
|
|
|
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
Visual Studio
|
|
|
|
=============
|
|
|
|
|
2023-01-12 20:39:50 +01:00
|
|
|
`Visual Studio Community ( https://visualstudio.microsoft.com )` is a Windows-only IDE
|
|
|
|
by `Microsoft ( https://microsoft.com )`_ that's free for non-commercial use.
|
2022-03-18 17:46:08 +01:00
|
|
|
It has many useful features, such as memory view, performance view, source
|
|
|
|
control and more.
|
|
|
|
|
|
|
|
Importing the project
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
Visual Studio requires a solution file to work on a project. While Godot does not come
|
|
|
|
with the solution file, it can be generated using SCons.
|
|
|
|
|
|
|
|
- Navigate to the Godot root folder and open a Command Prompt or PowerShell window.
|
2023-01-12 19:43:03 +01:00
|
|
|
- Run `scons platform=windows vsproj=yes` to generate the solution.
|
|
|
|
- You can now open the project by double-clicking on the `godot.sln` in the project root
|
2022-03-18 17:46:08 +01:00
|
|
|
or by using the **Open a project or solution** option inside of the Visual Studio.
|
|
|
|
- Use the **Build** top menu to build the project.
|
|
|
|
|
|
|
|
.. warning:: Visual Studio must be configured with the C++ package. It can be selected
|
|
|
|
in the intaller:
|
|
|
|
|
2023-01-12 20:16:00 +01:00
|
|
|
.. figure:: img/vs_1_install_cpp_package.png)
|
2022-03-18 17:46:08 +01:00
|
|
|
:align: center
|
|
|
|
|
|
|
|
Debugging the project
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
Visual Studio features a powerful debugger. This allows the user to examine Godot's
|
|
|
|
source code, stop at specific points in the code, inspect the current execution context,
|
|
|
|
and make live changes to the codebase.
|
|
|
|
|
|
|
|
You can launch the project with the debugger attached using the **Debug > Start Debugging**
|
|
|
|
option from the top menu. However, unless you want to debug the project manager specifically,
|
|
|
|
you'd need to configure debugging options first. This is due to the fact that when the Godot
|
|
|
|
project manager opens a project, the initial process is terminated and the debugger gets detached.
|
|
|
|
|
|
|
|
- To configure the launch options to use with the debugger use **Project > Properties**
|
|
|
|
from the top menu:
|
|
|
|
|
2023-01-12 20:16:00 +01:00
|
|
|
.. figure:: img/vs_2_project_properties.png)
|
2022-03-18 17:46:08 +01:00
|
|
|
:align: center
|
|
|
|
|
|
|
|
- Open the **Debugging** section and under **Command Arguments** add two new arguments:
|
2023-01-12 19:43:03 +01:00
|
|
|
the `-e` flag opens the editor instead of the project manager, and the `--path` argument
|
2022-03-18 17:46:08 +01:00
|
|
|
tells the executable to open the specified project (must be provided as an *absolute* path
|
2023-01-12 19:43:03 +01:00
|
|
|
to the project root, not the `project.godot` file).
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-01-12 20:16:00 +01:00
|
|
|
.. figure:: img/vs_3_debug_command_line.png)
|
2022-03-18 17:46:08 +01:00
|
|
|
:align: center
|
|
|
|
|
|
|
|
To learn more about command line arguments, refer to the
|
2023-01-12 20:47:54 +01:00
|
|
|
`command line tutorial ( doc_command_line_tutorial )`.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
Even if you start the project without a debugger attached it can still be connected to the running
|
|
|
|
process using **Debug > Attach to Process...** menu.
|
|
|
|
|
2023-01-12 19:43:03 +01:00
|
|
|
To check that everything is working, put a breakpoint in `main.cpp` and press :kbd:`F5` to
|
2022-03-18 17:46:08 +01:00
|
|
|
start debugging.
|
|
|
|
|
2023-01-12 20:16:00 +01:00
|
|
|
.. figure:: img/vs_4_debugging_main.png)
|
2022-03-18 17:46:08 +01:00
|
|
|
:align: center
|
|
|
|
|
|
|
|
If you run into any issues, ask for help in one of
|
2023-01-12 20:39:50 +01:00
|
|
|
`Godot's community channels ( https://godotengine.org/community )`.
|