All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.bgfx.BGFXCallbackVtbl Maven / Gradle / Ivy

Go to download

A cross-platform, graphics API agnostic rendering library. It provides a high performance, low level abstraction for common platform graphics APIs like OpenGL, Direct3D and Apple Metal.

There is a newer version: 3.3.4
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.bgfx;

import javax.annotation.*;

import java.nio.*;

import org.lwjgl.*;
import org.lwjgl.system.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;

/**
 * Callback virtual table.
 * 
 * 

Member documentation

* *
    *
  • {@code fatal} – the fatal error callback
  • *
  • {@code trace_vargs} – the debug message callback
  • *
  • {@code profiler_begin} – the profiler begin callback
  • *
  • {@code profiler_begin_literal} – the profiler begin literal callback
  • *
  • {@code profiler_end} – the profiler end callback
  • *
  • {@code cache_read_size} – the cache read size callback
  • *
  • {@code cache_read} – the cache read callback
  • *
  • {@code cache_write} – the cache write callback
  • *
  • {@code screen_shot} – the screenshot callback
  • *
  • {@code capture_begin} – the capture begin callback
  • *
  • {@code capture_end} – the capture end callback
  • *
  • {@code capture_frame} – the capture framecallback
  • *
* *

Layout

* *
 * struct bgfx_callback_vtbl_t {
 *     void (*{@link BGFXFatalCallbackI fatal}) (bgfx_callback_interface_t *_this, bgfx_fatal_t _code, char *_str);
 *     void (*{@link BGFXTraceVarArgsCallbackI trace_vargs}) (bgfx_callback_interface_t *_this, const char *_filePath, uint16_t _line, const char *_format, va_list *_argList);
 *     void (*{@link BGFXProfilerBeginI profiler_begin}) (bgfx_callback_interface_t *_this, const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line);
 *     void (*{@link BGFXProfilerBeginLiteralI profiler_begin_literal}) (bgfx_callback_interface_t *_this, const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line);
 *     void (*{@link BGFXProfilerEndI profiler_end}) (bgfx_callback_interface_t *_this);
 *     uint32_t (*{@link BGFXCacheReadSizeCallbackI cache_read_size}) (bgfx_callback_interface_t *_this, uint64_t _id);
 *     bool (*{@link BGFXCacheReadCallbackI cache_read}) (bgfx_callback_interface_t *_this, uint64_t _id, void *_data, uint32_t _size);
 *     void (*{@link BGFXCacheWriteCallbackI cache_write}) (bgfx_callback_interface_t *_this, uint64_t _id, const void *_data, uint32_t _size);
 *     void (*{@link BGFXScreenShotCallbackI screen_shot}) (bgfx_callback_interface_t *_this, const char *_filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void *_data, uint32_t _size, bool _yflip);
 *     void (*{@link BGFXCaptureBeginCallbackI capture_begin}) (bgfx_callback_interface_t *_this, uint32_t _width, uint32_t _height, uint32_t _pitch, bgfx_texture_format_t _format, bool _yflip);
 *     void (*{@link BGFXCaptureEndCallbackI capture_end}) (bgfx_callback_interface_t *_this);
 *     void (*{@link BGFXCaptureFrameCallbackI capture_frame}) (bgfx_callback_interface_t *_this, const void *_data, uint32_t _size);
 * }
*/ @NativeType("struct bgfx_callback_vtbl_t") public class BGFXCallbackVtbl extends Struct implements NativeResource { /** The struct size in bytes. */ public static final int SIZEOF; public static final int ALIGNOF; /** The struct member offsets. */ public static final int FATAL, TRACE_VARGS, PROFILER_BEGIN, PROFILER_BEGIN_LITERAL, PROFILER_END, CACHE_READ_SIZE, CACHE_READ, CACHE_WRITE, SCREEN_SHOT, CAPTURE_BEGIN, CAPTURE_END, CAPTURE_FRAME; static { Layout layout = __struct( __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(POINTER_SIZE) ); SIZEOF = layout.getSize(); ALIGNOF = layout.getAlignment(); FATAL = layout.offsetof(0); TRACE_VARGS = layout.offsetof(1); PROFILER_BEGIN = layout.offsetof(2); PROFILER_BEGIN_LITERAL = layout.offsetof(3); PROFILER_END = layout.offsetof(4); CACHE_READ_SIZE = layout.offsetof(5); CACHE_READ = layout.offsetof(6); CACHE_WRITE = layout.offsetof(7); SCREEN_SHOT = layout.offsetof(8); CAPTURE_BEGIN = layout.offsetof(9); CAPTURE_END = layout.offsetof(10); CAPTURE_FRAME = layout.offsetof(11); } BGFXCallbackVtbl(long address, @Nullable ByteBuffer container) { super(address, container); } /** * Creates a {@link BGFXCallbackVtbl} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be * visible to the struct instance and vice versa. * *

The created instance holds a strong reference to the container object.

*/ public BGFXCallbackVtbl(ByteBuffer container) { this(memAddress(container), __checkContainer(container, SIZEOF)); } @Override public int sizeof() { return SIZEOF; } /** Returns the value of the {@code fatal} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, bgfx_fatal_t, char *)") public BGFXFatalCallback fatal() { return nfatal(address()); } /** Returns the value of the {@code trace_vargs} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint16_t, const char *, va_list *)") public BGFXTraceVarArgsCallback trace_vargs() { return ntrace_vargs(address()); } /** Returns the value of the {@code profiler_begin} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, const char *, uint16_t)") public BGFXProfilerBegin profiler_begin() { return nprofiler_begin(address()); } /** Returns the value of the {@code profiler_begin_literal} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, const char *, uint16_t)") public BGFXProfilerBeginLiteral profiler_begin_literal() { return nprofiler_begin_literal(address()); } /** Returns the value of the {@code profiler_end} field. */ @NativeType("void (*) (bgfx_callback_interface_t *)") public BGFXProfilerEnd profiler_end() { return nprofiler_end(address()); } /** Returns the value of the {@code cache_read_size} field. */ @NativeType("uint32_t (*) (bgfx_callback_interface_t *, uint64_t)") public BGFXCacheReadSizeCallback cache_read_size() { return ncache_read_size(address()); } /** Returns the value of the {@code cache_read} field. */ @NativeType("bool (*) (bgfx_callback_interface_t *, uint64_t, void *, uint32_t)") public BGFXCacheReadCallback cache_read() { return ncache_read(address()); } /** Returns the value of the {@code cache_write} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, uint64_t, const void *, uint32_t)") public BGFXCacheWriteCallback cache_write() { return ncache_write(address()); } /** Returns the value of the {@code screen_shot} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, uint32_t, uint32_t, const void *, uint32_t, bool)") public BGFXScreenShotCallback screen_shot() { return nscreen_shot(address()); } /** Returns the value of the {@code capture_begin} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, uint32_t, uint32_t, uint32_t, bgfx_texture_format_t, bool)") public BGFXCaptureBeginCallback capture_begin() { return ncapture_begin(address()); } /** Returns the value of the {@code capture_end} field. */ @NativeType("void (*) (bgfx_callback_interface_t *)") public BGFXCaptureEndCallback capture_end() { return ncapture_end(address()); } /** Returns the value of the {@code capture_frame} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const void *, uint32_t)") public BGFXCaptureFrameCallback capture_frame() { return ncapture_frame(address()); } /** Sets the specified value to the {@code fatal} field. */ public BGFXCallbackVtbl fatal(@NativeType("void (*) (bgfx_callback_interface_t *, bgfx_fatal_t, char *)") BGFXFatalCallbackI value) { nfatal(address(), value); return this; } /** Sets the specified value to the {@code trace_vargs} field. */ public BGFXCallbackVtbl trace_vargs(@NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint16_t, const char *, va_list *)") BGFXTraceVarArgsCallbackI value) { ntrace_vargs(address(), value); return this; } /** Sets the specified value to the {@code profiler_begin} field. */ public BGFXCallbackVtbl profiler_begin(@NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, const char *, uint16_t)") BGFXProfilerBeginI value) { nprofiler_begin(address(), value); return this; } /** Sets the specified value to the {@code profiler_begin_literal} field. */ public BGFXCallbackVtbl profiler_begin_literal(@NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, const char *, uint16_t)") BGFXProfilerBeginLiteralI value) { nprofiler_begin_literal(address(), value); return this; } /** Sets the specified value to the {@code profiler_end} field. */ public BGFXCallbackVtbl profiler_end(@NativeType("void (*) (bgfx_callback_interface_t *)") BGFXProfilerEndI value) { nprofiler_end(address(), value); return this; } /** Sets the specified value to the {@code cache_read_size} field. */ public BGFXCallbackVtbl cache_read_size(@NativeType("uint32_t (*) (bgfx_callback_interface_t *, uint64_t)") BGFXCacheReadSizeCallbackI value) { ncache_read_size(address(), value); return this; } /** Sets the specified value to the {@code cache_read} field. */ public BGFXCallbackVtbl cache_read(@NativeType("bool (*) (bgfx_callback_interface_t *, uint64_t, void *, uint32_t)") BGFXCacheReadCallbackI value) { ncache_read(address(), value); return this; } /** Sets the specified value to the {@code cache_write} field. */ public BGFXCallbackVtbl cache_write(@NativeType("void (*) (bgfx_callback_interface_t *, uint64_t, const void *, uint32_t)") BGFXCacheWriteCallbackI value) { ncache_write(address(), value); return this; } /** Sets the specified value to the {@code screen_shot} field. */ public BGFXCallbackVtbl screen_shot(@NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, uint32_t, uint32_t, const void *, uint32_t, bool)") BGFXScreenShotCallbackI value) { nscreen_shot(address(), value); return this; } /** Sets the specified value to the {@code capture_begin} field. */ public BGFXCallbackVtbl capture_begin(@NativeType("void (*) (bgfx_callback_interface_t *, uint32_t, uint32_t, uint32_t, bgfx_texture_format_t, bool)") BGFXCaptureBeginCallbackI value) { ncapture_begin(address(), value); return this; } /** Sets the specified value to the {@code capture_end} field. */ public BGFXCallbackVtbl capture_end(@NativeType("void (*) (bgfx_callback_interface_t *)") BGFXCaptureEndCallbackI value) { ncapture_end(address(), value); return this; } /** Sets the specified value to the {@code capture_frame} field. */ public BGFXCallbackVtbl capture_frame(@NativeType("void (*) (bgfx_callback_interface_t *, const void *, uint32_t)") BGFXCaptureFrameCallbackI value) { ncapture_frame(address(), value); return this; } /** Initializes this struct with the specified values. */ public BGFXCallbackVtbl set( BGFXFatalCallbackI fatal, BGFXTraceVarArgsCallbackI trace_vargs, BGFXProfilerBeginI profiler_begin, BGFXProfilerBeginLiteralI profiler_begin_literal, BGFXProfilerEndI profiler_end, BGFXCacheReadSizeCallbackI cache_read_size, BGFXCacheReadCallbackI cache_read, BGFXCacheWriteCallbackI cache_write, BGFXScreenShotCallbackI screen_shot, BGFXCaptureBeginCallbackI capture_begin, BGFXCaptureEndCallbackI capture_end, BGFXCaptureFrameCallbackI capture_frame ) { fatal(fatal); trace_vargs(trace_vargs); profiler_begin(profiler_begin); profiler_begin_literal(profiler_begin_literal); profiler_end(profiler_end); cache_read_size(cache_read_size); cache_read(cache_read); cache_write(cache_write); screen_shot(screen_shot); capture_begin(capture_begin); capture_end(capture_end); capture_frame(capture_frame); return this; } /** * Copies the specified struct data to this struct. * * @param src the source struct * * @return this struct */ public BGFXCallbackVtbl set(BGFXCallbackVtbl src) { memCopy(src.address(), address(), SIZEOF); return this; } // ----------------------------------- /** Returns a new {@link BGFXCallbackVtbl} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ public static BGFXCallbackVtbl malloc() { return create(nmemAllocChecked(SIZEOF)); } /** Returns a new {@link BGFXCallbackVtbl} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ public static BGFXCallbackVtbl calloc() { return create(nmemCallocChecked(1, SIZEOF)); } /** Returns a new {@link BGFXCallbackVtbl} instance allocated with {@link BufferUtils}. */ public static BGFXCallbackVtbl create() { return new BGFXCallbackVtbl(BufferUtils.createByteBuffer(SIZEOF)); } /** Returns a new {@link BGFXCallbackVtbl} instance for the specified memory address. */ public static BGFXCallbackVtbl create(long address) { return new BGFXCallbackVtbl(address, null); } /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ @Nullable public static BGFXCallbackVtbl createSafe(long address) { return address == NULL ? null : create(address); } /** * Returns a new {@link BGFXCallbackVtbl.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. * * @param capacity the buffer capacity */ public static BGFXCallbackVtbl.Buffer malloc(int capacity) { return create(__malloc(capacity, SIZEOF), capacity); } /** * Returns a new {@link BGFXCallbackVtbl.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. * * @param capacity the buffer capacity */ public static BGFXCallbackVtbl.Buffer calloc(int capacity) { return create(nmemCallocChecked(capacity, SIZEOF), capacity); } /** * Returns a new {@link BGFXCallbackVtbl.Buffer} instance allocated with {@link BufferUtils}. * * @param capacity the buffer capacity */ public static BGFXCallbackVtbl.Buffer create(int capacity) { return new Buffer(__create(capacity, SIZEOF)); } /** * Create a {@link BGFXCallbackVtbl.Buffer} instance at the specified memory. * * @param address the memory address * @param capacity the buffer capacity */ public static BGFXCallbackVtbl.Buffer create(long address, int capacity) { return new Buffer(address, capacity); } /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ @Nullable public static BGFXCallbackVtbl.Buffer createSafe(long address, int capacity) { return address == NULL ? null : create(address, capacity); } // ----------------------------------- /** Returns a new {@link BGFXCallbackVtbl} instance allocated on the thread-local {@link MemoryStack}. */ public static BGFXCallbackVtbl mallocStack() { return mallocStack(stackGet()); } /** Returns a new {@link BGFXCallbackVtbl} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ public static BGFXCallbackVtbl callocStack() { return callocStack(stackGet()); } /** * Returns a new {@link BGFXCallbackVtbl} instance allocated on the specified {@link MemoryStack}. * * @param stack the stack from which to allocate */ public static BGFXCallbackVtbl mallocStack(MemoryStack stack) { return create(stack.nmalloc(ALIGNOF, SIZEOF)); } /** * Returns a new {@link BGFXCallbackVtbl} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. * * @param stack the stack from which to allocate */ public static BGFXCallbackVtbl callocStack(MemoryStack stack) { return create(stack.ncalloc(ALIGNOF, 1, SIZEOF)); } /** * Returns a new {@link BGFXCallbackVtbl.Buffer} instance allocated on the thread-local {@link MemoryStack}. * * @param capacity the buffer capacity */ public static BGFXCallbackVtbl.Buffer mallocStack(int capacity) { return mallocStack(capacity, stackGet()); } /** * Returns a new {@link BGFXCallbackVtbl.Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. * * @param capacity the buffer capacity */ public static BGFXCallbackVtbl.Buffer callocStack(int capacity) { return callocStack(capacity, stackGet()); } /** * Returns a new {@link BGFXCallbackVtbl.Buffer} instance allocated on the specified {@link MemoryStack}. * * @param stack the stack from which to allocate * @param capacity the buffer capacity */ public static BGFXCallbackVtbl.Buffer mallocStack(int capacity, MemoryStack stack) { return create(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); } /** * Returns a new {@link BGFXCallbackVtbl.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. * * @param stack the stack from which to allocate * @param capacity the buffer capacity */ public static BGFXCallbackVtbl.Buffer callocStack(int capacity, MemoryStack stack) { return create(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); } // ----------------------------------- /** Unsafe version of {@link #fatal}. */ public static BGFXFatalCallback nfatal(long struct) { return BGFXFatalCallback.create(memGetAddress(struct + BGFXCallbackVtbl.FATAL)); } /** Unsafe version of {@link #trace_vargs}. */ public static BGFXTraceVarArgsCallback ntrace_vargs(long struct) { return BGFXTraceVarArgsCallback.create(memGetAddress(struct + BGFXCallbackVtbl.TRACE_VARGS)); } /** Unsafe version of {@link #profiler_begin}. */ public static BGFXProfilerBegin nprofiler_begin(long struct) { return BGFXProfilerBegin.create(memGetAddress(struct + BGFXCallbackVtbl.PROFILER_BEGIN)); } /** Unsafe version of {@link #profiler_begin_literal}. */ public static BGFXProfilerBeginLiteral nprofiler_begin_literal(long struct) { return BGFXProfilerBeginLiteral.create(memGetAddress(struct + BGFXCallbackVtbl.PROFILER_BEGIN_LITERAL)); } /** Unsafe version of {@link #profiler_end}. */ public static BGFXProfilerEnd nprofiler_end(long struct) { return BGFXProfilerEnd.create(memGetAddress(struct + BGFXCallbackVtbl.PROFILER_END)); } /** Unsafe version of {@link #cache_read_size}. */ public static BGFXCacheReadSizeCallback ncache_read_size(long struct) { return BGFXCacheReadSizeCallback.create(memGetAddress(struct + BGFXCallbackVtbl.CACHE_READ_SIZE)); } /** Unsafe version of {@link #cache_read}. */ public static BGFXCacheReadCallback ncache_read(long struct) { return BGFXCacheReadCallback.create(memGetAddress(struct + BGFXCallbackVtbl.CACHE_READ)); } /** Unsafe version of {@link #cache_write}. */ public static BGFXCacheWriteCallback ncache_write(long struct) { return BGFXCacheWriteCallback.create(memGetAddress(struct + BGFXCallbackVtbl.CACHE_WRITE)); } /** Unsafe version of {@link #screen_shot}. */ public static BGFXScreenShotCallback nscreen_shot(long struct) { return BGFXScreenShotCallback.create(memGetAddress(struct + BGFXCallbackVtbl.SCREEN_SHOT)); } /** Unsafe version of {@link #capture_begin}. */ public static BGFXCaptureBeginCallback ncapture_begin(long struct) { return BGFXCaptureBeginCallback.create(memGetAddress(struct + BGFXCallbackVtbl.CAPTURE_BEGIN)); } /** Unsafe version of {@link #capture_end}. */ public static BGFXCaptureEndCallback ncapture_end(long struct) { return BGFXCaptureEndCallback.create(memGetAddress(struct + BGFXCallbackVtbl.CAPTURE_END)); } /** Unsafe version of {@link #capture_frame}. */ public static BGFXCaptureFrameCallback ncapture_frame(long struct) { return BGFXCaptureFrameCallback.create(memGetAddress(struct + BGFXCallbackVtbl.CAPTURE_FRAME)); } /** Unsafe version of {@link #fatal(BGFXFatalCallbackI) fatal}. */ public static void nfatal(long struct, BGFXFatalCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.FATAL, value.address()); } /** Unsafe version of {@link #trace_vargs(BGFXTraceVarArgsCallbackI) trace_vargs}. */ public static void ntrace_vargs(long struct, BGFXTraceVarArgsCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.TRACE_VARGS, value.address()); } /** Unsafe version of {@link #profiler_begin(BGFXProfilerBeginI) profiler_begin}. */ public static void nprofiler_begin(long struct, BGFXProfilerBeginI value) { memPutAddress(struct + BGFXCallbackVtbl.PROFILER_BEGIN, value.address()); } /** Unsafe version of {@link #profiler_begin_literal(BGFXProfilerBeginLiteralI) profiler_begin_literal}. */ public static void nprofiler_begin_literal(long struct, BGFXProfilerBeginLiteralI value) { memPutAddress(struct + BGFXCallbackVtbl.PROFILER_BEGIN_LITERAL, value.address()); } /** Unsafe version of {@link #profiler_end(BGFXProfilerEndI) profiler_end}. */ public static void nprofiler_end(long struct, BGFXProfilerEndI value) { memPutAddress(struct + BGFXCallbackVtbl.PROFILER_END, value.address()); } /** Unsafe version of {@link #cache_read_size(BGFXCacheReadSizeCallbackI) cache_read_size}. */ public static void ncache_read_size(long struct, BGFXCacheReadSizeCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.CACHE_READ_SIZE, value.address()); } /** Unsafe version of {@link #cache_read(BGFXCacheReadCallbackI) cache_read}. */ public static void ncache_read(long struct, BGFXCacheReadCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.CACHE_READ, value.address()); } /** Unsafe version of {@link #cache_write(BGFXCacheWriteCallbackI) cache_write}. */ public static void ncache_write(long struct, BGFXCacheWriteCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.CACHE_WRITE, value.address()); } /** Unsafe version of {@link #screen_shot(BGFXScreenShotCallbackI) screen_shot}. */ public static void nscreen_shot(long struct, BGFXScreenShotCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.SCREEN_SHOT, value.address()); } /** Unsafe version of {@link #capture_begin(BGFXCaptureBeginCallbackI) capture_begin}. */ public static void ncapture_begin(long struct, BGFXCaptureBeginCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.CAPTURE_BEGIN, value.address()); } /** Unsafe version of {@link #capture_end(BGFXCaptureEndCallbackI) capture_end}. */ public static void ncapture_end(long struct, BGFXCaptureEndCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.CAPTURE_END, value.address()); } /** Unsafe version of {@link #capture_frame(BGFXCaptureFrameCallbackI) capture_frame}. */ public static void ncapture_frame(long struct, BGFXCaptureFrameCallbackI value) { memPutAddress(struct + BGFXCallbackVtbl.CAPTURE_FRAME, value.address()); } /** * Validates pointer members that should not be {@code NULL}. * * @param struct the struct to validate */ public static void validate(long struct) { check(memGetAddress(struct + BGFXCallbackVtbl.FATAL)); check(memGetAddress(struct + BGFXCallbackVtbl.TRACE_VARGS)); check(memGetAddress(struct + BGFXCallbackVtbl.PROFILER_BEGIN)); check(memGetAddress(struct + BGFXCallbackVtbl.PROFILER_BEGIN_LITERAL)); check(memGetAddress(struct + BGFXCallbackVtbl.PROFILER_END)); check(memGetAddress(struct + BGFXCallbackVtbl.CACHE_READ_SIZE)); check(memGetAddress(struct + BGFXCallbackVtbl.CACHE_READ)); check(memGetAddress(struct + BGFXCallbackVtbl.CACHE_WRITE)); check(memGetAddress(struct + BGFXCallbackVtbl.SCREEN_SHOT)); check(memGetAddress(struct + BGFXCallbackVtbl.CAPTURE_BEGIN)); check(memGetAddress(struct + BGFXCallbackVtbl.CAPTURE_END)); check(memGetAddress(struct + BGFXCallbackVtbl.CAPTURE_FRAME)); } /** * Calls {@link #validate(long)} for each struct contained in the specified struct array. * * @param array the struct array to validate * @param count the number of structs in {@code array} */ public static void validate(long array, int count) { for (int i = 0; i < count; i++) { validate(array + i * SIZEOF); } } // ----------------------------------- /** An array of {@link BGFXCallbackVtbl} structs. */ public static class Buffer extends StructBuffer implements NativeResource { /** * Creates a new {@link BGFXCallbackVtbl.Buffer} instance backed by the specified container. * * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided * by {@link BGFXCallbackVtbl#SIZEOF}, and its mark will be undefined. * *

