microsoft / WindowsCompositionSamples

The Windows Composition Samples have moved here: https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/SceneGraph
https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/SceneGraph
MIT License
1.13k stars 287 forks source link

Upgrades and fixes #301

Closed hansmbakker closed 6 years ago

hansmbakker commented 6 years ago

Pull Request Type

[ ] Bugfix <!—Please add link to related Issue below -->
[ ] New Sample
[x] Other - Please describe: updates and fixes

Proposed Changes

daneuber commented 6 years ago

@hansmbakker were you able to get the effect editor running with these changes alone? It's been a while since we updated and when I tested locally I also had to update some ImageLoader calls: diff.txt

hansmbakker commented 6 years ago

@daneuber thank you for that diff. I see you added the SamplesNative project, just like me, but the issue

there are types referenced in https://github.com/Microsoft/WindowsCompositionSamples/blob/master/Demos/EffectEditor/MainPage.xaml.cs#L111 that are not defined in the rest of the repo

was not fixed by my PR. Do you want me to add the changes to MainPage.xaml.cs from your diff to my branch, or do you want to complete that yourself?

daneuber commented 6 years ago

@hansmbakker ahh I see. If you could just add to your PR that'd be great!

hansmbakker commented 6 years ago

@daneuber I tried; after adding your fixes the code compiles but I get a runtime error at https://github.com/Microsoft/WindowsCompositionSamples/blob/master/SamplesCommon/SamplesCommon/ImageLoader/ImageLoader.cs#L112

Does this work for you?

I'm using Visual Studio 15.9 Preview 3 with SDK 177663. I had some binding issues with this version before and would like to make sure that my VS instance is not the issue.

The relevant parts of the logging are:

Error: Converter failed to convert value of type 'EffectEditor.MainPage.EffectType' to type 'Int32'; BindingExpression: Path='ActiveEffectType' DataItem='EffectEditor.MainPage'; target element is 'Windows.UI.Xaml.Controls.ComboBox' (Name='EffectSelector'); target property is 'SelectedIndex' (type 'Int32'). 
'EffectEditor.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\hansm\Source\Repos\WindowsCompositionSamples\Demos\EffectEditor\bin\x86\Debug\AppX\SamplesCommon.dll'. Symbols loaded.
'EffectEditor.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\hansm\Source\Repos\WindowsCompositionSamples\Demos\EffectEditor\bin\x86\Debug\AppX\System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----

---- Assert Long Message ----

   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)
   at System.Diagnostics.Debug.Assert(Boolean condition)
   at SamplesCommon.ImageLoader.get_Instance()
   at EffectEditor.MainPage.CreateBrushFromAsset(String name, Size& size)
   at EffectEditor.MainPage.MainGridLoaded(Object sender, RoutedEventArgs e)
daneuber commented 6 years ago

Apologies, that's my fault for putting the ImageLoader Initialization in the CreateBrushFromAsset method which gets called multiple times. Here is a small diff moving that which should fix that error. Let me know if this fixes on your end as well. - diff2.txt

hansmbakker commented 6 years ago

@daneuber thank you! Now it seems to work correctly 😃

daneuber commented 6 years ago

@hansmbakker Awesome! Thanks for these changes!

hansmbakker commented 6 years ago

No problem, glad it's fixed :)