[−][src]Struct qt_gui::QOpenGLShader
The QOpenGLShader class allows OpenGL shaders to be compiled.
C++ class: QOpenGLShader
.
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]
&mut self,
source: impl CastInto<Ptr<c_char>>
) -> bool
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)
.
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]
&mut self,
source: impl CastInto<Ref<QByteArray>>
) -> bool
This is an overloaded function.
Calls C++ function: bool QOpenGLShader::compileSourceCode(const QByteArray& source)
.
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]
&mut self,
source: impl CastInto<Ref<QString>>
) -> bool
This is an overloaded function.
Calls C++ function: bool QOpenGLShader::compileSourceCode(const QString& source)
.
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]
&mut self,
file_name: impl CastInto<Ref<QString>>
) -> bool
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)
.
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]
type_: QFlags<ShaderTypeBit>,
context: impl CastInto<MutPtr<QOpenGLContext>>
) -> bool
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 = …)
.
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)
.
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
.
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
.
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]
type_: QFlags<ShaderTypeBit>,
parent: impl CastInto<MutPtr<QObject>>
) -> CppBox<QOpenGLShader>
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 = …)
.
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)
.
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]
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
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]
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
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
.
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
.
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
.
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]
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
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]
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
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()
.
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
impl RefUnwindSafe for QOpenGLShader
impl Send for QOpenGLShader
impl Sync for QOpenGLShader
impl Unpin for QOpenGLShader
impl UnwindSafe for QOpenGLShader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,