Skip to content

Added support to modify the GLWpfControlSettings within XAML front-end.#106

Merged
NogginBops merged 5 commits intoopentk:masterfrom
mathew-odwyer:feature/public-glwpf-settings
Apr 27, 2023
Merged

Added support to modify the GLWpfControlSettings within XAML front-end.#106
NogginBops merged 5 commits intoopentk:masterfrom
mathew-odwyer:feature/public-glwpf-settings

Conversation

@mathew-odwyer
Copy link
Contributor

@mathew-odwyer mathew-odwyer commented Mar 25, 2023

Description

  • Added a Start function overload that does not take any arguments; it relies on the Settings attached property.
    • This required the addition of a new field to check whether the control has been started.
  • Modified the example project to showcase both use cases.

Fixes #105

Dependencies

This PR introduces no new dependencies.

Type of change

  • New feature (non-breaking change which adds functionality).

How Has This Been Tested?

I tested this locally on my machine and ensured that everything was still functioning as normal within the example project.

Test Configuration:

  • Operating System: Windows 10 Home
  • Hardware: Intel i7-10710U @ 1.1GHz, 32GB RAM
  • Toolchain: VS Community 2022

Proposed Design

<glWpfControl:GLWpfControl
	x:Name="OpenTkControl"
	Render="OpenTkControl_OnRender">
	
        <!-- Add settings object -->
	<glWpfControl:GLWpfControl.Settings>
		<glWpfControl:GLWpfControlSettings MinorVersion="2" MajorVersion="1"/>
	</glWpfControl:GLWpfControl.Settings>
	
</glWpfControl:GLWpfControl>
// Now, we can just call start within the code behind.
this.OpenTKControl.Start();

// Or, provide settings as we did before.
OpenTKControl.Start(new GLWpfControlSettings()
{
	MajorVersion = 2,
	MinorVersion = 1,
	RenderContinuously = false,
});

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@mathew-odwyer mathew-odwyer marked this pull request as draft March 25, 2023 10:45
@mathew-odwyer mathew-odwyer changed the title Added support to modify the GLWpfControlSettings within XAML front-end. [WIP] Added support to modify the GLWpfControlSettings within XAML front-end. Mar 25, 2023
@NogginBops
Copy link
Member

This looks good to me, is there a reason this is WIP?

@mathew-odwyer
Copy link
Contributor Author

This looks good to me, is there a reason this is WIP?

I believe there was an issue but I can't remember what it was 😂. I'll be getting to this some time today so hopefully we can get it merged :)

@mathew-odwyer
Copy link
Contributor Author

Lol, I had major and minor version swapped around; fixed now :)

@mathew-odwyer mathew-odwyer marked this pull request as ready for review March 28, 2023 04:44
@mathew-odwyer mathew-odwyer changed the title [WIP] Added support to modify the GLWpfControlSettings within XAML front-end. Added support to modify the GLWpfControlSettings within XAML front-end. Apr 6, 2023
@mathew-odwyer
Copy link
Contributor Author

After testing this out once more; everything seems to be working 😊.

If there's anything else I need to do to get this pushed just let me know.

@NogginBops
Copy link
Member

NogginBops commented Apr 27, 2023

This looks great. I'll merge this now and test it out the next time I do some development on GLWpfControl.

Thanks a ton for the PR 🙂 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the ability to set GLWpfControlSettings parameters within XAML.

2 participants