コード例 #1
0
ファイル: glstate.cpp プロジェクト: galek/apitrace
/**
 * Dump a GL_KHR_debug/GL_EXT_debug_label object label.
 */
void
dumpObjectLabel(JSONWriter &json, Context &context, GLenum identifier, GLuint name, const char *member) {
    char *label = getObjectLabel(context, identifier, name);
    if (!label) {
        return;
    }

    json.writeStringMember(member, label);
    free(label);
}
コード例 #2
0
ファイル: DspDivide.cpp プロジェクト: Kyew/ZenGarden
void DspDivide::processMessage(int inletIndex, PdMessage *message) {
    if (inletIndex == 1) {
        if (message->isFloat(0)) {
            if (message->getFloat(0) == 0.0f) {
                constant = 1.0f;
                graph->printErr("%s received message which set divisor to zero. Divisor set to 1.0f.", getObjectLabel());
            } else {
                constant = message->getFloat(0);
            }
        }
    }
}
コード例 #3
0
ファイル: DspDivide.cpp プロジェクト: Kyew/ZenGarden
string DspDivide::toString() {
    const char *fmt = (constant == 0.0f) ? "%s" : "%s %g";
    char str[snprintf(NULL, 0, fmt, getObjectLabel(), constant)+1];
    snprintf(str, sizeof(str), fmt, getObjectLabel(), constant);
    return string(str);
}
コード例 #4
0
ファイル: DspSubtract.cpp プロジェクト: G4m4/ZenGarden
string DspSubtract::toString() {
  const char *fmt = (constant == 0.0f) ? "%s" : "%s %g";
  char* str(static_cast<char*>(alloca(snprintf(NULL, 0, fmt, getObjectLabel(), constant) + 1)));
  snprintf(str, sizeof(str), fmt, getObjectLabel(), constant);
  return string(str);
}
コード例 #5
0
ファイル: DspClip.cpp プロジェクト: UIKit0/ZenGarden
string DspClip::toString() {
  char str[snprintf(NULL, 0, "%s %g %g", getObjectLabel(), lowerBound, upperBound)+1];
  snprintf(str, sizeof(str), "%s %g %g", getObjectLabel(), lowerBound, upperBound);
  return string(str);
}
コード例 #6
0
ファイル: MessageMetro.cpp プロジェクト: Kyew/ZenGarden
string MessageMetro::toString() {
  char str[snprintf(NULL, 0, "%s %g", getObjectLabel(), intervalInMs)+1];
  snprintf(str, sizeof(str), "%s %g", getObjectLabel(), intervalInMs);
  return string(str);
}