The created buffer instance holds a strong reference to the container object.

*/ public Buffer(ByteBuffer container) { super(container, container.remaining() / SIZEOF); } public Buffer(long address, int cap) { super(address, null, -1, 0, cap, cap); } Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { super(address, container, mark, pos, lim, cap); } @Override protected Buffer self() { return this; } @Override protected Buffer newBufferInstance(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { return new Buffer(address, container, mark, pos, lim, cap); } @Override protected BGFXCallbackVtbl newInstance(long address) { return new BGFXCallbackVtbl(address, container); } @Override public int sizeof() { return SIZEOF; } /** Returns the value of the {@code fatal} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, bgfx_fatal_t, char *)") public BGFXFatalCallback fatal() { return BGFXCallbackVtbl.nfatal(address()); } /** Returns the value of the {@code trace_vargs} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint16_t, const char *, va_list *)") public BGFXTraceVarArgsCallback trace_vargs() { return BGFXCallbackVtbl.ntrace_vargs(address()); } /** Returns the value of the {@code profiler_begin} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, const char *, uint16_t)") public BGFXProfilerBegin profiler_begin() { return BGFXCallbackVtbl.nprofiler_begin(address()); } /** Returns the value of the {@code profiler_begin_literal} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, const char *, uint16_t)") public BGFXProfilerBeginLiteral profiler_begin_literal() { return BGFXCallbackVtbl.nprofiler_begin_literal(address()); } /** Returns the value of the {@code profiler_end} field. */ @NativeType("void (*) (bgfx_callback_interface_t *)") public BGFXProfilerEnd profiler_end() { return BGFXCallbackVtbl.nprofiler_end(address()); } /** Returns the value of the {@code cache_read_size} field. */ @NativeType("uint32_t (*) (bgfx_callback_interface_t *, uint64_t)") public BGFXCacheReadSizeCallback cache_read_size() { return BGFXCallbackVtbl.ncache_read_size(address()); } /** Returns the value of the {@code cache_read} field. */ @NativeType("bool (*) (bgfx_callback_interface_t *, uint64_t, void *, uint32_t)") public BGFXCacheReadCallback cache_read() { return BGFXCallbackVtbl.ncache_read(address()); } /** Returns the value of the {@code cache_write} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, uint64_t, const void *, uint32_t)") public BGFXCacheWriteCallback cache_write() { return BGFXCallbackVtbl.ncache_write(address()); } /** Returns the value of the {@code screen_shot} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, uint32_t, uint32_t, const void *, uint32_t, bool)") public BGFXScreenShotCallback screen_shot() { return BGFXCallbackVtbl.nscreen_shot(address()); } /** Returns the value of the {@code capture_begin} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, uint32_t, uint32_t, uint32_t, bgfx_texture_format_t, bool)") public BGFXCaptureBeginCallback capture_begin() { return BGFXCallbackVtbl.ncapture_begin(address()); } /** Returns the value of the {@code capture_end} field. */ @NativeType("void (*) (bgfx_callback_interface_t *)") public BGFXCaptureEndCallback capture_end() { return BGFXCallbackVtbl.ncapture_end(address()); } /** Returns the value of the {@code capture_frame} field. */ @NativeType("void (*) (bgfx_callback_interface_t *, const void *, uint32_t)") public BGFXCaptureFrameCallback capture_frame() { return BGFXCallbackVtbl.ncapture_frame(address()); } /** Sets the specified value to the {@code fatal} field. */ public BGFXCallbackVtbl.Buffer fatal(@NativeType("void (*) (bgfx_callback_interface_t *, bgfx_fatal_t, char *)") BGFXFatalCallbackI value) { BGFXCallbackVtbl.nfatal(address(), value); return this; } /** Sets the specified value to the {@code trace_vargs} field. */ public BGFXCallbackVtbl.Buffer trace_vargs(@NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint16_t, const char *, va_list *)") BGFXTraceVarArgsCallbackI value) { BGFXCallbackVtbl.ntrace_vargs(address(), value); return this; } /** Sets the specified value to the {@code profiler_begin} field. */ public BGFXCallbackVtbl.Buffer profiler_begin(@NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, const char *, uint16_t)") BGFXProfilerBeginI value) { BGFXCallbackVtbl.nprofiler_begin(address(), value); return this; } /** Sets the specified value to the {@code profiler_begin_literal} field. */ public BGFXCallbackVtbl.Buffer profiler_begin_literal(@NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, const char *, uint16_t)") BGFXProfilerBeginLiteralI value) { BGFXCallbackVtbl.nprofiler_begin_literal(address(), value); return this; } /** Sets the specified value to the {@code profiler_end} field. */ public BGFXCallbackVtbl.Buffer profiler_end(@NativeType("void (*) (bgfx_callback_interface_t *)") BGFXProfilerEndI value) { BGFXCallbackVtbl.nprofiler_end(address(), value); return this; } /** Sets the specified value to the {@code cache_read_size} field. */ public BGFXCallbackVtbl.Buffer cache_read_size(@NativeType("uint32_t (*) (bgfx_callback_interface_t *, uint64_t)") BGFXCacheReadSizeCallbackI value) { BGFXCallbackVtbl.ncache_read_size(address(), value); return this; } /** Sets the specified value to the {@code cache_read} field. */ public BGFXCallbackVtbl.Buffer cache_read(@NativeType("bool (*) (bgfx_callback_interface_t *, uint64_t, void *, uint32_t)") BGFXCacheReadCallbackI value) { BGFXCallbackVtbl.ncache_read(address(), value); return this; } /** Sets the specified value to the {@code cache_write} field. */ public BGFXCallbackVtbl.Buffer cache_write(@NativeType("void (*) (bgfx_callback_interface_t *, uint64_t, const void *, uint32_t)") BGFXCacheWriteCallbackI value) { BGFXCallbackVtbl.ncache_write(address(), value); return this; } /** Sets the specified value to the {@code screen_shot} field. */ public BGFXCallbackVtbl.Buffer screen_shot(@NativeType("void (*) (bgfx_callback_interface_t *, const char *, uint32_t, uint32_t, uint32_t, const void *, uint32_t, bool)") BGFXScreenShotCallbackI value) { BGFXCallbackVtbl.nscreen_shot(address(), value); return this; } /** Sets the specified value to the {@code capture_begin} field. */ public BGFXCallbackVtbl.Buffer capture_begin(@NativeType("void (*) (bgfx_callback_interface_t *, uint32_t, uint32_t, uint32_t, bgfx_texture_format_t, bool)") BGFXCaptureBeginCallbackI value) { BGFXCallbackVtbl.ncapture_begin(address(), value); return this; } /** Sets the specified value to the {@code capture_end} field. */ public BGFXCallbackVtbl.Buffer capture_end(@NativeType("void (*) (bgfx_callback_interface_t *)") BGFXCaptureEndCallbackI value) { BGFXCallbackVtbl.ncapture_end(address(), value); return this; } /** Sets the specified value to the {@code capture_frame} field. */ public BGFXCallbackVtbl.Buffer capture_frame(@NativeType("void (*) (bgfx_callback_interface_t *, const void *, uint32_t)") BGFXCaptureFrameCallbackI value) { BGFXCallbackVtbl.ncapture_frame(address(), value); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy