Skip to content

Repository files navigation

Integrity 2D - SDL2/OpenGL Engine

A work-in-progress, modern 2D graphics engine built entirely in C# to explore and implement the OpenGL 3.3 Core Profile pipeline from the ground up.

Integrity 2D Documentation


IntegrityGameDemo Showcase

Our primary example project showcases scene setup, input handling, and the engine's draw call efficiency by instancing over 10,000 sprites.

IntegrityGameDemo Screenshot showing 10,000 sprites on screen.


Requirements

  1. .NET 8+ SDK
  2. SDL2 runtime libraries (managed via Silk.NET/your environment setup)

Example: Scene Setup

New game objects are instantiated via the factory and registered with the active scene to be rendered automatically.

// Create a new scene
Scene defaultScene = new Scene("DefaultScene");

// Get the factory service from the engine's Service Locator
var factory = Service.Get<IGameObjectFactory>();
var sceneManager = Service.Get<ISceneManager>();

// Load the asset and create the SpriteObject
// The factory handles loading the texture via IAssetManager internally.
string assetPath = "/path/to/your/assets/my_sprite.png";
var playerSprite = factory.CreateSpriteObject("PlayerCharacter", assetPath);

// Adjust the object's transform (position, scale, rotation)
playerSprite.Transform.X = 250.0f;
playerSprite.Transform.Y = 150.0f;
playerSprite.Transform.ScaleX = 0.5f;

// Register the object with the current scene
// Once registered, the Engine's main Render() loop will automatically draw it batched and instanced.
sceneManager.CurrentScene.RegisterGameObject(playerSprite);

// Load and set the scene, rendering will happen automagically
m_SceneManager.AddScene(defaultScene);
m_SceneManager.LoadScene(defaultScene);

Contributing

Want a feature or fixing a bug? Just open a PR and I'll merge it in!

About

A fast Opengl C# 2D Engine with ImGui support

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages