Skip to content

Instantly share code, notes, and snippets.

View sortofsleepy's full-sized avatar

Joe sortofsleepy

View GitHub Profile
@sortofsleepy
sortofsleepy / copyGeo.h
Created May 23, 2020 03:09
Example of how to copy geometry with a VEX node in Houdini.
int numVerts = nvertices(1);
int numPoints = npoints(1);
int numPrim = nprimitives(1);
int ptTally = 0;
// copy all the primitives,vertex data, and indices.
for(int p = 0; p < numPrim; ++p){
int prim = addprim(0,"poly");
CompilerResultsLog: Error: NatureOfCodeGameModeBase.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl FDeferredCleanupInterface::FinishCleanup(void)" (?FinishCleanup@FDeferredCleanupInterface@@UEAAXXZ)
CompilerResultsLog: Error: NatureOfCodeGameModeBase.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl FShader::Serialize(class FArchive &)" (?Serialize@FShader@@UEAA_NAEAVFArchive@@@Z)
CompilerResultsLog: Error: NatureOfCodeGameModeBase.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class FVertexFactoryParameterRef const * __cdecl FShader::GetVertexFactoryParameterRef(void)const " (?GetVertexFactoryParameterRef@FShader@@UEBAPEBVFVertexFactoryParameterRef@@XZ)
CompilerResultsLog: Error: NatureOfCodeGameModeBase.cpp.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __cdecl FShader::GetAllocatedSize(void)const " (?GetAllocatedSize@FShader@@UEBAIXZ)
CompilerResultsLog: Error: NatureOfCodeGameM
{"keyboard":"walletburner/neuron","keymap":"walletburner_neuron_layout_mine","layout":"LAYOUT","layers":[["KC_ESC","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSPC","KC_TAB","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_ENT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","MO(1)","KC_LCTL","KC_LGUI","MO(3)","KC_NO","KC_SPC","MO(2)","KC_RALT"],["KC_NO","KC_PGDN","KC_UP","KC_PGUP","KC_NO","KC_NO","KC_NO","KC_NO","KC_LPRN","KC_RPRN","KC_SLSH","KC_BSLS","KC_NO","KC_LEFT","KC_DOWN","KC_RGHT","KC_NO","KC_NO","KC_NO","KC_GRV","KC_SCLN","KC_LCBR","KC_RCBR","KC_LSFT","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_EQL","KC_NO","KC_QUOT","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO"],["KC_NO","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_BSPC","KC_NO","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_LSFT","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO",
@sortofsleepy
sortofsleepy / .gitignore
Created April 3, 2020 23:37
Common stuff I usually leave out
.DS_Store
node_modules/
vc2015/.vs
vc2015/x64
backup/
@sortofsleepy
sortofsleepy / utils.h
Created February 24, 2020 22:10
useful c++ stuff
//! borrowed from https://github.com/wdlindmeier/Cinder-Metal/blob/master/include/MetalHelpers.hpp
template <typename T, typename U >
const U static inline convert( const T & t )
{
U tmp;
memcpy(&tmp, &t, sizeof(U));
U ret = tmp;
return ret;
}

Building Dawn on Windows

Writing this here cause it was one heck of an adventure to finally get Dawn built on Windows. It's unclear if things are truly built and whether or not there might be more issues to resolve, but for now, by following these instructions, you should be able to at the very least, get Dawn built, set things up properly without any compiler complaints, and with a slight tweak, get the samples up and running.

Note that Google has suggested that the current build system setup is not recommended for producing libraries to be included into your own projects, but there is the desire to include CMake build support for this purpose in the future.

As you might imagine, Dawn is stil being developed so things are bound to be broken. Hopefully things will smooth out as the project reaches it's first major milestone. I am just a casual hobyist so I have no idea as to the current progress but there is a mailing list you can keep up with [here](https://groups.google.com/forum/#!forum/dawn-g

@sortofsleepy
sortofsleepy / constants.ts
Created January 30, 2020 21:11
WebGPU constants aliased to shorter or more sensible names. Will apply on top of the window variable
export default function setConstants(){
if(navigator.gpu !== undefined){
let constants = {
// ============= SHADER STAGES ============ //
VERTEX_STAGE:GPUShaderStage.VERTEX,
FRAGMENT_STAGE:GPUShaderStage.FRAGMENT,
COMPUTE_STAGE:GPUShaderStage.COMPUTE,
@sortofsleepy
sortofsleepy / gist:e95f74ecd30522b83ba884d2ce62c23c
Created January 24, 2020 13:57
add MSVC checks + how to add options in CMake
if(MSVC_VERSION GREATER_EQUAL "1900")
include(CheckCXXCompilerFlag)
add_compile_options("/std:c++latest")
endif()
@sortofsleepy
sortofsleepy / utils.hpp
Created January 17, 2020 00:12
Helpful utilities
//
// utils.h
// Test
//
// Created by josephchow on 1/16/20.
//
#ifndef utils_h
#define utils_h
@sortofsleepy
sortofsleepy / main.cpp
Created January 11, 2020 16:57
How to initialize Cinder from main function instead of macro
int __stdcall WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nCmdShow*/)\
{
HMODULE livepp = lpp::lppLoadAndRegister(L"../../../LivePP","project");
lpp::lppEnableAllCallingModulesSync(livepp);
lpp::lppInstallExceptionHandler(livepp);
cinder::app::RendererRef renderer(new ci::app::RendererGl);