This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(){ | |
ofGLESWindowSettings settings; | |
settings.setGLESVersion(2); | |
ofCreateWindow(settings); | |
ofRunApp(new ofApp); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Inflation": { | |
"Inflation": { | |
"Circle": { | |
"circle_pct": "0", | |
"inner_radius": "0.99", | |
"outer_radius": "1" | |
}, | |
"Colors": { | |
"color_1": "0.956863, 0.8, 0, 1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listeners.push_back(gui.savePressedE.newListener([this]{ | |
auto saveTo = ofSystemSaveDialog(ofGetTimestampString() + ".json", "save settings"); | |
if(saveTo.bSuccess){ | |
auto path = std::filesystem::path(saveTo.getPath()); | |
auto folder = path.parent_path(); | |
auto basename = path.stem().filename().string(); | |
auto extension = ofToLower(path.extension().string()); | |
auto timelineDir = (folder / (basename + "_timeline")).string(); | |
if(extension == ".xml"){ | |
ofXml xml; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(auto line: pixels.getLines()){ | |
for(auto pixel: line.getPixels()){ | |
pixel[0] // -> red channel or gray in a grayscale image | |
auto lineAbovePixel = pixel - pixels.getWidth(); | |
lineAbovePixel[0] // read channel in pixel one line above | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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*); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <vector> | |
#include <functional> | |
#include <mutex> | |
#include <thread> | |
template<typename T> | |
class ofEvent{ | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 () | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TEST 0.8 | |
#include "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup() { | |
ofBackground(0, 0, 0); | |
bricksHigh = 0; | |
bricksWide = 0; | |
totalBricks = 0; |