io.qt.gui.rhi.QRhiBuffer Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.gui.rhi;
import io.qt.*;
/**
* Vertex, index, or uniform (constant) buffer resource
* Java wrapper for Qt class QRhiBuffer
*/
public abstract class QRhiBuffer extends io.qt.gui.rhi.QRhiResource
{
@NativeAccess
private static final class ConcreteWrapper extends QRhiBuffer {
@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);
}
/**
* Java wrapper for Qt enum QRhiBuffer::Type
*/
public enum Type implements QtEnumerator {
/**
* Representing QRhiBuffer:: Immutable
*/
Immutable(0),
/**
* Representing QRhiBuffer:: Static
*/
Static(1),
/**
* Representing QRhiBuffer:: Dynamic
*/
Dynamic(2);
static {
QtJambi_LibraryUtilities.initialize();
}
private Type(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull Type resolve(int value) {
switch (value) {
case 0: return Immutable;
case 1: return Static;
case 2: return Dynamic;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QRhiBuffer::UsageFlag
*
* @see UsageFlags
*/
public enum UsageFlag implements QtFlagEnumerator {
/**
* Representing QRhiBuffer:: VertexBuffer
*/
VertexBuffer(1),
/**
* Representing QRhiBuffer:: IndexBuffer
*/
IndexBuffer(2),
/**
* Representing QRhiBuffer:: UniformBuffer
*/
UniformBuffer(4),
/**
* Representing QRhiBuffer:: StorageBuffer
*/
StorageBuffer(8);
static {
QtJambi_LibraryUtilities.initialize();
}
private UsageFlag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull UsageFlags asFlags() {
return new UsageFlags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull UsageFlags combined(@NonNull UsageFlag 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 UsageFlags cleared(@NonNull UsageFlag e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link UsageFlags} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull UsageFlags flags(@Nullable UsageFlag @NonNull... values) {
return new UsageFlags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull UsageFlag resolve(int value) {
switch (value) {
case 1: return VertexBuffer;
case 2: return IndexBuffer;
case 4: return UniformBuffer;
case 8: return StorageBuffer;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link UsageFlag}
*/
public static final class UsageFlags extends QFlags implements Comparable {
private static final long serialVersionUID = 0x4cbfbb29b551fcabL;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new UsageFlags where the flags in args
are set.
* @param args enum entries
*/
public UsageFlags(@Nullable UsageFlag @NonNull... args){
super(args);
}
/**
* Creates a new UsageFlags with given value
.
* @param value
*/
public UsageFlags(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new UsageFlags
*/
@Override
public final @NonNull UsageFlags combined(@StrictNonNull UsageFlag e){
return new UsageFlags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull UsageFlags setFlag(@Nullable UsageFlag 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 UsageFlags setFlag(@Nullable UsageFlag 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 UsageFlags.
* @return array of enum entries
*/
@Override
public final @NonNull UsageFlag @NonNull[] flags(){
return super.flags(UsageFlag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull UsageFlags clone(){
return new UsageFlags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull UsageFlags other){
return Integer.compare(value(), other.value());
}
}
/**
* Contains information about the underlying native resources of a buffer
* Java wrapper for Qt class QRhiBuffer::NativeBuffer
*/
public static class NativeBuffer extends QtObject
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* See QRhiBuffer::NativeBuffer:: NativeBuffer()
*/
public NativeBuffer(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(NativeBuffer instance);
/**
* See QRhiBuffer::NativeBuffer:: NativeBuffer(QRhiBuffer::NativeBuffer)
*/
public NativeBuffer(io.qt.gui.rhi.QRhiBuffer.@StrictNonNull NativeBuffer other){
super((QPrivateConstructor)null);
java.util.Objects.requireNonNull(other, "Argument 'other': null not expected.");
initialize_native(this, other);
}
private native static void initialize_native(NativeBuffer instance, io.qt.gui.rhi.QRhiBuffer.NativeBuffer other);
/**
* See QRhiBuffer::NativeBuffer:: NativeBuffer{const void*[3], int}
*/
public NativeBuffer(io.qt.@Nullable QNativePointer @Nullable[] objects){
super((QPrivateConstructor)null);
initialize_native(this, objects);
}
private native static void initialize_native(NativeBuffer instance, io.qt.QNativePointer[] objects);
/**
* Array with pointers to the native object handles
* See QRhiBuffer::NativeBuffer:: objects
*/
@QtUninvokable
public final void setObjects(io.qt.@Nullable QNativePointer @Nullable[] objects){
setObjects_native_const_void_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), objects);
}
@QtUninvokable
private native void setObjects_native_const_void_ptr(long __this__nativeId, io.qt.QNativePointer[] objects);
/**
* Array with pointers to the native object handles
* See QRhiBuffer::NativeBuffer:: objects
*/
@QtUninvokable
public final io.qt.@Nullable QNativePointer @Nullable[] objects(){
return objects_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.@Nullable QNativePointer @Nullable[] objects_native(long __this__nativeId);
/**
* Specifies the number of valid elements in the objects array
* See QRhiBuffer::NativeBuffer:: slotCount
*/
@QtUninvokable
public final int slotCount(){
return slotCount_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int slotCount_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected NativeBuffer(QPrivateConstructor p) { super(p); }
/**
* Creates and returns a copy of this object.
See QRhiBuffer::NativeBuffer:: NativeBuffer(QRhiBuffer::NativeBuffer)
*/
@QtUninvokable
@Override
public NativeBuffer clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native NativeBuffer clone_native(long __this_nativeId);
/**
* @hidden
* Kotlin property getter. In Java use {@link #objects()} instead.
*/
@QtUninvokable
public final io.qt.@Nullable QNativePointer @Nullable[] getObjects() {
return objects();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #slotCount()} instead.
*/
@QtUninvokable
public final int getSlotCount() {
return slotCount();
}
}
/**
* See QRhiBuffer:: setSize(quint32)
*/
@QtUninvokable
public final void setSize(int sz){
setSize_native_quint32(QtJambi_LibraryUtilities.internal.nativeId(this), sz);
}
@QtUninvokable
private native void setSize_native_quint32(long __this__nativeId, int sz);
/**
* See QRhiBuffer:: setType(QRhiBuffer::Type)
*/
@QtUninvokable
public final void setType(io.qt.gui.rhi.QRhiBuffer.@NonNull Type t){
setType_native_QRhiBuffer_Type(QtJambi_LibraryUtilities.internal.nativeId(this), t.value());
}
@QtUninvokable
private native void setType_native_QRhiBuffer_Type(long __this__nativeId, int t);
/**
* See QRhiBuffer:: setUsage(QRhiBuffer::UsageFlags)
*/
@QtUninvokable
public final void setUsage(io.qt.gui.rhi.QRhiBuffer.@NonNull UsageFlags u){
setUsage_native_QRhiBuffer_UsageFlags(QtJambi_LibraryUtilities.internal.nativeId(this), u.value());
}
@QtUninvokable
private native void setUsage_native_QRhiBuffer_UsageFlags(long __this__nativeId, int u);
/**
*
*/
@QtUninvokable
public final int size(){
return size_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int size_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final io.qt.gui.rhi.QRhiBuffer.@NonNull Type type(){
return io.qt.gui.rhi.QRhiBuffer.Type.resolve(type_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int type_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final io.qt.gui.rhi.QRhiBuffer.@NonNull UsageFlags usage(){
return new io.qt.gui.rhi.QRhiBuffer.UsageFlags(usage_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int usage_native_constfct(long __this__nativeId);
/**
* See QRhiBuffer:: beginFullDynamicBufferUpdateForCurrentFrame()
*/
@QtUninvokable
public java.nio.@Nullable ByteBuffer beginFullDynamicBufferUpdateForCurrentFrame(){
return beginFullDynamicBufferUpdateForCurrentFrame_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.nio.ByteBuffer beginFullDynamicBufferUpdateForCurrentFrame_native(long __this__nativeId);
/**
*
*/
@QtUninvokable
public abstract boolean create();
@QtUninvokable
private native boolean create_native(long __this__nativeId);
/**
* See QRhiBuffer:: endFullDynamicBufferUpdateForCurrentFrame()
*/
@QtUninvokable
public void endFullDynamicBufferUpdateForCurrentFrame(){
endFullDynamicBufferUpdateForCurrentFrame_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void endFullDynamicBufferUpdateForCurrentFrame_native(long __this__nativeId);
/**
* See QRhiBuffer:: nativeBuffer()
*/
@QtUninvokable
public io.qt.gui.rhi.QRhiBuffer.@NonNull NativeBuffer nativeBuffer(){
return nativeBuffer_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.gui.rhi.QRhiBuffer.NativeBuffer nativeBuffer_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);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QRhiBuffer(QPrivateConstructor p) { super(p); }
/**
* Overloaded function for {@link #setUsage(io.qt.gui.rhi.QRhiBuffer.UsageFlags)}.
*/
@QtUninvokable
public final void setUsage(io.qt.gui.rhi.QRhiBuffer.@NonNull UsageFlag @NonNull... u) {
setUsage(new io.qt.gui.rhi.QRhiBuffer.UsageFlags(u));
}
}