GithubHelp home page GithubHelp logo

chroma-2d / chroma Goto Github PK

View Code? Open in Web Editor NEW
28.0 4.0 4.0 103.88 MB

Chroma Framework is a cross-platform 2D game development framework with focus on quick bring-up and hassle-free prototyping.

Home Page: https://chroma.vddcore.eu

License: MIT License

C# 99.49% GLSL 0.48% Shell 0.03%
gamedev gamedev-library gamedev-framework chroma 2d-game-framework 2d 2d-graphics game-development game-2d game-dev

chroma's Introduction


Chroma Framework

What? Another one?
Yeah! Another one! Chroma is a 2D-focused game development framework. Works just as well for other kinds of 2D applications too. Might as well call it a glorified SDL wrapper for .NET 6 if you like.

Why?
Because MonoGame iswas so slow to add hassle-free shader compilation on Linux that it seemed faster for me to write an entire goddamn game development framework. Thought to myself "might as well learn something along the way...". Besides, I've always wanted to have something like this for fast prototyping.

Alright. What are its features?
Oh I'm glad you asked! Features include, but are not limited to:
  ▐ Cross-platform support - Windows, Linux and (experimental!) macOS
  ▐ Hassle-free framework bring-up allowing you to prototype fast and without bullshit boilerplate.
  ▐ Supports GLSL shaders on any platform. No shader pre-compilation - plain old .frag and .vert.
  ▐ MIT licensed! Do whatever you want to/with it, I want my name on Chroma, though.
  ▐ Allows you to draw primitive shapes out-of-box. I'm looking at you, MonoGame.
  ▐ Err... Is actively developed? At least until I deem it feature-complete.
  ▐ Generally tries to make the gamedev's life easier rather than harder.
  ▐ Drawing inspiration from some of the best frameworks out there.
  ▐ <egoboost>Very clever native bootloading system.</egoboost>
  ▐ FreeType-based TTF and BMFont bitmap font format support.
  ▐ Integrates well with .NET ecosystem more often than not.
  ▐ Easy-to-understand rendering controls.
  ▐ Support for Xbox One/Elite, Nintendo and PlayStation 4 & 5 (trigger haptics) controllers.
  ▐ Flexible audio input and output system.

Mobile platform support?
Maybe? Until that happens you're free to use Love2D. I really dig its robustness and ease-of-use.

Docs?
API reference is available, but... I'll do you one better.

Is the API stable?
Mostly (meaning 'sometimes a method or two might change its signature'). While the entire thing is ready for people to make stuff with, I consider this software to still be in beta stage.

You got a roadmap or something?
Where we're going we don't need a roadmap.
Just watch the Issues page. Whenever I get an idea for a feature or someone suggests one I either throw it away or add it to project taskboards.

Are there any examples?
Might surprise you, there are some! For example this guy made a CHIP-8 emulator called CHROMA-8. That madlad also made an audio synthesis library and even a GameBoy emulator - all utilizing Chroma! Such dedication. Wow.

Alternatively, you can check commit history for some API usage examples as well as ghetto examples I create on my personal website. There are some actual demos here as well

How about a quick-start guide?
Since 30.06.2020 there's a possibility of using the official project template.

It can be installed using the following command.

dotnet new -i Chroma.GameTemplate

Afterwards you can create new Chroma projects using the dotnet new template.

dotnet new chromagame -n MyGameLongName
dotnet build
dotnet run

Alternatively:

dotnet new console -n MyGameLongName
cd MyGameLongName
dotnet add MyGameLongName.csproj package Chroma
dotnet build

chroma's People

Contributors

enovale avatar hacktix avatar nolemretawxd avatar vddcore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

chroma's Issues

compression for embedded natives

right now they take up the same amount of space when embedded and extracted, clogging up the Chroma.Natives.dll

a natural next step and possibly the last feature for the natives library would be to compress natives to reduce the file size.

macOS support untested

need people who had money to burn on bullshit apple hardware so that i can test changes i made to chroma, currently only linux and windows have reasonable amount of testing done

Feature Request: Quit()

It would be nice to have a function to call (like love.event.quit() in the love2d framework) that can quit/shutdown the game, especially since the standard windows X button isn't available in fullscreen.

text drag&drop does not work on win32

for whatever reason. however, i've noticed that visual studio is capable of handling dropped text just fine, perhaps it's an SDL-specific issue or i'm missing something windows-specific, as X11 can handle text drag&drop just fine

Additional user-defined Update Timers

While maybe slightly limited in usability, in some instances it could be nice to have seperate timers running on different frequencies to update game status. While this is technically possible in it's current state, being able to simply do something along the lines of this would be pretty cool:

new UpdateTimer(100, () => {
    // some code that's called 100 times per second
}).Start();

custom window icon

no way to do that currently, about time window class got some love again

add more logging for certain checks/failures

e.g. controller subsystem not telling the user they're stupid for setting deadzones for nonexistant controllers. directly ties into #18, after the logging gets unfucked and actually useful

