Skip to content

Instantly share code, notes, and snippets.

View KVM-Explorer's full-sized avatar

traveller KVM-Explorer

View GitHub Profile
@KVM-Explorer
KVM-Explorer / runner.c
Last active September 15, 2023 13:23
[左脚踩右脚螺旋升天] TM 引擎 runner line950-line974代码片段 #c #GameEngine
for (uint32_t s = 0, count = 0; s < app->num_splits; s++) {
if (app->activated_gpu_affinity_mask & (1 << s)) {
count++;
}
splits[count] = app->viewer_splits[s + 1];
}
tm_rect_t slider_rect = tm_rect_split_off_bottom(&rect, 20.0, 0.0);
const uint64_t slider_id = tm_ui_api->make_id(app->window.ui);
const tm_ui_slider_t slider = {
.id = slider_id,
@KVM-Explorer
KVM-Explorer / FixSizeBuffer.cpp
Last active October 23, 2023 03:17
[Fix Size Buffer]manager a simple fix length buffer with smart pointer #cpp #RAII
#include <memory>
#include <assert.h>
/**
* @brief 一个固定长度的buffer
* @note 用于存储固定长度的数据,不会发生内存的重新分配
* @author
*/
class FixSizeBuffer {
public:
FixSizeBuffer(uint32_t size)