Gorgon my API for C#/.NET

Quazar said I should Cortex this.  So I am.  I think.  Is this thing on?  Why is there a giant phallic looking object here?  Who's that doing the heavy breathing? Why am I sweating? Anyway this is about my graphics API for C#/.NET - Gorgon.

[deleted] 1442714416

What is Gorgon?

A modular set of libraries useful for graphics and/or video game development. Gorgon uses Direct 3D 11.2 (via SharpDX) to provide high performance graphics for your applications.

What is not Gorgon?

Building applications with Gorgon requires that you write code. There's no nodes, no blueprints, etc... It does not contain:

  • A fully featured game engine.
  • An all-in-one editor that uses drag and drop to build your application.
  • A scripting system.

Gorgon is meant for people that want to write their own functionality, get down into the guts of their applications and not have to deal with a black boxed scripting system, or editor. In short, it's more work, but more customizable.

For those that want a more complete (and polished) package to build their applications there's Unity, Unreal, Godot or Stride (formally Xenko).

Gorgon is licensed under the MIT license.

What can it do?

Gorgon provides a set of libraries that are capable of handling pretty much any task thrown at it. It includes:

Gorgon.Core

Core functionality, plug in support and utility functionality. This is the base library that everything else uses.

Gorgon.Windows

Core Windows specific functionality. Provides UI functionality, such as custom message box dialogs, timing functionality using QPC and/or the windows multimedia timer and various other bits of utility/diagnostic functionality.

Gorgon.FileSystem

A virtual file system that can mount a directory as a file system root, or using various file system providers, can mount a packed file as a virtual file system root. This code is based on the popular PhysFS library.

By default, Gorgon's basic virtual file system is based on the folder/files on the Windows file system, but using filesystem providers via plug ins, applications can read any type of file storage container can be used if the appropriate plug in is available for it. Gorgon comes with two plug ins for file system providers:

  • Gorgon.FileSystem.GorPack: Gorgon's proprietary packed file system format, using BZip2 compression.
  • Gorgon.FileSystem.Zip: Mounts standard .zip files as virtual file systems.

Gorgon.Input

A flexible input library to handle joysticks/gamepads, keyboard and mouse input. The input library can use events or polling to retrieve data from the various input sources.

Keyboard and mouse input is provided using the Windows Raw Input API, and joystick/gamepad support is driven by the following plug ins:

  • Gorgon.Input.XInput: Support for the XBox 360 controller (and potentially XBox One controller - not tested)
  • Gorgon.Input.DirectInput: Support for gaming devices that are not covered by the XInput API.

Gorgon.Graphics.Core

A "low-level" graphics API that sits on top of Direct 3D 11.2. Provides a simplified system to build objects such as render targets, swap chains, buffers, etc... The rendering portion of the API provides a simple mechanism to submit batched state and draw information back to the underlying D3D API.

Gorgon.Graphics.Imaging

Functionality to read and write image formats. This also contains functionality to use a fluent interface to manipulate images for things like cropping, scaling, etc...

Gorgon uses codecs to read/write images and includes codecs for the following formats:

  • DDS - Direct Draw Surface
  • TGA - Truevision Targa
  • PNG - Portable Network Graphics
  • JPG - Joint Photographic Experts Group
  • BMP - Windows Bitmap
  • GIF - Graphic Interchange Format (supports animated gifs as well)

In additon to the support above, applications can extend the support for file formats by adding their own custom codec plug in to read/write in their desired format(s).

Gorgon.Graphics.Fonts

An extensive bitmap font creation interface (within the graphics module) that supports kerning, outlining of font glyphs, and other customizations to help generate impressive looking text.

Currently Gorgon supports reading and writing of font files through codecs. Support is included for:

  • GorFont: A proprietary binary format for Gorgon.
  • BmFont: A popular font file type created by Andreas Jönsson (Note: this support is limited to the text based file format at this time).

In addition to the support above, applications can introduce their own codecs to read/write whatever font types they wish by extending the GorgonFontCodec type. (Plug in support is pending at this time)

Gorgon.Renderers.Gorgon2D

A 2D renderer that sits on top of the graphics module to make developing 2D games/applications much easier. It supports:

  • Sprites
  • Primitives (triangles, lines, ellipses, arcs, and rectangles)
  • Text rendering
  • A shader based effects system

All of these are provided using batched rendering, similar to MonoGame for maximum performance.

Gorgon.IO.Gorgon2D

IO functionality for serializing sprite and polysprite data to and from various formats using codecs.

Gorgon.Animation

An animation module that allows the creation and playback of key framed animations for various types of objects.

Animation controllers for the 2D renderer are provided by the Gorgon.Animation.Gorgon2D assembly.

Gorgon.Editor

A flexible content editor to allow for the creation and editing of content.

  • Supports a plug in based architecture to allow developers to extend the editor indefinitely.
  • Supports file management of content by using a simple tree layout for folders and files.
  • Comes with an image editor plug in which allows users to add depth slices to 3D images (I have yet, for the life of me to find anything on the web that does this), mip maps and array indices, and other simple functions.
  • Comes with a sprite editor plug in which allows users to clip sprites from an image and store them as a file.
  • Comes with an animation editor plug in for animating sprites.
  • Can output the files as a packed file. The type of file that be written out is provided via plug in support (currently only supports the proprietary Gorgon packed file format).
  • Can import packed files using file system plug ins (currently has support for zip and the proprietary Gorgon packed file formats - included with Gorgon as file system plug ins).

What's required?

  • .NET 4.7.2
  • Windows 10 (Build 15063 or later).
  • A video card that supports Microsoft DirectX 11.2 or better

To compile the library

Visual C# 2017 v15.8 or later.

To use the library

You may use any .NET 4.7.2 enabled language (e.g. Visual Basic .NET) to write an application with Gorgon.

And now you're obviously DYING to use it, so here are some links:
Tape-Worm/Gorgon: A modular set of libraries for .Net that are useful for graphics and video game development. (github.com)

Gorgon v3 | OMG NUB!! (tape-worm.net)

From The Chatty
Hello, Meet Lola