Skip to content

Instantly share code, notes, and snippets.

View tim-rex's full-sized avatar

Tim-Rex tim-rex

View GitHub Profile
@bkaradzic
bkaradzic / orthodoxc++.md
Last active July 5, 2024 10:46
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++?

  • void glEnableVertexAttribArray​(GLuint attribIndex);
  • void glDisableVertexAttribArray​(GLuint attribIndex);
  • void glVertexAttribPointer(GLuint attribIndex, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer);
  • void glVertexAttribFormat(GLuint attribIndex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
  • void glVertexAttribBinding(GLuint attribIndex, GLuint bindingIndex);
  • void glBindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset, GLintptr stride);
parameter Details
attribIndex the location for the vertex attribute to which the vertex array will feed data
@cdleon
cdleon / macbook-pro-2011-defective-gpu-fix.md
Last active June 3, 2024 16:56
Macbook Pro 2011 GPU Defect fix macOS Sierra and High Sierra
@nicebyte
nicebyte / dyn_arr.h
Last active July 1, 2024 10:44
dyn_arr
#pragma once
#define DYN_ARR_OF(type) struct { \
type *data; \
type *endptr; \
uint32_t capacity; \
}
#if !defined(__cplusplus)
#define decltype(x) void*
@NoelFB
NoelFB / routine.h
Last active November 7, 2022 07:19
Simple C++ Coroutine using a switch statement internally
#pragma once
namespace YourNamespace
{
struct Routine
{
// Current "waiting time" before we run the next block
float wait_for = 0;
// Used during `rt_for`, which repeats the given block for X time
@michaeljclark
michaeljclark / cpuident.c
Last active July 30, 2022 08:17
cmake configure time CPU feature detection for x86 processors
#include <stdio.h>
#include <stdlib.h>
#if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
#define HAS_X86_CPUID 1
#include <cpuid.h>
static inline void __x86_cpuidex(int reg[], int level, int count)
{ __cpuid_count(level, count, reg[0], reg[1], reg[2], reg[3]); }
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
#define HAS_X86_CPUID 1
@Devaniti
Devaniti / SystemSetup.ps1
Last active June 27, 2024 11:16
Setup script for new Windows 11 graphic developer PC.
# Script for setting up new Windows 11 PC for graphic development
# You need need to run it with administator rights
if (!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList @("-ExecutionPolicy Bypass", "-File `"$($MyInvocation.MyCommand.Path)`"")
Exit
}
Push-Location $env:TEMP
function ShowFileExtensions {