Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Dev News] Brutal Gets A Bit Less Brutal
1
The Brutal C# game development framework released earlier this month free and open source. One of the core tenets of Brutal is that it isn’t easy to use. In fact, that is the source of the name:

Quote:The name is a warning.

BRUTAL is intended for experienced programmers who want to make their own architectural decisions and are prepared to build and maintain the systems their games require. Its scope is deliberately focused. The team prioritises low-level functionality for demanding games, with contributions assessed against that purpose.

At launch however this was extremely true, as Brutal launched with no documentation and no examples. Nothing. To figure anything out you basically had to dive into the code and figure things out yourself. Today, well… there’s still no documentation, but there are now examples… lot’s of them in fact.

SampleWhat it showsHelloCore.csPlatform detection,
Code:
ByteSize
/
Code:
ElementCount
arithmetic and
Code:
Ptr<T>
HelloMemory.csAllocating and freeing unmanaged memory with
Code:
Mem
, and owning a pointer with
Code:
PtrOwner<T>
HelloCollections.cs
Code:
NativeList<T>
, a growable list backed by unmanaged memoryHelloStrings.csUTF-8 text with
Code:
String8
and
Code:
StringBuilder<byte>
, which are designed to avoid allocationsHelloNumerics.csVector and matrix basics with
Code:
float3
and
Code:
float4x4
HelloMaths.csThe
Code:
Random
extensions: ranges, points in shapes and random directionsHelloConcurrency.csRunning jobs across worker threads with
Code:
JobScheduler
HelloLogging.csLogging to the console with the default and named categoriesHelloLocalization.csLocalised strings with named variables, and swapping in a translation

Windowing and UI

SampleWhat it showsHelloGlfw.csAn empty GLFW windowHelloSdl.csAn SDL window with a renderer drawing a filled rectangleHelloSdlImage.csSaving a generated image as PNG with Sdl.Image and loading it backHelloSdlTtf.csRendering text to a surface with Sdl.Ttf, using a system font if you don’t pass oneHelloImGui.csDear ImGui on its GLFW and OpenGL backends with some text, a button and a sliderHelloImGuiFreeType.csBuilding the ImGui font atlas with FreeType, without a windowHelloImPlot.csPlotting a sine wave with ImPlot in one headless frameHelloImGuiAbstractions.csThe in-game console: registering
Code:
[TerminalAction]
commands and running command linesHelloImGuiExtensions.cs
Code:
ImGuiEx
widgets bound straight to C# enumsHelloNativeFileDialog.csThe operating system’s native file pickerHelloNotCurses.csColoured text in the terminal with notcurses (run it in a real terminal)

Graphics

SampleWhat it showsHelloOpenGl.csA coloured triangle with OpenGLHelloVulkan.csCreating a Vulkan instance, listing GPUs and their queue families, and creating a deviceHelloVulkanAbstractions.csThe Vulkan.Abstractions setup helpers, and a vertex input layout built from C# structsHelloVulkanVma.csCreating a VMA allocator and a mapped buffer, writing to it and reading it backHelloShaderC.csCompiling GLSL to SPIR-V with shadercHelloSlang.csCompiling Slang to SPIR-VHelloRenderMesh.csGenerating a procedural sphere mesh

Textures and assets

SampleWhat it showsHelloStb.csWriting and reading a PNG with stb_imageHelloTexture.csTexture format descriptors, filling a
Code:
GenericTexture
, and saving and loading it as PNG and KTX2 with
Code:
TextureWriter
and
Code:
TextureLoader
HelloKtx.csCreating, writing and loading a KTX2 textureHelloGli.csA texture with a full mip chain, saved and loaded as DDS with GLIHelloGltf.csParsing a tiny inline glTF, reading its vertices and saving it back outHelloMeshOptimizer.csReordering triangles for the vertex cache with meshoptimizer

Audio

SampleWhat it showsHelloOpenAl.csPlaying a generated tone with OpenALHelloSdlMixer.csPlaying a generated tone with Sdl.MixerHelloFmod.csPlaying a tone with FMOD. FMOD’s native libraries aren’t bundled, so you need your own licensed copy

Physics

SampleWhat it showsHelloBox2D.csDropping a box onto the ground with Box2D and printing where it landsHelloJolt.csDropping a box onto the ground with Jolt Physics and printing where it lands

Networking

SampleWhat it showsHelloRakNet.csA RakNet server and client connecting over localhost and sending a message

Diagnostics

SampleWhat it showsHelloMonitorHost.csStarting the Monitor watchdog and writing logs to a fileHelloRenderDoc.csChecking whether RenderDoc’s in-application API is loaded (Windows and Linux)HelloRenderDocImGui.csDrawing the RenderDoc control panel with Dear ImGui, headless

Demos

SampleWhat it showsDemoVulkan.csA coloured triangle with Vulkan, the Vulkan.Abstractions helpers, a VMA-allocated vertex buffer and shaders compiled with ShaderCDemoGltfViewer.csLoading a glTF scene with its node transforms, optimising it with meshoptimizer and drawing it lit with OpenGL. Pass your own
Code:
.gltf
or
Code:
.glb
, or it builds a torus knotDemoTexturedQuad.csWriting a mipmapped texture as KTX2, loading it back and drawing it on a floor with OpenGL, with each mip level tintedDemoImGui.csDear ImGui with FreeType fonts and an ImPlot plot, on GLFW and OpenGLDemoSdl.csAn SDL window using Sdl.Image (PNG save and load), Sdl.Mixer (a beep on Space) and Sdl.Ttf (text, if you pass a font)DemoRenderDoc.csAn OpenGL triangle that captures a frame with RenderDoc when you press F12 (Windows and Linux)DemoBox2D.csBoxes falling onto the ground with Box2D, drawn with OpenGLDemoJolt.csBoxes falling onto the ground with Jolt Physics, drawn in 3D with OpenGL

Even better, there is also a community created example available as well, that showcases a full Vulkan renderer implementation to create a 3D model loader.

Key Links

Brutal Framework Homepage

Brutal Samples

Community Sample – Hello Brutal

In the below we jump into the new samples and determine just how brutal the Brutal framework is to use!
Reply

Users browsing this thread:
1 Guest(s)


Forum Jump: