gunslinger
rotate
Our great sponsors
gunslinger | rotate | |
---|---|---|
10 | 4 | |
1,153 | 143 | |
- | - | |
7.5 | 10.0 | |
4 days ago | over 1 year ago | |
C | C | |
BSD 3-clause "New" or "Revised" License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
gunslinger
-
game development with c
Here's a framework that's cool: https://github.com/MrFrenik/gunslinger/. We have a great Discord community, too. Even if you don't end up using it, there are plenty of people who are willing to offer guidance regardless :). Invite link is on the author's YouTube channel: https://www.youtube.com/watch?v=-_HxKDNuCqA
- Do you have any C game frameworks, or should I just learn C++?
-
Magnum: Lightweight, modular C++11 graphics middleware for games/visualization
Check out gunslinger, a pure C99 game framework, with a very clean design.
The development has been making huge strides and they have a fairly active discord channel:
https://github.com/MrFrenik/gunslinger
-
Looking for a game engine programmable in C
Make your own. If you really want to make a game in C, this may be the best option. Depending on how complex the game is that you want to make, this could be an enormous task, or not too big of a deal, in some cases it could even be easier than learning a game engine. You can use frameworks like Gunslinger to make it easier, as well. If you need guidance, the Gunslinger community is friendly and accepting of beginners :).
-
Generic data type in c
That being said, you may have your requirements satisfied with tagged unions which consists in implementing a struct with an anonymous union and label (like an enum) to keep track of what data is inside the union, this works really well when you know beforehand which data types you want to support. Another technique could be using macros, like the containers on the gunslinger framework, however I have never implemented something like this. Lastly you can always use void pointers, however you may need to be more clever to achieve it (I almost never use them).
-
What is your own favorite C project?
Some of my favorites are: sokol/pacman.c, Gunslinger, and gb
-
Recreating Noita's Sand Simulation in C and OpenGL | Game Engineering
And here is Github of his game engine of this guy: Gunslinger Game Engine
-
Bash and Powershell remote scripts to install header-only C and C++ libraries from github repo.
To install non exotic library from a github repo, specify just the repo-owner/repo-name or the absolute github link to the repo. E.g. to install gunslinger and stb from master branch
-
A Header Only OpenGL Framework Written In C
Looking quickly at this lib, functions of the API are not static: https://github.com/MrFrenik/gunslinger/blob/d5ebcce0647e97badc9337749d7cd9f5810eecfa/gs.h#L1415, so it might lead to ODR violation.
rotate
-
10~17x faster than what? A performance analysis of Intel x86-SIMD-sort (AVX-512)
quadsort/fluxsort/crumsort author here.
For me there's a strong visual component, perhaps most obvious for my work on array rotation algorithms.
https://github.com/scandum/rotate
There's also the ability to notice strange/curious/discordant things, and either connect the dots through trying semi-random things, as well as sudden insights which seem to be partially subconscious.
One of my (many) theories is that I have the ability to use long-term memory in a quasi-similar manner to short-term memory for problem solving. My IQ is in the 120-130 range, I suffer from hypervigilance, so it's generally on the lower end due to lack of sleep.
I'd say there's a strong creative aspect. If I could redo life I might try my hand at music.
-
Is there a more efficient way to write this C program?
This is essentially just a rotation of a subrange of your original array. A variety of different algorithms for this operation can be found here.
-
Building the Perfect Memory Bandwidth Beast
Memory bandwidth is 1000x lower than CPU bandwidth, so as a rule of thumb any algorithm whose work scales linearly in the amount of data being processed will be memory bandwidth bound, and also any algorithm which can't be structured to do a lot of work on one memory region at once before moving onto the next one.
Examples (for large enough inputs that it's relevant) include shuffling, sorting, kmeans clustering, branch and bound sudoku solving, vector addition, dot products, and so on.
Moreover, writing a particular piece of code is often easier if you ignore memory bandwidth as a constraint. The classic example is matrix multiplication -- it can be structured such that even disk bandwidth isn't relevant compared to CPU bandwidth, but doing so is a little fiddly compared to the naive n^2 dot products approach, so writing it yourself usually results in a memory bandwidth bound solution for large matrices.
Similarly, writing two passes over your data rather than doing a mega-loop, the choice to use classic kmeans rather than one of its approximations (when it would be appropriate to do so), or not enforcing sortedness at some reasonable boundary and having to do additional passes over your data. It's easy to write code that hoovers up way more bandwidth than it needs to, and often faster algorithms that come out don't do anything different than access the right data at the right time to reduce that pressure, like a trinity rotation [0].
Caveat: Benchmark everything, especially as you're building intuition. Trying to fix what you think is a memory bandwidth issue can result in pipeline stalls and all sorts of fun things, especially when your server has more faster caches than your dev machine, when data in prod doesn't match your micro benchmark, ....
[0] https://github.com/scandum/rotate
- A collection of array rotation algorithms
What are some alternatives?
sokol - minimal cross-platform standalone C headers
stb - stb single-file public domain libraries for C/C++
raylib - A simple and easy-to-use library to enjoy videogames programming
quadsort - Quadsort is a branchless stable adaptive mergesort faster than quicksort.
microui - A tiny immediate-mode UI library
sort-research-rs - Test and benchmark suite for sort implementations.
mountain-sort - The best algorithm to sort mountains
nanovg - Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
buddy_alloc - A single header buddy memory allocator for C & C++
pns