Skip to content

Instantly share code, notes, and snippets.

View bkaradzic's full-sized avatar

Бранимир Караџић bkaradzic

View GitHub Profile
@bkaradzic
bkaradzic / idl.md
Last active March 26, 2023 22:12
bgfx is switching to IDL to generate API

bgfx is switching to IDL to generate API

bgfx main API is using basic C++ that looks like C, but it's C++ enough that can't be used directly in C projects. C is important as it provides ability to bind API to other languages, and also as sanity check for API design.

Every time API changes manual process of process for adding/changing API for C99 bindings was changing header declarations of function and function type for interface virtual table (I'll use bgfx::createVertexBuffer function as an example):

/* ... bunch of funcs ... */

/**/
BGFX_C_API bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(

Response to px_render.h rationale "but..." section of bgfx

Context:
https://web.archive.org/web/20180705002109/https://pplux.github.io/why_px_render.html

bgfx records render commands in global variables (or thread local variables), making impossible to use a task-based scheduler if you want to split your render between different tasks that might be executed from different threads.

bgfx does support submission from multiple threads via bgfx::Encoder interface:

@bkaradzic
bkaradzic / why_i_think_immediate_mode_gui_is_way_to_go_for_gamedev_tools.md
Last active October 30, 2024 03:09
Why I think Immediate Mode GUI is way to go for GameDev tools

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@bkaradzic
bkaradzic / notes_on_header_files.md
Last active December 8, 2023 03:24
Notes on header files

Notes on header files

After over 20 years working with C/C++ I finally got clear idea how header files need to be organized. Most of the projects in C++ world simply dump everything in .h file, and most of my C++ code was organized this way. Lately I started to separate function declaration from implementation as it was done in C. Now .h headers are exclusevely intended for function and class declaration with doxygen documentation style comments. Inline implementation of functions, class method implementation, etc. goes into .inl headers or .cpp files.

For example .h file would contain only declaration and doxygen style documentation comment:

	/// Convert size in bytes to human readable string.
	void prettify(char* _out, int32_t _max, uint64_t _value)
@bkaradzic
bkaradzic / yelp-programmers.md
Last active November 2, 2023 03:43
Phenomenon of Yelp Programmers

Phenomenon of Yelp Programmers

Other day on Twitter I ran into some retweets about "10x programmers" by some people who are not known for their coding, but rather complaining on Twitter. Since I followed them before I know partially their work history, or more like their brief stints, at different well known game tech companies.

This made me think about recent phenomenon of programmers who seem to be working on games with existing codebases their whole career, without significant contribution to any of those code bases, but who are very vocal and opinionated about things in those code bases.

Some traits of Yelp programmers are:

  • Brief stints at different game companies.
@bkaradzic
bkaradzic / orthodoxc++.md
Last active November 15, 2024 12:57
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@bkaradzic
bkaradzic / gist:8487361
Last active January 3, 2016 16:09
Using SteamBox as DevKit

Using SteamBox as DevKit

In SteamOS go to Settings / Intefrace and check "Enable access to the Linux desktop" option.

Click on Exit, choose "Return to Desktop".

Open terminal and set password so sudo can work:

passwd