本文整理汇总了C++中ofFile::open方法的典型用法代码示例。如果您正苦于以下问题:C++ ofFile::open方法的具体用法?C++ ofFile::open怎么用?C++ ofFile::open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofFile
的用法示例。
在下文中一共展示了ofFile::open方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: watch
void watch(string vertName, string fragName)
{
vertShader.open(vertName);
fragShader.open(fragName);
ofAddListener(ofEvents().update, this, &AutoLoadShader::onUpdate);
}
示例2: setup
//--------------------------------------------------------------
void testApp::setup(){
ofBackground(0);
ofSetFrameRate(60);
int PORT = 12000;
int REMOTE_PORT = 12000;
string REMOTE_HOST = "169.254.0.1";
receiver.setup(PORT);
sender.setup(REMOTE_HOST, REMOTE_PORT);
sprintf(oscStatus, "[LOCALPORT] %d\n[REMOTE PORT] (%s, %5d)\n", PORT, REMOTE_HOST.c_str(), REMOTE_PORT);
gui.setup();
gui.addTitle("TRACKER \n[i] hide controls");
gui.addToggle("TRACK", bTracking).setSize(200, 20);
calibratedButton = &gui.addToggle("CALIBRATED", bCalibrated);
calibratedButton->setSize(200, 20);
gui.addToggle("SAVE", bSaving).setSize(200, 20);
gui.addButton("Load MeshLab File", bLoadMLP).setSize(200, 20);
gui.addButton("Reset Server Counter", bReset).setSize(200, 20);
gui.addSlider("Zoom", camZoom, -5000, 5000).setSmoothing(0.9);
gui.addSlider("camPosX", camPosX, -200, 200).setSmoothing(0.9);
gui.addSlider("camPosY", camPosY, -200, 200).setSmoothing(0.9);
gui.addSlider("camRotX", camRotX, 0, 360).setSmoothing(0.9);
gui.addSlider("camRotY", camRotY, 0, 360).setSmoothing(0.9);
gui.addToggle("Lock top view", bTop).setSize(200, 20);
gui.addToggle("Enable ghost 1", bGhost0).setSize(200, 20);
gui.addToggle("Enable ghost 2", bGhost1).setSize(200, 20);
gui.addButton("Set Center", bSetCenter).setSize(200, 20);
gui.addButton("Set Ref Point", bSetRefPoint).setSize(200, 20);
gui.addButton("Set Ghost 1", bSetGhost0).setSize(200, 20);
gui.addButton("Set Ghost 2", bSetGhost1).setSize(200, 20);
status = &gui.addTitle("STATUS");
status->setNewColumn(true);
gui.loadFromXML();
gui.show();
matrixData.setup();
// LOAD space references
XML.loadFile(ofToDataPath("xmlSettings.xml"));
int cX = XML.getValue("CENTER_X", 0);
int cZ = XML.getValue("CENTER_Z", 0);
int rX = XML.getValue("REF_X", 0);
int rZ = XML.getValue("REF_Z", 0);
center = ofVec3f(cX, 0, cZ);
refPoint = ofVec3f(rX, 0, rZ);
refVector = center - refPoint;
for(int i = 0; i < K; i++){
kinects[i].setMatrix(matrixData.getMatrix(i));
kinects[i].setCenter(center, refVector);
}
// LOAD GHOSTS
int gX, gZ;
gX = XML.getValue("GHOST_0_X", 0);
gZ = XML.getValue("GHOST_0_Z", 0);
ghost0 = ofVec3f(gX, 0, gZ);
gX = XML.getValue("GHOST_1_X", 0);
gZ = XML.getValue("GHOST_1_Z", 0);
ghost1 = ofVec3f(gX, 0, gZ);
//-----
bTracking = false;
bCalibrated = false;
bSaving = false;
pbSaving = false;
bReset = false;
bTop = false;
// Purge old osc messages
while(receiver.hasWaitingMessages()){
ofxOscMessage m;
receiver.getNextMessage(&m);
}
logFile.open("log.txt", ofFile::WriteOnly, false);
/*
AAAAAdasdasdadsa
bGhost0 = true;
bGhost1 = true;
*/
}