Skip to content

Instantly share code, notes, and snippets.

View daltondotgd's full-sized avatar

Krzysztof 'Dalton' Pachulski daltondotgd

View GitHub Profile
@daltondotgd
daltondotgd / GetAllBoolPropertyValues.cpp
Last active November 1, 2018 21:43
UE4 list all properties of a type
for (TFieldIterator<UProperty> prop_It(this->GetClass()); prop_It; ++prop_It)
{
if (UBoolProperty* BoolProperty = Cast<UBoolProperty>(*prop_It))
{
UE_LOG(LogTemp, Log, TEXT("%s: %s"), *BoolProperty->GetName(), BoolProperty->GetPropertyValue(this) ? TEXT("true") : TEXT("false"));
}
}
@daltondotgd
daltondotgd / VSyncForCocos2dX.cpp
Created August 27, 2014 18:50
To enable VSync for WIN32 in cocos2d-x, modify initWithRect(...) function in CCGLView.cpp, so it contains this code right before 'initGlew();'
...
...
...
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
// Turn on vertical screen sync under Windows.
// (I.e. it uses the WGL_EXT_swap_control extension)
typedef BOOL(WINAPI *PFNWGLSWAPINTERVALEXTPROC)(int interval);
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
/*
* Copyright (c) 2014 Krzysztof Pachulski
* License: The MIT License (MIT)
* MIT License page: http://opensource.org/licenses/MIT
*
* getConvexHull() function calculates a convex hull of a cloud
* of points defined as a vector of points.
*
* getConvexHull() function uses Point and Edge classes
* provided below.
@daltondotgd
daltondotgd / Class.sublime-snippet
Created June 21, 2014 11:18
Sublime: new JavaScript class snippet (for straps.js inheritance model)
<snippet>
<content><![CDATA[
var ${1:Class} = ${2:Base}.extend({
initialize: function ${1:Class}(${3}) {
${4}
},
});
]]></content>