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-FileCopyrightText: © 2022 Phillip Trudeau-Tavara <pmttavara@protonmail.com> | |
// SPDX-License-Identifier: 0BSD | |
// https://hero.handmade.network/forums/code-discussion/t/7485-queryperformancefrequency_returning_10mhz_bug/2 | |
// https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/timers#partition-reference-tsc-mechanism | |
#include <stdbool.h> | |
#include <stdint.h> | |
#define WIN32_LEAN_AND_MEAN |
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
#include <stdio.h> | |
#define STR2(x) #x | |
#define STR(x) STR2(x) | |
#ifdef _WIN32 | |
#define INCBIN_SECTION ".rdata, \"dr\"" | |
#else | |
#define INCBIN_SECTION ".rodata" | |
#endif |
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
// example how to set up OpenGL core context on X11 with EGL | |
// and use basic functionality of OpenGL 4.5 version | |
// to compile on Ubuntu first install following packages: build-essential libx11-dev libgl-dev libegl-dev, then run: | |
// gcc x11_opengl.c -o x11_opengl -lm -lX11 -lEGL | |
// important extension functionality used here: | |
// (4.3) KHR_debug: https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt | |
// (4.5) ARB_direct_state_access: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_direct_state_access.txt | |
// (4.1) ARB_separate_shader_objects: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_separate_shader_objects.txt |
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
memcmp Cld | |
Mov r10, rdi ; save | |
Mov r11, rsi ; save | |
Mov rdi, rcx | |
Mov rsi, rdx | |
Mov rcx, r8 | |
Mov rdx, r8 | |
Xor eax, eax | |
Cmpsb |
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
memcmp Cld | |
Mov r10, rdi ; save | |
Mov r11, rsi ; save | |
Mov rdi, rcx | |
Mov rsi, rdx | |
Mov rcx, r8 | |
Mov rdx, r8 | |
Xor eax, eax | |
Cmpsb |
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
sed -i '/x86_64-\*-elf\*)/a \\ttmake_file=\"\${tmake_file\} i386/t-x86_64-elf\"' gcc-8.1.0/gcc/config.gcc |
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
#include "dynamicarray.h" | |
using namespace std; | |
DynamicArray::DynamicArray() { | |
DynamicArray::DynamicArray(5); | |
} | |
DynamicArray::DynamicArray(int initSize) { | |
size = initSize; |