MennoVink
Topic Author
Posts: 3
Joined: 17 Feb 2020, 16:42

Recommended c++ workflow

10 Jun 2020, 01:06

Hi,
i'm having a hard time figuring out what the recommended c++ workflow should be. If i want to use blend or xaml designer it seems that i am stuck using a c# project, but these projects dont accept cpp files. Then if i have a visual c++ project then opening a xaml file just shows the xml source code.
What i'm thinking right now is that i'm required to have a c# project containing mock data and then a c++ project that uses the same xaml files but hooks them up differently. This has quite a few downsides, thereby making it hard to believe that that is the right solution. Is there something obvious i am missing?

Also i'm wondering how i'm supposed to run the examples. eg the example project in Src/Packages/Samples/QuestLog/Projects/windows_x86_64 is ancient (msvc 2015). If i open it with msvc 2019 i get some conversion dialogs. Completing those and trying to build, it fails while linking because it "cannot open file 'NoesisApp.lib'". Is there anything i am doing wrong here?

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 1935
Joined: 22 Dec 2011, 19:20

Re: Recommended c++ workflow

10 Jun 2020, 11:51

Hi,

Our native SDK provides a solution in the Build/ directory (one for each platform) that contains projects for all our samples and application framework (NoesisApp).
As you can see there we provide 2 projects for each sample, a C# Blend project that can be used to design the xaml files, and a C++ project which consumes the same data files. For our samples we provide fully functional C# projects, but it is not mandatory, it is enough to create empty controls without logic to edit the xaml files (Visual Studio/Blend already creates the C# code when adding new control items to the project).

If you open the solution with VS2019, convert the projects and build any sample, it will generate the NoesisApp library first and then build the sample project without errors.

The NativeSDK contains a GettingStarted.html trying to explain this.
 
MennoVink
Topic Author
Posts: 3
Joined: 17 Feb 2020, 16:42

Re: Recommended c++ workflow

17 Jun 2020, 14:20

hey sfernandez thanks for the answer, i can now run the c++ project from the solution :)
What i'm noticing is that if i open the MainWindow.xaml from the Menu3D c++ project is that visual studio doesn't show the ui, instead it gives an "Invalid Markup" error. Is this expected?
If i close this file and open it from the Menu3D-blend project it does correctly show the ui, but only after i've built the c# project.

The GettingStarted.html mentions that the Menu3D sample should be openable from blend by opening NoesisSDK/Src/Packages/Samples/Menu3D/Data/Menu3D-blend.sln. This file doesn't exist, in fact no such solution file exists anywhere inside the 3.0.1 sdk. If i open NoesisSDK/Src/Packages/Samples/Menu3D/Data/Menu3D-blend.csproj inside Blend instead that'll cause it to generate a solution. If i then open the MainWindow.xaml it has three behaviours i can show. Sometimes it shows the ui as expected. Other times it shows the "Invalid Markup" error again, and still other times i'm getting a lot of errors about some noesis package missing of some sorts. What should i do to cause it to always show me the ui?

If i develop controls inside blend without any logic attached to them, doesn't that mean that the ui designer can only test static ui's? Lets take for example the Unity editor. Each GameObject has some optional Components. There's list of all GameObjects, which when selected update the inspector. The inspector conditionally shows controls for the attached Components. The GameObjects, Components and Selection are implemented in c++, so C# would need to have mockup data for those. How would the ui designer test if his control for some component has the right appearance when it is in between two other components? He cannot select some GameObject and add/remove the components he wants to test with. (unless he does it in the main application and restarts it every time he makes a change to the ui)
 
User avatar
jsantos
Site Admin
Posts: 2923
Joined: 20 Jan 2012, 17:18
Contact:

Re: Recommended c++ workflow

18 Jun 2020, 12:43

hey sfernandez thanks for the answer, i can now run the c++ project from the solution :)
What i'm noticing is that if i open the MainWindow.xaml from the Menu3D c++ project is that visual studio doesn't show the ui, instead it gives an "Invalid Markup" error. Is this expected?
If i close this file and open it from the Menu3D-blend project it does correctly show the ui, but only after i've built the c# project.
Yes, this is a limitation of Visual Studio. You need to open XAMLs from the C# project, if you use the C++ project you will get an error. But note that C# projects are included next to C++ projects in our global solution and that XAMLs are shared between them. So if you change a XAML from the C# project you will change also the C++ one.
The GettingStarted.html mentions that the Menu3D sample should be openable from blend by opening NoesisSDK/Src/Packages/Samples/Menu3D/Data/Menu3D-blend.sln. This file doesn't exist, in fact no such solution file exists anywhere inside the 3.0.1 sdk. If i open NoesisSDK/Src/Packages/Samples/Menu3D/Data/Menu3D-blend.csproj inside Blend instead that'll cause it to generate a solution. If i then open the MainWindow.xaml it has three behaviours i can show. Sometimes it shows the ui as expected. Other times it shows the "Invalid Markup" error again, and still other times i'm getting a lot of errors about some noesis package missing of some sorts. What should i do to cause it to always show me the ui?
This is a bug (#1727), thans for reporting. Anyway, you should open the main solution contained in /Build/.
If i develop controls inside blend without any logic attached to them, doesn't that mean that the ui designer can only test static ui's? Lets take for example the Unity editor. Each GameObject has some optional Components. There's list of all GameObjects, which when selected update the inspector. The inspector conditionally shows controls for the attached Components. The GameObjects, Components and Selection are implemented in c++, so C# would need to have mockup data for those. How would the ui designer test if his control for some component has the right appearance when it is in between two other components? He cannot select some GameObject and add/remove the components he wants to test with. (unless he does it in the main application and restarts it every time he makes a change to the ui)
You can develop many things in Blend without having to create new C# proxy classes. If you abuse behaviors to avoid having to inherit from a base class (for example, avoid extending Button, and instead use a behavior) or for example creating new controls by aggregating existing controls. But yes, sometimes you need code in C# to have in Blend what you extend in your C++ engine. Many times, the implementation can be empty, because the designer doesn't need a full implementation for animating in Blend.

This is an exclusive problem with C++ SDK, in Unity you use C#, so Blend and Unity share the same implementation for extensions.

Who is online

Users browsing this forum: No registered users and 1 guest