Skip to content

Instantly share code, notes, and snippets.

@marco-we
marco-we / lldbprintstring
Created June 1, 2016 13:19
lldb print string
if you want to print an char* via lldb, lldb only prints the first about 300 characters. to print the complete one just type:
`set set target.max-string-summary-length 10000`
in the lldb command line. now the first 10000 characters are print via:
`p someCharPointer`
(source: http://www.web0.at/lldb-print-complete-char-string/)
@marco-we
marco-we / gist:7dcce28d65b9fa1b7f8839dc2ac12598
Created April 6, 2016 15:31
Trigger Capture Debug Frame on iOS
glInsertEventMarkerEXT(0, "com.apple.GPUTools.event.debug-frame");
const uint32_t width = frameBuffer.m_width;
const uint32_t height = frameBuffer.m_height;
const uint32_t length = width*height*4;
GLuint pboId;
GL_CHECK(glGenBuffers(1, &pboId) );
GL_CHECK(glBindBuffer(GL_PIXEL_PACK_BUFFER, pboId) );
GL_CHECK(glBufferData(GL_PIXEL_PACK_BUFFER, length, 0, GL_STREAM_READ) );
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer.m_fbo[0]) );
@marco-we
marco-we / quaternion_how_tos
Created May 6, 2015 14:42
quaternion_how_tos
* How to rotate one quaternion on to another:
// http://answers.unity3d.com/questions/35541/problem-finding-relative-rotation-from-one-quatern.html
Quaternion relative = Quaternion.Inverse(a) * b;
@marco-we
marco-we / oculus_mobile-unity-cs
Last active August 29, 2015 14:20
How to fix this annoying Unity/Oculus Mobile C# error
Visual Studio is just much better than MonoDevelop in general.
If you are a hobbyist or in a company with fewer than 5 people it's free as well.
However it also doesn't compile version 0.5.1 either, but is fixable (I would think it would be the same for MonoDevelop too however).
You can fix those build errors by adding a
: this()
to the end of both constructor declarations in OVRUnityVersionChecker.cs (line 91 and 138).
(source: https://forums.oculus.com/viewtopic.php?f=37&t=21954&p=259797&hilit=OvrUnityVersionChecker#p259797)
@marco-we
marco-we / android-remote-adb
Last active August 29, 2015 14:16
How to remote adb an Android device
Connect device via USB and make sure debugging is working.
adb tcpip 5555
adb connect <DEVICE_IP_ADDRESS>:5555
Disconnect USB and proceed with wireless debugging.
adb -s <DEVICE_IP_ADDRESS>:5555 usb to switch back when done.
(source: http://stackoverflow.com/questions/4893953/android-run-install-debug-applications-over-wifi)