Skip to content

Instantly share code, notes, and snippets.

/*
* ofPBO.h
*
* Created on: 08/04/2012
* Author: arturo
*/
#pragma once
#include "ofConstants.h"
#include "ofTexture.h"
/*
* ofPBO.cpp
*
* Created on: 08/04/2012
* Author: arturo
*/
#include "ofPBO.h"
#ifndef TARGET_OPENGLES
.DEFAULT_GOAL=Release
# define the OF_SHARED_MAKEFILES location
OF_SHARED_MAKEFILES_PATH=$(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon
include $(OF_SHARED_MAKEFILES_PATH)/config.shared.mk
# if APPNAME is not defined, set it to the project dir name
ifndef APPNAME
APPNAME = $(shell basename `pwd`)
// .h
ofPath path;
// setup
path.rectangle(0,0,ofGetWidth(),ofGetHeight());
path.circle(ofGetWidth()*.5,ofGetHeight()*.5,100);
path.setFilled(true);
path.setFillColor(color);
// TEST 0.8
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup() {
ofBackground(0, 0, 0);
bricksHigh = 0;
bricksWide = 0;
totalBricks = 0;
spawn(proc(){
let (port,chan): (comm::Port<Message>, comm::Chan<Message>) = comm::Chan::new();
let mut chan = ~chan;
set_c_callback(c_callback, cast::transmute(&mut *chan));
loop{
//...
}
});
extern "C" fn c_callback (data: *c_void){
fatal runtime error: assertion failed: !ptr.is_null()
Program received signal SIGILL, Illegal instruction.
[Switching to Thread 0x7fffd7fff700 (LWP 28971)]
0x0000000000483d4b in rt::util::abort::h66e24f48938afe6eMim::v0.10.pre ()
(gdb) bt
#0 0x0000000000483d4b in rt::util::abort::h66e24f48938afe6eMim::v0.10.pre ()
#1 0x00000000007b73d1 in rt::local_ptr::compiled::take::he8a5e3f0ec45f53amAs::v0.1 ()
#2 0x00000000007c7778 in comm::Chan$LT$T$GT$::send::hfedc51b572bd5818fot::v0.1 ()
...
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
#pragma once
#include <vector>
#include <functional>
#include <mutex>
#include <thread>
template<typename T>
class ofEvent{
public:
EGLContext context = eglGetCurrentContext();
EGLDisplay eglDisplay = eglGetCurrentDisplay();
glBindTexture(GL_TEXTURE_2D, 0);
EGLint imageAttributes[] = {
EGL_GL_TEXTURE_LEVEL_KHR, 0, // mip map level to reference
EGL_IMAGE_PRESERVED_KHR, EGL_FALSE,
EGL_NONE
};
EGLImageKHR (*eglCreateImageKHR)(EGLDisplay,EGLContext,int,EGLClientBuffer,EGLint*);