Ejemplo n.º 1
0
std::string AbstractObject::getLabelImplementationExt(const GLenum identifier, const GLuint name) {
    GLsizei size = 0;

    /* Get label size (w/o null terminator) */
    #ifndef CORRADE_TARGET_NACL
    const GLenum type = extTypeFromKhrIdentifier(identifier);
    glGetObjectLabelEXT(type, name, 0, &size, nullptr);
    #else
    static_cast<void>(identifier);
    static_cast<void>(name);
    CORRADE_ASSERT_UNREACHABLE();
    #endif

    /* Make place also for the null terminator */
    std::string label;
    label.resize(size+1);
    #ifndef CORRADE_TARGET_NACL
    glGetObjectLabelEXT(identifier, name, size+1, nullptr, &label[0]);
    #else
    CORRADE_ASSERT_UNREACHABLE();
    #endif

    /* Pop null terminator and return the string */
    label.resize(size);
    return label;
}
Ejemplo n.º 2
0
std::string AbstractObject::getLabelImplementationExt(const GLenum identifier, const GLuint name) {
    const GLenum type = extTypeFromKhrIdentifier(identifier);

    /* Get label size (w/o null terminator) */
    GLsizei size;
    /** @todo Re-enable when extension loader is available for ES */
    #ifndef MAGNUM_TARGET_GLES
    glGetObjectLabelEXT(type, name, 0, &size, nullptr);
    #else
    static_cast<void>(type);
    static_cast<void>(name);
    CORRADE_INTERNAL_ASSERT(false);
    #endif

    /* Make place also for the null terminator */
    std::string label;
    label.resize(size+1);
    /** @todo Re-enable when extension loader is available for ES */
    #ifndef MAGNUM_TARGET_GLES
    glGetObjectLabelEXT(identifier, name, size+1, nullptr, &label[0]);
    #endif

    /* Pop null terminator and return the string */
    label.resize(size);
    return label;
}
Ejemplo n.º 3
0
void AbstractObject::labelImplementationExt(const GLenum identifier, const GLuint name, const Containers::ArrayView<const char> label) {
    #ifndef CORRADE_TARGET_NACL
    const GLenum type = extTypeFromKhrIdentifier(identifier);
    glLabelObjectEXT(type, name, label.size(), label);
    #else
    static_cast<void>(identifier);
    static_cast<void>(name);
    static_cast<void>(label);
    CORRADE_ASSERT_UNREACHABLE();
    #endif
}
Ejemplo n.º 4
0
void AbstractObject::labelImplementationExt(const GLenum identifier, const GLuint name, const std::string& label) {
    const GLenum type = extTypeFromKhrIdentifier(identifier);
    /** @todo Re-enable when extension loader is available for ES */
    #ifndef MAGNUM_TARGET_GLES
    glLabelObjectEXT(type, name, label.size(), label.data());
    #else
    static_cast<void>(type);
    static_cast<void>(name);
    static_cast<void>(label);
    CORRADE_INTERNAL_ASSERT(false);
    #endif
}