Skip to content

Commit 13b5cbe

Browse files
committed
- Added dummy GameWindow class (marked obsolete) to not cause immediate breakage in current versions of the library
- Updated README and nuget package
1 parent 168358b commit 13b5cbe

File tree

3 files changed

+52
-22
lines changed

3 files changed

+52
-22
lines changed

GLFW.NET/GLFW.NET.csproj

+6-8
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,19 @@
99
<RepositoryUrl>https://github.com/ForeverZer0/glfw-net</RepositoryUrl>
1010
<PackageProjectUrl>https://github.com/ForeverZer0/glfw-net</PackageProjectUrl>
1111
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
12-
<PackageReleaseNotes>*v1.0.1
13-
- Fixed bug with calling the GameWindow constructor when using a context-less window (Vulkan).
14-
*v1.0.0
15-
- Built with Visual Studio 2017 15.3
16-
- Targets .NET Standard 2.0 for maximum compatibility with .NET Framework and .NET Core
17-
- Covers 100% GLFW 3.2.1 (latest version) exported functions, including Vulkan context
18-
- Simplified "GameWindow" class to emulate WinForms, with similar properties, events, etc.
19-
</PackageReleaseNotes>
12+
<PackageReleaseNotes>- Implemented new GLFW 3.3 features
13+
- Large refactorings
14+
- Code improvements</PackageReleaseNotes>
2015
<RepositoryType>GitHub</RepositoryType>
2116
<PackageTags>GLFW OpenGL OpenGLES ES C# F# VB Csharp CS Windows Mono Linux Mac OSX Context NET Standard Core Framework Game Native Form Cross Platform Unix netcore netstandard dotnet winform</PackageTags>
2217
<Copyright>Copyright © Eric Freed 2018</Copyright>
2318
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2419
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2520
<Version>1.0.1</Version>
2621
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
22+
<PackageVersion>3.3.0</PackageVersion>
23+
<Title>glfw-net</Title>
24+
<PackageIconUrl>https://github.com/ForeverZer0/glfw-net/raw/master/favicons.png</PackageIconUrl>
2725
</PropertyGroup>
2826

2927
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

GLFW.NET/GameWindow.cs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
3+
namespace GLFW.Game
4+
{
5+
[Obsolete("Use NativeWindow, GameWindow will be removed in future release.")]
6+
public class GameWindow : NativeWindow
7+
{
8+
[Obsolete("Use NativeWindow, GameWindow will be removed in future release.")]
9+
public GameWindow()
10+
{
11+
}
12+
13+
[Obsolete("Use NativeWindow, GameWindow will be removed in future release.")]
14+
public GameWindow(int width, int height, string title) : base(width, height, title)
15+
{
16+
17+
}
18+
19+
[Obsolete("Use NativeWindow, GameWindow will be removed in future release.")]
20+
public GameWindow(int width, int height, string title, Monitor monitor, Window share) : base(width, height,
21+
title, monitor, share)
22+
{
23+
24+
}
25+
}
26+
}

README.md

+20-14
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,6 @@ Complete, cross-platform, managed wrapper around the GLFW library for creating n
1919
## Getting Started
2020
The recommended way to use this library is to download the source and include directly within your application, as this offers the highest amount of control over dependency loading. It was build upon [.NET Standard 2.0](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) to target the largest number of platforms and frameworks, and thus you will need to fine-tune the dependency loading to your specific needs (see below).
2121

22-
Creating a window is simple.
23-
```csharp
24-
using (var window = new GameWindow(640, 480, "MyWindowTitle"))
25-
{
26-
while (!window.IsClosing)
27-
{
28-
// OpenGL rendering
29-
30-
window.SwapBuffers();
31-
Glfw.PollEvents();
32-
}
33-
}
34-
```
35-
3622
### .NET Core
3723
In all platforms utilizing .NET Core, the `AssemblyLoadContext` can be used to resolve native dependencies at runtime, based on platform, architecture, etc.
3824

@@ -45,5 +31,25 @@ Unix users need only have GLFW built and installed on the system globally, and n
4531
## IMPORTANT!
4632
The Windows and Unix library name differ. On Windows, the library name is `glfw3` (always exclude file extensions), and on Unix systems, it is only `glfw` without the major version suffix. By default, the `Glfw.LIBRARY` constant is hard-coded in the Windows format, so this will either need changed, or require you to resolve the dependencies manually.
4733

34+
## Native Window Creation
35+
Once you have your dependencies taken care of, creating a window is simple.
36+
```csharp
37+
using (var window = new NativeWindow(800, 600, "MyWindowTitle"))
38+
{
39+
// Main application loop
40+
while (!window.IsClosing)
41+
{
42+
// OpenGL rendering
43+
// Implement any timing for flow control, etc (see Glfw.GetTime())
44+
45+
// Swap the front/back buffers
46+
window.SwapBuffers();
47+
48+
// Poll native operating system events (must be called or OS will think application is hanging)
49+
Glfw.PollEvents();
50+
}
51+
}
52+
```
53+
4854
## Source Code
4955
Source code can be found at GitHub: https://github.com/ForeverZer0/glfw-net

0 commit comments

Comments
 (0)