Skip to content

Commit c7300c3

Browse files
committed
Fix compile errors and update windowing code to use strict pascal case for GL/EGL
1 parent cd5b2c9 commit c7300c3

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

sources/Windowing/Windowing/Implementations/SDL3/SdlEventProcessor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static unsafe void DeliverEvent(ref Event @event)
8282
SdlSurface? surface = null;
8383
if (
8484
@event.Type is >= (uint)EventType.WindowFirst and <= (uint)EventType.WindowLast
85-
&& !_surfaces.TryGetValue(@event.Window.WindowID, out surface)
85+
&& !_surfaces.TryGetValue(@event.Window.WindowId, out surface)
8686
)
8787
{
8888
return;
@@ -172,7 +172,7 @@ public static unsafe void DeliverEvent(ref Event @event)
172172
{
173173
foreach (var knownSurface in _surfaces.Values)
174174
{
175-
knownSurface.Impl.OnDisplayCoordinatesChanged(@event.Display.DisplayID);
175+
knownSurface.Impl.OnDisplayCoordinatesChanged(@event.Display.DisplayId);
176176
}
177177
break;
178178
}
@@ -183,7 +183,7 @@ public static unsafe void DeliverEvent(ref Event @event)
183183
foreach (var knownSurface in _surfaces.Values)
184184
{
185185
knownSurface.Impl.OnPotentialVideoModeChanges(
186-
@event.Display.DisplayID,
186+
@event.Display.DisplayId,
187187
out var isDisplayCurrent,
188188
currentDisplay
189189
);
@@ -203,7 +203,7 @@ public static unsafe void DeliverEvent(ref Event @event)
203203
{
204204
Display = @event.Display with
205205
{
206-
DisplayID = currentDisplay = Sdl.GetDisplayForWindow(surface!.Impl.Handle),
206+
DisplayId = currentDisplay = Sdl.GetDisplayForWindow(surface!.Impl.Handle),
207207
},
208208
};
209209
goto case (uint)EventType.DisplayContentScaleChanged;
@@ -283,7 +283,7 @@ public static unsafe void DeliverEvent(ref Event @event)
283283
{
284284
if (
285285
_droppedFiles is null
286-
|| !_surfaces.TryGetValue(@event.Window.WindowID, out surface)
286+
|| !_surfaces.TryGetValue(@event.Window.WindowId, out surface)
287287
)
288288
{
289289
_droppedFiles = null;

sources/Windowing/Windowing/Implementations/SDL3/SdlSurface.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal class SdlSurface : Surface, IDisposable
1717
// `surface is ISurfaceWindow` instead of `surface.Window`)
1818
internal SdlSurfaceComponents Impl { get; }
1919
internal SdlSurface? Parent { get; set; }
20-
public override ISurfaceOpenGl? OpenGl => SdlSurfaceComponents.IsOpenGLEnabled ? Impl : null;
20+
public override ISurfaceOpenGl? OpenGl => SdlSurfaceComponents.IsOpenGlEnabled ? Impl : null;
2121
public override ISurfaceWindow? Window => SdlSurfaceComponents.IsWindowEnabled ? Impl : null;
2222
public override ISurfaceDisplay? Display => SdlSurfaceComponents.IsDisplayEnabled ? Impl : null;
2323
public override ISurfaceVulkan? Vulkan => SdlSurfaceComponents.IsVulkanEnabled ? Impl : null;
@@ -107,8 +107,8 @@ public override bool TryGetPlatformInfo<TPlatformInfo>(
107107
info = (TPlatformInfo)
108108
(object)
109109
new EglPlatformInfo(
110-
(nint)Sdl.EGLGetCurrentDisplay(),
111-
(nint)Sdl.EGLGetWindowSurface(Impl.Handle)
110+
(nint)Sdl.EglGetCurrentDisplay(),
111+
(nint)Sdl.EglGetWindowSurface(Impl.Handle)
112112
);
113113
Sdl.ClearError();
114114
return true;

sources/Windowing/Windowing/Implementations/SDL3/SdlSurfaceComponents.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal partial class SdlSurfaceComponents(SdlSurface surface)
1212
{
1313
public static bool IsChildrenEnabled { get; private set; }
1414
public static bool IsDisplayEnabled => true;
15-
public static bool IsOpenGLEnabled { get; private set; }
15+
public static bool IsOpenGlEnabled { get; private set; }
1616
public static bool IsScaleEnabled => true;
1717
public static bool IsVulkanEnabled { get; private set; }
1818
public static bool IsWindowEnabled { get; private set; }
@@ -81,8 +81,8 @@ public static WindowHandle InitializePlatform()
8181
return nullptr;
8282
}
8383

84-
IsOpenGLEnabled = Sdl.GLLoadLibrary(nullptr);
85-
DebugPrintWithError(IsOpenGLEnabled ? "OpenGL support enabled" : "OpenGL support disabled");
84+
IsOpenGlEnabled = Sdl.GlLoadLibrary(nullptr);
85+
DebugPrintWithError(IsOpenGlEnabled ? "OpenGL support enabled" : "OpenGL support disabled");
8686

8787
IsVulkanEnabled = Sdl.VulkanLoadLibrary(nullptr);
8888
DebugPrintWithError(IsVulkanEnabled ? "Vulkan support enabled" : "Vulkan support disabled");
@@ -159,9 +159,9 @@ public void InitializeSurface()
159159
InitializeChildren(createProps);
160160
}
161161

162-
if (IsOpenGLEnabled)
162+
if (IsOpenGlEnabled)
163163
{
164-
InitializeOpenGL(createProps);
164+
InitializeOpenGl(createProps);
165165
}
166166

167167
if (IsScaleEnabled)
@@ -197,13 +197,13 @@ public void InitializeSurface()
197197
Sdl.ThrowError();
198198
}
199199

200-
Id = Sdl.GetWindowID(Handle);
200+
Id = Sdl.GetWindowId(Handle);
201201
SdlEventProcessor.AddSurface(Id, surface);
202202
DebugPrintAllProps(Sdl.GetWindowProperties(Handle));
203203
IsSurfaceInitialized = true;
204-
if (IsOpenGLEnabled)
204+
if (IsOpenGlEnabled)
205205
{
206-
PostInitializeOpenGL();
206+
PostInitializeOpenGl();
207207
}
208208

209209
if (IsScaleEnabled)
@@ -231,9 +231,9 @@ public static void TerminatePlatform()
231231
}
232232

233233
Sdl.QuitSubSystem(Sdl.InitVideo);
234-
if (IsOpenGLEnabled)
234+
if (IsOpenGlEnabled)
235235
{
236-
Sdl.GLUnloadLibrary();
236+
Sdl.GlUnloadLibrary();
237237
}
238238

239239
if (IsVulkanEnabled)

0 commit comments

Comments
 (0)