RandyGaul/cute_headers hiện có 5.1k sao trên GitHub, viết chủ yếu bằng C. Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Run-time 2d sprite batcher. Builds atlases on-the-fly in-memory. Useful to implement a sprite batcher for any purpose (like 2D games) for high-performance rendering, without the need to precompile texture atlases on-disk.
1.08
C/C++
cute_sync
Collection of practical synchronization primitives, including read/write lock and threadpool/task system
1.02
C/C++
cute_tls
Create a TLS connection to a website over TCP, useful for HTTPS requests.
1.02
C/C++/Obj-C
How to Use
Generally these headers do not have dependencies and are intended to be included directly into your source (check each header for specific documentation at the top of the file). Each header has a LIBNAME_IMPLEMENTATION symbol; add this to a single translation unit in your code and include the header right after in order to define library symbols. Just include the header as normal otherwise.
Examples and Tests
Some headers also have example code or demos. In this repo just look for the corresponding examples or tests folders. The example folders are particularly useful for figuring out how to use a particular header.
Contact
Here's a link to the discord chat for cute_headers. Feel free to pop in and ask questions, make suggestions, or have a discussion. If anyone has used cute_headers it would be great to hear your experience! https://discord.gg/2DFHRmX
Another easy way to get a hold of me is on twitter @randypgaul.
FAQ
What's the point of making a single file? Why is there implementation and static functions in the headers?
Including these headers is like including a normal header. However, to define the implementation each header looks something like this:
// Do this ONCE in a .c/.cpp file
#define LIBNAME_IMPLEMENTATION
#include "libname.h"
// Everywhere else, just include like a typical header
#include "libname.h"
This will turn the file into a header + c file combo, one time. The point of this is: A) handling the header or sending it to people is easy, no zip files or anything just copy and paste a single file; B) build scripts are a pain in the ass, and these single-file libs can be integrated into any project without modifying a single build script.
Doesn't writing all the code in a header ruin compile times?
The stigma that header implementations slow compile time come from inline'd code and template spam. In either case every single translation unit must churn through the header and place inline versions of functions, or for templates generate various type-specific functions. It gets worse once the linker kicks in and needs to coalesce translation units together, deleting duplicated symbols. Often linkers are single-threaded tasks and can really bottleneck build times.
A well constructed single-file header will not use any templates and make use of inline sparingly. Additionally well constructed single-file headers use a #define to place implementation (the function definitions and symbols) into a single translation unit. In this way a well crafted single-file header is pretty much the best thing a C compiler can come across, as far as build times go. Especially when the header can optionally #define out unneeded features.
Aren't these header only libraries just a new fad?
I personally don't really know if it's a fad or not, but these files aren't really just headers. They are headers with the .C file part (the implementation) attached to the end. It's two different files stuck together with the C preprocessor, but the implementation part never shows up unless the user does #define LIB_IMPLEMENTATION. This define step is the only integration step required to use these headers.
Unfortunately writing a good header library is pretty hard, so just any random header lib out there in the wild is probably not a good one. The STB and RJM are pretty good header libs, and are a good reference to get an idea at what a good header lib looks like. Mattias Gustavsson has my favorite collection of headers.
What is the license?
Each lib contains license info at the end of the file. There is a choice between public domain, and zlib.
I was looking for a header I've seen before, but it's missing. Where did it go?
Some of the unpopular or not so useful headers became deprecated, and live here now.
*Do you have any higher level libraries? These seem a bit too low-level.
The cute headers are indeed rather low-level. They solve specific problems. If you're looking for a higher level game creation framework I suggestion trying out Cute Framework, a 2D game creation framework built largely on-top of the various low-level cute headers seen here.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/RandyGaul/cute_headers là nguồn chính thức.
RandyGaul/cute_headers có bao nhiêu sao?
RandyGaul/cute_headers có 5.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/RandyGaul/cute_headers. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
RandyGaul/cute_headers có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho RandyGaul/cute_headers. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
RandyGaul/cute_headers còn đang phát triển không?
Commit gần nhất trên RandyGaul/cute_headers là 5 tháng trước (theo timestamp GitHub). Repo có 319 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
RandyGaul/cute_headers là gì?
RandyGaul/cute_headers (RandyGaul/cute_headers) là dự án C trên GitHub. Theo mô tả gốc: Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
RandyGaul/cute_headers so với các dự án Backend khác thế nào?
RandyGaul/cute_headers được TopGit xếp vào nhóm Backend, với 5.1k sao GitHub và viết bằng C. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về cute_headers?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về cute_headers.