Skip to content

Instantly share code, notes, and snippets.

View tgfrerer's full-sized avatar

Tim Gfrerer tgfrerer

View GitHub Profile
@tgfrerer
tgfrerer / ofTexture.cpp (lines 1042 to 1053)
Last active December 15, 2015 03:49
flipped vertex draw order to check if that un-messes texture coordinate problems with NVIDIA cards whilst keeping it sane for everyone else =)
ofPushMatrix();
ofTranslate(x,y,z);
quad.getVertices()[0].set(px0,py0);
quad.getVertices()[1].set(px1,py0);
quad.getVertices()[3].set(px0,py1); // flipped
quad.getVertices()[2].set(px1,py1); // flipped
quad.getTexCoords()[0].set(tx0,ty0);
quad.getTexCoords()[1].set(tx1,ty0);
if(bUsingTexCoords) {
glBindBuffer(GL_ARRAY_BUFFER, texCoordId);
ofEnableTexCoords();
if(ofGLIsFixedPipeline()){
glTexCoordPointer(2, GL_FLOAT, texCoordStride, 0);
}else{
glVertexAttribPointer(ofGetAttrLocationTexCoord(), 2, GL_FLOAT, GL_FALSE, texCoordStride, 0);
}
}
@tgfrerer
tgfrerer / gist:5262377
Created March 28, 2013 11:03
opengl profiler log
glEnableVertexAttribArray(2)
Error: GL_INVALID_OPERATION
Context: 0x058a5600
Virtual Screen: 0/2
kCGLCPCurrentRendererID: 16915206 (0x01021b06)
GL_RENDERER: AMD Radeon HD 6750M OpenGL Engine
GL_VENDOR: ATI Technologies Inc.
GL_VERSION: 3.2 ATI-1.6.37
kCGLCPGPUFragmentProcessing: GL_TRUE
kCGLCPGPUVertexProcessing: GL_TRUE
=================== config.mk platform detection ================
PLATFORM_ARCH=armv6l
PLATFORM_OS=Linux
PLATFORM_VARIANT=default
PLATFORM_LIB_SUBPATH=linuxarmv6l
=================== config.mk paths =============================
OF_ADDONS_PATH=../../../addons
OF_EXPORT_PATH=../../../export
OF_EXAMPLES_PATH=../../../examples
OF_APPS_PATH=../../../apps
@tgfrerer
tgfrerer / gist:5788384
Created June 15, 2013 14:49
build flags for GLFW 3.0 / openFrameworks OS X 32 bit
compiled using these flags:
# cmake ../ -DGLFW_USE_CHDIR=0 -DGLFW_USE_MENUBAR=1 -DBUILD_SHARED_LIBS=0 -DGLFW_BUILD_EXAMPLES=0 -DGLFW_BUILD_TESTS=0 -DGLFW_BUILD_UNIVERSAL=0 -DCMAKE_OSX_ARCHITECTURES=i386 -DCMAKE_{C,CXX}_FLAGS=-m32
# make -j
@tgfrerer
tgfrerer / main.cpp
Last active December 18, 2015 13:18
init programmable GL renderer in openFrameworks
#include "ofMain.h"
#include "testApp.h"
#include "ofGLProgrammableRenderer.h"
//========================================================================
int main( ){
ofPtr<ofBaseRenderer> renderer(new ofGLProgrammableRenderer(false));
ofSetCurrentRenderer(renderer, false);
ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context
@tgfrerer
tgfrerer / GLES2 Renderer (filtered by of*)
Created July 4, 2013 15:11
Two perf records comparing a minimal of App running in the raspberry Pi using the Programmeble GL Renderer and the GLES2 Renderer '''perf_3.2 record -c 2 ./bin/emptyExample
Samples: 31K of event 'cpu-clock:HG', Event count (approx.): 31838
3.76% emptyExample emptyExample [.] ofGLES2Renderer::draw(ofMesh&, ofPolyRenderMode, bool, bool, bool)
3.56% emptyExample emptyExample [.] ofShader::getUniformLocation(char const*)
3.52% emptyExample emptyExample [.] ofGLES2Renderer::drawString(std::string, float, float, float, ofDrawBitmapMode)
3.07% emptyExample emptyExample [.] ofShader::getAttributeLocation(char const*)
2.68% emptyExample emptyExample [.] ofAppEGLWindow::display()
2.50% emptyExample emptyExample [.] ofDrawBitmapCharacter(int, int, int)
1.91% emptyExample emptyExample [.] Poco::AbstractEvent<ofEventArgs, Poco::FIFOStrategy<ofEventArgs, Poco::AbstractDelegate<ofEventArgs> >, Poco::AbstractDelegate<ofEve
1.78% emptyExample emptyExample [.] ofShader::setUniform1f(char const*, float)
1.75% emptyExample emptyExample [.] ofTexture::drawSubsection(float, float, float, float,
@tgfrerer
tgfrerer / perf.md
Last active December 19, 2015 09:49
# how to do performance monitoring on raspberry pi

use the perf tool:

use -c 1 to test every sample

perf_3.2 record -c 1 ./yourApp

display the report

perf report

#!/bin/bash
echo "start profiling"
sudo killall -12 raspberrypi_hello_world
sleep 20
sudo killall raspberrypi_hello_world
echo "end profiling"
@tgfrerer
tgfrerer / gister.py
Last active December 19, 2015 09:58
#!/bin/env python
"""
Gist
----
Gist is a command line tool for interacting with `gist.github.com`_. Usage
information is available through the command line interface help.
.. _gist.github.com: <https://gist.github.com>