This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WrappedType = struct { | |
// Assumption that this field would be taken out for runtime and therefore not affect the size of WrappedType | |
comptime const gaurantee: TypeProperties, | |
data: u64, | |
}; | |
const TypeProperties = enum { | |
isA, | |
isB | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
// Copyright (c) 2021 Keith Chambers | |
// This program is free software: you can redistribute it and/or modify it under the terms | |
// of the GNU General Public License as published by the Free Software Foundation, version 3. | |
// NOTE: This gist is a snippet from https://github.com/kdchambers/zedikor/blob/main/src/core.zig | |
// The update function is used to check what changes have occurred due to user input and whether | |
// vertexes need to be updated and screen re-rendered. | |
fn update(allocator: *Allocator, app: *GraphicsContext) !void { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
// Copyright (c) 2021 Keith Chambers | |
// This program is free software: you can redistribute it and/or modify it under the terms | |
// of the GNU General Public License as published by the Free Software Foundation, version 3. | |
// NOTE: This snippet is taken from https://github.com/kdchambers/kpl/blob/master/include/kpl/chainedarray.h which | |
// is part of the kpl library. This data structure is used when you extent to use a reasonably small amount of data | |
// but need the assurance of being able to allocate large amounts of data in some rare scenarios. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
// Copyright (c) 2021 Keith Chambers | |
// This program is free software: you can redistribute it and/or modify it under the terms | |
// of the GNU General Public License as published by the Free Software Foundation, version 3. | |
// NOTE: This snippet is taken from https://github.com/kdchambers/VulkanGUIExample/blob/master/text.cpp | |
// This file is responsible for taking a font file (E.g ttf) and creating a texture bitmap containing all the | |
// requested glyphs at the desired size. This texture is then sampled by the vulkan engine to render text to screen | |
#include "text.h" |