audio system

jesus h. christ cookie you completely forgot about the fact that games use sound omg get it working before alpha hits the store

provide a way for extension assemblies to load natives

the general idea is that extensions should be able to load natives in the same fashion chroma core does - need to figure out a standardized system and the built-in native bootstrapper could be a good foundation for the system

stabilize the API

right now anything can change for any reason, if people are to take this piece of shit framework seriously it needs API definition

Can't render to a rendertarget and get it's pixels

When running this code:

context.RenderTo(FrameTarget, () =>
            {
                context.Clear(Color.Red);
                context.Rectangle(ShapeMode.Fill, Vector2.Zero, 100, 200, Color.Aqua);
            });
            FrameTarget.Flush();

            int[] PixelArray = new int[FrameTarget.Width * FrameTarget.Height];
            for (int y = 0; y < FrameTarget.Height; y++)
            {
                for (int x = 0; x < FrameTarget.Width; x++)
                {
                    PixelArray.Push((int)FrameTarget.GetPixel(x, y).PackedValue);
                }
            }

(Array.Push is an extension method)

PixelArray ends up being filled with 0s, instead of the expected red background with aqua rectangle.

feature usage examples

time to actually make some feature usage examples so people can finally know how to start doing things!

Connected controller count

Especially for multiplayer scenarios it'd be nice to have a property that counts the amount of connected controllers. Currently this can be worked around by creating a counter in the game class and incrementing/decrementing it in the ControllerConnected() and ControllerDisconnected() methods respectively.

error handling for "human" errors

right now chroma works perfectly fine, assuming the user doesn't provide invalid data... HOWEVER i am not sure what are the places that are missing the error handling. find those holes and plug them

shaders seem to break on macOS

because of course they would.

initial crash report suggests sdl_gpu might be at fault?

---
Initializing SDL2 core...
[10:42:47 INF] [GraphicsManager] GraphicsManager initializing...
[10:42:47 INF] [GraphicsManager]  Registered renderers:
[10:42:47 INF] [GraphicsManager]   OpenGL 3 (3.2)
[10:42:47 INF] [GraphicsManager]  Available displays:
[10:42:47 INF] [GraphicsManager]   0: 1792x1120@60Hz
[10:42:47 INF] [Window] Selecting best renderer: OpenGL 3
libfreetype.so not found. Will try to register first...
libfreetype.so is not available. Moving onto next on the list...
freetype.dll not found. Will try to register first...
freetype.dll is not available. Moving onto next on the list...
libpng warning: iCCP: known incorrect sRGB profile
dotnet(82884,0x119aa1dc0) malloc: *** error for object 0x10f0d0010: pointer being freed was not allocated
dotnet(82884,0x119aa1dc0) malloc: *** set a breakpoint in malloc_error_break to debug
[1]    82884 abort      dotnet PixelShaders.dll

Timestamps for Log File Names

In order to have Chroma not break when multiple instances are started, add timestamps to the names of log files to take care of exceptions raised due to the log file already being in use by another process.

Content subsystem

there is no way to conveniently load content nor a way for people to write their own content providers

shader support

chroma needs shaders to even consider itself a "good" framework. make it happen

camera system

how the heck are you supposed to make a game without fast camera things dude

Incorrect Content folder location on "Open With..."

When opening a file from a different folder with a Chroma-based application, Chroma will create a Content folder in the directory of the file that is being opened, rather than the executable it's being opened with.

nuget package

because of course how else are you going to build games without it

improve buildscripts

general:

  • right now the buildscripts keep the mentality of mvp, they will need a refactor once stabilized

osx:

  • freetype doesnt link correctly
  • sdl_sound and sdl_nmix rpath is dealt with using a post-install_name_tool treatment, perhaps cmakelists tweaks can fix this

docs

fuck off with this template

issue: no docs.


what broke
[replace with actual description of the bug please]

how can the dev break it
Steps to reproduce the behavior:

  1. [...]
  2. [...]
  3. etc

what should actually happen instead of y'know... breaking
[replace with some explanation of what did you expect to happen]

got any screenshots?
[no can has pix? remove the paragraph. otherwise post bug related pix]

environment (complete the following):

  • OS and version: [e.g. Windows 10/Linux Mint (kernel 2.6.27)]
  • GPU: [e.g. Intel HD Graphics 4000]

additional context? remarks?
[post some remarks if you got them, otherwise remove paragraph]

update SDL_gpu bindings

SDL_gpu bindings we're using are not compliant with the version of SDL_gpu we're using, it's quite critical to fix it before - or during - alpha period

FPS goals

A seperate option to set an FPS goal for a game, so FPS aren't linked to either maximum or monitor refresh rate

better native library loader

current implementation of the native library loader works only on windows - on linux and friends it assumes the libraries are provided by the system - and extracts files to load them from user's temp directory. not ideal. either provide a mechanism to change that behavior or rely completely on native binaries provided by us

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.