Skip to content

Conversation

@Redhacker1
Copy link
Contributor

Implements "Stub" windowing API, the framework is there, but the meat and potatoes are not currently implemented

Summary of the PR

Essentially adds the interfaces as defined in the Windowing(3.0) proposal

Implements "Stub" windowing API, the framework is there, but the meat and potatoes are not currently implemented
@Redhacker1 Redhacker1 requested a review from a team as a code owner August 5, 2022 19:55
Copy link
Member

@HurricanKai HurricanKai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of comments, and I think a lot of missing XML additionally.
You don't have to resolve all of these, some of these you might not even be able to resolve.

bool IsCloseRequested { get; set; }

/// <summary>
/// Gets whether the window is focused or not.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: or not is unecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, all of the interfaces are pretty much pulled from the proposal directly, if you have issues with it, it might be best to talk about overall proposal changes.

Comment on lines 71 to 79
/// <summary>
/// Gets the distances in screen coordinates from the edges of the content area to the corresponding edges of
/// the full window.
/// </summary>
/// <remarks>
/// Because these are distances and not coordinates, they are always zero or positive.
/// </remarks>
/// <seealso cref="WindowExtensions.GetFullSize"/>
Rectangle<int> BorderSize { get; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear to me what the docs are saying here. We don't use the concept of a content area anywhere else.
Is there a different way to word this to make it easier to understand?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea what it is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content area describes the space a window can actually take up. So on a 2160p monitor, it will be 3840 x (2160 - <size of taskbar>) if that makes any sense.

Comment on lines +81 to +84
/// <summary>
/// Raised when the window has been requested to close.
/// </summary>
event Action CloseRequested;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the corresponding boolean property set before or after?
(add to remarks)

In line with other properties, there should be a delegate providing the new value and the old value should be found in the property.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set before (the user can cancel closure by setting it back to false), agree needs remarks (in proposal)

Comment on lines 56 to 59
/// <summary>
/// Gets or sets whether the window waits for an event to be posted before existing <see cref="DoEvents" />.
/// </summary>
bool IsEventDriven { get; set; }
Copy link
Member

@HurricanKai HurricanKai Aug 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the proposal go into details about this? Seems like a relic of 2.x that's not really needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the update loop is very similar to 2.X this will still be needed for applications (e.g. UI) that do not regularly need to render (i.e. only when an animation changes or some other event happens such as the user moving their mouse or the window etc)

Comment on lines +16 to +18
/// <summary>
/// The position of the window. If set to -1, use the backend default.
/// </summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a <see... To where this backend default can be found.
Also why did we make the user figure this out?

Additionally, can't a window actually be outside the screen (negative coordinates), at least with whatever anchor point is used here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone will need to pick apart the logic I wrote in 2.X to determine whether that's possible (or just experiment separately)

if you want to find the code you can search for marks] and you'll find it.

Copy link
Contributor Author

@Redhacker1 Redhacker1 Aug 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if that is something we even know AOT, or if we have a type that exposes it at all, or if GLFW and other APIs expose such a thing in the first place.


namespace Silk.NET.Windowing
{
public readonly struct VideoMode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Record Struct?


namespace Silk.NET.Windowing.Implementations.GLFW;

public class GLFWSurface : IGLTransparentFramebuffer, IGlesDesktopSurface, IVkDesktopSurface, IGLDesktopSurface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem like it'll work 🤔 we will see when implementing I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it not work?

Comment on lines 3 to 12
<PropertyGroup>
<TargetFrameworks>$(SilkTargetFramework)</TargetFrameworks>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarningsAsErrors>true</WarningsAsErrors>
<LangVersion>9.0</LangVersion>

<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: verify with rest of project setup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was based on silk.net.Maths

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but the 3.0 setup is quite different. I'll review it when everything else is done, just left this here to remind myself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean it was pulled from the Silk.net.Maths implementation currently sitting in the directory right beside it, I figured at worst it would not completely break anything

@Perksey
Copy link
Member

Perksey commented Aug 6, 2022

I can answer any outstanding proposal wording questions in a bit, really annoyed this didn’t come up in #539 though.

@HurricanKai
Copy link
Member

Yeah me too - We've been less then thorough with that review. I guess I was just so into the idea cause we came up with it only few days before, and didn't see any problems with it.

@Perksey
Copy link
Member

Perksey commented Aug 6, 2022

Can you propose a change to the proposal itself? It's unfair to expect an external contributor to answer to this.

@HurricanKai
Copy link
Member

I don't really expect any contributor to answer this, I just figured tracking it here associated directly with the code seems easier. If you want I'll delete the proposal and re-submit it, and attach the comments there.

@Perksey
Copy link
Member

Perksey commented Aug 6, 2022

I was more suggesting propose changes to the proposal in response to your comments yourself, probably the most productive :) again I can help respond in a bit.

@HurricanKai
Copy link
Member

Ah wups, yeah will do that once I'm done with my current work item. Just wanted to get my review out there, and will resolve any outstanding things once I get to windowing.

@Redhacker1
Copy link
Contributor Author

Ah wups, yeah will do that once I'm done with my current work item. Just wanted to get my review out there, and will resolve any outstanding things once I get to windowing.

Does this mean I other than some the slight changes I am stuck?

@HurricanKai
Copy link
Member

Not necessarily, your free to put in any work you want to, but no one expects you to do any of the proposal work.
Ill look at perkseys proposals in the morning and then also submit proposal changes, but heading to bed now.

Implementing test for Version32, moving Version32 to Core, removing implementations from Interfaces among other stuff I probably forgot.
@Beyley Beyley reopened this Aug 13, 2022
For some reason my branch is not picking it up
@Perksey
Copy link
Member

Perksey commented Nov 3, 2022

This has an outstanding action on @HurricanKai to change the proposals, but there is little work being done here at this time. Should we merge just so we have something in the repo as this does technically implement the approved API as it currently stands?

@Perksey
Copy link
Member

Perksey commented Jan 15, 2023

I think this activity has proven that we're not necessarily ready to work on this right now.

Opinions for closing for now?

@HurricanKai
Copy link
Member

Doesn't seem like this will be implemented anytime soon, and there's lots of conflicts.

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.

4 participants