Skip to content

Commit

Permalink
- Added dummy GameWindow class (marked obsolete) to not cause immedia…
Browse files Browse the repository at this point in the history
…te breakage in current versions of the library

- Updated README and nuget package
  • Loading branch information
ForeverZer0 committed Apr 29, 2019
1 parent 168358b commit 13b5cbe
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 22 deletions.
14 changes: 6 additions & 8 deletions GLFW.NET/GLFW.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,19 @@
<RepositoryUrl>https://github.com/ForeverZer0/glfw-net</RepositoryUrl>
<PackageProjectUrl>https://github.com/ForeverZer0/glfw-net</PackageProjectUrl>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageReleaseNotes>*v1.0.1
- Fixed bug with calling the GameWindow constructor when using a context-less window (Vulkan).
*v1.0.0
- Built with Visual Studio 2017 15.3
- Targets .NET Standard 2.0 for maximum compatibility with .NET Framework and .NET Core
- Covers 100% GLFW 3.2.1 (latest version) exported functions, including Vulkan context
- Simplified "GameWindow" class to emulate WinForms, with similar properties, events, etc.
</PackageReleaseNotes>
<PackageReleaseNotes>- Implemented new GLFW 3.3 features
- Large refactorings
- Code improvements</PackageReleaseNotes>
<RepositoryType>GitHub</RepositoryType>
<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>
<Copyright>Copyright © Eric Freed 2018</Copyright>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackageVersion>3.3.0</PackageVersion>
<Title>glfw-net</Title>
<PackageIconUrl>https://github.com/ForeverZer0/glfw-net/raw/master/favicons.png</PackageIconUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
26 changes: 26 additions & 0 deletions GLFW.NET/GameWindow.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;

namespace GLFW.Game
{
[Obsolete("Use NativeWindow, GameWindow will be removed in future release.")]
public class GameWindow : NativeWindow
{
[Obsolete("Use NativeWindow, GameWindow will be removed in future release.")]
public GameWindow()
{
}

[Obsolete("Use NativeWindow, GameWindow will be removed in future release.")]
public GameWindow(int width, int height, string title) : base(width, height, title)
{

}

[Obsolete("Use NativeWindow, GameWindow will be removed in future release.")]
public GameWindow(int width, int height, string title, Monitor monitor, Window share) : base(width, height,
title, monitor, share)
{

}
}
}
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ Complete, cross-platform, managed wrapper around the GLFW library for creating n
## Getting Started
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).

Creating a window is simple.
```csharp
using (var window = new GameWindow(640, 480, "MyWindowTitle"))
{
while (!window.IsClosing)
{
// OpenGL rendering
window.SwapBuffers();
Glfw.PollEvents();
}
}
```

### .NET Core
In all platforms utilizing .NET Core, the `AssemblyLoadContext` can be used to resolve native dependencies at runtime, based on platform, architecture, etc.

Expand All @@ -45,5 +31,25 @@ Unix users need only have GLFW built and installed on the system globally, and n
## IMPORTANT!
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.

## Native Window Creation
Once you have your dependencies taken care of, creating a window is simple.
```csharp
using (var window = new NativeWindow(800, 600, "MyWindowTitle"))
{
// Main application loop
while (!window.IsClosing)
{
// OpenGL rendering
// Implement any timing for flow control, etc (see Glfw.GetTime())
// Swap the front/back buffers
window.SwapBuffers();

// Poll native operating system events (must be called or OS will think application is hanging)
Glfw.PollEvents();
}
}
```

## Source Code
Source code can be found at GitHub: https://github.com/ForeverZer0/glfw-net

0 comments on commit 13b5cbe

Please sign in to comment.