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

org.lwjgl.bgfx.BGFXPlatform 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 static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.JNI.*;

/** Native bindings to the C platform API of the bgfx library. */
public class BGFXPlatform {

	/**
	 * Render frame. ({@code bgfx_renderer_frame_t})
	 * 
	 * 
Enum values:
* *
    *
  • {@link #BGFX_RENDER_FRAME_NO_CONTEXT RENDER_FRAME_NO_CONTEXT}
  • *
  • {@link #BGFX_RENDER_FRAME_RENDER RENDER_FRAME_RENDER}
  • *
  • {@link #BGFX_RENDER_FRAME_EXITING RENDER_FRAME_EXITING}
  • *
  • {@link #BGFX_RENDER_FRAME_COUNT RENDER_FRAME_COUNT}
  • *
*/ public static final int BGFX_RENDER_FRAME_NO_CONTEXT = 0, BGFX_RENDER_FRAME_RENDER = 1, BGFX_RENDER_FRAME_EXITING = 2, BGFX_RENDER_FRAME_COUNT = 3; protected BGFXPlatform() { throw new UnsupportedOperationException(); } /** Contains the function pointers loaded from {@code BGFX.getLibrary()}. */ public static final class Functions { private Functions() {} /** Function address. */ public static final long render_frame = apiGetFunctionAddress(BGFX.getLibrary(), "bgfx_render_frame"), set_platform_data = apiGetFunctionAddress(BGFX.getLibrary(), "bgfx_set_platform_data"), get_internal_data = apiGetFunctionAddress(BGFX.getLibrary(), "bgfx_get_internal_data"), override_internal_texture_ptr = apiGetFunctionAddress(BGFX.getLibrary(), "bgfx_override_internal_texture_ptr"), override_internal_texture = apiGetFunctionAddress(BGFX.getLibrary(), "bgfx_override_internal_texture"); } // --- [ bgfx_render_frame ] --- /** * Render frame. * *

This call should be only used on platforms that don't allow creating separate rendering thread. If it is called before to {@link BGFX#bgfx_init init}, render thread won't * be created by {@link BGFX#bgfx_init init} call.

* * @return current renderer state */ public static int bgfx_render_frame() { long __functionAddress = Functions.render_frame; return invokeI(__functionAddress); } // --- [ bgfx_set_platform_data ] --- /** Unsafe version of: {@link #bgfx_set_platform_data set_platform_data} */ public static void nbgfx_set_platform_data(long _data) { long __functionAddress = Functions.set_platform_data; invokePV(__functionAddress, _data); } /** * Sets platform data. * *

Must be called before {@link BGFX#bgfx_init init}.

* * @param _data the platform data to set */ public static void bgfx_set_platform_data(BGFXPlatformData _data) { nbgfx_set_platform_data(_data.address()); } // --- [ bgfx_get_internal_data ] --- /** Unsafe version of: {@link #bgfx_get_internal_data get_internal_data} */ public static long nbgfx_get_internal_data() { long __functionAddress = Functions.get_internal_data; return invokeP(__functionAddress); } /** Gets internal data for interop. */ public static BGFXInternalData bgfx_get_internal_data() { long __result = nbgfx_get_internal_data(); return BGFXInternalData.create(__result); } // --- [ bgfx_override_internal_texture_ptr ] --- /** * Overrides internal texture with externally created texture. Previously created internal texture will released. * *

It's expected you understand some bgfx internals before you use this call.

* *

Must be called only on render thread.

* * @param _handle texture handle * @param _ptr native API pointer to texture * * @return native API pointer to texture. If result is 0, texture is not created yet from the main thread. */ public static long bgfx_override_internal_texture_ptr(short _handle, long _ptr) { long __functionAddress = Functions.override_internal_texture_ptr; return invokePP(__functionAddress, _handle, _ptr); } // --- [ bgfx_override_internal_texture ] --- /** Unsafe version of: {@link #bgfx_override_internal_texture override_internal_texture} */ public static long nbgfx_override_internal_texture(short _handle, short _width, short _height, byte _numMips, int _format, int _flags) { long __functionAddress = Functions.override_internal_texture; return invokeP(__functionAddress, _handle, _width, _height, _numMips, _format, _flags); } /** * Overrides internal texture by creating new texture. Previously created internal texture will released. * *

It's expected you understand some bgfx internals before you use this call.

* *

Must be called only on render thread.

* * @param _handle texture handle * @param _width width * @param _height height * @param _numMips number of mip-maps * @param _format texture format * @param _flags default texture sampling mode is linear, and wrap mode is repeat * * @return native API pointer to texture. If result is 0, texture is not created yet from the main thread. */ public static long bgfx_override_internal_texture(short _handle, int _width, int _height, int _numMips, int _format, int _flags) { return nbgfx_override_internal_texture(_handle, (short)_width, (short)_height, (byte)_numMips, _format, _flags); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy