Skip to content

Commit d10fe33

Browse files
committed
Revert "Made to mostly compile, added docs (Getting MSB4057 RN)"
This reverts commit 118fc0c.
1 parent 118fc0c commit d10fe33

25 files changed

+215
-695
lines changed

src/libraries/Silk.Net.Windowing/Abstract/ContextFlags.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
using System;
4-
5-
namespace Silk.NET.Windowing
1+
namespace Silk.NET.Windowing
62
{
73
/// <summary>
84
/// Represents flags related to the OpenGL context.
@@ -27,4 +23,4 @@ public enum ContextFlags
2723
/// <remarks>On OpenGL contexts older than 3.0, this flag does nothing.</remarks>
2824
ForwardCompatible = 2
2925
}
30-
}
26+
}

src/libraries/Silk.Net.Windowing/Abstract/ContextProfile.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
namespace Silk.NET.Windowing
1+
namespace Silk.NET.Windowing
42
{
53
/// <summary>
64
/// Represents the context profile OpenGL should use.
@@ -18,4 +16,4 @@ public enum ContextProfile
1816
/// </summary>
1917
Compatability
2018
}
21-
}
19+
}
Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
using Silk.NET.Maths;
1+
using Silk.NET.Maths;
42
using Silk.NET.Windowing;
53

6-
//TODO: Copy proposal explanation as to why we are doing this, also other than Vector2DAction these names are HIGHLY specialized for no apparently good reason, I am not a fan.
7-
/// <summary>
8-
/// An action that takes a <see cref="Vector2D{T}"/>
9-
/// </summary>
104
public delegate void Vector2DAction(Vector2D<int> newValue);
11-
12-
/// <summary>
13-
/// An action that takes a double as a parameter
14-
/// </summary>
155
public delegate void DeltaAction(double deltaTime);
16-
/// <summary>
17-
/// An action that takes a <see cref="WindowState"/>
18-
/// </summary>
196
public delegate void WindowStateAction(WindowState newState);
20-
/// <summary>
21-
/// An action that takes a list of strings as a parameter, intended for file path callbacks
22-
/// </summary>
237
public delegate void FilePathsAction(string[] filePaths);
24-
/// <summary>
25-
/// An action that takes a bool as a parameter, intended for a callback when things are toggled.
26-
/// </summary>
27-
public delegate void ToggleAction(bool newValue);
8+
public delegate void ToggleAction(bool newValue);

src/libraries/Silk.Net.Windowing/Abstract/IDesktopSurface.cs

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
using System;
4-
using System.Collections.Generic;
5-
using Silk.NET.Core;
1+
using Silk.NET.Core;
62
using Silk.NET.Maths;
73

84
namespace Silk.NET.Windowing
@@ -58,7 +54,7 @@ public interface IDesktopSurface : ISurface
5854
IEnumerable<IScreen>? AvailableScreens { get; }
5955

6056
/// <summary>
61-
/// Gets or sets whether the window waits for an event to be posted before existing <see cref="IDesktopSurface.DoEvents" />.
57+
/// Gets or sets whether the window waits for an event to be posted before existing <see cref="DoEvents" />.
6258
/// </summary>
6359
bool IsEventDriven { get; set; }
6460

@@ -79,7 +75,7 @@ public interface IDesktopSurface : ISurface
7975
/// <remarks>
8076
/// Because these are distances and not coordinates, they are always zero or positive.
8177
/// </remarks>
82-
/// <seealso cref="IDesktopSurface.Size"/>
78+
/// <seealso cref="WindowExtensions.GetFullSize"/>
8379
Rectangle<int> BorderSize { get; }
8480

8581
/// <summary>
@@ -111,28 +107,44 @@ public interface IDesktopSurface : ISurface
111107
/// Sets the window icons.
112108
/// </summary>
113109
/// <param name="icons">Either a collection of window icons, or null to set to the default icon.</param>
114-
void SetWindowIcon(ReadOnlySpan<RawImage> icons);
110+
void SetWindowIcon(ReadOnlySpan<RawImage> icons)
111+
{
112+
throw new NotImplementedException();
113+
}
115114

116115
/// <summary>
117-
/// When using <see cref="IDesktopSurface.IsEventDriven"/> = true, wakes the main thread from
116+
/// When using <see cref="WindowOptions.IsEventDriven"/> = true, wakes the main thread from
118117
/// its blocking wait on incoming events. Can be called from any thread.
119118
/// </summary>
120-
void ContinueEvents();
119+
void ContinueEvents()
120+
{
121+
throw new NotImplementedException();
122+
}
121123

122124
/// <summary>
123125
/// Converts this point to client coordinates.
124126
/// </summary>
125127
/// <param name="point">The point to transform.</param>
126128
/// <returns>The transformed point.</returns>
127129
/// <remarks>Expects screen coordinates as input.</remarks>
128-
Vector2D<int> PointToClient(Vector2D<int> point);
130+
Vector2D<int> PointToClient(Vector2D<int> point)
131+
{
132+
return new Vector2D<int>(point.X - Position.X, point.Y - Position.Y);
133+
}
129134

