Skip to content

Instantly share code, notes, and snippets.

@roxlu ☾ roxlu

Block or report user

Report or block roxlu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@roxlu
roxlu / fun.cpp
Last active Aug 29, 2015 — forked from kizzx2/fun.cpp
THIS DOES NOT WORK WITH 5.2
View fun.cpp
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
@roxlu
roxlu / gist:1068050
Created Jul 6, 2011
ofThead blocking does not work
View gist:1068050
// simple thread class
class MyCustomThread : public ofThread {
protected:
virtual void threadedFunction() {
while(true) {
cout << "My own custom thread!" << endl;
ofSleepMillis(3000);
}
}
};
@roxlu
roxlu / oflogging.cpp
Created Jul 6, 2011
Testing of logging
View oflogging.cpp
// Check 1.
//ofLogToFile("of.log");
ofSetLogLevel(OF_LOG_VERBOSE);
ofLog(OF_LOG_VERBOSE,"log something");
ofLog(OF_LOG_VERBOSE,"Something to log");
ofLog(OF_LOG_VERBOSE,"Something else to log");
/*
Output of Check 1:
OF: OF_VERBOSE: log something
View ofLight.cpp
//----------------------------------------
void ofLight::setAmbientColor(const ofFloatColor& c) {
if(glIndex==-1) return;
ambientColor = c;
glLightfv(GL_LIGHT0 + glIndex, GL_AMBIENT, &c.r);
}
//----------------------------------------
void ofLight::setDiffuseColor(const ofFloatColor& c) {
if(glIndex==-1) return;
View gist:1075588
#include "testApp.h"
void testApp::setup(){
ofBackground(33,33,33);
light.enable();
// light.setDirectional();
// light.setSpotlight(45.0, 0.2f);
light.setPointLight();
View testApp.cpp
#include "testApp.h"
#include "ofMaterial.h"
void testApp::setup(){
ofBackground(33,33,33);
my_fbo.allocate(ofGetWidth(),ofGetHeight());
ofEnableNormalizedTexCoords();
}
void testApp::draw(){
View app.cpp
// testapp.h
class testApp : public ofBaseApp{
public:
ofVideoGrabber my_grabber;
void setup();
void update();
void draw();
View sphere.cpp
//! \p detail can be between 0 ( = icosahedron) and 8 (extremely detailed sphere)
//! a value of 2 yelds already very good results.
ref<Geometry> vl::makeIcosphere(const vec3& pos, Real diameter, int detail, bool remove_doubles)
{
ref<Geometry> geom = new Geometry;
geom->setObjectName("Icosphere");
ref<ArrayFloat3> coords = new ArrayFloat3;
ref<ArrayFloat3> norms = new ArrayFloat3;
View gist:1082525
GL_ZERO -> GL_ZERO
GL_ZERO -> GL_ONE
GL_ZERO -> GL_SRC_COLOR
GL_ZERO -> GL_ONE_MINUS_SRC_COLOR
GL_ZERO -> GL_DST_COLOR
GL_ZERO -> GL_ONE_MINUS_DST_COLOR
GL_ZERO -> GL_SRC_ALPHA
GL_ZERO -> GL_ONE_MINUS_SRC_ALPHA
GL_ZERO -> GL_DST_ALPHA
GL_ZERO -> GL_ONE_MINUS_DST_ALPHA
View blender.cpp
#include "BlendModeTester.h"
#include "error.h"
BlendModeTester::BlendModeTester()
:is_initialized(false)
,num_tex(1)
,curr_mode(0)
,page(0)
,item(0)
{
You can’t perform that action at this time.