|
1 | | -[openFrameworks](http://openframeworks.cc/) | [Documentation table of contents](table_of_contents.md) |
| 1 | +# Visual Studio |
2 | 2 |
|
3 | | -Visual Studio |
4 | | -============= |
| 3 | +## Prerequisites |
| 4 | +- Git - [Git for Windows] (https://git-scm.com/install/windows) |
5 | 5 |
|
6 | | -Installation |
| 6 | +## Visual Studio Installation |
7 | 7 | ------------ |
8 | | -To getting started with openFrameworks and Visual Studio, you need to have [Visual Studio 2015](https://www.visualstudio.com) installed. |
9 | | -Any version should work, Express included. |
10 | | -There are many versions of Visual Studio. If you don't know which one to install, then we recommend [Visual Studio Community 2015](https://www.visualstudio.com/products/visual-studio-community-vs.aspx). |
11 | | -Each generation of Visual Studio (i.e. 2010, 2012, 2015) comes with a different C++ compiler (a compiler is what makes your c++ code into an executable that you can run). |
12 | | -Generally, projects created in different generations of Visual Studio are not compatible with each other, but you can upgrade files from old generations to new generations. |
13 | 8 |
|
14 | | -**See [setup guide](http://openframeworks.cc/setup/vs) for more detailed instructions.** |
| 9 | +Download and install **Visual Studio 2022** or **Visual Studio 2026**. |
15 | 10 |
|
16 | | -_Visual Studio Community is free for individual developers, open source projects, academic research, education, and small professional teams. |
17 | | -Community versions have a reduced feature set whilst sharing the same compiler and general interface of the more premium versions (e.g. Professional, Enterprise etc). |
18 | | -The premium versions are only really recommended for more commercial oF users, for students who can otherwise get these versions for free, or for users who know for definite that they need |
19 | | -the premium features which aren't available in the Community distributions._ |
| 11 | +We recommend the free **Community** edition. |
20 | 12 |
|
21 | | -Creating a new openFrameworks project |
| 13 | +- [Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/) |
| 14 | +- [Visual Studio 2026 Community](https://visualstudio.microsoft.com/downloads/) |
| 15 | + |
| 16 | +During installation, select the **Desktop development with C++** workload. |
| 17 | + |
| 18 | +## Install openFrameworks |
| 19 | +- Download openFrameworks 0.12.1 or later from the [download page](http://openframeworks.cc/download/) or from [github](https://github.com/openframeworks/openFrameworks/). |
| 20 | +- If you got openFrameworks from git: https://github.com/openframeworks/openFrameworks |
| 21 | + - Run `scripts/android/download_libs.sh` to download libraries. |
| 22 | + - Use the Project Generator to generate Visual Studio project files for examples. |
| 23 | + |
| 24 | +## Libraries |
| 25 | +------------ |
| 26 | + |
| 27 | +If missing any libraries or want to update them run the script at **vs/scripts/** |
| 28 | +- **download_libs.sh** |
| 29 | + |
| 30 | +## Creating a new openFrameworks project |
22 | 31 | ------------------------------------- |
23 | | -See [projectGenerator page](projectgenerator.md), to understand the usage of this tool. |
24 | 32 |
|
25 | | -Open your new Solution |
| 33 | +1. Open the **Project Generator** (ofxImGui interface). |
| 34 | +2. Enter your **Project name**. |
| 35 | +3. Choose your **Project path**. |
| 36 | +4. Under **Platforms**, select **Windows (Visual Studio)**. |
| 37 | +5. Under **Template**: |
| 38 | + - For **Visual Studio 2022** → leave the Template field empty (default) |
| 39 | + - For **Visual Studio 2026** → select **`vs2026`** from the dropdown |
| 40 | +6. Click **Generate**. |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +## Open and Run your project |
26 | 47 | ---------------------- |
27 | | -Every openFrameworks application is represented by a **'Solution'** and a **'Project'**. A solution is a collection of (generally) co-dependent projects. |
28 | | -The solution for your project contains your project, and the openFrameworks project, which is a library of all openFrameworks functions and classes |
29 | | -which can be used by your project. |
30 | | -Your solution filename will be `openFrameworks/apps/[your name]/[project name]/[project name].sln`. Open this file with Visual Studio either by double |
31 | | -clicking on it in Explorer, or selecting File>Open>Project/Solution... inside Visual Studio. |
32 | | - |
33 | | -Compile and Run |
34 | | ---------------- |
35 | | -Open your solution file `[project].sln`, and hit **F5**. This should compile and run your project. You should see a blank OpenGL window appear. |
36 | | -_If Visual Studio complains that your project cannot be started, try right clicking on your project in the 'Solution Explorer' and select 'Set as startup project' and then try F5 again._ |
37 | | - |
38 | | -The difference between Debug and Release mode |
39 | | ---------------------------------------------- |
40 | | -These are two build configurations, **"Debug"** and **"Release"**: |
41 | | - |
42 | | -* **Debug** is useful when developing your project, as it will _provide the most information_ about where and why something crashed. |
43 | | -* **Release** is useful when you're done developing your project. Release will create a _smaller_, _faster_ app, but it _won't give you much information_ if it crashes. |
44 | | - |
45 | | -Change the world |
46 | | ----------------- |
47 | | -Now it's time to get to work coding with openFrameworks. Hit 'Esc' to exit the blank, boring application you just built, and start editing `testApp.cpp` |
48 | | -and `testApp.h` to finally put to rest your critics and friends and make that generative/interactive/totally awesome piece of work that you've been wanting |
49 | | -to get out. |
50 | | -Just be careful not to forget your friends and critics in the process! |
51 | | - |
52 | | -openFrameworks resources |
53 | | ------------------------- |
54 | | -If you have questions or issues, the best place to look is the [openFrameworks forum](http://forum.openframeworks.cc/). |
55 | | - |
56 | | - |
57 | | -Thanks for reading this and enjoy! |
58 | | -_The OF Team_ |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +You can run by clicking Open in IDE in Project Generator or Open Folder to access directory. |
| 52 | + |
| 53 | +Your project solution file is located at: |
| 54 | +`openFrameworks/apps/[yourFolder]/[projectName]/[projectName].sln` |
| 55 | + |
| 56 | + |
| 57 | +Double-click the `.sln` file to open it in the matching version of Visual Studio (2022 or 2026). |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +Press **F5** to build and run in Debug mode. |
| 63 | + |
| 64 | +## Debug vs Release |
| 65 | +------------------- |
| 66 | + |
| 67 | +- **Debug** — best while developing (full error info). |
| 68 | +- **Release** — smaller and faster (use when finished). |
| 69 | + |
| 70 | +Switch between them using the dropdown at the top of Visual Studio. |
| 71 | + |
| 72 | +## Architectures |
| 73 | +------------------- |
| 74 | +- Targets are x86_64 - x64 - Default Windows |
| 75 | +- ARM64 - for arm64 processors (native arm) |
| 76 | +- ARM64EC - a mixture of both x64/arm64 for Windows 11 |
| 77 | + |
| 78 | +## Start coding |
| 79 | +------------- |
| 80 | + |
| 81 | +Hit **Esc** to close the window, then edit your code in `src/ofApp.cpp` and `src/ofApp.h`. |
| 82 | + |
| 83 | + |
0 commit comments