io.qt.gui.rhi.QRhiShaderResourceBindings Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.gui.rhi;
import io.qt.*;
/**
* Encapsulates resources for making buffer, texture, sampler resources visible to shaders
* Java wrapper for Qt class QRhiShaderResourceBindings
*/
public abstract class QRhiShaderResourceBindings extends io.qt.gui.rhi.QRhiResource
{
@NativeAccess
private static final class ConcreteWrapper extends QRhiShaderResourceBindings {
@NativeAccess
private ConcreteWrapper(QPrivateConstructor p) { super(p); }
@Override
@QtUninvokable
public boolean create(){
return create_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean create_native(long __this__nativeId);
@Override
@QtUninvokable
public void destroy(){
destroy_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void destroy_native(long __this__nativeId);
@Override
@QtUninvokable
public void updateResources(io.qt.gui.rhi.QRhiShaderResourceBindings.@NonNull UpdateFlags flags){
updateResources_native_QRhiShaderResourceBindings_UpdateFlags(QtJambi_LibraryUtilities.internal.nativeId(this), flags.value());
}
@QtUninvokable
private native void updateResources_native_QRhiShaderResourceBindings_UpdateFlags(long __this__nativeId, int flags);
}
/**
* Java wrapper for Qt enum QRhiShaderResourceBindings::UpdateFlag
*
* @see UpdateFlags
*/
public enum UpdateFlag implements QtFlagEnumerator {
/**
* Representing QRhiShaderResourceBindings:: BindingsAreSorted
*/
BindingsAreSorted(1);
static {
QtJambi_LibraryUtilities.initialize();
}
private UpdateFlag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull UpdateFlags asFlags() {
return new UpdateFlags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull UpdateFlags combined(@NonNull UpdateFlag e) {
return asFlags().setFlag(e, true);
}
/**
* Excludes other enum entry from a flag of this entry.
* @param e enum entry
* @return new flag
*/
public @NonNull UpdateFlags cleared(@NonNull UpdateFlag e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link UpdateFlags} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull UpdateFlags flags(@Nullable UpdateFlag @NonNull... values) {
return new UpdateFlags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull UpdateFlag resolve(int value) {
switch (value) {
case 1: return BindingsAreSorted;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link UpdateFlag}
*/
public static final class UpdateFlags extends QFlags implements Comparable {
private static final long serialVersionUID = 0x8466282049b9d2c5L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new UpdateFlags where the flags in args
are set.
* @param args enum entries
*/
public UpdateFlags(@Nullable UpdateFlag @NonNull... args){
super(args);
}
/**
* Creates a new UpdateFlags with given value
.
* @param value
*/
public UpdateFlags(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new UpdateFlags
*/
@Override
public final @NonNull UpdateFlags combined(@StrictNonNull UpdateFlag e){
return new UpdateFlags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull UpdateFlags setFlag(@Nullable UpdateFlag e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final @NonNull UpdateFlags setFlag(@Nullable UpdateFlag e, boolean on){
if (on) {
setValue(value() | e.value());
}else {
setValue(value() & ~e.value());
}
return this;
}
/**
* Returns an array of flag objects represented by this UpdateFlags.
* @return array of enum entries
*/
@Override
public final @NonNull UpdateFlag @NonNull[] flags(){
return super.flags(UpdateFlag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull UpdateFlags clone(){
return new UpdateFlags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull UpdateFlags other){
return Integer.compare(value(), other.value());
}
}
/**
* See QRhiShaderResourceBindings:: bindingAt(qsizetype)const
*/
@QtUninvokable
public final io.qt.gui.rhi.@Nullable QRhiShaderResourceBinding bindingAt(long index){
return bindingAt_native_qsizetype_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), index);
}
@QtUninvokable
private native io.qt.gui.rhi.QRhiShaderResourceBinding bindingAt_native_qsizetype_constfct(long __this__nativeId, long index);
/**
* See QRhiShaderResourceBindings:: bindingCount()const
*/
@QtUninvokable
public final long bindingCount(){
return bindingCount_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long bindingCount_native_constfct(long __this__nativeId);
/**
* See QRhiShaderResourceBindings:: isLayoutCompatible(const QRhiShaderResourceBindings*)const
*/
@QtUninvokable
public final boolean isLayoutCompatible(io.qt.gui.rhi.@Nullable QRhiShaderResourceBindings other){
return isLayoutCompatible_native_const_QRhiShaderResourceBindings_ptr_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native boolean isLayoutCompatible_native_const_QRhiShaderResourceBindings_ptr_constfct(long __this__nativeId, long other);
/**
* See QRhiShaderResourceBindings:: serializedLayoutDescription()const
*/
@QtUninvokable
public final io.qt.core.@NonNull QList serializedLayoutDescription(){
return serializedLayoutDescription_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QList serializedLayoutDescription_native_constfct(long __this__nativeId);
/**
* See QRhiShaderResourceBindings:: setBindings(std::initializer_list<QRhiShaderResourceBinding>)
*/
@QtUninvokable
public final void setBindings(io.qt.gui.rhi.@NonNull QRhiShaderResourceBinding@NonNull ... list){
setBindings_native_std_initializer_list(QtJambi_LibraryUtilities.internal.nativeId(this), list);
}
@QtUninvokable
private native void setBindings_native_std_initializer_list(long __this__nativeId, io.qt.gui.rhi.QRhiShaderResourceBinding[] list);
/**
* See QRhiShaderResourceBindings:: create()
*/
@QtUninvokable
public abstract boolean create();
@QtUninvokable
private native boolean create_native(long __this__nativeId);
/**
* See QRhiResource:: resourceType()const
*/
@QtUninvokable
@Override
public io.qt.gui.rhi.QRhiResource.@NonNull Type resourceType(){
return io.qt.gui.rhi.QRhiResource.Type.resolve(resourceType_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int resourceType_native_constfct(long __this__nativeId);
/**
* See QRhiShaderResourceBindings:: updateResources(QRhiShaderResourceBindings::UpdateFlags)
*/
@QtUninvokable
public abstract void updateResources(io.qt.gui.rhi.QRhiShaderResourceBindings.@NonNull UpdateFlags flags);
@QtUninvokable
private native void updateResources_native_QRhiShaderResourceBindings_UpdateFlags(long __this__nativeId, int flags);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QRhiShaderResourceBindings(QPrivateConstructor p) { super(p); }
/**
* See operator<<(QDebug, QRhiShaderResourceBindings)
*/
@QtUninvokable
@Override
public @NonNull String toString() {
return toString_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private static native String toString_native(long __this_nativeId);
/**
* Overloaded function for {@link #updateResources(io.qt.gui.rhi.QRhiShaderResourceBindings.UpdateFlags)}
* with flags = new io.qt.gui.rhi.QRhiShaderResourceBindings.UpdateFlags(0)
.
*/
@QtUninvokable
public final void updateResources() {
updateResources(new io.qt.gui.rhi.QRhiShaderResourceBindings.UpdateFlags(0));
}
/**
* Overloaded function for {@link #updateResources(io.qt.gui.rhi.QRhiShaderResourceBindings.UpdateFlags)}.
*/
@QtUninvokable
public final void updateResources(io.qt.gui.rhi.QRhiShaderResourceBindings.@NonNull UpdateFlag @NonNull... flags) {
updateResources(new io.qt.gui.rhi.QRhiShaderResourceBindings.UpdateFlags(flags));
}
}