Skip to content

Instantly share code, notes, and snippets.

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

Block or report user

Report or block bkaradzic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bkaradzic
bkaradzic / idl.md
Last active Apr 9, 2019
bgfx is switching to IDL to generate API
View idl.md

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(
View response.md

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 May 21, 2019
Why I think Immediate Mode GUI is way to go for GameDev tools
View why_i_think_immediate_mode_gui_is_way_to_go_for_gamedev_tools.md

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 Apr 23, 2019
Notes on header files
View notes_on_header_files.md

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 Jul 17, 2018
Phenomenon of Yelp Programmers
View yelp-programmers.md

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.
View orthodoxc++.md

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 Jan 3, 2016
Using SteamBox as DevKit
View gist:8487361

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
You can’t perform that action at this time.