visual_studio.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .. _doc_configuring_an_ide_vs:
  2. Visual Studio
  3. =============
  4. Visual Studio Community is a Windows-only IDE that's free for non-commercial use.
  5. It has many useful features, such as memory view, performance view, source
  6. control and more. You can get it
  7. `from Microsoft <https://visualstudio.microsoft.com/downloads/>`__.
  8. Setup
  9. -----
  10. To start developing with Visual Studio, follow these steps:
  11. - Open the Visual Studio Installer and install the C++ package:
  12. .. image:: img/vs_1_install_cpp_package.png
  13. - Open a Command Prompt or PowerShell window, use ``cd`` to reach the Godot source
  14. directory and run ``scons platform=windows vsproj=yes``.
  15. - Now open the Godot folder by clicking **Open a project or solution** and choose
  16. ``godot.sln``.
  17. - You can also double-click the ``godot.sln`` file in Explorer.
  18. You can now start developing with Visual Studio.
  19. Debugging
  20. ---------
  21. Visual Studio features a powerful debugger. This allows the user to examine Godot's
  22. source code, stop at specific points in the code, make changes, and view them on the run.
  23. .. note:: Debugging the Godot Engine inside the editor will require an extra setup step.
  24. Because opening Godot opens the Project Manager at first instead of the project
  25. you're working on, the debugger will detach as soon as you open a project.
  26. This means that the debugger will stop, even though Godot is still running in
  27. another process.
  28. To overcome this, you need to edit the debugging command line arguments in VS. In your
  29. project, click **Project > Project Properties**:
  30. .. image:: img/vs_2_project_properties.png
  31. Then add this to the command arguments:
  32. .. image:: img/vs_3_debug_command_line.png
  33. - The ``-e`` flag is for entering the editor directly (which skips the Project Manager).
  34. - The ``--path`` argument should be an *absolute* path to a project directory (not a
  35. `project.godot` file).
  36. To learn more about command line arguments, refer to the
  37. :ref:`command line tutorial <doc_command_line_tutorial>`.
  38. To check that everything is working, put a breakpoint in ``main.cpp`` and press F5 to
  39. start debugging.
  40. .. image:: img/vs_4_debugging_main.png
  41. If you run into any issues, ask for help in one of
  42. `Godot's community channels <https://godotengine.org/community>`__.