130135
/// <summary>
131136
/// Converts this point to screen coordinates.
132137
/// </summary>
133138
/// <param name="point">The point to transform.</param>
134139
/// <returns>The transformed point.</returns>
135140
/// <remarks>Expects client coordinates as input.</remarks>
136-
Vector2D<int> PointToScreen(Vector2D<int> point);
141+
Vector2D<int> PointToScreen(Vector2D<int> point)
142+
{
143+
return new Vector2D<int>(point.X + Position.X, point.Y + Position.Y);
144+
}
145+
public Vector2D<int> PointToFramebuffer(Vector2D<int> point)
146+
{
147+
throw new NotImplementedException();
148+
}
137149
}
138-
}
150+
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
1+

32
namespace Silk.NET.Windowing
43
{
5-
/// <summary>
6-
/// An interface that defines a desktop surface with the ability to create a desktop GL Context
7-
/// </summary>
84
public interface IGLDesktopSurface : IDesktopSurface, IGLSurface { }
9-
}
5+
}
Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
namespace Silk.NET.Windowing
1+
namespace Silk.NET.Windowing
42
{
5-
/// <summary>
6-
/// A surface that can have a desktop GL context.
7-
/// </summary>
83
public interface IGLSurface : INativeGLSurface
94
{
10-
/// <summary>
11-
/// The flags the context was created with
12-
/// </summary>
135
ContextFlags ContextFlags { get; set; }
14-
/// <summary>
15-
/// The profile of the specified context.
16-
/// </summary>
176
ContextProfile ContextProfile { get; set; }
18-
/// <summary>
19-
/// The surface representing the context to use.
20-
/// </summary>
21-
IGLSurface? SharedContext { get; set; } // Redhacker1/Donovan: DAFUQ? What exactly is supposed to be going on here
7+
IGLSurface? SharedContext { get; set; }
228

239
/// <summary>
2410
/// Enables OpenGL support for this surface. This will create a surface upon initialization.
2511
/// </summary>
26-
bool TryEnableOpenGL();
12+
bool TryEnableOpenGL()
13+
{
14+
throw new NotImplementedException();
15+
}
2716
}
28-
}
17+
}
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
1+

32
namespace Silk.NET.Windowing
43
{
5-
/// <summary>
6-
/// Represents a GL Surface with a transparent Framebuffer
7-
/// </summary>
8-
// Is GLFW making this an optional feature worth adding this? -Donovan/Redhacker1
94
public interface IGLTransparentFramebuffer : INativeGLSurface
105
{
11-
/// <summary>
12-
/// Whether the buffer can be actually transparent
13-
/// </summary>
146
bool TransparentFramebuffer { get; set; }
157
}
16-
}
8+
}
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
namespace Silk.NET.Windowing
1+
namespace Silk.NET.Windowing
42
{
5-
/// <summary>
6-
/// A Desktop Surface with the ability to create a GLES surface
7-
/// </summary>
83
public interface IGlesDesktopSurface : IDesktopSurface, IGlesSurface
94
{
105

116
}
12-
}
7+
}
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
namespace Silk.NET.Windowing
1+
namespace Silk.NET.Windowing
42
{
5-
/// <summary>
6-
/// Defines a surface that can have a GLES context attatched
7-
/// </summary>
83
public interface IGlesSurface : INativeGLSurface
94
{
10-
/// <summary>
11-
/// The surface representing the context to use.
12-
/// </summary>
13-
IGlesSurface? SharedContext { get; set; } // Donovan/Redhacker1: How on earth is this supposed to work?
5+
IGlesSurface? SharedContext { get; set; }
146
/// <summary>
157
/// Enables OpenGLES support for this surface. This will create a surface upon initialization.
168
/// </summary>
179
bool TryEnableOpenGLES();
1810
}
19-
}
11+
}

src/libraries/Silk.Net.Windowing/Abstract/INativeGLSurface.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
using Silk.NET.Core;
1+
using Silk.NET.Core;
42
using Silk.NET.Maths;
53

64
namespace Silk.NET.Windowing
75
{
86
public interface INativeGLSurface : ISurface
97
{
10-
/// <summary>
11-
/// the GL Handle
12-
/// </summary>
138
nint Handle { get; }
14-
/// <summary>
15-
/// Whether this is the currently running context on this thread
16-
/// </summary>
179
bool IsContextCurrent { get; set; }
18-
/// <summary>
19-
/// Should the buffers swap immediately upon completion?
20-
/// </summary>
2110
bool ShouldSwapAutomatically { get; set; }
2211

2312
/// <summary>
@@ -59,6 +48,9 @@ public interface INativeGLSurface : ISurface
5948
Version32? ApiVersion { get; set; }
6049

6150
nint? GetProcAddress(string proc);
62-
void SwapBuffers();
51+
void SwapBuffers()
52+
{
53+
throw new NotImplementedException();
54+
}
6355
}
64-
}
56+
}

0 commit comments

Comments
 (0)