This has been a very frustrating weekend so far. As nice as your samples are, in fact if I had something like the Menu3D in my game I would be very happy, they are just not a good learning resource as they are simply too complex for that. Of course I'm new to xaml so some heavy learning is expected but the general concept is straightforward enough that someone with 30 years programming experience should be able to get simple results pretty quickly.
As I mentioned I'm using it with Qt5 in a QOpenGLWindow so I can't really use the app framework but will integrate it into my own. So first step was to create that window, initialize my GL stuff then initialize Noesis and render some hello world. That works, though there is still some strange thing going on that my rendering fails with
glEnable( GL_DEPTH_TEST );
even though I call
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
before. But lets ignore that for now.
The plan is to start with the menu stuff, main menu, settings screens, new game screens and so on. Using the Menu3D example I just remove stuff and just keep your headers, change it to my namespace and created the main menu page.
<Page
x:Class="MainMenu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
xmlns:local="using:IngnomiaGUI"
x:Name="MainMenuControl">
<Border Margin="20">
<Viewbox>
<Grid Width="960" Height="540">
<Grid.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="#FF123F61"/>
<GradientStop Offset="0.6" Color="#FF0E4B79"/>
<GradientStop Offset="0.7" Color="#FF106097"/>
</LinearGradientBrush>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" FontSize="50" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Ingnomia" />
<local:MainPage x:Name="MainPage" Grid.Row="1" Grid.Column="1"/>
<local:SettingsPage x:Name="SettingsPage" Grid.Row="1" Grid.Column="1" Visibility="Hidden"/>
</Grid>
</Viewbox>
</Border>
</Page>
With the main page just some buttons
<UserControl
x:Class="MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:IngnomiaGUI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<UserControl.Resources>
<ResourceDictionary Source="MMStyles.xaml"/>
</UserControl.Resources>
<StackPanel>
<ToggleButton x:Name="MMContinue" Style="{StaticResource MenuButtonStyle}" Content="Continue"/>
<ToggleButton x:Name="Start" Style="{StaticResource MenuButtonStyle}" Content="New Game" />
<ToggleButton x:Name="MMSetupGame" Style="{StaticResource MenuButtonStyle}" Content="Setup Game"/>
<ToggleButton x:Name="MMLoadGame" Style="{StaticResource MenuButtonStyle}" Content="Load Game"/>
<ToggleButton x:Name="Settings" Style="{StaticResource MenuButtonStyle}" Content="Settings" Command="{Binding Settings}"/>
<ToggleButton x:Name="Exit" Style="{StaticResource MenuButtonStyle}" Content="Exit" Click="onMMExit_Click"/>
<TextBlock x:Name="MenuDescription"/>
<Grid Margin="18,4,0,0">
<ContentControl Content="Dive straight into the adventure." IsEnabled="{Binding ElementName=Start}"/>
<ContentControl Content="Configure the settings for the demo." IsEnabled="{Binding ElementName=Settings}"/>
<ContentControl Content="Exit the demo." IsEnabled="{Binding ElementName=Exit}"/>
</Grid>
</StackPanel>
</UserControl>
The result is what you might expect
The green, yellow red back ground is just 2 triangles rendered in opengl with coordinates mapped to color just to see the renderer is working. On top of it the noesis gui.
Now lets add a ResourceDictionary to add some styles to make it possible to switch between menu pages. So taking your MenuResources.xaml from the Menu3D sample, delete every entry than those for the ToggleButton and see what happens:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:local="clr-namespace:IngnomiaGUI"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<Style x:Key="MenuButtonStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="OverridesDefaultStyle" Value="False"/>
<Setter Property="FontSize" Value="26"/>
<Setter Property="MinWidth" Value="300"/>
<Setter Property="MinHeight" Value="30"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="noesis:StyleInteraction.Triggers">
<Setter.Value>
<noesis:StyleTriggerCollection>
<i:EventTrigger EventName="MouseEnter">
<noesis:SetFocusAction/>
</i:EventTrigger>
<i:EventTrigger EventName="GotFocus">
<ei:PlaySoundAction Source="Sounds/WaterDropSmall.mp3" Volume="0.3"/>
</i:EventTrigger>
<i:EventTrigger EventName="Click">
<ei:PlaySoundAction Source="Sounds/WaterDropBig.mp3" Volume="0.5"/>
</i:EventTrigger>
</noesis:StyleTriggerCollection>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="IsChecked" Value="True"/>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
15:47:54:911 [D] [NOESIS] I Noesis Init v2.2.6 (Windows on x86_64 Profile)
15:47:54:939 [D] [NOESIS] I 'NoesisTheme.xaml' loaded
15:47:54:943 [D] [NOESIS] E MMStyles.xaml(13): Unknown property 'noesis:StyleInteraction.Triggers' setting Setter.Property.
15:47:54:947 [D] [NOESIS] E MMStyles.xaml(15): Unknown type 'NoesisGUIExtensions.StyleTriggerCollection'.
15:47:54:950 [D] [NOESIS] I 'MMStyles.xaml' loaded
15:47:54:953 [D] [NOESIS] I 'MainPage.xaml' loaded
15:47:54:957 [D] [NOESIS] E MMStyles.xaml(13): Unknown property 'noesis:StyleInteraction.Triggers' setting Setter.Property.
15:47:54:960 [D] [NOESIS] E MMStyles.xaml(15): Unknown type 'NoesisGUIExtensions.StyleTriggerCollection'.
15:47:54:963 [D] [NOESIS] I 'MMStyles.xaml' loaded
15:47:54:967 [D] [NOESIS] I 'SettingsPage.xaml' loaded
15:47:54:970 [D] [NOESIS] I 'MainMenu.xaml' loaded
15:47:54:973 [D] [NOESIS] E Setter.Property can't be null
15:47:54:979 [D] [NOESIS] E 'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: New Game' (type 'ToggleButton')
15:47:54:982 [D] [NOESIS] E 'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: Settings' (type 'ToggleButton')
15:47:54:987 [D] [NOESIS] E 'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: Exit' (type 'ToggleButton')
15:47:54:991 [D] [NOESIS] E Setter.Property can't be null
15:47:54:999 [D] [NOESIS] E Binding failed: Path=Settings, Source=null(''), Target=ToggleButton('Settings'), TargetProperty=ButtonBase.Command
Here is where I've been banging my head against a wall for some time now. Why is noesis:StyleInteraction.Triggers an unknown property? Am I missing some macro, some declaration somewhere? But where? What does the converter error mean? What's missing there?
I'm pretty confident that once this minimal example is running I'm pretty much in the green but right now I hit a pretty solid road block. So any help would be appreciated. Thanks
If you need to look at the c++ files
https://drive.google.com/open?id=1HpP32 ... -9-uvr53OQ