This file contains hidden or 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
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <stdint.h> | |
#pragma comment(lib, "Advapi32.lib") | |
bool tryToFindMicrocodeVersionInRegistry(uint32_t* pOutMicrocodeVersion) | |
{ | |
bool success = false; | |
HKEY pProcessorRegistryKey = nullptr; |
This file contains hidden or 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
# General | |
TabWidth: 4 | |
Language: Cpp | |
BreakStringLiterals: true | |
PointerAlignment: Left | |
NamespaceIndentation: All | |
Cpp11BracedListStyle: false | |
# Spacing | |
SpaceAfterCStyleCast: false |
This file contains hidden or 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 <stdlib.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
bool isDebuggerAttached() | |
{ | |
char buf[128] = {}; | |
bool debugger_present = false; |
This file contains hidden or 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
cmd.exe /K "CALL "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"" |
This file contains hidden or 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
//kglGetProcAddress = (wglGetProcAddress/glxGetProcAddress/eglGetProcAddress) | |
/*********************************************************************************/ | |
/* - p_GLExtensionFunctionName = The name of the function whose pointer you want to retrieve. e.g. glGenVertexArray) | |
- p_ReviewBoardAbbreveration = Abbreveration of the review board that implemented the extension (e.g. ARB, KHR, INTEL, etc.) | |
- p_Buffer = An external buffer we can write stuff into | |
*/ | |
char* ConstructGLExtensionFunctionString(const char* p_GLExtensionFunctionName, |
This file contains hidden or 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
Shader file (e.g. vertex shader): | |
---- | |
float4 TransformVertex(in float4 pos : POSITION, | |
in float2 uvIn : TEXCOORD0, | |
in float4x4 worldMatrix : WORLDMATRIX, | |
in float4x4 projMatrix : PROJECTIONMATRIX, | |
in float4x4 viewMatrix : VIEWMATRIX, | |
out float2 uvOut : TEXCOORD0) | |
{ |
This file contains hidden or 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
//once on init | |
HANDLE process = GetCurrentProcess(); | |
SymInitialize( process, NULL, TRUE ); | |
//create stacktrace | |
HANDLE process = GetCurrentProcess(); | |
PVOID addresses[256]; | |
unsigned short framesCaptures = CaptureStackBackTrace(1, 256, addresses, 0); | |
for (unsigned short i = 0; i < framesCaptures; ++i) |
This file contains hidden or 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
@echo off | |
echo Searching for Visual Studio installation... | |
setlocal enableextensions enabledelayedexpansion | |
set FOUND_PATH=0 | |
set VS_PATH= | |
::check whether this is 64bit windows or not | |
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT | |
IF %OS%==64BIT set REG_FOLDER=HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7 |