[][src]Struct qt_gui::QOpenGLShader

#[repr(C)]
pub struct QOpenGLShader { /* fields omitted */ }

The QOpenGLShader class allows OpenGL shaders to be compiled.

C++ class: QOpenGLShader.

C++ documentation:

The QOpenGLShader class allows OpenGL shaders to be compiled.

This class supports shaders written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES).

QOpenGLShader and QOpenGLShaderProgram shelter the programmer from the details of compiling and linking vertex and fragment shaders.

Methods

impl QOpenGLShader[src]

pub unsafe fn compile_source_code_char(
    &mut self,
    source: impl CastInto<Ptr<c_char>>
) -> bool
[src]

Sets the source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.

Calls C++ function: bool QOpenGLShader::compileSourceCode(const char* source).

C++ documentation:

Sets the source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.

See also compileSourceFile().

pub unsafe fn compile_source_code_q_byte_array(
    &mut self,
    source: impl CastInto<Ref<QByteArray>>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QOpenGLShader::compileSourceCode(const QByteArray& source).

C++ documentation:

This is an overloaded function.

Sets the source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.

See also compileSourceFile().

pub unsafe fn compile_source_code_q_string(
    &mut self,
    source: impl CastInto<Ref<QString>>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QOpenGLShader::compileSourceCode(const QString& source).

C++ documentation:

This is an overloaded function.

Sets the source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.

See also compileSourceFile().

pub unsafe fn compile_source_file(
    &mut self,
    file_name: impl CastInto<Ref<QString>>
) -> bool
[src]

Sets the source code for this shader to the contents of fileName and compiles it. Returns true if the file could be opened and the source compiled, false otherwise.

Calls C++ function: bool QOpenGLShader::compileSourceFile(const QString& fileName).

C++ documentation:

Sets the source code for this shader to the contents of fileName and compiles it. Returns true if the file could be opened and the source compiled, false otherwise.

See also compileSourceCode().

pub unsafe fn has_opengl_shaders_2a(
    type_: QFlags<ShaderTypeBit>,
    context: impl CastInto<MutPtr<QOpenGLContext>>
) -> bool
[src]

Returns true if shader programs of type type are supported on this system; false otherwise.

Calls C++ function: static bool QOpenGLShader::hasOpenGLShaders(QFlags<QOpenGLShader::ShaderTypeBit> type, QOpenGLContext* context = …).

C++ documentation:

Returns true if shader programs of type type are supported on this system; false otherwise.

The context is used to resolve the GLSL extensions. If context is null, then QOpenGLContext::currentContext() is used.

pub unsafe fn has_opengl_shaders_1a(type_: QFlags<ShaderTypeBit>) -> bool[src]

Returns true if shader programs of type type are supported on this system; false otherwise.

Calls C++ function: static bool QOpenGLShader::hasOpenGLShaders(QFlags<QOpenGLShader::ShaderTypeBit> type).

C++ documentation:

Returns true if shader programs of type type are supported on this system; false otherwise.

The context is used to resolve the GLSL extensions. If context is null, then QOpenGLContext::currentContext() is used.

pub unsafe fn is_compiled(&self) -> bool[src]

Returns true if this shader has been compiled; false otherwise.

Calls C++ function: bool QOpenGLShader::isCompiled() const.

C++ documentation:

Returns true if this shader has been compiled; false otherwise.

See also compileSourceCode() and compileSourceFile().

pub unsafe fn log(&self) -> CppBox<QString>[src]

Returns the errors and warnings that occurred during the last compile.

Calls C++ function: QString QOpenGLShader::log() const.

C++ documentation:

Returns the errors and warnings that occurred during the last compile.

See also compileSourceCode() and compileSourceFile().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QOpenGLShader::metaObject() const.

pub unsafe fn new_2a(
    type_: QFlags<ShaderTypeBit>,
    parent: impl CastInto<MutPtr<QObject>>
) -> CppBox<QOpenGLShader>
[src]

Constructs a new QOpenGLShader object of the specified type and attaches it to parent. If shader programs are not supported, QOpenGLShaderProgram::hasOpenGLShaderPrograms() will return false.

Calls C++ function: [constructor] void QOpenGLShader::QOpenGLShader(QFlags<QOpenGLShader::ShaderTypeBit> type, QObject* parent = …).

C++ documentation:

Constructs a new QOpenGLShader object of the specified type and attaches it to parent. If shader programs are not supported, QOpenGLShaderProgram::hasOpenGLShaderPrograms() will return false.

This constructor is normally followed by a call to compileSourceCode() or compileSourceFile().

The shader will be associated with the current QOpenGLContext.

See also compileSourceCode() and compileSourceFile().

pub unsafe fn new_1a(type_: QFlags<ShaderTypeBit>) -> CppBox<QOpenGLShader>[src]

Constructs a new QOpenGLShader object of the specified type and attaches it to parent. If shader programs are not supported, QOpenGLShaderProgram::hasOpenGLShaderPrograms() will return false.

Calls C++ function: [constructor] void QOpenGLShader::QOpenGLShader(QFlags<QOpenGLShader::ShaderTypeBit> type).

C++ documentation:

Constructs a new QOpenGLShader object of the specified type and attaches it to parent. If shader programs are not supported, QOpenGLShaderProgram::hasOpenGLShaderPrograms() will return false.

This constructor is normally followed by a call to compileSourceCode() or compileSourceFile().

The shader will be associated with the current QOpenGLContext.

See also compileSourceCode() and compileSourceFile().

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QOpenGLShader::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QOpenGLShader::qt_metacast(const char* arg1).

pub unsafe fn shader_id(&self) -> u32[src]

Returns the OpenGL identifier associated with this shader.

Calls C++ function: GLuint QOpenGLShader::shaderId() const.

C++ documentation:

Returns the OpenGL identifier associated with this shader.

See also QOpenGLShaderProgram::programId().

pub unsafe fn shader_type(&self) -> QFlags<ShaderTypeBit>[src]

Returns the type of this shader.

Calls C++ function: QFlags<QOpenGLShader::ShaderTypeBit> QOpenGLShader::shaderType() const.

C++ documentation:

Returns the type of this shader.

pub unsafe fn source_code(&self) -> CppBox<QByteArray>[src]

Returns the source code for this shader.

Calls C++ function: QByteArray QOpenGLShader::sourceCode() const.

C++ documentation:

Returns the source code for this shader.

See also compileSourceCode().

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tr(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QOpenGLShader::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QOpenGLShader::trUtf8(const char* s, const char* c, int n).

Trait Implementations

impl CppDeletable for QOpenGLShader[src]

unsafe fn delete(&mut self)[src]

Deletes this shader. If the shader has been attached to a QOpenGLShaderProgram object, then the actual shader will stay around until the QOpenGLShaderProgram is destroyed.

Calls C++ function: virtual [destructor] void QOpenGLShader::~QOpenGLShader().

C++ documentation:

Deletes this shader. If the shader has been attached to a QOpenGLShaderProgram object, then the actual shader will stay around until the QOpenGLShaderProgram is destroyed.

impl Deref for QOpenGLShader[src]

type Target = QObject

The resulting type after dereferencing.

fn deref(&self) -> &QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QOpenGLShader* ptr).

impl DerefMut for QOpenGLShader[src]

fn deref_mut(&mut self) -> &mut QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QOpenGLShader* ptr).

impl DynamicCast<QOpenGLShader> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QOpenGLShader>[src]

Calls C++ function: QOpenGLShader* dynamic_cast<QOpenGLShader*>(QObject* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QOpenGLShader>[src]

Calls C++ function: QOpenGLShader* dynamic_cast<QOpenGLShader*>(QObject* ptr).

impl StaticDowncast<QOpenGLShader> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QOpenGLShader>[src]

Calls C++ function: QOpenGLShader* static_cast<QOpenGLShader*>(QObject* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QOpenGLShader>[src]

Calls C++ function: QOpenGLShader* static_cast<QOpenGLShader*>(QObject* ptr).

impl StaticUpcast<QObject> for QOpenGLShader[src]

unsafe fn static_upcast(ptr: Ptr<QOpenGLShader>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QOpenGLShader* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QOpenGLShader>) -> MutPtr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QOpenGLShader* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.