add lwjgl2 native

This commit is contained in:
ShirosakiMio 2023-01-13 01:12:51 +08:00
parent 794e315c4e
commit c437463eef
265 changed files with 28938 additions and 10 deletions

View File

@ -220,17 +220,19 @@ public interface GameRepository extends VersionProvider {
default List<String> getClasspath(Version version) { default List<String> getClasspath(Version version) {
List<String> classpath = new ArrayList<>(); List<String> classpath = new ArrayList<>();
if (version.getMinimumLauncherVersion() >= 21) { if (version.getMinimumLauncherVersion() >= 21) {
classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl.jar"); // classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl.jar");
classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-glfw.jar"); // classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-glfw.jar");
classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-jemalloc.jar"); // classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-jemalloc.jar");
classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-openal.jar"); // classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-openal.jar");
classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-opengl.jar"); // classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-opengl.jar");
classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-stb.jar"); // classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-stb.jar");
classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-tinyfd.jar"); // classpath.add(FCLPath.LWJGL3_DIR + "/lwjgl-tinyfd.jar");
classpath.add(FCLPath.LWJGL3_DIR + "/Lwjgl3.jar");
} }
else { else {
classpath.add(FCLPath.LWJGL2_DIR + "/lwjgl.jar"); classpath.add(FCLPath.LWJGL2_DIR + "/Lwjgl2.jar");
classpath.add(FCLPath.LWJGL2_DIR + "/lwjgl_util.jar"); // classpath.add(FCLPath.LWJGL2_DIR + "/lwjgl.jar");
// classpath.add(FCLPath.LWJGL2_DIR + "/lwjgl_util.jar");
} }
for (Library library : version.getLibraries()) for (Library library : version.getLibraries())
if (library.appliesToCurrentEnvironment() && !library.isNative()) { if (library.appliesToCurrentEnvironment() && !library.isNative()) {

View File

@ -70,4 +70,229 @@ LOCAL_MODULE := awt_xawt
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/awt_xawt LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/awt_xawt
LOCAL_SHARED_LIBRARIES := awt_headless LOCAL_SHARED_LIBRARIES := awt_headless
LOCAL_SRC_FILES := awt_xawt/xawt_fake.c LOCAL_SRC_FILES := awt_xawt/xawt_fake.c
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := lwjgl
LOCAL_SHARED_LIBRARIES := fcl
LOCAL_SRC_FILES := lwjgl2/common/common_tools.c \
lwjgl2/common/extal.c \
lwjgl2/common/extcl.c \
lwjgl2/common/opengl/extgl.c \
lwjgl2/common/opengl/org_lwjgl_opengl_CallbackUtil.c \
lwjgl2/common/opengl/org_lwjgl_opengl_GLContext.c \
lwjgl2/common/opengl/org_lwjgl_opengl_NVPresentVideoUtil.c \
lwjgl2/common/opengl/org_lwjgl_opengl_NVVideoCaptureUtil.c \
lwjgl2/common/org_lwjgl_BufferUtils.c \
lwjgl2/common/org_lwjgl_openal_AL.c \
lwjgl2/common/org_lwjgl_openal_ALC10.c \
lwjgl2/common/org_lwjgl_openal_ALC11.c \
lwjgl2/common/org_lwjgl_opencl_CallbackUtil.c \
lwjgl2/common/org_lwjgl_opencl_CL.c \
lwjgl2/common/org_lwjgl_opengl_AWTSurfaceLock.c \
lwjgl2/fcl/fcl_al.c \
lwjgl2/fcl/fcl_cl.c \
lwjgl2/fcl/opengl/context.c \
lwjgl2/fcl/opengl/display.c \
lwjgl2/fcl/opengl/EGL.c \
lwjgl2/fcl/opengl/extgl_egl.c \
lwjgl2/fcl/opengl/org_lwjgl_opengl_Display.c \
lwjgl2/fcl/opengl/org_lwjgl_opengl_FCLContextImplementation.c \
lwjgl2/fcl/opengl/org_lwjgl_opengl_Pbuffer.c \
lwjgl2/fcl/org_lwjgl_input_Cursor.c \
lwjgl2/fcl/org_lwjgl_opengl_Display.c \
lwjgl2/fcl/org_lwjgl_opengl_FCLEvent.c \
lwjgl2/fcl/org_lwjgl_opengl_FCLKeyboard.c \
lwjgl2/fcl/org_lwjgl_opengl_FCLMouse.c \
lwjgl2/fcl/org_lwjgl_opengl_FCLPeerInfo.c \
lwjgl2/generated/openal/org_lwjgl_openal_AL10.c \
lwjgl2/generated/openal/org_lwjgl_openal_AL11.c \
lwjgl2/generated/openal/org_lwjgl_openal_EFX10.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_APPLEContextLoggingFunctions.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_APPLEGLSharing.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_APPLESetMemObjectDestructor.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_CL10.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_CL10GL.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_CL11.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_CL12.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_CL12GL.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_EXTDeviceFission.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_EXTMigrateMemobject.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_KHRGLEvent.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_KHRGLSharing.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_KHRICD.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_KHRSubgroups.c \
lwjgl2/generated/opencl/org_lwjgl_opencl_KHRTerminateContext.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDDebugOutput.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDDrawBuffersBlend.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDInterleavedElements.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDMultiDrawIndirect.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDNameGenDelete.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDPerformanceMonitor.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDSamplePositions.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDSparseTexture.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDStencilOperationExtended.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_AMDVertexShaderTessellator.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_APPLEElementArray.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_APPLEFence.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_APPLEFlushBufferRange.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_APPLEObjectPurgeable.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_APPLETextureRange.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_APPLEVertexArrayObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_APPLEVertexArrayRange.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_APPLEVertexProgramEvaluators.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBBindlessTexture.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBBufferObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBBufferStorage.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBClearBufferObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBCLEvent.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBColorBufferFloat.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBComputeVariableGroupSize.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBDebugOutput.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBDrawBuffers.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBDrawBuffersBlend.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBDrawInstanced.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBFramebufferNoAttachments.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBGeometryShader4.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBGpuShaderFp64.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBImaging.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBIndirectParameters.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBInstancedArrays.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBMatrixPalette.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBMultisample.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBMultitexture.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBOcclusionQuery.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBPointParameters.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBProgram.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBRobustness.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBSampleShading.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBShaderObjects.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBShadingLanguageInclude.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBSparseBuffer.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBSparseTexture.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBTextureBufferObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBTextureBufferRange.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBTextureCompression.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBTextureStorage.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBTextureStorageMultisample.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBTransposeMatrix.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBVertexAttrib64bit.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBVertexBlend.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBVertexShader.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ARBWindowPos.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIDrawBuffers.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIElementArray.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIEnvmapBumpmap.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIFragmentShader.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIMapObjectBuffer.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIPnTriangles.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATISeparateStencil.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIVertexArrayObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIVertexAttribArrayObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_ATIVertexStreams.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTBindableUniform.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTBlendColor.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTBlendEquationSeparate.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTBlendFuncSeparate.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTBlendMinmax.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTCompiledVertexArray.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTDepthBoundsTest.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTDirectStateAccess.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTDrawBuffers2.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTDrawInstanced.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTDrawRangeElements.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTFogCoord.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTFramebufferBlit.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTFramebufferMultisample.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTFramebufferObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTGeometryShader4.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTGpuProgramParameters.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTGpuShader4.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTMultiDrawArrays.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTPalettedTexture.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTPointParameters.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTProvokingVertex.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTSecondaryColor.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTSeparateShaderObjects.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTShaderImageLoadStore.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTStencilClearTag.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTStencilTwoSide.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTTextureBufferObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTTextureInteger.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTTimerQuery.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTTransformFeedback.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTVertexAttrib64bit.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTVertexShader.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_EXTVertexWeighting.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL11.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL12.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL13.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL14.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL15.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL20.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL21.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL30.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL31.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL32.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL33.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL40.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL41.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL42.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL43.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL44.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GL45.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GREMEDYFrameTerminator.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_GREMEDYStringMarker.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_INTELMapTexture.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirect.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVBindlessTexture.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVBlendEquationAdvanced.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVConditionalRender.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVCopyImage.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVDepthBufferFloat.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVDrawTexture.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVEvaluators.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVExplicitMultisample.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVFence.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVFragmentProgram.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVFramebufferMultisampleCoverage.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVGeometryProgram4.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVGpuProgram4.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVGpuShader5.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVHalfFloat.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVOcclusionQuery.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVParameterBufferObject.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVPathRendering.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVPixelDataRange.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVPointSprite.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVPresentVideo.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVPrimitiveRestart.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVProgram.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVRegisterCombiners.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVRegisterCombiners2.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVShaderBufferLoad.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVTextureBarrier.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVTextureMultisample.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVTransformFeedback.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVTransformFeedback2.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVVertexArrayRange.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVVertexAttribInteger64bit.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVVertexBufferUnifiedMemory.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVVertexProgram.c \
lwjgl2/generated/opengl/org_lwjgl_opengl_NVVideoCapture.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/lwjgl2/common \
$(LOCAL_PATH)/lwjgl2/common/opengl \
$(LOCAL_PATH)/lwjgl2/common/CL \
$(LOCAL_PATH)/lwjgl2/common/EGL \
$(LOCAL_PATH)/lwjgl2/common/GLES2 \
$(LOCAL_PATH)/lwjgl2/common/KHR \
$(LOCAL_PATH)/lwjgl2/common/OpenCL \
$(LOCAL_PATH)/lwjgl2/fcl \
$(LOCAL_PATH)/lwjgl2/fcl/opengl \
$(LOCAL_PATH)/fcl/include
LOCAL_CFLAGS := -O2 -Wall -c -fPIC -std=c99 -Wunused -DPLATFORM_FCL
LOCAL_LDLIBS := -lm -landroid
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)

View File

@ -1,2 +1,3 @@
APP_STL := system APP_STL := system
APP_PLATFORM := android-23 APP_PLATFORM := android-23
APP_SHORT_COMMANDS := true

View File

@ -0,0 +1,998 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
/* $Revision: 11985 $ on $Date: 2010-07-15 11:16:06 -0700 (Thu, 15 Jul 2010) $ */
#ifndef __OPENCL_CL_H
#define __OPENCL_CL_H
#ifdef __APPLE__
#include <OpenCL/cl_platform.h>
#else
#include <CL/cl_platform.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************/
typedef struct _cl_platform_id * cl_platform_id;
typedef struct _cl_device_id * cl_device_id;
typedef struct _cl_context * cl_context;
typedef struct _cl_command_queue * cl_command_queue;
typedef struct _cl_mem * cl_mem;
typedef struct _cl_program * cl_program;
typedef struct _cl_kernel * cl_kernel;
typedef struct _cl_event * cl_event;
typedef struct _cl_sampler * cl_sampler;
typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */
typedef cl_ulong cl_bitfield;
typedef cl_bitfield cl_device_type;
typedef cl_uint cl_platform_info;
typedef cl_uint cl_device_info;
typedef cl_bitfield cl_device_fp_config;
typedef cl_uint cl_device_mem_cache_type;
typedef cl_uint cl_device_local_mem_type;
typedef cl_bitfield cl_device_exec_capabilities;
typedef cl_bitfield cl_command_queue_properties;
typedef intptr_t cl_context_properties;
typedef cl_uint cl_context_info;
typedef cl_uint cl_command_queue_info;
typedef cl_uint cl_channel_order;
typedef cl_uint cl_channel_type;
typedef cl_bitfield cl_mem_flags;
typedef cl_uint cl_mem_object_type;
typedef cl_uint cl_mem_info;
typedef cl_uint cl_image_info;
typedef cl_uint cl_buffer_create_type;
typedef cl_uint cl_addressing_mode;
typedef cl_uint cl_filter_mode;
typedef cl_uint cl_sampler_info;
typedef cl_bitfield cl_map_flags;
typedef cl_uint cl_program_info;
typedef cl_uint cl_program_build_info;
typedef cl_int cl_build_status;
typedef cl_uint cl_kernel_info;
typedef cl_uint cl_kernel_work_group_info;
typedef cl_uint cl_event_info;
typedef cl_uint cl_command_type;
typedef cl_uint cl_profiling_info;
typedef struct _cl_image_format {
cl_channel_order image_channel_order;
cl_channel_type image_channel_data_type;
} cl_image_format;
typedef struct _cl_buffer_region {
size_t origin;
size_t size;
} cl_buffer_region;
/******************************************************************************/
/* Error Codes */
#define CL_SUCCESS 0
#define CL_DEVICE_NOT_FOUND -1
#define CL_DEVICE_NOT_AVAILABLE -2
#define CL_COMPILER_NOT_AVAILABLE -3
#define CL_MEM_OBJECT_ALLOCATION_FAILURE -4
#define CL_OUT_OF_RESOURCES -5
#define CL_OUT_OF_HOST_MEMORY -6
#define CL_PROFILING_INFO_NOT_AVAILABLE -7
#define CL_MEM_COPY_OVERLAP -8
#define CL_IMAGE_FORMAT_MISMATCH -9
#define CL_IMAGE_FORMAT_NOT_SUPPORTED -10
#define CL_BUILD_PROGRAM_FAILURE -11
#define CL_MAP_FAILURE -12
#define CL_MISALIGNED_SUB_BUFFER_OFFSET -13
#define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
#define CL_INVALID_VALUE -30
#define CL_INVALID_DEVICE_TYPE -31
#define CL_INVALID_PLATFORM -32
#define CL_INVALID_DEVICE -33
#define CL_INVALID_CONTEXT -34
#define CL_INVALID_QUEUE_PROPERTIES -35
#define CL_INVALID_COMMAND_QUEUE -36
#define CL_INVALID_HOST_PTR -37
#define CL_INVALID_MEM_OBJECT -38
#define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39
#define CL_INVALID_IMAGE_SIZE -40
#define CL_INVALID_SAMPLER -41
#define CL_INVALID_BINARY -42
#define CL_INVALID_BUILD_OPTIONS -43
#define CL_INVALID_PROGRAM -44
#define CL_INVALID_PROGRAM_EXECUTABLE -45
#define CL_INVALID_KERNEL_NAME -46
#define CL_INVALID_KERNEL_DEFINITION -47
#define CL_INVALID_KERNEL -48
#define CL_INVALID_ARG_INDEX -49
#define CL_INVALID_ARG_VALUE -50
#define CL_INVALID_ARG_SIZE -51
#define CL_INVALID_KERNEL_ARGS -52
#define CL_INVALID_WORK_DIMENSION -53
#define CL_INVALID_WORK_GROUP_SIZE -54
#define CL_INVALID_WORK_ITEM_SIZE -55
#define CL_INVALID_GLOBAL_OFFSET -56
#define CL_INVALID_EVENT_WAIT_LIST -57
#define CL_INVALID_EVENT -58
#define CL_INVALID_OPERATION -59
#define CL_INVALID_GL_OBJECT -60
#define CL_INVALID_BUFFER_SIZE -61
#define CL_INVALID_MIP_LEVEL -62
#define CL_INVALID_GLOBAL_WORK_SIZE -63
#define CL_INVALID_PROPERTY -64
/* OpenCL Version */
#define CL_VERSION_1_0 1
#define CL_VERSION_1_1 1
/* cl_bool */
#define CL_FALSE 0
#define CL_TRUE 1
/* cl_platform_info */
#define CL_PLATFORM_PROFILE 0x0900
#define CL_PLATFORM_VERSION 0x0901
#define CL_PLATFORM_NAME 0x0902
#define CL_PLATFORM_VENDOR 0x0903
#define CL_PLATFORM_EXTENSIONS 0x0904
/* cl_device_type - bitfield */
#define CL_DEVICE_TYPE_DEFAULT (1 << 0)
#define CL_DEVICE_TYPE_CPU (1 << 1)
#define CL_DEVICE_TYPE_GPU (1 << 2)
#define CL_DEVICE_TYPE_ACCELERATOR (1 << 3)
#define CL_DEVICE_TYPE_ALL 0xFFFFFFFF
/* cl_device_info */
#define CL_DEVICE_TYPE 0x1000
#define CL_DEVICE_VENDOR_ID 0x1001
#define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
#define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003
#define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004
#define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B
#define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C
#define CL_DEVICE_ADDRESS_BITS 0x100D
#define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E
#define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F
#define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010
#define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011
#define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012
#define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013
#define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014
#define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015
#define CL_DEVICE_IMAGE_SUPPORT 0x1016
#define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017
#define CL_DEVICE_MAX_SAMPLERS 0x1018
#define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019
#define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A
#define CL_DEVICE_SINGLE_FP_CONFIG 0x101B
#define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C
#define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D
#define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E
#define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F
#define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020
#define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021
#define CL_DEVICE_LOCAL_MEM_TYPE 0x1022
#define CL_DEVICE_LOCAL_MEM_SIZE 0x1023
#define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024
#define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025
#define CL_DEVICE_ENDIAN_LITTLE 0x1026
#define CL_DEVICE_AVAILABLE 0x1027
#define CL_DEVICE_COMPILER_AVAILABLE 0x1028
#define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029
#define CL_DEVICE_QUEUE_PROPERTIES 0x102A
#define CL_DEVICE_NAME 0x102B
#define CL_DEVICE_VENDOR 0x102C
#define CL_DRIVER_VERSION 0x102D
#define CL_DEVICE_PROFILE 0x102E
#define CL_DEVICE_VERSION 0x102F
#define CL_DEVICE_EXTENSIONS 0x1030
#define CL_DEVICE_PLATFORM 0x1031
/* 0x1032 reserved for CL_DEVICE_DOUBLE_FP_CONFIG */
/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG 0x1039
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT 0x103A
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C
#define CL_DEVICE_OPENCL_C_VERSION 0x103D
/* cl_device_fp_config - bitfield */
#define CL_FP_DENORM (1 << 0)
#define CL_FP_INF_NAN (1 << 1)
#define CL_FP_ROUND_TO_NEAREST (1 << 2)
#define CL_FP_ROUND_TO_ZERO (1 << 3)
#define CL_FP_ROUND_TO_INF (1 << 4)
#define CL_FP_FMA (1 << 5)
#define CL_FP_SOFT_FLOAT (1 << 6)
/* cl_device_mem_cache_type */
#define CL_NONE 0x0
#define CL_READ_ONLY_CACHE 0x1
#define CL_READ_WRITE_CACHE 0x2
/* cl_device_local_mem_type */
#define CL_LOCAL 0x1
#define CL_GLOBAL 0x2
/* cl_device_exec_capabilities - bitfield */
#define CL_EXEC_KERNEL (1 << 0)
#define CL_EXEC_NATIVE_KERNEL (1 << 1)
/* cl_command_queue_properties - bitfield */
#define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0)
#define CL_QUEUE_PROFILING_ENABLE (1 << 1)
/* cl_context_info */
#define CL_CONTEXT_REFERENCE_COUNT 0x1080
#define CL_CONTEXT_DEVICES 0x1081
#define CL_CONTEXT_PROPERTIES 0x1082
#define CL_CONTEXT_NUM_DEVICES 0x1083
/* cl_context_info + cl_context_properties */
#define CL_CONTEXT_PLATFORM 0x1084
/* cl_command_queue_info */
#define CL_QUEUE_CONTEXT 0x1090
#define CL_QUEUE_DEVICE 0x1091
#define CL_QUEUE_REFERENCE_COUNT 0x1092
#define CL_QUEUE_PROPERTIES 0x1093
/* cl_mem_flags - bitfield */
#define CL_MEM_READ_WRITE (1 << 0)
#define CL_MEM_WRITE_ONLY (1 << 1)
#define CL_MEM_READ_ONLY (1 << 2)
#define CL_MEM_USE_HOST_PTR (1 << 3)
#define CL_MEM_ALLOC_HOST_PTR (1 << 4)
#define CL_MEM_COPY_HOST_PTR (1 << 5)
/* cl_channel_order */
#define CL_R 0x10B0
#define CL_A 0x10B1
#define CL_RG 0x10B2
#define CL_RA 0x10B3
#define CL_RGB 0x10B4
#define CL_RGBA 0x10B5
#define CL_BGRA 0x10B6
#define CL_ARGB 0x10B7
#define CL_INTENSITY 0x10B8
#define CL_LUMINANCE 0x10B9
#define CL_Rx 0x10BA
#define CL_RGx 0x10BB
#define CL_RGBx 0x10BC
/* cl_channel_type */
#define CL_SNORM_INT8 0x10D0
#define CL_SNORM_INT16 0x10D1
#define CL_UNORM_INT8 0x10D2
#define CL_UNORM_INT16 0x10D3
#define CL_UNORM_SHORT_565 0x10D4
#define CL_UNORM_SHORT_555 0x10D5
#define CL_UNORM_INT_101010 0x10D6
#define CL_SIGNED_INT8 0x10D7
#define CL_SIGNED_INT16 0x10D8
#define CL_SIGNED_INT32 0x10D9
#define CL_UNSIGNED_INT8 0x10DA
#define CL_UNSIGNED_INT16 0x10DB
#define CL_UNSIGNED_INT32 0x10DC
#define CL_HALF_FLOAT 0x10DD
#define CL_FLOAT 0x10DE
/* cl_mem_object_type */
#define CL_MEM_OBJECT_BUFFER 0x10F0
#define CL_MEM_OBJECT_IMAGE2D 0x10F1
#define CL_MEM_OBJECT_IMAGE3D 0x10F2
/* cl_mem_info */
#define CL_MEM_TYPE 0x1100
#define CL_MEM_FLAGS 0x1101
#define CL_MEM_SIZE 0x1102
#define CL_MEM_HOST_PTR 0x1103
#define CL_MEM_MAP_COUNT 0x1104
#define CL_MEM_REFERENCE_COUNT 0x1105
#define CL_MEM_CONTEXT 0x1106
#define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107
#define CL_MEM_OFFSET 0x1108
/* cl_image_info */
#define CL_IMAGE_FORMAT 0x1110
#define CL_IMAGE_ELEMENT_SIZE 0x1111
#define CL_IMAGE_ROW_PITCH 0x1112
#define CL_IMAGE_SLICE_PITCH 0x1113
#define CL_IMAGE_WIDTH 0x1114
#define CL_IMAGE_HEIGHT 0x1115
#define CL_IMAGE_DEPTH 0x1116
/* cl_addressing_mode */
#define CL_ADDRESS_NONE 0x1130
#define CL_ADDRESS_CLAMP_TO_EDGE 0x1131
#define CL_ADDRESS_CLAMP 0x1132
#define CL_ADDRESS_REPEAT 0x1133
#define CL_ADDRESS_MIRRORED_REPEAT 0x1134
/* cl_filter_mode */
#define CL_FILTER_NEAREST 0x1140
#define CL_FILTER_LINEAR 0x1141
/* cl_sampler_info */
#define CL_SAMPLER_REFERENCE_COUNT 0x1150
#define CL_SAMPLER_CONTEXT 0x1151
#define CL_SAMPLER_NORMALIZED_COORDS 0x1152
#define CL_SAMPLER_ADDRESSING_MODE 0x1153
#define CL_SAMPLER_FILTER_MODE 0x1154
/* cl_map_flags - bitfield */
#define CL_MAP_READ (1 << 0)
#define CL_MAP_WRITE (1 << 1)
/* cl_program_info */
#define CL_PROGRAM_REFERENCE_COUNT 0x1160
#define CL_PROGRAM_CONTEXT 0x1161
#define CL_PROGRAM_NUM_DEVICES 0x1162
#define CL_PROGRAM_DEVICES 0x1163
#define CL_PROGRAM_SOURCE 0x1164
#define CL_PROGRAM_BINARY_SIZES 0x1165
#define CL_PROGRAM_BINARIES 0x1166
/* cl_program_build_info */
#define CL_PROGRAM_BUILD_STATUS 0x1181
#define CL_PROGRAM_BUILD_OPTIONS 0x1182
#define CL_PROGRAM_BUILD_LOG 0x1183
/* cl_build_status */
#define CL_BUILD_SUCCESS 0
#define CL_BUILD_NONE -1
#define CL_BUILD_ERROR -2
#define CL_BUILD_IN_PROGRESS -3
/* cl_kernel_info */
#define CL_KERNEL_FUNCTION_NAME 0x1190
#define CL_KERNEL_NUM_ARGS 0x1191
#define CL_KERNEL_REFERENCE_COUNT 0x1192
#define CL_KERNEL_CONTEXT 0x1193
#define CL_KERNEL_PROGRAM 0x1194
/* cl_kernel_work_group_info */
#define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
#define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1
#define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
#define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
#define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4
/* cl_event_info */
#define CL_EVENT_COMMAND_QUEUE 0x11D0
#define CL_EVENT_COMMAND_TYPE 0x11D1
#define CL_EVENT_REFERENCE_COUNT 0x11D2
#define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3
#define CL_EVENT_CONTEXT 0x11D4
/* cl_command_type */
#define CL_COMMAND_NDRANGE_KERNEL 0x11F0
#define CL_COMMAND_TASK 0x11F1
#define CL_COMMAND_NATIVE_KERNEL 0x11F2
#define CL_COMMAND_READ_BUFFER 0x11F3
#define CL_COMMAND_WRITE_BUFFER 0x11F4
#define CL_COMMAND_COPY_BUFFER 0x11F5
#define CL_COMMAND_READ_IMAGE 0x11F6
#define CL_COMMAND_WRITE_IMAGE 0x11F7
#define CL_COMMAND_COPY_IMAGE 0x11F8
#define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9
#define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA
#define CL_COMMAND_MAP_BUFFER 0x11FB
#define CL_COMMAND_MAP_IMAGE 0x11FC
#define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD
#define CL_COMMAND_MARKER 0x11FE
#define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF
#define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200
#define CL_COMMAND_READ_BUFFER_RECT 0x1201
#define CL_COMMAND_WRITE_BUFFER_RECT 0x1202
#define CL_COMMAND_COPY_BUFFER_RECT 0x1203
#define CL_COMMAND_USER 0x1204
/* command execution status */
#define CL_COMPLETE 0x0
#define CL_RUNNING 0x1
#define CL_SUBMITTED 0x2
#define CL_QUEUED 0x3
/* cl_buffer_create_type */
#define CL_BUFFER_CREATE_TYPE_REGION 0x1220
/* cl_profiling_info */
#define CL_PROFILING_COMMAND_QUEUED 0x1280
#define CL_PROFILING_COMMAND_SUBMIT 0x1281
#define CL_PROFILING_COMMAND_START 0x1282
#define CL_PROFILING_COMMAND_END 0x1283
/********************************************************************************************************/
/* Platform API */
extern CL_API_ENTRY cl_int CL_API_CALL
clGetPlatformIDs(cl_uint /* num_entries */,
cl_platform_id * /* platforms */,
cl_uint * /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetPlatformInfo(cl_platform_id /* platform */,
cl_platform_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Device APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clGetDeviceIDs(cl_platform_id /* platform */,
cl_device_type /* device_type */,
cl_uint /* num_entries */,
cl_device_id * /* devices */,
cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetDeviceInfo(cl_device_id /* device */,
cl_device_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Context APIs */
extern CL_API_ENTRY cl_context CL_API_CALL
clCreateContext(const cl_context_properties * /* properties */,
cl_uint /* num_devices */,
const cl_device_id * /* devices */,
void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_context CL_API_CALL
clCreateContextFromType(const cl_context_properties * /* properties */,
cl_device_type /* device_type */,
void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *),
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetContextInfo(cl_context /* context */,
cl_context_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Command Queue APIs */
extern CL_API_ENTRY cl_command_queue CL_API_CALL
clCreateCommandQueue(cl_context /* context */,
cl_device_id /* device */,
cl_command_queue_properties /* properties */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetCommandQueueInfo(cl_command_queue /* command_queue */,
cl_command_queue_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1!
/*
* WARNING:
* This API introduces mutable state into the OpenCL implementation. It has been REMOVED
* to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the
* OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
* It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
*
* Software developers previously relying on this API are instructed to set the command queue
* properties when creating the queue, instead.
*/
extern CL_API_ENTRY cl_int CL_API_CALL
clSetCommandQueueProperty(cl_command_queue /* command_queue */,
cl_command_queue_properties /* properties */,
cl_bool /* enable */,
cl_command_queue_properties * /* old_properties */) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
#endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
/* Memory Object APIs */
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateBuffer(cl_context /* context */,
cl_mem_flags /* flags */,
size_t /* size */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateSubBuffer(cl_mem /* buffer */,
cl_mem_flags /* flags */,
cl_buffer_create_type /* buffer_create_type */,
const void * /* buffer_create_info */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateImage2D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_row_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateImage3D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_depth */,
size_t /* image_row_pitch */,
size_t /* image_slice_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetSupportedImageFormats(cl_context /* context */,
cl_mem_flags /* flags */,
cl_mem_object_type /* image_type */,
cl_uint /* num_entries */,
cl_image_format * /* image_formats */,
cl_uint * /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetMemObjectInfo(cl_mem /* memobj */,
cl_mem_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetImageInfo(cl_mem /* image */,
cl_image_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clSetMemObjectDestructorCallback( cl_mem /* memobj */,
void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
void * /*user_data */ ) CL_API_SUFFIX__VERSION_1_1;
/* Sampler APIs */
extern CL_API_ENTRY cl_sampler CL_API_CALL
clCreateSampler(cl_context /* context */,
cl_bool /* normalized_coords */,
cl_addressing_mode /* addressing_mode */,
cl_filter_mode /* filter_mode */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetSamplerInfo(cl_sampler /* sampler */,
cl_sampler_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Program Object APIs */
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithSource(cl_context /* context */,
cl_uint /* count */,
const char ** /* strings */,
const size_t * /* lengths */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithBinary(cl_context /* context */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const size_t * /* lengths */,
const unsigned char ** /* binaries */,
cl_int * /* binary_status */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clBuildProgram(cl_program /* program */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const char * /* options */,
void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
void * /* user_data */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetProgramInfo(cl_program /* program */,
cl_program_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetProgramBuildInfo(cl_program /* program */,
cl_device_id /* device */,
cl_program_build_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Kernel Object APIs */
extern CL_API_ENTRY cl_kernel CL_API_CALL
clCreateKernel(cl_program /* program */,
const char * /* kernel_name */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clCreateKernelsInProgram(cl_program /* program */,
cl_uint /* num_kernels */,
cl_kernel * /* kernels */,
cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clSetKernelArg(cl_kernel /* kernel */,
cl_uint /* arg_index */,
size_t /* arg_size */,
const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetKernelInfo(cl_kernel /* kernel */,
cl_kernel_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
cl_device_id /* device */,
cl_kernel_work_group_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Event Object APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clWaitForEvents(cl_uint /* num_events */,
const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetEventInfo(cl_event /* event */,
cl_event_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_event CL_API_CALL
clCreateUserEvent(cl_context /* context */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clSetUserEventStatus(cl_event /* event */,
cl_int /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clSetEventCallback( cl_event /* event */,
cl_int /* command_exec_callback_type */,
void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
void * /* user_data */) CL_API_SUFFIX__VERSION_1_1;
/* Profiling APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clGetEventProfilingInfo(cl_event /* event */,
cl_profiling_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Flush and Finish APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
/* Enqueued Commands APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReadBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_read */,
size_t /* offset */,
size_t /* cb */,
void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReadBufferRect(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_read */,
const size_t * /* buffer_origin */,
const size_t * /* host_origin */,
const size_t * /* region */,
size_t /* buffer_row_pitch */,
size_t /* buffer_slice_pitch */,
size_t /* host_row_pitch */,
size_t /* host_slice_pitch */,
void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_write */,
size_t /* offset */,
size_t /* cb */,
const void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWriteBufferRect(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_write */,
const size_t * /* buffer_origin */,
const size_t * /* host_origin */,
const size_t * /* region */,
size_t /* buffer_row_pitch */,
size_t /* buffer_slice_pitch */,
size_t /* host_row_pitch */,
size_t /* host_slice_pitch */,
const void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
cl_mem /* src_buffer */,
cl_mem /* dst_buffer */,
size_t /* src_offset */,
size_t /* dst_offset */,
size_t /* cb */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyBufferRect(cl_command_queue /* command_queue */,
cl_mem /* src_buffer */,
cl_mem /* dst_buffer */,
const size_t * /* src_origin */,
const size_t * /* dst_origin */,
const size_t * /* region */,
size_t /* src_row_pitch */,
size_t /* src_slice_pitch */,
size_t /* dst_row_pitch */,
size_t /* dst_slice_pitch */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReadImage(cl_command_queue /* command_queue */,
cl_mem /* image */,
cl_bool /* blocking_read */,
const size_t * /* origin[3] */,
const size_t * /* region[3] */,
size_t /* row_pitch */,
size_t /* slice_pitch */,
void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWriteImage(cl_command_queue /* command_queue */,
cl_mem /* image */,
cl_bool /* blocking_write */,
const size_t * /* origin[3] */,
const size_t * /* region[3] */,
size_t /* input_row_pitch */,
size_t /* input_slice_pitch */,
const void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyImage(cl_command_queue /* command_queue */,
cl_mem /* src_image */,
cl_mem /* dst_image */,
const size_t * /* src_origin[3] */,
const size_t * /* dst_origin[3] */,
const size_t * /* region[3] */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
cl_mem /* src_image */,
cl_mem /* dst_buffer */,
const size_t * /* src_origin[3] */,
const size_t * /* region[3] */,
size_t /* dst_offset */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
cl_mem /* src_buffer */,
cl_mem /* dst_image */,
size_t /* src_offset */,
const size_t * /* dst_origin[3] */,
const size_t * /* region[3] */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY void * CL_API_CALL
clEnqueueMapBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_map */,
cl_map_flags /* map_flags */,
size_t /* offset */,
size_t /* cb */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY void * CL_API_CALL
clEnqueueMapImage(cl_command_queue /* command_queue */,
cl_mem /* image */,
cl_bool /* blocking_map */,
cl_map_flags /* map_flags */,
const size_t * /* origin[3] */,
const size_t * /* region[3] */,
size_t * /* image_row_pitch */,
size_t * /* image_slice_pitch */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
cl_mem /* memobj */,
void * /* mapped_ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
cl_kernel /* kernel */,
cl_uint /* work_dim */,
const size_t * /* global_work_offset */,
const size_t * /* global_work_size */,
const size_t * /* local_work_size */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueTask(cl_command_queue /* command_queue */,
cl_kernel /* kernel */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueNativeKernel(cl_command_queue /* command_queue */,
void (*user_func)(void *),
void * /* args */,
size_t /* cb_args */,
cl_uint /* num_mem_objects */,
const cl_mem * /* mem_list */,
const void ** /* args_mem_loc */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueMarker(cl_command_queue /* command_queue */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
cl_uint /* num_events */,
const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
/* Extension function access
*
* Returns the extension function address for the given function name,
* or NULL if a valid function can not be found. The client must
* check to make sure the address is not NULL, before using or
* calling the returned function address.
*/
extern CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_H */

View File

@ -0,0 +1,126 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
#ifndef __OPENCL_CL_D3D10_H
#define __OPENCL_CL_D3D10_H
#include <d3d10.h>
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* cl_khr_d3d10_sharing */
#define cl_khr_d3d10_sharing 1
typedef cl_uint cl_d3d10_device_source_khr;
typedef cl_uint cl_d3d10_device_set_khr;
/******************************************************************************/
// Error Codes
#define CL_INVALID_D3D10_DEVICE_KHR -1002
#define CL_INVALID_D3D10_RESOURCE_KHR -1003
#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004
#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005
// cl_d3d10_device_source_nv
#define CL_D3D10_DEVICE_KHR 0x4010
#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
// cl_d3d10_device_set_nv
#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
// cl_context_info
#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014
#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
// cl_mem_info
#define CL_MEM_D3D10_RESOURCE_KHR 0x4015
// cl_image_info
#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
// cl_command_type
#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
cl_platform_id platform,
cl_d3d10_device_source_khr d3d_device_source,
void * d3d_object,
cl_d3d10_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture2D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture3D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
#ifdef __cplusplus
}
#endif
#endif // __OPENCL_CL_D3D10_H

View File

@ -0,0 +1,213 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
/* $Revision: 11928 $ on $Date: 2010-07-13 09:04:56 -0700 (Tue, 13 Jul 2010) $ */
/* cl_ext.h contains OpenCL extensions which don't have external */
/* (OpenGL, D3D) dependencies. */
#ifndef __CL_EXT_H
#define __CL_EXT_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __APPLE__
#include <OpenCL/cl.h>
#include <AvailabilityMacros.h>
#else
#include <CL/cl.h>
#endif
/* cl_khr_fp64 extension - no extension #define since it has no functions */
#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
/* cl_khr_fp16 extension - no extension #define since it has no functions */
#define CL_DEVICE_HALF_FP_CONFIG 0x1033
/* Memory object destruction
*
* Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR
*
* Registers a user callback function that will be called when the memory object is deleted and its resources
* freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback
* stack associated with memobj. The registered user callback functions are called in the reverse order in
* which they were registered. The user callback functions are called and then the memory object is deleted
* and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be
* notified when the memory referenced by host_ptr, specified when the memory object is created and used as
* the storage bits for the memory object, can be reused or freed.
*
* The application may not call CL api's with the cl_mem object passed to the pfn_notify.
*
* Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
* before using.
*/
#define cl_APPLE_SetMemObjectDestructor 1
cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem /* memobj */,
void (* /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
void * /*user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
/* Context Logging Functions
*
* The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext().
* Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
* before using.
*
* clLogMessagesToSystemLog fowards on all log messages to the Apple System Logger
*/
#define cl_APPLE_ContextLoggingFunctions 1
extern void CL_API_ENTRY clLogMessagesToSystemLogAPPLE( const char * /* errstr */,
const void * /* private_info */,
size_t /* cb */,
void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
/* clLogMessagesToStdout sends all log messages to the file descriptor stdout */
extern void CL_API_ENTRY clLogMessagesToStdoutAPPLE( const char * /* errstr */,
const void * /* private_info */,
size_t /* cb */,
void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
/* clLogMessagesToStderr sends all log messages to the file descriptor stderr */
extern void CL_API_ENTRY clLogMessagesToStderrAPPLE( const char * /* errstr */,
const void * /* private_info */,
size_t /* cb */,
void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
/************************
* cl_khr_icd extension *
************************/
#define cl_khr_icd 1
/* cl_platform_info */
#define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920
/* Additional Error Codes */
#define CL_PLATFORM_NOT_FOUND_KHR -1001
extern CL_API_ENTRY cl_int CL_API_CALL
clIcdGetPlatformIDsKHR(cl_uint /* num_entries */,
cl_platform_id * /* platforms */,
cl_uint * /* num_platforms */);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
cl_uint /* num_entries */,
cl_platform_id * /* platforms */,
cl_uint * /* num_platforms */);
/******************************************
* cl_nv_device_attribute_query extension *
******************************************/
/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */
#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000
#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001
#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002
#define CL_DEVICE_WARP_SIZE_NV 0x4003
#define CL_DEVICE_GPU_OVERLAP_NV 0x4004
#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005
#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006
/*********************************
* cl_amd_device_attribute_query *
*********************************/
#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036
#ifdef CL_VERSION_1_1
/***********************************
* cl_ext_device_fission extension *
***********************************/
#define cl_ext_device_fission 1
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int
(CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int
(CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
typedef cl_ulong cl_device_partition_property_ext;
extern CL_API_ENTRY cl_int CL_API_CALL
clCreateSubDevicesEXT( cl_device_id /*in_device*/,
const cl_device_partition_property_ext * /* properties */,
cl_uint /*num_entries*/,
cl_device_id * /*out_devices*/,
cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int
( CL_API_CALL * clCreateSubDevicesEXT_fn)( cl_device_id /*in_device*/,
const cl_device_partition_property_ext * /* properties */,
cl_uint /*num_entries*/,
cl_device_id * /*out_devices*/,
cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
/* cl_device_partition_property_ext */
#define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050
#define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051
#define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052
#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053
/* clDeviceGetInfo selectors */
#define CL_DEVICE_PARENT_DEVICE_EXT 0x4054
#define CL_DEVICE_PARTITION_TYPES_EXT 0x4055
#define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056
#define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057
#define CL_DEVICE_PARTITION_STYLE_EXT 0x4058
/* error codes */
#define CL_DEVICE_PARTITION_FAILED_EXT -1057
#define CL_INVALID_PARTITION_COUNT_EXT -1058
#define CL_INVALID_PARTITION_NAME_EXT -1059
/* CL_AFFINITY_DOMAINs */
#define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1
#define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2
#define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3
#define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4
#define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10
#define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100
/* cl_device_partition_property_ext list terminators */
#define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0)
#define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0)
#define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
#endif /* CL_VERSION_1_1 */
#ifdef __cplusplus
}
#endif
#endif /* __CL_EXT_H */

View File

@ -0,0 +1,155 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
/*
* cl_gl.h contains Khronos-approved (KHR) OpenCL extensions which have
* OpenGL dependencies. The application is responsible for #including
* OpenGL or OpenGL ES headers before #including cl_gl.h.
*/
#ifndef __OPENCL_CL_GL_H
#define __OPENCL_CL_GL_H
#ifdef __APPLE__
#include <OpenCL/cl.h>
#include <OpenGL/CGLDevice.h>
#else
#include <CL/cl.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef cl_uint cl_gl_object_type;
typedef cl_uint cl_gl_texture_info;
typedef cl_uint cl_gl_platform_info;
typedef struct __GLsync *cl_GLsync;
/* cl_gl_object_type */
#define CL_GL_OBJECT_BUFFER 0x2000
#define CL_GL_OBJECT_TEXTURE2D 0x2001
#define CL_GL_OBJECT_TEXTURE3D 0x2002
#define CL_GL_OBJECT_RENDERBUFFER 0x2003
/* cl_gl_texture_info */
#define CL_GL_TEXTURE_TARGET 0x2004
#define CL_GL_MIPMAP_LEVEL 0x2005
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLBuffer(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLuint /* bufobj */,
int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLTexture2D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLTexture3D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLRenderbuffer(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLuint /* renderbuffer */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLObjectInfo(cl_mem /* memobj */,
cl_gl_object_type * /* gl_object_type */,
cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLTextureInfo(cl_mem /* memobj */,
cl_gl_texture_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */,
cl_uint /* num_objects */,
const cl_mem * /* mem_objects */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
cl_uint /* num_objects */,
const cl_mem * /* mem_objects */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
/* cl_khr_gl_sharing extension */
#define cl_khr_gl_sharing 1
typedef cl_uint cl_gl_context_info;
/* Additional Error Codes */
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
/* cl_gl_context_info */
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
/* Additional cl_context_properties */
#define CL_GL_CONTEXT_KHR 0x2008
#define CL_EGL_DISPLAY_KHR 0x2009
#define CL_GLX_DISPLAY_KHR 0x200A
#define CL_WGL_HDC_KHR 0x200B
#define CL_CGL_SHAREGROUP_KHR 0x200C
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLContextInfoKHR(const cl_context_properties * /* properties */,
cl_gl_context_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
const cl_context_properties * properties,
cl_gl_context_info param_name,
size_t param_value_size,
void * param_value,
size_t * param_value_size_ret);
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_GL_H */

View File

@ -0,0 +1,69 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
/* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */
/* OpenGL dependencies. */
#ifndef __OPENCL_CL_GL_EXT_H
#define __OPENCL_CL_GL_EXT_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __APPLE__
#include <OpenCL/cl_gl.h>
#else
#include <CL/cl_gl.h>
#endif
/*
* For each extension, follow this template
* /* cl_VEN_extname extension */
/* #define cl_VEN_extname 1
* ... define new types, if any
* ... define new tokens, if any
* ... define new APIs, if any
*
* If you need GLtypes here, mirror them with a cl_GLtype, rather than including a GL header
* This allows us to avoid having to decide whether to include GL headers or GLES here.
*/
/*
* cl_khr_gl_event extension
* See section 9.9 in the OpenCL 1.1 spec for more information
*/
#define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D
extern CL_API_ENTRY cl_event CL_API_CALL
clCreateEventFromGLsyncKHR(cl_context /* context */,
cl_GLsync /* cl_GLsync */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_GL_EXT_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,329 @@
/* -*- mode: c; tab-width: 8; -*- */
/* vi: set sw=4 ts=8: */
/* Reference version of egl.h for EGL 1.4.
* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
*/
/*
** Copyright (c) 2007-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#ifndef __egl_h_
#define __egl_h_
/* All platform-dependent types and macro boilerplate (such as EGLAPI
* and EGLAPIENTRY) should go in eglplatform.h.
*/
#include <EGL/eglplatform.h>
#ifdef __cplusplus
extern "C" {
#endif
/* EGL Types */
/* EGLint is defined in eglplatform.h */
typedef unsigned int EGLBoolean;
typedef unsigned int EGLenum;
typedef void *EGLConfig;
typedef void *EGLContext;
typedef void *EGLDisplay;
typedef void *EGLSurface;
typedef void *EGLClientBuffer;
/* EGL Versioning */
#define EGL_VERSION_1_0 1
#define EGL_VERSION_1_1 1
#define EGL_VERSION_1_2 1
#define EGL_VERSION_1_3 1
#define EGL_VERSION_1_4 1
/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
* enums are assigned unique values starting at 0x3000.
*/
/* EGL aliases */
#define EGL_FALSE 0
#define EGL_TRUE 1
/* Out-of-band handle values */
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
#define EGL_NO_CONTEXT ((EGLContext)0)
#define EGL_NO_DISPLAY ((EGLDisplay)0)
#define EGL_NO_SURFACE ((EGLSurface)0)
/* Out-of-band attribute value */
#define EGL_DONT_CARE ((EGLint)-1)
/* Errors / GetError return values */
#define EGL_SUCCESS 0x3000
#define EGL_NOT_INITIALIZED 0x3001
#define EGL_BAD_ACCESS 0x3002
#define EGL_BAD_ALLOC 0x3003
#define EGL_BAD_ATTRIBUTE 0x3004
#define EGL_BAD_CONFIG 0x3005
#define EGL_BAD_CONTEXT 0x3006
#define EGL_BAD_CURRENT_SURFACE 0x3007
#define EGL_BAD_DISPLAY 0x3008
#define EGL_BAD_MATCH 0x3009
#define EGL_BAD_NATIVE_PIXMAP 0x300A
#define EGL_BAD_NATIVE_WINDOW 0x300B
#define EGL_BAD_PARAMETER 0x300C
#define EGL_BAD_SURFACE 0x300D
#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
/* Reserved 0x300F-0x301F for additional errors */
/* Config attributes */
#define EGL_BUFFER_SIZE 0x3020
#define EGL_ALPHA_SIZE 0x3021
#define EGL_BLUE_SIZE 0x3022
#define EGL_GREEN_SIZE 0x3023
#define EGL_RED_SIZE 0x3024
#define EGL_DEPTH_SIZE 0x3025
#define EGL_STENCIL_SIZE 0x3026
#define EGL_CONFIG_CAVEAT 0x3027
#define EGL_CONFIG_ID 0x3028
#define EGL_LEVEL 0x3029
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
#define EGL_MAX_PBUFFER_PIXELS 0x302B
#define EGL_MAX_PBUFFER_WIDTH 0x302C
#define EGL_NATIVE_RENDERABLE 0x302D
#define EGL_NATIVE_VISUAL_ID 0x302E
#define EGL_NATIVE_VISUAL_TYPE 0x302F
#define EGL_SAMPLES 0x3031
#define EGL_SAMPLE_BUFFERS 0x3032
#define EGL_SURFACE_TYPE 0x3033
#define EGL_TRANSPARENT_TYPE 0x3034
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
#define EGL_TRANSPARENT_RED_VALUE 0x3037
#define EGL_NONE 0x3038 /* Attrib list terminator */
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
#define EGL_MIN_SWAP_INTERVAL 0x303B
#define EGL_MAX_SWAP_INTERVAL 0x303C
#define EGL_LUMINANCE_SIZE 0x303D
#define EGL_ALPHA_MASK_SIZE 0x303E
#define EGL_COLOR_BUFFER_TYPE 0x303F
#define EGL_RENDERABLE_TYPE 0x3040
#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
#define EGL_CONFORMANT 0x3042
/* Reserved 0x3041-0x304F for additional config attributes */
/* Config attribute values */
#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
/* More config attribute values, for EGL_TEXTURE_FORMAT */
#define EGL_NO_TEXTURE 0x305C
#define EGL_TEXTURE_RGB 0x305D
#define EGL_TEXTURE_RGBA 0x305E
#define EGL_TEXTURE_2D 0x305F
/* Config attribute mask bits */
#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
/* QueryString targets */
#define EGL_VENDOR 0x3053
#define EGL_VERSION 0x3054
#define EGL_EXTENSIONS 0x3055
#define EGL_CLIENT_APIS 0x308D
/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
#define EGL_HEIGHT 0x3056
#define EGL_WIDTH 0x3057
#define EGL_LARGEST_PBUFFER 0x3058
#define EGL_TEXTURE_FORMAT 0x3080
#define EGL_TEXTURE_TARGET 0x3081
#define EGL_MIPMAP_TEXTURE 0x3082
#define EGL_MIPMAP_LEVEL 0x3083
#define EGL_RENDER_BUFFER 0x3086
#define EGL_VG_COLORSPACE 0x3087
#define EGL_VG_ALPHA_FORMAT 0x3088
#define EGL_HORIZONTAL_RESOLUTION 0x3090
#define EGL_VERTICAL_RESOLUTION 0x3091
#define EGL_PIXEL_ASPECT_RATIO 0x3092
#define EGL_SWAP_BEHAVIOR 0x3093
#define EGL_MULTISAMPLE_RESOLVE 0x3099
/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
#define EGL_BACK_BUFFER 0x3084
#define EGL_SINGLE_BUFFER 0x3085
/* OpenVG color spaces */
#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
/* OpenVG alpha formats */
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
/* Constant scale factor by which fractional display resolutions &
* aspect ratio are scaled when queried as integer values.
*/
#define EGL_DISPLAY_SCALING 10000
/* Unknown display resolution/aspect ratio */
#define EGL_UNKNOWN ((EGLint)-1)
/* Back buffer swap behaviors */
#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
/* CreatePbufferFromClientBuffer buffer types */
#define EGL_OPENVG_IMAGE 0x3096
/* QueryContext targets */
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
/* CreateContext attributes */
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
/* Multisample resolution behaviors */
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
/* BindAPI/QueryAPI targets */
#define EGL_OPENGL_ES_API 0x30A0
#define EGL_OPENVG_API 0x30A1
#define EGL_OPENGL_API 0x30A2
/* GetCurrentSurface targets */
#define EGL_DRAW 0x3059
#define EGL_READ 0x305A
/* WaitNative engines */
#define EGL_CORE_NATIVE_ENGINE 0x305B
/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
#define EGL_COLORSPACE EGL_VG_COLORSPACE
#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
/* EGL extensions must request enum blocks from the Khronos
* API Registrar, who maintains the enumerant registry. Submit
* a bug in Khronos Bugzilla against task "Registry".
*/
/* EGL Functions */
EGLAPI EGLint EGLAPIENTRY eglGetError(void);
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
EGLint config_size, EGLint *num_config);
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
EGLConfig *configs, EGLint config_size,
EGLint *num_config);
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
EGLint attribute, EGLint *value);
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
EGLNativeWindowType win,
const EGLint *attrib_list);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
const EGLint *attrib_list);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
EGLNativePixmapType pixmap,
const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
EGLint attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
EGLConfig config, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
EGLint attribute, EGLint value);
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
EGLContext share_context,
const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
EGLSurface read, EGLContext ctx);
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
EGLint attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
EGLNativePixmapType target);
/* This is a generic function pointer type, whose name indicates it must
* be cast to the proper type *and calling convention* before use.
*/
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
/* Now, define eglGetProcAddress using the generic function ptr. type */
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
eglGetProcAddress(const char *procname);
#ifdef __cplusplus
}
#endif
#endif /* __egl_h_ */

View File

@ -0,0 +1,230 @@
#ifndef __eglext_h_
#define __eglext_h_
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <EGL/eglplatform.h>
/*************************************************************/
/* Header file version number */
/* Current version at http://www.khronos.org/registry/egl/ */
/* $Revision: 11249 $ on $Date: 2010-05-05 09:54:28 -0700 (Wed, 05 May 2010) $ */
#define EGL_EGLEXT_VERSION 5
#ifndef EGL_KHR_config_attribs
#define EGL_KHR_config_attribs 1
#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
#endif
#ifndef EGL_KHR_lock_surface
#define EGL_KHR_lock_surface 1
#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
#endif
#ifndef EGL_KHR_image
#define EGL_KHR_image 1
#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
typedef void *EGLImageKHR;
#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
#endif
#ifndef EGL_KHR_vg_parent_image
#define EGL_KHR_vg_parent_image 1
#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
#endif
#ifndef EGL_KHR_gl_texture_2D_image
#define EGL_KHR_gl_texture_2D_image 1
#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
#endif
#ifndef EGL_KHR_gl_texture_cubemap_image
#define EGL_KHR_gl_texture_cubemap_image 1
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
#endif
#ifndef EGL_KHR_gl_texture_3D_image
#define EGL_KHR_gl_texture_3D_image 1
#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
#endif
#ifndef EGL_KHR_gl_renderbuffer_image
#define EGL_KHR_gl_renderbuffer_image 1
#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
#endif
#ifndef EGL_KHR_reusable_sync
#define EGL_KHR_reusable_sync 1
typedef void* EGLSyncKHR;
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
#define EGL_SYNC_STATUS_KHR 0x30F1
#define EGL_SIGNALED_KHR 0x30F2
#define EGL_UNSIGNALED_KHR 0x30F3
#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
#define EGL_CONDITION_SATISFIED_KHR 0x30F6
#define EGL_SYNC_TYPE_KHR 0x30F7
#define EGL_SYNC_REUSABLE_KHR 0x30FA
#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */
#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
#endif
#ifndef EGL_KHR_image_base
#define EGL_KHR_image_base 1
/* Most interfaces defined by EGL_KHR_image_pixmap above */
#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */
#endif
#ifndef EGL_KHR_image_pixmap
#define EGL_KHR_image_pixmap 1
/* Interfaces defined by EGL_KHR_image above */
#endif
#ifndef EGL_IMG_context_priority
#define EGL_IMG_context_priority 1
#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
#endif
#ifndef EGL_NV_coverage_sample
#define EGL_NV_coverage_sample 1
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
#endif
#ifndef EGL_NV_depth_nonlinear
#define EGL_NV_depth_nonlinear 1
#define EGL_DEPTH_ENCODING_NV 0x30E2
#define EGL_DEPTH_ENCODING_NONE_NV 0
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
#endif
#ifndef EGL_NV_sync
#define EGL_NV_sync 1
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
#define EGL_SYNC_STATUS_NV 0x30E7
#define EGL_SIGNALED_NV 0x30E8
#define EGL_UNSIGNALED_NV 0x30E9
#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
#define EGL_ALREADY_SIGNALED_NV 0x30EA
#define EGL_TIMEOUT_EXPIRED_NV 0x30EB
#define EGL_CONDITION_SATISFIED_NV 0x30EC
#define EGL_SYNC_TYPE_NV 0x30ED
#define EGL_SYNC_CONDITION_NV 0x30EE
#define EGL_SYNC_FENCE_NV 0x30EF
#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
typedef void* EGLSyncNV;
typedef unsigned long long EGLTimeNV;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
EGLBoolean eglFenceNV (EGLSyncNV sync);
EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
#endif
#ifndef EGL_KHR_fence_sync
#define EGL_KHR_fence_sync 1
/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
#define EGL_SYNC_CONDITION_KHR 0x30F8
#define EGL_SYNC_FENCE_KHR 0x30F9
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,110 @@
#ifndef __eglplatform_h_
#define __eglplatform_h_
/*
** Copyright (c) 2007-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Platform-specific types and definitions for egl.h
* $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "EGL" component "Registry".
*/
#include <KHR/khrplatform.h>
/* Macros used in EGL function prototype declarations.
*
* EGL functions should be prototyped as:
*
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
*
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
*/
#ifndef EGLAPI
#define EGLAPI KHRONOS_APICALL
#endif
#ifndef EGLAPIENTRY
#define EGLAPIENTRY KHRONOS_APIENTRY
#endif
#define EGLAPIENTRYP EGLAPIENTRY*
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
* are aliases of window-system-dependent types, such as X Display * or
* Windows Device Context. They must be defined in platform-specific
* code below. The EGL-prefixed versions of Native*Type are the same
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
*/
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
typedef HWND EGLNativeWindowType;
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
typedef int EGLNativeDisplayType;
typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
#elif defined(__unix__)
/* X11 (tentative) */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
typedef Display *EGLNativeDisplayType;
typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType;
#else
#error "Platform not recognized"
#endif
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
typedef EGLNativeDisplayType NativeDisplayType;
typedef EGLNativePixmapType NativePixmapType;
typedef EGLNativeWindowType NativeWindowType;
/* Define EGLint. This must be a signed integral type large enough to contain
* all legal attribute names and values passed into and out of EGL, whether
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
* handle, or other. While in general a 32-bit integer will suffice, if
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
* integer type.
*/
typedef khronos_int32_t EGLint;
#endif /* __eglplatform_h */

View File

@ -0,0 +1,621 @@
#ifndef __gl2_h_
#define __gl2_h_
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
#include <GLES2/gl2platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/*-------------------------------------------------------------------------
* Data type definitions
*-----------------------------------------------------------------------*/
typedef void GLvoid;
typedef char GLchar;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef khronos_int8_t GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef khronos_float_t GLfloat;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
/* GL types for handling large vertex buffer objects */
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
/* OpenGL ES core versions */
#define GL_ES_VERSION_2_0 1
/* ClearBufferMask */
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_COLOR_BUFFER_BIT 0x00004000
/* Boolean */
#define GL_FALSE 0
#define GL_TRUE 1
/* BeginMode */
#define GL_POINTS 0x0000
#define GL_LINES 0x0001
#define GL_LINE_LOOP 0x0002
#define GL_LINE_STRIP 0x0003
#define GL_TRIANGLES 0x0004
#define GL_TRIANGLE_STRIP 0x0005
#define GL_TRIANGLE_FAN 0x0006
/* AlphaFunction (not supported in ES20) */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* BlendingFactorDest */
#define GL_ZERO 0
#define GL_ONE 1
#define GL_SRC_COLOR 0x0300
#define GL_ONE_MINUS_SRC_COLOR 0x0301
#define GL_SRC_ALPHA 0x0302
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_DST_ALPHA 0x0304
#define GL_ONE_MINUS_DST_ALPHA 0x0305
/* BlendingFactorSrc */
/* GL_ZERO */
/* GL_ONE */
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
/* BlendEquationSeparate */
#define GL_FUNC_ADD 0x8006
#define GL_BLEND_EQUATION 0x8009
#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
#define GL_BLEND_EQUATION_ALPHA 0x883D
/* BlendSubtract */
#define GL_FUNC_SUBTRACT 0x800A
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
/* Separate Blend Functions */
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
#define GL_BLEND_SRC_ALPHA 0x80CB
#define GL_CONSTANT_COLOR 0x8001
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
#define GL_CONSTANT_ALPHA 0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
#define GL_BLEND_COLOR 0x8005
/* Buffer Objects */
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_STREAM_DRAW 0x88E0
#define GL_STATIC_DRAW 0x88E4
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
/* CullFaceMode */
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_FRONT_AND_BACK 0x0408
/* DepthFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* EnableCap */
#define GL_TEXTURE_2D 0x0DE1
#define GL_CULL_FACE 0x0B44
#define GL_BLEND 0x0BE2
#define GL_DITHER 0x0BD0
#define GL_STENCIL_TEST 0x0B90
#define GL_DEPTH_TEST 0x0B71
#define GL_SCISSOR_TEST 0x0C11
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_COVERAGE 0x80A0
/* ErrorCode */
#define GL_NO_ERROR 0
#define GL_INVALID_ENUM 0x0500
#define GL_INVALID_VALUE 0x0501
#define GL_INVALID_OPERATION 0x0502
#define GL_OUT_OF_MEMORY 0x0505
/* FrontFaceDirection */
#define GL_CW 0x0900
#define GL_CCW 0x0901
/* GetPName */
#define GL_LINE_WIDTH 0x0B21
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
#define GL_CULL_FACE_MODE 0x0B45
#define GL_FRONT_FACE 0x0B46
#define GL_DEPTH_RANGE 0x0B70
#define GL_DEPTH_WRITEMASK 0x0B72
#define GL_DEPTH_CLEAR_VALUE 0x0B73
#define GL_DEPTH_FUNC 0x0B74
#define GL_STENCIL_CLEAR_VALUE 0x0B91
#define GL_STENCIL_FUNC 0x0B92
#define GL_STENCIL_FAIL 0x0B94
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
#define GL_STENCIL_REF 0x0B97
#define GL_STENCIL_VALUE_MASK 0x0B93
#define GL_STENCIL_WRITEMASK 0x0B98
#define GL_STENCIL_BACK_FUNC 0x8800
#define GL_STENCIL_BACK_FAIL 0x8801
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
#define GL_STENCIL_BACK_REF 0x8CA3
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
#define GL_VIEWPORT 0x0BA2
#define GL_SCISSOR_BOX 0x0C10
/* GL_SCISSOR_TEST */
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_COLOR_WRITEMASK 0x0C23
#define GL_UNPACK_ALIGNMENT 0x0CF5
#define GL_PACK_ALIGNMENT 0x0D05
#define GL_MAX_TEXTURE_SIZE 0x0D33
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
#define GL_SUBPIXEL_BITS 0x0D50
#define GL_RED_BITS 0x0D52
#define GL_GREEN_BITS 0x0D53
#define GL_BLUE_BITS 0x0D54
#define GL_ALPHA_BITS 0x0D55
#define GL_DEPTH_BITS 0x0D56
#define GL_STENCIL_BITS 0x0D57
#define GL_POLYGON_OFFSET_UNITS 0x2A00
/* GL_POLYGON_OFFSET_FILL */
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_SAMPLE_BUFFERS 0x80A8
#define GL_SAMPLES 0x80A9
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
/* HintMode */
#define GL_DONT_CARE 0x1100
#define GL_FASTEST 0x1101
#define GL_NICEST 0x1102
/* HintTarget */
#define GL_GENERATE_MIPMAP_HINT 0x8192
/* DataType */
#define GL_BYTE 0x1400
#define GL_UNSIGNED_BYTE 0x1401
#define GL_SHORT 0x1402
#define GL_UNSIGNED_SHORT 0x1403
#define GL_INT 0x1404
#define GL_UNSIGNED_INT 0x1405
#define GL_FLOAT 0x1406
#define GL_FIXED 0x140C
/* PixelFormat */
#define GL_DEPTH_COMPONENT 0x1902
#define GL_ALPHA 0x1906
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
#define GL_LUMINANCE 0x1909
#define GL_LUMINANCE_ALPHA 0x190A
/* PixelType */
/* GL_UNSIGNED_BYTE */
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
/* Shaders */
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_VERTEX_SHADER 0x8B31
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GL_MAX_VARYING_VECTORS 0x8DFC
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
#define GL_SHADER_TYPE 0x8B4F
#define GL_DELETE_STATUS 0x8B80
#define GL_LINK_STATUS 0x8B82
#define GL_VALIDATE_STATUS 0x8B83
#define GL_ATTACHED_SHADERS 0x8B85
#define GL_ACTIVE_UNIFORMS 0x8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_CURRENT_PROGRAM 0x8B8D
/* StencilFunction */
#define GL_NEVER 0x0200
#define GL_LESS 0x0201
#define GL_EQUAL 0x0202
#define GL_LEQUAL 0x0203
#define GL_GREATER 0x0204
#define GL_NOTEQUAL 0x0205
#define GL_GEQUAL 0x0206
#define GL_ALWAYS 0x0207
/* StencilOp */
/* GL_ZERO */
#define GL_KEEP 0x1E00
#define GL_REPLACE 0x1E01
#define GL_INCR 0x1E02
#define GL_DECR 0x1E03
#define GL_INVERT 0x150A
#define GL_INCR_WRAP 0x8507
#define GL_DECR_WRAP 0x8508
/* StringName */
#define GL_VENDOR 0x1F00
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
/* TextureMagFilter */
#define GL_NEAREST 0x2600
#define GL_LINEAR 0x2601
/* TextureMinFilter */
/* GL_NEAREST */
/* GL_LINEAR */
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
/* TextureParameterName */
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
/* TextureTarget */
/* GL_TEXTURE_2D */
#define GL_TEXTURE 0x1702
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
/* TextureUnit */
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
#define GL_TEXTURE3 0x84C3
#define GL_TEXTURE4 0x84C4
#define GL_TEXTURE5 0x84C5
#define GL_TEXTURE6 0x84C6
#define GL_TEXTURE7 0x84C7
#define GL_TEXTURE8 0x84C8
#define GL_TEXTURE9 0x84C9
#define GL_TEXTURE10 0x84CA
#define GL_TEXTURE11 0x84CB
#define GL_TEXTURE12 0x84CC
#define GL_TEXTURE13 0x84CD
#define GL_TEXTURE14 0x84CE
#define GL_TEXTURE15 0x84CF
#define GL_TEXTURE16 0x84D0
#define GL_TEXTURE17 0x84D1
#define GL_TEXTURE18 0x84D2
#define GL_TEXTURE19 0x84D3
#define GL_TEXTURE20 0x84D4
#define GL_TEXTURE21 0x84D5
#define GL_TEXTURE22 0x84D6
#define GL_TEXTURE23 0x84D7
#define GL_TEXTURE24 0x84D8
#define GL_TEXTURE25 0x84D9
#define GL_TEXTURE26 0x84DA
#define GL_TEXTURE27 0x84DB
#define GL_TEXTURE28 0x84DC
#define GL_TEXTURE29 0x84DD
#define GL_TEXTURE30 0x84DE
#define GL_TEXTURE31 0x84DF
#define GL_ACTIVE_TEXTURE 0x84E0
/* TextureWrapMode */
#define GL_REPEAT 0x2901
#define GL_CLAMP_TO_EDGE 0x812F
#define GL_MIRRORED_REPEAT 0x8370
/* Uniform Types */
#define GL_FLOAT_VEC2 0x8B50
#define GL_FLOAT_VEC3 0x8B51
#define GL_FLOAT_VEC4 0x8B52
#define GL_INT_VEC2 0x8B53
#define GL_INT_VEC3 0x8B54
#define GL_INT_VEC4 0x8B55
#define GL_BOOL 0x8B56
#define GL_BOOL_VEC2 0x8B57
#define GL_BOOL_VEC3 0x8B58
#define GL_BOOL_VEC4 0x8B59
#define GL_FLOAT_MAT2 0x8B5A
#define GL_FLOAT_MAT3 0x8B5B
#define GL_FLOAT_MAT4 0x8B5C
#define GL_SAMPLER_2D 0x8B5E
#define GL_SAMPLER_CUBE 0x8B60
/* Vertex Arrays */
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
/* Read Format */
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
/* Shader Source */
#define GL_COMPILE_STATUS 0x8B81
#define GL_INFO_LOG_LENGTH 0x8B84
#define GL_SHADER_SOURCE_LENGTH 0x8B88
#define GL_SHADER_COMPILER 0x8DFA
/* Shader Binary */
#define GL_SHADER_BINARY_FORMATS 0x8DF8
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
/* Shader Precision-Specified Types */
#define GL_LOW_FLOAT 0x8DF0
#define GL_MEDIUM_FLOAT 0x8DF1
#define GL_HIGH_FLOAT 0x8DF2
#define GL_LOW_INT 0x8DF3
#define GL_MEDIUM_INT 0x8DF4
#define GL_HIGH_INT 0x8DF5
/* Framebuffer Object. */
#define GL_FRAMEBUFFER 0x8D40
#define GL_RENDERBUFFER 0x8D41
#define GL_RGBA4 0x8056
#define GL_RGB5_A1 0x8057
#define GL_RGB565 0x8D62
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_STENCIL_INDEX 0x1901
#define GL_STENCIL_INDEX8 0x8D48
#define GL_RENDERBUFFER_WIDTH 0x8D42
#define GL_RENDERBUFFER_HEIGHT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_NONE 0
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_FRAMEBUFFER_BINDING 0x8CA6
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
/*-------------------------------------------------------------------------
* GL core functions.
*-----------------------------------------------------------------------*/
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glFinish (void);
GL_APICALL void GL_APIENTRY glFlush (void);
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
#ifdef __cplusplus
}
#endif
#endif /* __gl2_h_ */

View File

@ -0,0 +1,803 @@
#ifndef __gl2ext_h_
#define __gl2ext_h_
/* $Revision: 10969 $ on $Date:: 2010-04-09 02:27:15 -0700 #$ */
#ifdef __cplusplus
extern "C" {
#endif
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
#ifndef GL_APIENTRYP
# define GL_APIENTRYP GL_APIENTRY*
#endif
/*------------------------------------------------------------------------*
* OES extension tokens
*------------------------------------------------------------------------*/
/* GL_OES_compressed_ETC1_RGB8_texture */
#ifndef GL_OES_compressed_ETC1_RGB8_texture
#define GL_ETC1_RGB8_OES 0x8D64
#endif
/* GL_OES_compressed_paletted_texture */
#ifndef GL_OES_compressed_paletted_texture
#define GL_PALETTE4_RGB8_OES 0x8B90
#define GL_PALETTE4_RGBA8_OES 0x8B91
#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
#define GL_PALETTE4_RGBA4_OES 0x8B93
#define GL_PALETTE4_RGB5_A1_OES 0x8B94
#define GL_PALETTE8_RGB8_OES 0x8B95
#define GL_PALETTE8_RGBA8_OES 0x8B96
#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
#define GL_PALETTE8_RGBA4_OES 0x8B98
#define GL_PALETTE8_RGB5_A1_OES 0x8B99
#endif
/* GL_OES_depth24 */
#ifndef GL_OES_depth24
#define GL_DEPTH_COMPONENT24_OES 0x81A6
#endif
/* GL_OES_depth32 */
#ifndef GL_OES_depth32
#define GL_DEPTH_COMPONENT32_OES 0x81A7
#endif
/* GL_OES_depth_texture */
/* No new tokens introduced by this extension. */
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
typedef void* GLeglImageOES;
#endif
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_UNSIGNED_INT 0x1405
#endif
/* GL_OES_get_program_binary */
#ifndef GL_OES_get_program_binary
#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
#endif
/* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
#define GL_WRITE_ONLY_OES 0x88B9
#define GL_BUFFER_ACCESS_OES 0x88BB
#define GL_BUFFER_MAPPED_OES 0x88BC
#define GL_BUFFER_MAP_POINTER_OES 0x88BD
#endif
/* GL_OES_packed_depth_stencil */
#ifndef GL_OES_packed_depth_stencil
#define GL_DEPTH_STENCIL_OES 0x84F9
#define GL_UNSIGNED_INT_24_8_OES 0x84FA
#define GL_DEPTH24_STENCIL8_OES 0x88F0
#endif
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_RGB8_OES 0x8051
#define GL_RGBA8_OES 0x8058
#endif
/* GL_OES_standard_derivatives */
#ifndef GL_OES_standard_derivatives
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
#endif
/* GL_OES_stencil1 */
#ifndef GL_OES_stencil1
#define GL_STENCIL_INDEX1_OES 0x8D46
#endif
/* GL_OES_stencil4 */
#ifndef GL_OES_stencil4
#define GL_STENCIL_INDEX4_OES 0x8D47
#endif
/* GL_OES_texture_3D */
#ifndef GL_OES_texture_3D
#define GL_TEXTURE_WRAP_R_OES 0x8072
#define GL_TEXTURE_3D_OES 0x806F
#define GL_TEXTURE_BINDING_3D_OES 0x806A
#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073
#define GL_SAMPLER_3D_OES 0x8B5F
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
#endif
/* GL_OES_texture_float */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_float_linear */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_half_float */
#ifndef GL_OES_texture_half_float
#define GL_HALF_FLOAT_OES 0x8D61
#endif
/* GL_OES_texture_half_float_linear */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_npot */
/* No new tokens introduced by this extension. */
/* GL_OES_vertex_array_object */
#ifndef GL_OES_vertex_array_object
#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
#endif
/* GL_OES_vertex_half_float */
/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
/* GL_OES_vertex_type_10_10_10_2 */
#ifndef GL_OES_vertex_type_10_10_10_2
#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
#define GL_INT_10_10_10_2_OES 0x8DF7
#endif
/*------------------------------------------------------------------------*
* AMD extension tokens
*------------------------------------------------------------------------*/
/* GL_AMD_compressed_3DC_texture */
#ifndef GL_AMD_compressed_3DC_texture
#define GL_3DC_X_AMD 0x87F9
#define GL_3DC_XY_AMD 0x87FA
#endif
/* GL_AMD_compressed_ATC_texture */
#ifndef GL_AMD_compressed_ATC_texture
#define GL_ATC_RGB_AMD 0x8C92
#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
#endif
/* GL_AMD_performance_monitor */
#ifndef GL_AMD_performance_monitor
#define GL_COUNTER_TYPE_AMD 0x8BC0
#define GL_COUNTER_RANGE_AMD 0x8BC1
#define GL_UNSIGNED_INT64_AMD 0x8BC2
#define GL_PERCENTAGE_AMD 0x8BC3
#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
#define GL_PERFMON_RESULT_AMD 0x8BC6
#endif
/* GL_AMD_program_binary_Z400 */
#ifndef GL_AMD_program_binary_Z400
#define GL_Z400_BINARY_AMD 0x8740
#endif
/*------------------------------------------------------------------------*
* EXT extension tokens
*------------------------------------------------------------------------*/
/* GL_EXT_blend_minmax */
#ifndef GL_EXT_blend_minmax
#define GL_MIN_EXT 0x8007
#define GL_MAX_EXT 0x8008
#endif
/* GL_EXT_discard_framebuffer */
#ifndef GL_EXT_discard_framebuffer
#define GL_COLOR_EXT 0x1800
#define GL_DEPTH_EXT 0x1801
#define GL_STENCIL_EXT 0x1802
#endif
/* GL_EXT_multi_draw_arrays */
/* No new tokens introduced by this extension. */
/* GL_EXT_read_format_bgra */
#ifndef GL_EXT_read_format_bgra
#define GL_BGRA_EXT 0x80E1
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
#endif
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
#endif
/* GL_EXT_texture_format_BGRA8888 */
#ifndef GL_EXT_texture_format_BGRA8888
#define GL_BGRA_EXT 0x80E1
#endif
/* GL_EXT_texture_type_2_10_10_10_REV */
#ifndef GL_EXT_texture_type_2_10_10_10_REV
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
#endif
/* GL_EXT_texture_compression_dxt1 */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#endif
/*------------------------------------------------------------------------*
* IMG extension tokens
*------------------------------------------------------------------------*/
/* GL_IMG_program_binary */
#ifndef GL_IMG_program_binary
#define GL_SGX_PROGRAM_BINARY_IMG 0x9130
#endif
/* GL_IMG_read_format */
#ifndef GL_IMG_read_format
#define GL_BGRA_IMG 0x80E1
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
#endif
/* GL_IMG_shader_binary */
#ifndef GL_IMG_shader_binary
#define GL_SGX_BINARY_IMG 0x8C0A
#endif
/* GL_IMG_texture_compression_pvrtc */
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif
/* GL_IMG_multisampled_render_to_texture */
#ifndef GL_IMG_multisampled_render_to_texture
#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
#define GL_MAX_SAMPLES_IMG 0x9135
#define GL_TEXTURE_SAMPLES_IMG 0x9136
#endif
/*------------------------------------------------------------------------*
* NV extension tokens
*------------------------------------------------------------------------*/
/* GL_NV_fence */
#ifndef GL_NV_fence
#define GL_ALL_COMPLETED_NV 0x84F2
#define GL_FENCE_STATUS_NV 0x84F3
#define GL_FENCE_CONDITION_NV 0x84F4
#endif
/* GL_NV_coverage_sample */
#ifndef GL_NV_coverage_sample
#define GL_COVERAGE_COMPONENT_NV 0x8ED0
#define GL_COVERAGE_COMPONENT4_NV 0x8ED1
#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2
#define GL_COVERAGE_BUFFERS_NV 0x8ED3
#define GL_COVERAGE_SAMPLES_NV 0x8ED4
#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5
#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7
#define GL_COVERAGE_BUFFER_BIT_NV 0x8000
#endif
/* GL_NV_depth_nonlinear */
#ifndef GL_NV_depth_nonlinear
#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
#endif
/*------------------------------------------------------------------------*
* QCOM extension tokens
*------------------------------------------------------------------------*/
/* GL_QCOM_driver_control */
/* No new tokens introduced by this extension. */
/* GL_QCOM_extended_get */
#ifndef GL_QCOM_extended_get
#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
#define GL_TEXTURE_TYPE_QCOM 0x8BD7
#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
#define GL_TEXTURE_TARGET_QCOM 0x8BDA
#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
#define GL_STATE_RESTORE 0x8BDC
#endif
/* GL_QCOM_extended_get2 */
/* No new tokens introduced by this extension. */
/* GL_QCOM_perfmon_global_mode */
#ifndef GL_QCOM_perfmon_global_mode
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
#endif
/* GL_QCOM_writeonly_rendering */
#ifndef GL_QCOM_writeonly_rendering
#define GL_WRITEONLY_RENDERING_QCOM 0x8823
#endif
/* GL_QCOM_tiled_rendering */
#ifndef GL_QCOM_tiled_rendering
#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
#endif
/*------------------------------------------------------------------------*
* End of extension tokens, start of corresponding extension functions
*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*
* OES extension functions
*------------------------------------------------------------------------*/
/* GL_OES_compressed_ETC1_RGB8_texture */
#ifndef GL_OES_compressed_ETC1_RGB8_texture
#define GL_OES_compressed_ETC1_RGB8_texture 1
#endif
/* GL_OES_compressed_paletted_texture */
#ifndef GL_OES_compressed_paletted_texture
#define GL_OES_compressed_paletted_texture 1
#endif
/* GL_OES_depth24 */
#ifndef GL_OES_depth24
#define GL_OES_depth24 1
#endif
/* GL_OES_depth32 */
#ifndef GL_OES_depth32
#define GL_OES_depth32 1
#endif
/* GL_OES_depth_texture */
#ifndef GL_OES_depth_texture
#define GL_OES_depth_texture 1
#endif
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
#endif
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_OES_element_index_uint 1
#endif
/* GL_OES_fbo_render_mipmap */
#ifndef GL_OES_fbo_render_mipmap
#define GL_OES_fbo_render_mipmap 1
#endif
/* GL_OES_fragment_precision_high */
#ifndef GL_OES_fragment_precision_high
#define GL_OES_fragment_precision_high 1
#endif
/* GL_OES_get_program_binary */
#ifndef GL_OES_get_program_binary
#define GL_OES_get_program_binary 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
#endif
typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
#endif
/* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
#define GL_OES_mapbuffer 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params);
#endif
typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params);
#endif
/* GL_OES_packed_depth_stencil */
#ifndef GL_OES_packed_depth_stencil
#define GL_OES_packed_depth_stencil 1
#endif
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_OES_rgb8_rgba8 1
#endif
/* GL_OES_standard_derivatives */
#ifndef GL_OES_standard_derivatives
#define GL_OES_standard_derivatives 1
#endif
/* GL_OES_stencil1 */
#ifndef GL_OES_stencil1
#define GL_OES_stencil1 1
#endif
/* GL_OES_stencil4 */
#ifndef GL_OES_stencil4
#define GL_OES_stencil4 1
#endif
/* GL_OES_texture_3D */
#ifndef GL_OES_texture_3D
#define GL_OES_texture_3D 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
#endif
typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
#endif
/* GL_OES_texture_float */
#ifndef GL_OES_texture_float
#define GL_OES_texture_float 1
#endif
/* GL_OES_texture_float_linear */
#ifndef GL_OES_texture_float_linear
#define GL_OES_texture_float_linear 1
#endif
/* GL_OES_texture_half_float */
#ifndef GL_OES_texture_half_float
#define GL_OES_texture_half_float 1
#endif
/* GL_OES_texture_half_float_linear */
#ifndef GL_OES_texture_half_float_linear
#define GL_OES_texture_half_float_linear 1
#endif
/* GL_OES_texture_npot */
#ifndef GL_OES_texture_npot
#define GL_OES_texture_npot 1
#endif
/* GL_OES_vertex_array_object */
#ifndef GL_OES_vertex_array_object
#define GL_OES_vertex_array_object 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
#endif
typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
#endif
/* GL_OES_vertex_half_float */
#ifndef GL_OES_vertex_half_float
#define GL_OES_vertex_half_float 1
#endif
/* GL_OES_vertex_type_10_10_10_2 */
#ifndef GL_OES_vertex_type_10_10_10_2
#define GL_OES_vertex_type_10_10_10_2 1
#endif
/*------------------------------------------------------------------------*
* AMD extension functions
*------------------------------------------------------------------------*/
/* GL_AMD_compressed_3DC_texture */
#ifndef GL_AMD_compressed_3DC_texture
#define GL_AMD_compressed_3DC_texture 1
#endif
/* GL_AMD_compressed_ATC_texture */
#ifndef GL_AMD_compressed_ATC_texture
#define GL_AMD_compressed_ATC_texture 1
#endif
/* AMD_performance_monitor */
#ifndef GL_AMD_performance_monitor
#define GL_AMD_performance_monitor 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
#endif
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
#endif
/* GL_AMD_program_binary_Z400 */
#ifndef GL_AMD_program_binary_Z400
#define GL_AMD_program_binary_Z400 1
#endif
/*------------------------------------------------------------------------*
* EXT extension functions
*------------------------------------------------------------------------*/
/* GL_EXT_blend_minmax */
#ifndef GL_EXT_blend_minmax
#define GL_EXT_blend_minmax 1
#endif
/* GL_EXT_discard_framebuffer */
#ifndef GL_EXT_discard_framebuffer
#define GL_EXT_discard_framebuffer 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
#endif
/* GL_EXT_read_format_bgra */
#ifndef GL_EXT_read_format_bgra
#define GL_EXT_read_format_bgra 1
#endif
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_EXT_texture_filter_anisotropic 1
#endif
/* GL_EXT_texture_format_BGRA8888 */
#ifndef GL_EXT_texture_format_BGRA8888
#define GL_EXT_texture_format_BGRA8888 1
#endif
/* GL_EXT_texture_type_2_10_10_10_REV */
#ifndef GL_EXT_texture_type_2_10_10_10_REV
#define GL_EXT_texture_type_2_10_10_10_REV 1
#endif
/* GL_EXT_texture_compression_dxt1 */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_EXT_texture_compression_dxt1 1
#endif
/*------------------------------------------------------------------------*
* IMG extension functions
*------------------------------------------------------------------------*/
/* GL_IMG_program_binary */
#ifndef GL_IMG_program_binary
#define GL_IMG_program_binary 1
#endif
/* GL_IMG_read_format */
#ifndef GL_IMG_read_format
#define GL_IMG_read_format 1
#endif
/* GL_IMG_shader_binary */
#ifndef GL_IMG_shader_binary
#define GL_IMG_shader_binary 1
#endif
/* GL_IMG_texture_compression_pvrtc */
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_IMG_texture_compression_pvrtc 1
#endif
/* GL_IMG_multisampled_render_to_texture */
#ifndef GL_IMG_multisampled_render_to_texture
#define GL_IMG_multisampled_render_to_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
#endif
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif
/*------------------------------------------------------------------------*
* NV extension functions
*------------------------------------------------------------------------*/
/* GL_NV_fence */
#ifndef GL_NV_fence
#define GL_NV_fence 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *);
GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint);
GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint);
GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint);
GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint, GLenum);
#endif
typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#endif
/* GL_NV_coverage_sample */
#ifndef GL_NV_coverage_sample
#define GL_NV_coverage_sample 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
#endif
typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
#endif
/* GL_NV_depth_nonlinear */
#ifndef GL_NV_depth_nonlinear
#define GL_NV_depth_nonlinear 1
#endif
/*------------------------------------------------------------------------*
* QCOM extension functions
*------------------------------------------------------------------------*/
/* GL_QCOM_driver_control */
#ifndef GL_QCOM_driver_control
#define GL_QCOM_driver_control 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
#endif
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
#endif
/* GL_QCOM_extended_get */
#ifndef GL_QCOM_extended_get
#define GL_QCOM_extended_get 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
#endif
typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
#endif
/* GL_QCOM_extended_get2 */
#ifndef GL_QCOM_extended_get2
#define GL_QCOM_extended_get2 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
#endif
typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
#endif
/* GL_QCOM_perfmon_global_mode */
#ifndef GL_QCOM_perfmon_global_mode
#define GL_QCOM_perfmon_global_mode 1
#endif
/* GL_QCOM_writeonly_rendering */
#ifndef GL_QCOM_writeonly_rendering
#define GL_QCOM_writeonly_rendering 1
#endif
/* GL_QCOM_tiled_rendering */
#ifndef GL_QCOM_tiled_rendering
#define GL_QCOM_tiled_rendering 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
#endif
typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __gl2ext_h_ */

View File

@ -0,0 +1,51 @@
#ifndef __gl2extimg_h_
#define __gl2extimg_h_
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#ifdef __cplusplus
extern "C" {
#endif
/*------------------------------------------------------------------------*
* IMG extension tokens
*------------------------------------------------------------------------*/
/* GL_IMG_binary_shader */
#ifndef GL_IMG_binary_shader
#define GL_SGX_BINARY_IMG 0x8C0A
#endif
/* GL_IMG_texture_compression_pvrtc */
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif
/* GL_IMG_texture_format_BGRA8888 */
#define GL_BGRA 0x80E1
/*------------------------------------------------------------------------*
* IMG extension functions
*------------------------------------------------------------------------*/
/* GL_IMG_binary_shader */
#ifndef GL_IMG_binary_shader
#define GL_IMG_binary_shader 1
#endif
/* GL_IMG_texture_compression_pvrtc */
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_IMG_texture_compression_pvrtc 1
#endif
#ifdef __cplusplus
}
#endif
#endif /* __gl2extimg_h_ */

View File

@ -0,0 +1,30 @@
#ifndef __gl2platform_h_
#define __gl2platform_h_
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
*/
#include <KHR/khrplatform.h>
#ifndef GL_APICALL
#define GL_APICALL KHRONOS_APICALL
#endif
#ifndef GL_APIENTRY
#define GL_APIENTRY KHRONOS_APIENTRY
#endif
#endif /* __gl2platform_h_ */

View File

@ -0,0 +1,269 @@
#ifndef __khrplatform_h_
#define __khrplatform_h_
/*
** Copyright (c) 2008-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by sending them to the public Khronos Bugzilla
* (http://khronos.org/bugzilla) by filing a bug against product
* "Khronos (general)" component "Registry".
*
* A predefined template which fills in some of the bug fields can be
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
* must create a Bugzilla login first.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#else
# define KHRONOS_APICALL
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
/* Win32 but not WinCE */
# define KHRONOS_APIENTRY __stdcall
#else
# define KHRONOS_APIENTRY
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
#if defined (__ARMCC_2__)
#define KHRONOS_APIATTRIBUTES __softfp
#else
#define KHRONOS_APIATTRIBUTES
#endif
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
/*
* Using <stdint.h>
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__VMS ) || defined(__sgi)
/*
* Using <inttypes.h>
*/
#include <inttypes.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
/*
* Win32
*/
typedef __int32 khronos_int32_t;
typedef unsigned __int32 khronos_uint32_t;
typedef __int64 khronos_int64_t;
typedef unsigned __int64 khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__sun__) || defined(__digital__)
/*
* Sun or Digital
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#if defined(__arch64__) || defined(_LP64)
typedef long int khronos_int64_t;
typedef unsigned long int khronos_uint64_t;
#else
typedef long long int khronos_int64_t;
typedef unsigned long long int khronos_uint64_t;
#endif /* __arch64__ */
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif 0
/*
* Hypothetical platform with no float or int64 support
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#define KHRONOS_SUPPORT_INT64 0
#define KHRONOS_SUPPORT_FLOAT 0
#else
/*
* Generic fallback
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#endif
/*
* Types that are (so far) the same on all platforms
*/
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#if KHRONOS_SUPPORT_FLOAT
/*
* Float type
*/
typedef float khronos_float_t;
#endif
#if KHRONOS_SUPPORT_INT64
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
typedef khronos_int64_t khronos_stime_nanoseconds_t;
#endif
/*
* Dummy value used to pad enum types to 32 bits.
*/
#ifndef KHRONOS_MAX_ENUM
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
#endif
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
typedef enum {
KHRONOS_FALSE = 0,
KHRONOS_TRUE = 1,
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
} khronos_boolean_enum_t;
#endif /* __khrplatform_h_ */

View File

@ -0,0 +1,296 @@
/**********************************************************************************
* Copyright (c) 2008-2009 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
#ifndef __CL_PLATFORM_H
#define __CL_PLATFORM_H
#ifdef __APPLE__
/* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */
#include <AvailabilityMacros.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define CL_API_ENTRY
#define CL_API_CALL
#ifdef __APPLE__
#define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
#else
#define CL_API_SUFFIX__VERSION_1_0
#define CL_EXTENSION_WEAK_LINK
#endif
#if (defined (WIN32) && (_MSC_VER))
/* scalar types */
typedef signed __int8 cl_char;
typedef unsigned __int8 cl_uchar;
typedef signed __int16 cl_short;
typedef unsigned __int16 cl_ushort;
typedef signed __int32 cl_int;
typedef unsigned __int32 cl_uint;
typedef signed __int64 cl_long;
typedef unsigned __int64 cl_ulong;
typedef unsigned __int16 cl_half;
typedef float cl_float;
typedef double cl_double;
/*
* Vector types
*
* Note: OpenCL requires that all types be naturally aligned.
* This means that vector types must be naturally aligned.
* For example, a vector of four floats must be aligned to
* a 16 byte boundary (calculated as 4 * the natural 4-byte
* alignment of the float). The alignment qualifiers here
* will only function properly if your compiler supports them
* and if you don't actively work to defeat them. For example,
* in order for a cl_float4 to be 16 byte aligned in a struct,
* the start of the struct must itself be 16-byte aligned.
*
* Maintaining proper alignment is the user's responsibility.
*/
typedef signed __int8 cl_char2[2];
typedef signed __int8 cl_char4[4];
typedef signed __int8 cl_char8[8];
typedef signed __int8 cl_char16[16];
typedef unsigned __int8 cl_uchar2[2];
typedef unsigned __int8 cl_uchar4[4];
typedef unsigned __int8 cl_uchar8[8];
typedef unsigned __int8 cl_uchar16[16];
typedef signed __int16 cl_short2[2];
typedef signed __int16 cl_short4[4];
typedef signed __int16 cl_short8[8];
typedef signed __int16 cl_short16[16];
typedef unsigned __int16 cl_ushort2[2];
typedef unsigned __int16 cl_ushort4[4];
typedef unsigned __int16 cl_ushort8[8];
typedef unsigned __int16 cl_ushort16[16];
typedef signed __int32 cl_int2[2];
typedef signed __int32 cl_int4[4];
typedef signed __int32 cl_int8[8];
typedef signed __int32 cl_int16[16];
typedef unsigned __int32 cl_uint2[2];
typedef unsigned __int32 cl_uint4[4];
typedef unsigned __int32 cl_uint8[8];
typedef unsigned __int32 cl_uint16[16];
typedef signed __int64 cl_long2[2];
typedef signed __int64 cl_long4[4];
typedef signed __int64 cl_long8[8];
typedef signed __int64 cl_long16[16];
typedef unsigned __int64 cl_ulong2[2];
typedef unsigned __int64 cl_ulong4[4];
typedef unsigned __int64 cl_ulong8[8];
typedef unsigned __int64 cl_ulong16[16];
typedef float cl_float2[2];
typedef float cl_float4[4];
typedef float cl_float8[8];
typedef float cl_float16[16];
typedef double cl_double2[2];
typedef double cl_double4[4];
typedef double cl_double8[8];
typedef double cl_double16[16];
/* There are no vector types for half */
#define CL_CHAR_BIT 8
#define CL_SCHAR_MAX 127
#define CL_SCHAR_MIN (-127-1)
#define CL_CHAR_MAX CL_SCHAR_MAX
#define CL_CHAR_MIN CL_SCHAR_MIN
#define CL_UCHAR_MAX 255
#define CL_SHRT_MAX 32767
#define CL_SHRT_MIN (-32767-1)
#define CL_USHRT_MAX 65535
#define CL_INT_MAX 2147483647
#define CL_INT_MIN (-2147483647-1)
#define CL_UINT_MAX 0xffffffffU
#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
#define CL_FLT_DIG 6
#define CL_FLT_MANT_DIG 24
#define CL_FLT_MAX_10_EXP +38
#define CL_FLT_MAX_EXP +128
#define CL_FLT_MIN_10_EXP -37
#define CL_FLT_MIN_EXP -125
#define CL_FLT_RADIX 2
#define CL_FLT_MAX 340282346638528859811704183484516925440.0f
#define CL_FLT_MIN 1.175494350822287507969e-38f
#define CL_FLT_EPSILON 0x1.0p-23f
#define CL_DBL_DIG 15
#define CL_DBL_MANT_DIG 53
#define CL_DBL_MAX_10_EXP +308
#define CL_DBL_MAX_EXP +1024
#define CL_DBL_MIN_10_EXP -307
#define CL_DBL_MIN_EXP -1021
#define CL_DBL_RADIX 2
#define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
#define CL_DBL_MIN 2.225073858507201383090e-308
#define CL_DBL_EPSILON 2.220446049250313080847e-16
#else
#include <stdint.h>
/* scalar types */
typedef int8_t cl_char;
typedef uint8_t cl_uchar;
typedef int16_t cl_short __attribute__((aligned(2)));
typedef uint16_t cl_ushort __attribute__((aligned(2)));
typedef int32_t cl_int __attribute__((aligned(4)));
typedef uint32_t cl_uint __attribute__((aligned(4)));
typedef int64_t cl_long __attribute__((aligned(8)));
typedef uint64_t cl_ulong __attribute__((aligned(8)));
typedef uint16_t cl_half __attribute__((aligned(2)));
typedef float cl_float __attribute__((aligned(4)));
typedef double cl_double __attribute__((aligned(8)));
/*
* Vector types
*
* Note: OpenCL requires that all types be naturally aligned.
* This means that vector types must be naturally aligned.
* For example, a vector of four floats must be aligned to
* a 16 byte boundary (calculated as 4 * the natural 4-byte
* alignment of the float). The alignment qualifiers here
* will only function properly if your compiler supports them
* and if you don't actively work to defeat them. For example,
* in order for a cl_float4 to be 16 byte aligned in a struct,
* the start of the struct must itself be 16-byte aligned.
*
* Maintaining proper alignment is the user's responsibility.
*/
typedef int8_t cl_char2[2] __attribute__((aligned(2)));
typedef int8_t cl_char4[4] __attribute__((aligned(4)));
typedef int8_t cl_char8[8] __attribute__((aligned(8)));
typedef int8_t cl_char16[16] __attribute__((aligned(16)));
typedef uint8_t cl_uchar2[2] __attribute__((aligned(2)));
typedef uint8_t cl_uchar4[4] __attribute__((aligned(4)));
typedef uint8_t cl_uchar8[8] __attribute__((aligned(8)));
typedef uint8_t cl_uchar16[16] __attribute__((aligned(16)));
typedef int16_t cl_short2[2] __attribute__((aligned(4)));
typedef int16_t cl_short4[4] __attribute__((aligned(8)));
typedef int16_t cl_short8[8] __attribute__((aligned(16)));
typedef int16_t cl_short16[16] __attribute__((aligned(32)));
typedef uint16_t cl_ushort2[2] __attribute__((aligned(4)));
typedef uint16_t cl_ushort4[4] __attribute__((aligned(8)));
typedef uint16_t cl_ushort8[8] __attribute__((aligned(16)));
typedef uint16_t cl_ushort16[16] __attribute__((aligned(32)));
typedef int32_t cl_int2[2] __attribute__((aligned(8)));
typedef int32_t cl_int4[4] __attribute__((aligned(16)));
typedef int32_t cl_int8[8] __attribute__((aligned(32)));
typedef int32_t cl_int16[16] __attribute__((aligned(64)));
typedef uint32_t cl_uint2[2] __attribute__((aligned(8)));
typedef uint32_t cl_uint4[4] __attribute__((aligned(16)));
typedef uint32_t cl_uint8[8] __attribute__((aligned(32)));
typedef uint32_t cl_uint16[16] __attribute__((aligned(64)));
typedef int64_t cl_long2[2] __attribute__((aligned(16)));
typedef int64_t cl_long4[4] __attribute__((aligned(32)));
typedef int64_t cl_long8[8] __attribute__((aligned(64)));
typedef int64_t cl_long16[16] __attribute__((aligned(128)));
typedef uint64_t cl_ulong2[2] __attribute__((aligned(16)));
typedef uint64_t cl_ulong4[4] __attribute__((aligned(32)));
typedef uint64_t cl_ulong8[8] __attribute__((aligned(64)));
typedef uint64_t cl_ulong16[16] __attribute__((aligned(128)));
typedef float cl_float2[2] __attribute__((aligned(8)));
typedef float cl_float4[4] __attribute__((aligned(16)));
typedef float cl_float8[8] __attribute__((aligned(32)));
typedef float cl_float16[16] __attribute__((aligned(64)));
typedef double cl_double2[2] __attribute__((aligned(16)));
typedef double cl_double4[4] __attribute__((aligned(32)));
typedef double cl_double8[8] __attribute__((aligned(64)));
typedef double cl_double16[16] __attribute__((aligned(128)));
/* There are no vector types for half */
/******************************************************************************/
// Macro names and corresponding values defined by OpenCL
#define CL_CHAR_BIT 8
#define CL_SCHAR_MAX 127
#define CL_SCHAR_MIN (-127-1)
#define CL_CHAR_MAX CL_SCHAR_MAX
#define CL_CHAR_MIN CL_SCHAR_MIN
#define CL_UCHAR_MAX 255
#define CL_SHRT_MAX 32767
#define CL_SHRT_MIN (-32767-1)
#define CL_USHRT_MAX 65535
#define CL_INT_MAX 2147483647
#define CL_INT_MIN (-2147483647-1)
#define CL_UINT_MAX 0xffffffffU
#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
#define CL_FLT_DIG 6
#define CL_FLT_MANT_DIG 24
#define CL_FLT_MAX_10_EXP +38
#define CL_FLT_MAX_EXP +128
#define CL_FLT_MIN_10_EXP -37
#define CL_FLT_MIN_EXP -125
#define CL_FLT_RADIX 2
#define CL_FLT_MAX 0x1.fffffep127f
#define CL_FLT_MIN 0x1.0p-126f
#define CL_FLT_EPSILON 0x1.0p-23f
#define CL_DBL_DIG 15
#define CL_DBL_MANT_DIG 53
#define CL_DBL_MAX_10_EXP +308
#define CL_DBL_MAX_EXP +1024
#define CL_DBL_MIN_10_EXP -307
#define CL_DBL_MIN_EXP -1021
#define CL_DBL_RADIX 2
#define CL_DBL_MAX 0x1.fffffffffffffp1023
#define CL_DBL_MIN 0x1.0p-1022
#define CL_DBL_EPSILON 0x1.0p-52
#endif
#include <stddef.h>
#ifdef __cplusplus
}
#endif
#endif // __CL_PLATFORM_H

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
#ifndef __LWJGL_AWT_TOOLS_H
#define __LWJGL_AWT_TOOLS_H
#include <jni.h>
#ifndef PLATFORM_FCL
#include <jawt_md.h>
typedef struct {
JAWT awt;
JAWT_DrawingSurface* ds;
JAWT_DrawingSurfaceInfo *dsi;
} AWTSurfaceLock;
#else
typedef struct {
int awt;
void* ds;
void *dsi;
} AWTSurfaceLock;
#endif
#endif

View File

@ -0,0 +1,398 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
#include <jni.h>
#include <stdlib.h>
#include "common_tools.h"
#include "org_lwjgl_DefaultSysImplementation.h"
static bool debug = false;
static JavaVM *jvm;
static jmethodID mByteBuffer_asReadOnlyBuffer;
static jmethodID mPointerWrapper_getPointer;
void initAttribList(attrib_list_t *list) {
list->current_index = 0;
}
void putAttrib(attrib_list_t *list, int attrib) {
if (list->current_index == ATTRIB_LIST_SIZE) {
printfDebug("Ignoring attrib %d: attrib list size too small", attrib);
return;
}
list->attribs[list->current_index] = attrib;
list->current_index++;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getPointerSize(JNIEnv *env, jclass clazz) {
return (jint)sizeof(void *);
}
JNIEXPORT void JNICALL Java_org_lwjgl_DefaultSysImplementation_setDebug
(JNIEnv *env, jobject ignored, jboolean enable) {
debug = enable == JNI_TRUE ? true : false;
}
bool isDebugEnabled(void) {
return debug;
}
static int do_vsnprintf(char* buffer, size_t buffer_size, const char *format, va_list ap) {
#ifdef _MSC_VER
return vsnprintf_s(buffer, buffer_size, _TRUNCATE, format, ap);
#else
va_list cp_ap;
va_copy(cp_ap, ap);
int res = vsnprintf(buffer, buffer_size, format, cp_ap);
va_end(cp_ap);
return res;
#endif
}
static jstring sprintfJavaString(JNIEnv *env, const char *format, va_list ap) {
int buffer_size = 2048;
char *buffer;
jstring str;
int str_size;
buffer = (char *)malloc(sizeof(char)*buffer_size);
if (buffer == NULL)
return NULL;
str_size = do_vsnprintf(buffer, buffer_size, format, ap);
if (str_size > buffer_size) {
free(buffer);
buffer_size = str_size + 1;
buffer = (char *)malloc(sizeof(char)*buffer_size);
if (buffer == NULL)
return NULL;
do_vsnprintf(buffer, buffer_size, format, ap);
}
str = (*env)->NewStringUTF(env, buffer);
free(buffer);
return str;
}
void printfDebugJava(JNIEnv *env, const char *format, ...) {
jstring str;
jclass org_lwjgl_LWJGLUtil_class;
jmethodID log_method;
va_list ap;
if (isDebugEnabled() && !(*env)->ExceptionOccurred(env)) {
va_start(ap, format);
str = sprintfJavaString(env, format, ap);
va_end(ap);
org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil");
if (org_lwjgl_LWJGLUtil_class == NULL)
return;
log_method = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "log", "(Ljava/lang/CharSequence;)V");
if (log_method == NULL)
return;
(*env)->CallStaticVoidMethod(env, org_lwjgl_LWJGLUtil_class, log_method, str);
}
}
void printfDebug(const char *format, ...) {
va_list ap;
va_start(ap, format);
if (isDebugEnabled())
vfprintf(stderr, format, ap);
va_end(ap);
}
static void throwFormattedGeneralException(JNIEnv * env, const char *exception_name, const char *format, va_list ap) {
jclass cls;
jstring str;
jmethodID exception_constructor;
jobject exception;
if ((*env)->ExceptionCheck(env) == JNI_TRUE)
return; // The JVM crashes if we try to throw two exceptions from one native call
str = sprintfJavaString(env, format, ap);
cls = (*env)->FindClass(env, exception_name);
exception_constructor = (*env)->GetMethodID(env, cls, "<init>", "(Ljava/lang/String;)V");
exception = (*env)->NewObject(env, cls, exception_constructor, str);
(*env)->Throw(env, exception);
}
void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err) {
jclass cls;
if ((*env)->ExceptionCheck(env) == JNI_TRUE)
return; // The JVM crashes if we try to throw two exceptions from one native call
cls = (*env)->FindClass(env, exception_name);
(*env)->ThrowNew(env, cls, err);
}
void throwFMODException(JNIEnv * env, const char * err) {
throwGeneralException(env, "org/lwjgl/fmod3/FMODException", err);
}
void throwFormattedRuntimeException(JNIEnv * env, const char *format, ...) {
va_list ap;
va_start(ap, format);
throwFormattedGeneralException(env, "java/lang/RuntimeException", format, ap);
va_end(ap);
}
void throwFormattedException(JNIEnv * env, const char *format, ...) {
va_list ap;
va_start(ap, format);
throwFormattedGeneralException(env, "org/lwjgl/LWJGLException", format, ap);
va_end(ap);
}
void throwException(JNIEnv * env, const char * err) {
throwGeneralException(env, "org/lwjgl/LWJGLException", err);
}
// retrieves the locale-specific C string
char * GetStringNativeChars(JNIEnv *env, jstring jstr) {
jbyteArray bytes = 0;
jthrowable exc;
char *result = 0;
jclass jcls_str;
jmethodID MID_String_getBytes;
/* out of memory error? */
if ((*env)->EnsureLocalCapacity(env, 2) < 0) {
return 0;
}
// aquire getBytes method
jcls_str = (*env)->FindClass(env, "java/lang/String");
MID_String_getBytes = (*env)->GetMethodID(env, jcls_str, "getBytes", "()[B");
// get the bytes
bytes = (jbyteArray) (*env)->CallObjectMethod(env, jstr, MID_String_getBytes);
exc = (*env)->ExceptionOccurred(env);
// if no exception occured while getting bytes - continue
if (!exc) {
jint len = (*env)->GetArrayLength(env, bytes);
result = (char *) malloc(len + 1);
if (result == 0) {
throwGeneralException(env, "java/lang/OutOfMemoryError", NULL);
(*env)->DeleteLocalRef(env, bytes);
return 0;
}
(*env)->GetByteArrayRegion(env, bytes, 0, len, (jbyte *) result);
result[len] = 0; /* NULL-terminate */
} else {
(*env)->DeleteLocalRef(env, exc);
}
(*env)->DeleteLocalRef(env, bytes);
return (char*) result;
}
/* creates locale specific string, unsigned argument to
* match GLuchar and ALuchar types
*/
jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *ustr) {
const char *str = (const char *)ustr;
if (str == NULL)
return NULL;
return NewStringNativeWithLength(env, str, (jsize)strlen(str));
}
// creates locale specific string
jstring NewStringNativeWithLength(JNIEnv *env, const char *str, jsize length) {
jclass jcls_str;
jmethodID jmethod_str;
jstring result;
jbyteArray bytes;
if (str==NULL) {
return NULL;
}
jcls_str = (*env)->FindClass(env,"java/lang/String");
if (jcls_str == NULL)
return NULL;
jmethod_str = (*env)->GetMethodID(env,jcls_str, "<init>", "([B)V");
if (jmethod_str == NULL)
return NULL;
bytes = 0;
if ((*env)->EnsureLocalCapacity(env,2) < 0) {
return NULL; /* out of memory error */
}
bytes = (*env)->NewByteArray(env,length);
if (bytes != NULL) {
(*env)->SetByteArrayRegion(env,bytes, 0, length, (jbyte *)str);
result = (jstring)(*env)->NewObject(env,jcls_str, jmethod_str, bytes);
(*env)->DeleteLocalRef(env,bytes);
return result;
} /* else fall through */
return NULL;
}
bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions) {
int i;
void **ext_function_pointer_pointer;
for (i = 0; i < num_functions; i++) {
ExtFunction *function = functions + i;
if (function->ext_function_name != NULL) {
void *ext_func_pointer = gpa(function->ext_function_name);
if (ext_func_pointer == NULL)
return false;
ext_function_pointer_pointer = function->ext_function_pointer;
*ext_function_pointer_pointer = ext_func_pointer;
}
}
return true;
}
jobject NewReadOnlyDirectByteBuffer(JNIEnv* env, const void* address, jlong capacity) {
jobject buffer = (*env)->NewDirectByteBuffer(env, (void *)address, capacity);
return (*env)->CallObjectMethod(env, buffer, mByteBuffer_asReadOnlyBuffer);
}
jobject newJavaManagedByteBuffer(JNIEnv *env, const int size) {
jclass bufferutils_class = (*env)->FindClass(env, "org/lwjgl/BufferUtils");
jmethodID createByteBuffer = (*env)->GetStaticMethodID(env, bufferutils_class, "createByteBuffer", "(I)Ljava/nio/ByteBuffer;");
jobject buffer = (*env)->CallStaticObjectMethod(env, bufferutils_class, createByteBuffer, size);
return buffer;
}
void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions) {
JNINativeMethod *methods;
JavaMethodAndExtFunction *function;
void *ext_func_pointer;
void **ext_function_pointer_pointer;
JNINativeMethod *method;
int i, num_natives = 0;
if (clazz == NULL) {
throwException(env, "Null class");
return;
}
methods = (JNINativeMethod *)malloc(num_functions*sizeof(JNINativeMethod));
for (i = 0; i < num_functions; i++) {
function = functions + i;
if (function->ext_function_name != NULL) {
ext_func_pointer = gpa(function->ext_function_name);
if (ext_func_pointer == NULL) {
if ( function->optional )
continue;
free(methods);
throwException(env, "Missing driver symbols");
return;
}
ext_function_pointer_pointer = function->ext_function_pointer;
*ext_function_pointer_pointer = ext_func_pointer;
}
method = methods + num_natives;
method->name = function->method_name;
method->signature = function->signature;
method->fnPtr = function->method_pointer;
num_natives++;
}
(*env)->RegisterNatives(env, clazz, methods, num_natives);
free(methods);
}
bool getBooleanProperty(JNIEnv *env, const char* propertyName) {
jstring property = NewStringNativeWithLength(env, propertyName, (jsize)strlen(propertyName));
jclass org_lwjgl_LWJGLUtil_class;
jmethodID getBoolean;
if (property == NULL)
return false;
org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil");
if (org_lwjgl_LWJGLUtil_class == NULL)
return false;
getBoolean = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "getPrivilegedBoolean", "(Ljava/lang/String;)Z");
if (getBoolean == NULL)
return false;
return (*env)->CallStaticBooleanMethod(env, org_lwjgl_LWJGLUtil_class, getBoolean, property) ? true : false;
}
jlong getPointerWrapperAddress(JNIEnv *env, jobject wrapper) {
return (*env)->CallLongMethod(env, wrapper, mPointerWrapper_getPointer);
}
JNIEnv *getThreadEnv() {
JNIEnv *env;
(*jvm)->GetEnv(jvm, (void *)&env, JNI_VERSION_1_4);
return env;
}
JNIEnv *attachCurrentThread() {
JNIEnv *env;
(*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL);
return env;
}
void detachCurrentThread() {
(*jvm)->DetachCurrentThread(jvm);
}
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
JNIEnv *env;
jclass clazz;
jvm = vm;
env = getThreadEnv();
clazz = (*env)->FindClass(env, "java/nio/ByteBuffer");
mByteBuffer_asReadOnlyBuffer = (*env)->GetMethodID(env, clazz, "asReadOnlyBuffer", "()Ljava/nio/ByteBuffer;");
clazz = (*env)->FindClass(env, "org/lwjgl/PointerWrapper");
mPointerWrapper_getPointer = (*env)->GetMethodID(env, clazz, "getPointer", "()J");
return JNI_VERSION_1_4;
}
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
}
bool positionBuffer(JNIEnv *env, jobject buffer, jint position) {
jclass buffer_class;
jmethodID position_method;
buffer_class = (*env)->GetObjectClass(env, buffer);
if (buffer_class == NULL)
return false;
position_method = (*env)->GetMethodID(env, buffer_class, "position", "(I)Ljava/nio/Buffer;");
if (position_method == NULL)
return false;
(*env)->CallObjectMethod(env, buffer, position_method, position);
return true;
}

View File

@ -0,0 +1,159 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
#ifndef _COMMON_TOOLS_H
#define _COMMON_TOOLS_H
#include <jni.h>
#include <string.h>
#include <stdlib.h>
#define ATTRIB_LIST_SIZE (256)
typedef struct {
int current_index;
int attribs[ATTRIB_LIST_SIZE];
} attrib_list_t;
#ifndef __cplusplus
#ifndef bool
typedef enum {false, true} bool;
#endif
#endif
#ifdef _MSC_VER
#define inline __inline
#include <Basetsd.h>
#else
#include <inttypes.h>
#endif
static inline void * safeGetBufferAddress(JNIEnv *env, jobject buffer) {
if (buffer != NULL) {
#ifdef __cplusplus
return (void *)((char *)env->GetDirectBufferAddress(buffer));
#else
return (void *)((char *)(*env)->GetDirectBufferAddress(env, buffer));
#endif
} else
return NULL;
}
static inline jobject safeNewBuffer(JNIEnv *env, void *p, jlong capacity) {
if (p != NULL) {
#ifdef __cplusplus
return env->NewDirectByteBuffer(p, capacity);
#else
return (*env)->NewDirectByteBuffer(env, p, capacity);
#endif
} else
return NULL;
}
static inline jobject safeNewBufferCached(JNIEnv *env, void *p, jlong size, jobject old_buffer) {
if (old_buffer != NULL) {
void *old_buffer_address = (*env)->GetDirectBufferAddress(env, old_buffer);
jlong capacity = (*env)->GetDirectBufferCapacity(env, old_buffer);
if (old_buffer_address == p && capacity == size)
return old_buffer;
}
return safeNewBuffer(env, p, size);
}
static inline void *offsetToPointer(jlong offset) {
return (char *)NULL + offset;
}
typedef void *(* ExtGetProcAddressPROC) (const char *func_name);
typedef struct {
char *method_name;
char *signature;
void *method_pointer;
char *ext_function_name;
void **ext_function_pointer;
bool optional;
} JavaMethodAndExtFunction;
typedef struct {
char *ext_function_name;
void **ext_function_pointer;
} ExtFunction;
#define NUMFUNCTIONS(x) (sizeof(x)/sizeof(JavaMethodAndExtFunction));
#ifdef __cplusplus
extern "C" {
#endif
extern JNIEnv *getThreadEnv();
extern JNIEnv *attachCurrentThread();
extern void detachCurrentThread();
extern void initAttribList(attrib_list_t *list);
extern void putAttrib(attrib_list_t *list, int attrib);
extern bool isDebugEnabled(void);
extern jstring getVersionString(JNIEnv *env);
extern void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err);
extern void throwFormattedRuntimeException(JNIEnv * env, const char *format, ...);
extern void throwException(JNIEnv *env, const char *msg);
extern void throwFormattedException(JNIEnv * env, const char *format, ...);
extern void throwFMODException(JNIEnv * env, const char * err);
extern void setDebugEnabled(bool enable);
extern void printfDebugJava(JNIEnv *env, const char *format, ...);
extern void printfDebug(const char *format, ...);
extern bool getBooleanProperty(JNIEnv *env, const char* propertyName);
extern char * GetStringNativeChars(JNIEnv *env, jstring jstr);
extern jstring NewStringNativeWithLength(JNIEnv *env, const char *str, jsize length);
extern jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str);
extern jobject NewReadOnlyDirectByteBuffer(JNIEnv* env, const void* address, jlong capacity);
extern jobject newJavaManagedByteBuffer(JNIEnv *env, const int size);
extern bool positionBuffer(JNIEnv *env, jobject buffer, jint position);
extern jlong getPointerWrapperAddress(JNIEnv *env, jobject wrapper);
extern void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, int num_functions, JavaMethodAndExtFunction *functions);
extern bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFunction *functions);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,78 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <jni.h>
#include "extal.h"
typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)(const ALubyte* fname);
/* alGetProcAddress is commented out, since we don't use it anyway */
//static alGetProcAddressPROC alGetProcAddress = NULL;
/**
* Initializes OpenAL by loading the library
*/
/*void InitializeOpenAL(JNIEnv *env, jstring oalPath) {
//load our library
if (!extal_LoadLibrary(env, oalPath)) {
throwException(env, "Could not load openal library.");
return;
}
alGetProcAddress = (alGetProcAddressPROC)extal_NativeGetFunctionPointer("alGetProcAddress");
if (alGetProcAddress == NULL) {
extal_UnloadLibrary();
throwException(env, "Could not load alGetProcAddress function pointer.");
return;
}
}*/
/**
* Retrieves a pointer to the named function
*
* @param function Name of function
* @return pointer to named function, or NULL if not found
*/
void* extal_GetProcAddress(const char* function) {
void *p;
/* p = alGetProcAddress((const ALubyte*)function);
if (p == NULL) {*/
p = extal_NativeGetFunctionPointer(function);
if (p == NULL) {
printfDebug("Could not locate symbol %s\n", function);
}
// }
return p;
}
void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) {
ext_InitializeClass(env, clazz, &extal_GetProcAddress, num_functions, functions);
}

View File

@ -0,0 +1,172 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _AL_TEST_H
#define _AL_TEST_H
#ifdef _WIN32
#include <windows.h>
#endif
#include <jni.h>
#include "common_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WIN32)
#ifdef _OPENAL32LIB
#define ALCAPI __declspec(dllexport)
#else
#define ALCAPI __declspec(dllimport)
#endif
#define ALCAPIENTRY __cdecl
#else
#define ALCAPI
#define ALCAPIENTRY
#endif
#ifdef _WIN32
#ifdef _OPENAL32LIB
#define ALAPI __declspec(dllexport)
#else
#define ALAPI __declspec(dllimport)
#endif
#define ALAPIENTRY __cdecl
#define AL_CALLBACK
#else
#define ALAPI
#define ALAPIENTRY
#define AL_CALLBACK
#endif
#define INITGUID
#define OPENAL
// ALC typedefs
typedef struct ALCdevice_struct ALCdevice;
typedef struct ALCcontext_struct ALCcontext;
/** 8-bit boolean */
typedef char ALCboolean;
/** character */
typedef char ALCchar;
/** signed 8-bit 2's complement integer */
typedef char ALCbyte;
/** unsigned 8-bit integer */
typedef unsigned char ALCubyte;
/** signed 16-bit 2's complement integer */
typedef short ALCshort;
/** unsigned 16-bit integer */
typedef unsigned short ALCushort;
/** signed 32-bit 2's complement integer */
typedef int ALCint;
/** unsigned 32-bit integer */
typedef unsigned int ALCuint;
/** non-negative 32-bit binary integer size */
typedef int ALCsizei;
/** enumerated 32-bit value */
typedef int ALCenum;
/** 32-bit IEEE754 floating-point */
typedef float ALCfloat;
/** 64-bit IEEE754 floating-point */
typedef double ALCdouble;
/** void type (for opaque pointers only) */
typedef void ALCvoid;
// AL typedefs
/** 8-bit boolean */
typedef char ALboolean;
/** character */
typedef char ALchar;
/** signed 8-bit 2's complement integer */
typedef char ALbyte;
/** unsigned 8-bit integer */
typedef unsigned char ALubyte;
/** signed 16-bit 2's complement integer */
typedef short ALshort;
/** unsigned 16-bit integer */
typedef unsigned short ALushort;
/** signed 32-bit 2's complement integer */
typedef int ALint;
/** unsigned 32-bit integer */
typedef unsigned int ALuint;
/** non-negative 32-bit binary integer size */
typedef int ALsizei;
/** enumerated 32-bit value */
typedef int ALenum;
/** 32-bit IEEE754 floating-point */
typedef float ALfloat;
/** 64-bit IEEE754 floating-point */
typedef double ALdouble;
/** void type (for opaque pointers only) */
typedef void ALvoid;
void* extal_GetProcAddress(const char* function);
void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions);
/* Platform dependent functions */
void *extal_NativeGetFunctionPointer(const char *function);
void extal_LoadLibrary(JNIEnv *env, jstring path);
void extal_UnloadLibrary();
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,67 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY void * (CL_API_CALL *clGetExtensionFunctionAddressPROC) (const char * func_name);
static clGetExtensionFunctionAddressPROC clGetExtensionFunctionAddress;
/**
* Retrieves a pointer to the named function
*
* @param function Name of function
* @return pointer to named function, or NULL if not found
*/
void* extcl_GetProcAddress(const char * function) {
void *p = NULL;
if ( clGetExtensionFunctionAddress == NULL )
clGetExtensionFunctionAddress = extcl_NativeGetFunctionPointer("clGetExtensionFunctionAddress");
p = clGetExtensionFunctionAddress(function);
if ( p == NULL )
p = extcl_NativeGetFunctionPointer(function);
return p;
}
void extcl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) {
ext_InitializeClass(env, clazz, &extcl_GetProcAddress, num_functions, functions);
}
size_t extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch) {
if ( slice_pitch == 0 )
return region[1] * row_pitch;
else
return region[2] * slice_pitch;
}

View File

@ -0,0 +1,85 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __EXTCL_H__
#define __EXTCL_H__
#include <jni.h>
#ifdef __APPLE__
#include <OpenCL/cl_platform.h>
#else
#include <CL/cl_platform.h>
#endif
#include "common_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "extgl_types.h"
#include "extcl_types.h"
// -----------------[ OpenGL-dependent typedefs ]-----------------
typedef GLsync cl_GLsync;
// -----------------[ Callback function typedefs ]-----------------
#ifndef CL_CALLBACK
#define CL_CALLBACK
#endif
typedef void (CL_CALLBACK * cl_create_context_callback)(const char *errinfo, const void *private_info, size_t cb, void *user_data);
typedef void (CL_CALLBACK * cl_mem_object_destructor_callback)(cl_mem memobj, void *user_data);
typedef void (CL_CALLBACK * cl_program_callback)(cl_program program, void *user_data);
typedef void (CL_CALLBACK * cl_event_callback)(cl_event event, cl_int event_command_exec_status, void *user_data);
typedef void (CL_CALLBACK * cl_native_kernel_func)(void *args);
typedef void (CL_CALLBACK * cl_printf_callback)(cl_context context, cl_uint printf_data_len, char *printf_data_ptr, void *user_data);
// -----------------[ Cross-platform functions ]-----------------
void* extcl_GetProcAddress(const char* function);
void extcl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions);
size_t extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch);
// -----------------[ Platform dependent functions ]-----------------
void *extcl_NativeGetFunctionPointer(const char *function);
void extcl_LoadLibrary(JNIEnv *env, jstring path);
void extcl_UnloadLibrary();
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,95 @@
// -----------------[ Core typedefs ]-----------------
typedef struct _cl_platform_id * cl_platform_id;
typedef struct _cl_device_id * cl_device_id;
typedef struct _cl_context * cl_context;
typedef struct _cl_command_queue * cl_command_queue;
typedef struct _cl_mem * cl_mem;
typedef struct _cl_program * cl_program;
typedef struct _cl_kernel * cl_kernel;
typedef struct _cl_event * cl_event;
typedef struct _cl_sampler * cl_sampler;
typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */
typedef cl_ulong cl_bitfield;
typedef cl_bitfield cl_device_type;
typedef cl_uint cl_platform_info;
typedef cl_uint cl_device_info;
typedef cl_bitfield cl_device_fp_config;
typedef cl_uint cl_device_mem_cache_type;
typedef cl_uint cl_device_local_mem_type;
typedef cl_bitfield cl_device_exec_capabilities;
typedef cl_bitfield cl_command_queue_properties;
typedef intptr_t cl_device_partition_property;
typedef cl_bitfield cl_device_affinity_domain;
typedef intptr_t cl_context_properties;
typedef cl_uint cl_context_info;
typedef cl_uint cl_command_queue_info;
typedef cl_uint cl_channel_order;
typedef cl_uint cl_channel_type;
typedef cl_bitfield cl_mem_flags;
typedef cl_uint cl_mem_object_type;
typedef cl_uint cl_mem_info;
typedef cl_bitfield cl_mem_migration_flags;
typedef cl_uint cl_image_info;
typedef cl_uint cl_buffer_create_type;
typedef cl_uint cl_addressing_mode;
typedef cl_uint cl_filter_mode;
typedef cl_uint cl_sampler_info;
typedef cl_bitfield cl_map_flags;
typedef cl_uint cl_program_info;
typedef cl_uint cl_program_build_info;
typedef cl_uint cl_program_binary_type;
typedef cl_int cl_build_status;
typedef cl_uint cl_kernel_info;
typedef cl_uint cl_kernel_arg_info;
typedef cl_uint cl_kernel_arg_address_qualifier;
typedef cl_uint cl_kernel_arg_access_qualifier;
typedef cl_uint cl_kernel_work_group_info;
typedef cl_uint cl_event_info;
typedef cl_uint cl_command_type;
typedef cl_uint cl_profiling_info;
typedef struct _cl_image_format {
cl_channel_order image_channel_order;
cl_channel_type image_channel_data_type;
} cl_image_format;
typedef struct _cl_image_desc {
cl_mem_object_type image_type;
size_t image_width;
size_t image_height;
size_t image_depth;
size_t image_array_size;
size_t image_row_pitch;
size_t image_slice_pitch;
cl_uint num_mip_levels;
cl_uint num_samples;
cl_mem buffer;
} cl_image_desc;
typedef struct _cl_buffer_region {
size_t origin;
size_t size;
} cl_buffer_region;
// cl_gl.h
typedef cl_uint cl_gl_platform_info;
typedef cl_uint cl_gl_context_info;
typedef cl_uint cl_gl_object_type;
typedef cl_uint cl_gl_texture_info;
// -----------------[ Extension typedefs ]-----------------
// EXT_device_fission
typedef cl_ulong cl_device_partition_property_ext;
// EXT_migrate_memobject
typedef cl_bitfield cl_mem_migration_flags_ext;
// KHR_subgroups
typedef cl_uint cl_kernel_sub_group_info;
// -----------------[ Convenience typedefs ]-----------------
typedef void cl_void;

View File

@ -0,0 +1,56 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
#ifndef __OPENCL_H
#define __OPENCL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __APPLE__
#include <OpenCL/cl.h>
#include <OpenCL/cl_gl.h>
#include <OpenCL/cl_gl_ext.h>
#include <OpenCL/cl_ext.h>
#else
#include <CL/cl.h>
#include <CL/cl_gl.h>
#include <CL/cl_gl_ext.h>
#include <CL/cl_ext.h>
#endif
#include "common_tools.h"
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_H */

View File

@ -0,0 +1,83 @@
/* ----------------------------------------------------------------------------
Copyright (c) 2001-2002, Lev Povalahev
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------*/
/*
Lev Povalahev
levp@gmx.net
http://www.uni-karlsruhe.de/~uli2/
*/
#include <stdio.h>
#include <string.h>
#include "extgl.h"
#include "common_tools.h"
void extgl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) {
ext_InitializeClass(env, clazz, &extgl_GetProcAddress, num_functions, functions);
}
bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions) {
return ext_InitializeFunctions(&extgl_GetProcAddress, num_functions, functions);
}
bool extgl_QueryExtension(const GLubyte*extensions, const char *name)
{
const GLubyte *start;
GLubyte *where, *terminator;
if (extensions == NULL) {
printfDebug("NULL extension string\n");
return false;
}
/* Extension names should not have spaces. */
where = (GLubyte *) strchr(name, ' ');
if (where || *name == '\0')
return false;
/* It takes a bit of care to be fool-proof about parsing the
OpenGL extensions string. Don't be fooled by sub-strings,
etc. */
start = extensions;
for (;;)
{
where = (GLubyte *) strstr((const char *) start, name);
if (!where)
break;
terminator = where + strlen(name);
if (where == start || *(where - 1) == ' ')
if (*terminator == ' ' || *terminator == '\0') {
return true;
}
start = terminator;
}
return false;
}

View File

@ -0,0 +1,124 @@
/* Small parts were taken from Mesa's glext.h and gl.h, here's the license: */
/*
* Mesa 3-D graphics library
* Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* Some parts derived from files copyright (c) 2001-2002 Lev Povalahev under this license: */
/* ----------------------------------------------------------------------------
Copyright (c) 2002, Lev Povalahev
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------*/
/*
GL_draw_range_elements support added by Benjamin Karaban
Lev Povalahev contact information:
levp@gmx.net
http://www.uni-karlsruhe.de/~uli2/
*/
#ifndef __EXTGL_H__
#define __EXTGL_H__
#include <jni.h>
#include <string.h>
#include <stddef.h>
#ifdef __APPLE__
#include <OpenCL/cl_platform.h>
#else
#include <CL/cl_platform.h>
#endif
#include "common_tools.h"
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h> // fix APIENTRY macro redefinition
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
#include "extcl_types.h"
#include "extgl_types.h"
/* AMD_debug_output callback function pointer. */
typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
/* ARB_debug_output callback function pointer. */
typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
/* KHR_debug callback function pointer. */
typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
/* initializes everything, call this right after the rc is created. the function returns true if successful */
extern bool extgl_Open(JNIEnv *env);
extern void extgl_Close(void);
extern void extgl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions);
extern bool extgl_InitializeFunctions(int num_functions, ExtFunction *functions);
extern bool extgl_QueryExtension(const GLubyte*extensions, const char *name);
extern void *extgl_GetProcAddress(const char *name);
#ifndef __APPLE__
/* NV_present_video functions (GLX & WGL only) */
extern jint extgl_EnumerateVideoDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position);
extern jboolean extgl_BindVideoDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position);
extern jboolean extgl_QueryContextNV(JNIEnv *env, jobject peer_info_handle, jobject context_handle, jint attrib, jobject value, jint value_position);
/* NV_video_capture functions (GLX & WGL only) */
extern jboolean extgl_BindVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong device);
extern jint extgl_EnumerateVideoCaptureDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position);
extern jboolean extgl_LockVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device);
extern jboolean extgl_QueryVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device, jint attribute, jobject value, jint value_position);
extern jboolean extgl_ReleaseVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device);
#endif
#endif /* __EXTGL_H__ */

View File

@ -0,0 +1,55 @@
#if defined(_WIN32) || defined(_WIN64)
#define int64_t __int64
#define uint64_t unsigned __int64
#endif
#ifdef _MACOSX
typedef unsigned long GLenum;
typedef unsigned char GLboolean;
typedef unsigned long GLbitfield;
typedef signed char GLbyte;
typedef short GLshort;
typedef long GLint;
typedef long GLsizei;
typedef unsigned char GLubyte;
typedef unsigned short GLushort;
typedef unsigned long GLuint;
typedef float GLfloat;
typedef float GLclampf;
typedef double GLdouble;
typedef double GLclampd;
typedef void GLvoid;
#else
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef void GLvoid;
typedef signed char GLbyte; /* 1-byte signed */
typedef short GLshort; /* 2-byte signed */
typedef int GLint; /* 4-byte signed */
typedef unsigned char GLubyte; /* 1-byte unsigned */
typedef unsigned short GLushort; /* 2-byte unsigned */
typedef unsigned int GLuint; /* 4-byte unsigned */
typedef int GLsizei; /* 4-byte signed */
typedef float GLfloat; /* single precision float */
typedef float GLclampf; /* single precision float in [0,1] */
typedef double GLdouble; /* double precision float */
typedef double GLclampd; /* double precision float in [0,1] */
#endif
typedef char GLchar; /* native character */
typedef ptrdiff_t GLintptr;
typedef ptrdiff_t GLsizeiptr;
typedef ptrdiff_t GLintptrARB;
typedef ptrdiff_t GLsizeiptrARB;
typedef char GLcharARB; /* native character */
typedef unsigned int GLhandleARB; /* shader object handle */
typedef unsigned short GLhalfARB;
typedef unsigned short GLhalfNV;
typedef unsigned short GLhalf;
typedef int64_t GLint64EXT;
typedef uint64_t GLuint64EXT;
typedef int64_t GLint64;
typedef uint64_t GLuint64;
typedef struct __GLsync * GLsync;

View File

@ -0,0 +1,143 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* JNI implementation of the ARB/AMD_debug_output & KHR_debug function callbacks.
*
* @author Spasi
*/
#include <jni.h>
#include "common_tools.h"
#include "extgl.h"
#include "org_lwjgl_opengl_CallbackUtil.h"
static jmethodID debugOutputCallbackARBJ;
static jmethodID debugOutputCallbackAMDJ;
static jmethodID debugCallbackKHRJ;
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_CallbackUtil_ncreateGlobalRef(JNIEnv *env, jclass clazz, jobject obj) {
return (jlong)(intptr_t)(*env)->NewGlobalRef(env, obj);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CallbackUtil_deleteGlobalRef(JNIEnv *env, jclass clazz, jlong globalRef) {
(*env)->DeleteGlobalRef(env, (jobject)(intptr_t)globalRef);
}
// ----------------- [ ARB_debug_output ] -----------------
static void APIENTRY debugOutputCallbackARB(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) {
JNIEnv *env = attachCurrentThread();
if ( env != NULL && !(*env)->ExceptionOccurred(env) && debugOutputCallbackARBJ != NULL ) {
(*env)->CallVoidMethod(env, (jobject)userParam, debugOutputCallbackARBJ,
(jint)source,
(jint)type,
(jint)id,
(jint)severity,
NewStringNativeWithLength(env, message, length)
);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_CallbackUtil_getDebugOutputCallbackARB(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( debugOutputCallbackARBJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opengl/ARBDebugOutputCallback$Handler");
if ( callbackClass != NULL )
debugOutputCallbackARBJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(IIIILjava/lang/String;)V");
}
return (jlong)(intptr_t)&debugOutputCallbackARB;
}
// ----------------- [ AMD_debug_output ] -----------------
static void APIENTRY debugOutputCallbackAMD(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) {
JNIEnv *env = attachCurrentThread();
if ( env != NULL && !(*env)->ExceptionOccurred(env) && debugOutputCallbackAMDJ != NULL ) {
(*env)->CallVoidMethod(env, (jobject)userParam, debugOutputCallbackAMDJ,
(jint)id,
(jint)category,
(jint)severity,
NewStringNativeWithLength(env, message, length)
);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_CallbackUtil_getDebugOutputCallbackAMD(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( debugOutputCallbackAMDJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opengl/AMDDebugOutputCallback$Handler");
if ( callbackClass != NULL )
debugOutputCallbackAMDJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(IIILjava/lang/String;)V");
}
return (jlong)(intptr_t)&debugOutputCallbackAMD;
}
// ----------------- [ KHR_debug ] -----------------
static void APIENTRY debugCallbackKHR(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) {
JNIEnv *env = attachCurrentThread();
if ( env != NULL && !(*env)->ExceptionOccurred(env) && debugCallbackKHRJ != NULL ) {
(*env)->CallVoidMethod(env, (jobject)userParam, debugCallbackKHRJ,
(jint)source,
(jint)type,
(jint)id,
(jint)severity,
NewStringNativeWithLength(env, message, length)
);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_CallbackUtil_getDebugCallbackKHR(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( debugCallbackKHRJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opengl/KHRDebugCallback$Handler");
if ( callbackClass != NULL )
debugCallbackKHRJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(IIIILjava/lang/String;)V");
}
return (jlong)(intptr_t)&debugCallbackKHR;
}

View File

@ -0,0 +1,53 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_CallbackUtil */
#ifndef _Included_org_lwjgl_opengl_CallbackUtil
#define _Included_org_lwjgl_opengl_CallbackUtil
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opengl_CallbackUtil
* Method: ncreateGlobalRef
* Signature: (Ljava/lang/Object;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_CallbackUtil_ncreateGlobalRef
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_CallbackUtil
* Method: deleteGlobalRef
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CallbackUtil_deleteGlobalRef
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_CallbackUtil
* Method: getDebugOutputCallbackARB
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_CallbackUtil_getDebugOutputCallbackARB
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_CallbackUtil
* Method: getDebugOutputCallbackAMD
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_CallbackUtil_getDebugOutputCallbackAMD
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_CallbackUtil
* Method: getDebugCallbackKHR
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_CallbackUtil_getDebugCallbackKHR
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <jni.h>
#include "common_tools.h"
#include "org_lwjgl_opengl_GLContext.h"
#include "extgl.h"
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GLContext_ngetFunctionAddress(JNIEnv *env, jclass clazz, jlong function_name) {
return (jlong)(intptr_t)extgl_GetProcAddress((char *)(intptr_t)function_name);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nLoadOpenGLLibrary(JNIEnv * env, jclass clazz) {
extgl_Open(env);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nUnloadOpenGLLibrary(JNIEnv * env, jclass clazz) {
extgl_Close();
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_resetNativeStubs(JNIEnv *env, jclass clazz, jclass gl_class) {
(*env)->UnregisterNatives(env, gl_class);
}

View File

@ -0,0 +1,45 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_GLContext */
#ifndef _Included_org_lwjgl_opengl_GLContext
#define _Included_org_lwjgl_opengl_GLContext
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opengl_GLContext
* Method: ngetFunctionAddress
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GLContext_ngetFunctionAddress
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_GLContext
* Method: nLoadOpenGLLibrary
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nLoadOpenGLLibrary
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_GLContext
* Method: nUnloadOpenGLLibrary
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nUnloadOpenGLLibrary
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_GLContext
* Method: resetNativeStubs
* Signature: (Ljava/lang/Class;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_resetNativeStubs
(JNIEnv *, jclass, jclass);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,13 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_GLContext_CapabilitiesCacheEntry */
#ifndef _Included_org_lwjgl_opengl_GLContext_CapabilitiesCacheEntry
#define _Included_org_lwjgl_opengl_GLContext_CapabilitiesCacheEntry
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,70 @@
/*
* Copyright (c) 2002-2011 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* JNI implementation of the NVPresentVideoUtil class (GLX & WGL only).
*
* @author Spasi
*/
#include <jni.h>
#include "common_tools.h"
#include "extgl.h"
#include "org_lwjgl_opengl_NVPresentVideoUtil.h"
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglEnumerateVideoDevicesNV(
JNIEnv *env, jclass clazz, jobject peer_info, jobject devices, jint devices_position
) {
#ifdef __APPLE__
return 0;
#else
return extgl_EnumerateVideoDevicesNV(env, peer_info, devices, devices_position);
#endif
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglBindVideoDeviceNV(
JNIEnv *env, jclass clazz, jobject peer_info, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position
) {
#ifdef __APPLE__
return false;
#else
return extgl_BindVideoDeviceNV(env, peer_info, video_slot, video_device, attrib_list, attrib_list_position);
#endif
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglQueryContextNV(JNIEnv *env, jclass clazz, jobject peer_info, jobject context_handle, jint attrib, jobject value, jint value_position) {
#ifdef __APPLE__
return false;
#else
return extgl_QueryContextNV(env, peer_info, context_handle, attrib, value, value_position);
#endif
}

View File

@ -0,0 +1,37 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_NVPresentVideoUtil */
#ifndef _Included_org_lwjgl_opengl_NVPresentVideoUtil
#define _Included_org_lwjgl_opengl_NVPresentVideoUtil
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opengl_NVPresentVideoUtil
* Method: nglEnumerateVideoDevicesNV
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/LongBuffer;I)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglEnumerateVideoDevicesNV
(JNIEnv *, jclass, jobject, jobject, jint);
/*
* Class: org_lwjgl_opengl_NVPresentVideoUtil
* Method: nglBindVideoDeviceNV
* Signature: (Ljava/nio/ByteBuffer;IJLjava/nio/IntBuffer;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglBindVideoDeviceNV
(JNIEnv *, jclass, jobject, jint, jlong, jobject, jint);
/*
* Class: org_lwjgl_opengl_NVPresentVideoUtil
* Method: nglQueryContextNV
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;ILjava/nio/IntBuffer;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglQueryContextNV
(JNIEnv *, jclass, jobject, jobject, jint, jobject, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,82 @@
/*
* Copyright (c) 2002-2011 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* JNI implementation of the NVVideoCaptureUtil class (GLX & WGL only).
*
* @author Spasi
*/
#include <jni.h>
#include "common_tools.h"
#include "extgl.h"
#include "org_lwjgl_opengl_NVVideoCaptureUtil.h"
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglBindVideoCaptureDeviceNV(JNIEnv *env, jclass clazz, jobject peer_info, jint video_slot, jlong device) {
#ifdef __APPLE__
return false;
#else
return extgl_BindVideoCaptureDeviceNV(env, peer_info, video_slot, device);
#endif
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglEnumerateVideoCaptureDevicesNV(JNIEnv *env, jclass clazz, jobject peer_info, jobject devices, jint devices_position) {
#ifdef __APPLE__
return 0;
#else
return extgl_EnumerateVideoCaptureDevicesNV(env, peer_info, devices, devices_position);
#endif
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglLockVideoCaptureDeviceNV(JNIEnv *env, jclass clazz, jobject peer_info, jlong device) {
#ifdef __APPLE__
return false;
#else
return extgl_LockVideoCaptureDeviceNV(env, peer_info, device);
#endif
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglQueryVideoCaptureDeviceNV(JNIEnv *env, jclass clazz, jobject peer_info, jlong device, jint attribute, jobject value, jint value_position) {
#ifdef __APPLE__
return false;
#else
return extgl_QueryVideoCaptureDeviceNV(env, peer_info, device, attribute, value, value_position);
#endif
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglReleaseVideoCaptureDeviceNV(JNIEnv *env, jclass clazz, jobject peer_info, jlong device) {
#ifdef __APPLE__
return false;
#else
return extgl_ReleaseVideoCaptureDeviceNV(env, peer_info, device);
#endif
}

View File

@ -0,0 +1,53 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_NVVideoCaptureUtil */
#ifndef _Included_org_lwjgl_opengl_NVVideoCaptureUtil
#define _Included_org_lwjgl_opengl_NVVideoCaptureUtil
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opengl_NVVideoCaptureUtil
* Method: nglBindVideoCaptureDeviceNV
* Signature: (Ljava/nio/ByteBuffer;IJ)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglBindVideoCaptureDeviceNV
(JNIEnv *, jclass, jobject, jint, jlong);
/*
* Class: org_lwjgl_opengl_NVVideoCaptureUtil
* Method: nglEnumerateVideoCaptureDevicesNV
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/LongBuffer;I)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglEnumerateVideoCaptureDevicesNV
(JNIEnv *, jclass, jobject, jobject, jint);
/*
* Class: org_lwjgl_opengl_NVVideoCaptureUtil
* Method: nglLockVideoCaptureDeviceNV
* Signature: (Ljava/nio/ByteBuffer;J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglLockVideoCaptureDeviceNV
(JNIEnv *, jclass, jobject, jlong);
/*
* Class: org_lwjgl_opengl_NVVideoCaptureUtil
* Method: nglQueryVideoCaptureDeviceNV
* Signature: (Ljava/nio/ByteBuffer;JILjava/nio/IntBuffer;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglQueryVideoCaptureDeviceNV
(JNIEnv *, jclass, jobject, jlong, jint, jobject, jint);
/*
* Class: org_lwjgl_opengl_NVVideoCaptureUtil
* Method: nglReleaseVideoCaptureDeviceNV
* Signature: (Ljava/nio/ByteBuffer;J)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglReleaseVideoCaptureDeviceNV
(JNIEnv *, jclass, jobject, jlong);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,47 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_Pbuffer */
#ifndef _Included_org_lwjgl_opengl_Pbuffer
#define _Included_org_lwjgl_opengl_Pbuffer
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED
#define org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED 1L
#undef org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_SUPPORTED
#define org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_SUPPORTED 2L
#undef org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_RECTANGLE_SUPPORTED
#define org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_RECTANGLE_SUPPORTED 4L
#undef org_lwjgl_opengl_Pbuffer_RENDER_DEPTH_TEXTURE_SUPPORTED
#define org_lwjgl_opengl_Pbuffer_RENDER_DEPTH_TEXTURE_SUPPORTED 8L
#undef org_lwjgl_opengl_Pbuffer_MIPMAP_LEVEL
#define org_lwjgl_opengl_Pbuffer_MIPMAP_LEVEL 8315L
#undef org_lwjgl_opengl_Pbuffer_CUBE_MAP_FACE
#define org_lwjgl_opengl_Pbuffer_CUBE_MAP_FACE 8316L
#undef org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_POSITIVE_X
#define org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_POSITIVE_X 8317L
#undef org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_NEGATIVE_X
#define org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_NEGATIVE_X 8318L
#undef org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_POSITIVE_Y
#define org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_POSITIVE_Y 8319L
#undef org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_NEGATIVE_Y
#define org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_NEGATIVE_Y 8320L
#undef org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_POSITIVE_Z
#define org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_POSITIVE_Z 8321L
#undef org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_NEGATIVE_Z
#define org_lwjgl_opengl_Pbuffer_TEXTURE_CUBE_MAP_NEGATIVE_Z 8322L
#undef org_lwjgl_opengl_Pbuffer_FRONT_LEFT_BUFFER
#define org_lwjgl_opengl_Pbuffer_FRONT_LEFT_BUFFER 8323L
#undef org_lwjgl_opengl_Pbuffer_FRONT_RIGHT_BUFFER
#define org_lwjgl_opengl_Pbuffer_FRONT_RIGHT_BUFFER 8324L
#undef org_lwjgl_opengl_Pbuffer_BACK_LEFT_BUFFER
#define org_lwjgl_opengl_Pbuffer_BACK_LEFT_BUFFER 8325L
#undef org_lwjgl_opengl_Pbuffer_BACK_RIGHT_BUFFER
#define org_lwjgl_opengl_Pbuffer_BACK_RIGHT_BUFFER 8326L
#undef org_lwjgl_opengl_Pbuffer_DEPTH_BUFFER
#define org_lwjgl_opengl_Pbuffer_DEPTH_BUFFER 8359L
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,10 @@
#include "org_lwjgl_BufferUtils.h"
#include "common_tools.h"
JNIEXPORT void JNICALL Java_org_lwjgl_BufferUtils_zeroBuffer0(JNIEnv *env, jclass clazz, jobject buffer, jlong offset, jlong size) {
memset((char*)(*env)->GetDirectBufferAddress(env, buffer) + (size_t)offset, 0, (size_t)size);
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_BufferUtils_getBufferAddress(JNIEnv *env, jclass clazz, jobject buffer) {
return (intptr_t)(*env)->GetDirectBufferAddress(env, buffer);
}

View File

@ -0,0 +1,29 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_BufferUtils */
#ifndef _Included_org_lwjgl_BufferUtils
#define _Included_org_lwjgl_BufferUtils
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_BufferUtils
* Method: zeroBuffer0
* Signature: (Ljava/nio/Buffer;JJ)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_BufferUtils_zeroBuffer0
(JNIEnv *, jclass, jobject, jlong, jlong);
/*
* Class: org_lwjgl_BufferUtils
* Method: getBufferAddress
* Signature: (Ljava/nio/Buffer;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_BufferUtils_getBufferAddress
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,37 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_DefaultSysImplementation */
#ifndef _Included_org_lwjgl_DefaultSysImplementation
#define _Included_org_lwjgl_DefaultSysImplementation
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_DefaultSysImplementation
* Method: getJNIVersion
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
(JNIEnv *, jobject);
/*
* Class: org_lwjgl_DefaultSysImplementation
* Method: getPointerSize
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getPointerSize
(JNIEnv *, jobject);
/*
* Class: org_lwjgl_DefaultSysImplementation
* Method: setDebug
* Signature: (Z)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_DefaultSysImplementation_setDebug
(JNIEnv *, jobject, jboolean);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,19 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_input_Cursor */
#ifndef _Included_org_lwjgl_input_Cursor
#define _Included_org_lwjgl_input_Cursor
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_input_Cursor_CURSOR_ONE_BIT_TRANSPARENCY
#define org_lwjgl_input_Cursor_CURSOR_ONE_BIT_TRANSPARENCY 1L
#undef org_lwjgl_input_Cursor_CURSOR_8_BIT_ALPHA
#define org_lwjgl_input_Cursor_CURSOR_8_BIT_ALPHA 2L
#undef org_lwjgl_input_Cursor_CURSOR_ANIMATION
#define org_lwjgl_input_Cursor_CURSOR_ANIMATION 4L
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,13 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_input_Cursor_CursorElement */
#ifndef _Included_org_lwjgl_input_Cursor_CursorElement
#define _Included_org_lwjgl_input_Cursor_CursorElement
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,287 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_input_Keyboard */
#ifndef _Included_org_lwjgl_input_Keyboard
#define _Included_org_lwjgl_input_Keyboard
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_input_Keyboard_EVENT_SIZE
#define org_lwjgl_input_Keyboard_EVENT_SIZE 18L
#undef org_lwjgl_input_Keyboard_CHAR_NONE
#define org_lwjgl_input_Keyboard_CHAR_NONE 0L
#undef org_lwjgl_input_Keyboard_KEY_NONE
#define org_lwjgl_input_Keyboard_KEY_NONE 0L
#undef org_lwjgl_input_Keyboard_KEY_ESCAPE
#define org_lwjgl_input_Keyboard_KEY_ESCAPE 1L
#undef org_lwjgl_input_Keyboard_KEY_1
#define org_lwjgl_input_Keyboard_KEY_1 2L
#undef org_lwjgl_input_Keyboard_KEY_2
#define org_lwjgl_input_Keyboard_KEY_2 3L
#undef org_lwjgl_input_Keyboard_KEY_3
#define org_lwjgl_input_Keyboard_KEY_3 4L
#undef org_lwjgl_input_Keyboard_KEY_4
#define org_lwjgl_input_Keyboard_KEY_4 5L
#undef org_lwjgl_input_Keyboard_KEY_5
#define org_lwjgl_input_Keyboard_KEY_5 6L
#undef org_lwjgl_input_Keyboard_KEY_6
#define org_lwjgl_input_Keyboard_KEY_6 7L
#undef org_lwjgl_input_Keyboard_KEY_7
#define org_lwjgl_input_Keyboard_KEY_7 8L
#undef org_lwjgl_input_Keyboard_KEY_8
#define org_lwjgl_input_Keyboard_KEY_8 9L
#undef org_lwjgl_input_Keyboard_KEY_9
#define org_lwjgl_input_Keyboard_KEY_9 10L
#undef org_lwjgl_input_Keyboard_KEY_0
#define org_lwjgl_input_Keyboard_KEY_0 11L
#undef org_lwjgl_input_Keyboard_KEY_MINUS
#define org_lwjgl_input_Keyboard_KEY_MINUS 12L
#undef org_lwjgl_input_Keyboard_KEY_EQUALS
#define org_lwjgl_input_Keyboard_KEY_EQUALS 13L
#undef org_lwjgl_input_Keyboard_KEY_BACK
#define org_lwjgl_input_Keyboard_KEY_BACK 14L
#undef org_lwjgl_input_Keyboard_KEY_TAB
#define org_lwjgl_input_Keyboard_KEY_TAB 15L
#undef org_lwjgl_input_Keyboard_KEY_Q
#define org_lwjgl_input_Keyboard_KEY_Q 16L
#undef org_lwjgl_input_Keyboard_KEY_W
#define org_lwjgl_input_Keyboard_KEY_W 17L
#undef org_lwjgl_input_Keyboard_KEY_E
#define org_lwjgl_input_Keyboard_KEY_E 18L
#undef org_lwjgl_input_Keyboard_KEY_R
#define org_lwjgl_input_Keyboard_KEY_R 19L
#undef org_lwjgl_input_Keyboard_KEY_T
#define org_lwjgl_input_Keyboard_KEY_T 20L
#undef org_lwjgl_input_Keyboard_KEY_Y
#define org_lwjgl_input_Keyboard_KEY_Y 21L
#undef org_lwjgl_input_Keyboard_KEY_U
#define org_lwjgl_input_Keyboard_KEY_U 22L
#undef org_lwjgl_input_Keyboard_KEY_I
#define org_lwjgl_input_Keyboard_KEY_I 23L
#undef org_lwjgl_input_Keyboard_KEY_O
#define org_lwjgl_input_Keyboard_KEY_O 24L
#undef org_lwjgl_input_Keyboard_KEY_P
#define org_lwjgl_input_Keyboard_KEY_P 25L
#undef org_lwjgl_input_Keyboard_KEY_LBRACKET
#define org_lwjgl_input_Keyboard_KEY_LBRACKET 26L
#undef org_lwjgl_input_Keyboard_KEY_RBRACKET
#define org_lwjgl_input_Keyboard_KEY_RBRACKET 27L
#undef org_lwjgl_input_Keyboard_KEY_RETURN
#define org_lwjgl_input_Keyboard_KEY_RETURN 28L
#undef org_lwjgl_input_Keyboard_KEY_LCONTROL
#define org_lwjgl_input_Keyboard_KEY_LCONTROL 29L
#undef org_lwjgl_input_Keyboard_KEY_A
#define org_lwjgl_input_Keyboard_KEY_A 30L
#undef org_lwjgl_input_Keyboard_KEY_S
#define org_lwjgl_input_Keyboard_KEY_S 31L
#undef org_lwjgl_input_Keyboard_KEY_D
#define org_lwjgl_input_Keyboard_KEY_D 32L
#undef org_lwjgl_input_Keyboard_KEY_F
#define org_lwjgl_input_Keyboard_KEY_F 33L
#undef org_lwjgl_input_Keyboard_KEY_G
#define org_lwjgl_input_Keyboard_KEY_G 34L
#undef org_lwjgl_input_Keyboard_KEY_H
#define org_lwjgl_input_Keyboard_KEY_H 35L
#undef org_lwjgl_input_Keyboard_KEY_J
#define org_lwjgl_input_Keyboard_KEY_J 36L
#undef org_lwjgl_input_Keyboard_KEY_K
#define org_lwjgl_input_Keyboard_KEY_K 37L
#undef org_lwjgl_input_Keyboard_KEY_L
#define org_lwjgl_input_Keyboard_KEY_L 38L
#undef org_lwjgl_input_Keyboard_KEY_SEMICOLON
#define org_lwjgl_input_Keyboard_KEY_SEMICOLON 39L
#undef org_lwjgl_input_Keyboard_KEY_APOSTROPHE
#define org_lwjgl_input_Keyboard_KEY_APOSTROPHE 40L
#undef org_lwjgl_input_Keyboard_KEY_GRAVE
#define org_lwjgl_input_Keyboard_KEY_GRAVE 41L
#undef org_lwjgl_input_Keyboard_KEY_LSHIFT
#define org_lwjgl_input_Keyboard_KEY_LSHIFT 42L
#undef org_lwjgl_input_Keyboard_KEY_BACKSLASH
#define org_lwjgl_input_Keyboard_KEY_BACKSLASH 43L
#undef org_lwjgl_input_Keyboard_KEY_Z
#define org_lwjgl_input_Keyboard_KEY_Z 44L
#undef org_lwjgl_input_Keyboard_KEY_X
#define org_lwjgl_input_Keyboard_KEY_X 45L
#undef org_lwjgl_input_Keyboard_KEY_C
#define org_lwjgl_input_Keyboard_KEY_C 46L
#undef org_lwjgl_input_Keyboard_KEY_V
#define org_lwjgl_input_Keyboard_KEY_V 47L
#undef org_lwjgl_input_Keyboard_KEY_B
#define org_lwjgl_input_Keyboard_KEY_B 48L
#undef org_lwjgl_input_Keyboard_KEY_N
#define org_lwjgl_input_Keyboard_KEY_N 49L
#undef org_lwjgl_input_Keyboard_KEY_M
#define org_lwjgl_input_Keyboard_KEY_M 50L
#undef org_lwjgl_input_Keyboard_KEY_COMMA
#define org_lwjgl_input_Keyboard_KEY_COMMA 51L
#undef org_lwjgl_input_Keyboard_KEY_PERIOD
#define org_lwjgl_input_Keyboard_KEY_PERIOD 52L
#undef org_lwjgl_input_Keyboard_KEY_SLASH
#define org_lwjgl_input_Keyboard_KEY_SLASH 53L
#undef org_lwjgl_input_Keyboard_KEY_RSHIFT
#define org_lwjgl_input_Keyboard_KEY_RSHIFT 54L
#undef org_lwjgl_input_Keyboard_KEY_MULTIPLY
#define org_lwjgl_input_Keyboard_KEY_MULTIPLY 55L
#undef org_lwjgl_input_Keyboard_KEY_LMENU
#define org_lwjgl_input_Keyboard_KEY_LMENU 56L
#undef org_lwjgl_input_Keyboard_KEY_SPACE
#define org_lwjgl_input_Keyboard_KEY_SPACE 57L
#undef org_lwjgl_input_Keyboard_KEY_CAPITAL
#define org_lwjgl_input_Keyboard_KEY_CAPITAL 58L
#undef org_lwjgl_input_Keyboard_KEY_F1
#define org_lwjgl_input_Keyboard_KEY_F1 59L
#undef org_lwjgl_input_Keyboard_KEY_F2
#define org_lwjgl_input_Keyboard_KEY_F2 60L
#undef org_lwjgl_input_Keyboard_KEY_F3
#define org_lwjgl_input_Keyboard_KEY_F3 61L
#undef org_lwjgl_input_Keyboard_KEY_F4
#define org_lwjgl_input_Keyboard_KEY_F4 62L
#undef org_lwjgl_input_Keyboard_KEY_F5
#define org_lwjgl_input_Keyboard_KEY_F5 63L
#undef org_lwjgl_input_Keyboard_KEY_F6
#define org_lwjgl_input_Keyboard_KEY_F6 64L
#undef org_lwjgl_input_Keyboard_KEY_F7
#define org_lwjgl_input_Keyboard_KEY_F7 65L
#undef org_lwjgl_input_Keyboard_KEY_F8
#define org_lwjgl_input_Keyboard_KEY_F8 66L
#undef org_lwjgl_input_Keyboard_KEY_F9
#define org_lwjgl_input_Keyboard_KEY_F9 67L
#undef org_lwjgl_input_Keyboard_KEY_F10
#define org_lwjgl_input_Keyboard_KEY_F10 68L
#undef org_lwjgl_input_Keyboard_KEY_NUMLOCK
#define org_lwjgl_input_Keyboard_KEY_NUMLOCK 69L
#undef org_lwjgl_input_Keyboard_KEY_SCROLL
#define org_lwjgl_input_Keyboard_KEY_SCROLL 70L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD7
#define org_lwjgl_input_Keyboard_KEY_NUMPAD7 71L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD8
#define org_lwjgl_input_Keyboard_KEY_NUMPAD8 72L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD9
#define org_lwjgl_input_Keyboard_KEY_NUMPAD9 73L
#undef org_lwjgl_input_Keyboard_KEY_SUBTRACT
#define org_lwjgl_input_Keyboard_KEY_SUBTRACT 74L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD4
#define org_lwjgl_input_Keyboard_KEY_NUMPAD4 75L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD5
#define org_lwjgl_input_Keyboard_KEY_NUMPAD5 76L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD6
#define org_lwjgl_input_Keyboard_KEY_NUMPAD6 77L
#undef org_lwjgl_input_Keyboard_KEY_ADD
#define org_lwjgl_input_Keyboard_KEY_ADD 78L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD1
#define org_lwjgl_input_Keyboard_KEY_NUMPAD1 79L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD2
#define org_lwjgl_input_Keyboard_KEY_NUMPAD2 80L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD3
#define org_lwjgl_input_Keyboard_KEY_NUMPAD3 81L
#undef org_lwjgl_input_Keyboard_KEY_NUMPAD0
#define org_lwjgl_input_Keyboard_KEY_NUMPAD0 82L
#undef org_lwjgl_input_Keyboard_KEY_DECIMAL
#define org_lwjgl_input_Keyboard_KEY_DECIMAL 83L
#undef org_lwjgl_input_Keyboard_KEY_F11
#define org_lwjgl_input_Keyboard_KEY_F11 87L
#undef org_lwjgl_input_Keyboard_KEY_F12
#define org_lwjgl_input_Keyboard_KEY_F12 88L
#undef org_lwjgl_input_Keyboard_KEY_F13
#define org_lwjgl_input_Keyboard_KEY_F13 100L
#undef org_lwjgl_input_Keyboard_KEY_F14
#define org_lwjgl_input_Keyboard_KEY_F14 101L
#undef org_lwjgl_input_Keyboard_KEY_F15
#define org_lwjgl_input_Keyboard_KEY_F15 102L
#undef org_lwjgl_input_Keyboard_KEY_F16
#define org_lwjgl_input_Keyboard_KEY_F16 103L
#undef org_lwjgl_input_Keyboard_KEY_F17
#define org_lwjgl_input_Keyboard_KEY_F17 104L
#undef org_lwjgl_input_Keyboard_KEY_F18
#define org_lwjgl_input_Keyboard_KEY_F18 105L
#undef org_lwjgl_input_Keyboard_KEY_KANA
#define org_lwjgl_input_Keyboard_KEY_KANA 112L
#undef org_lwjgl_input_Keyboard_KEY_F19
#define org_lwjgl_input_Keyboard_KEY_F19 113L
#undef org_lwjgl_input_Keyboard_KEY_CONVERT
#define org_lwjgl_input_Keyboard_KEY_CONVERT 121L
#undef org_lwjgl_input_Keyboard_KEY_NOCONVERT
#define org_lwjgl_input_Keyboard_KEY_NOCONVERT 123L
#undef org_lwjgl_input_Keyboard_KEY_YEN
#define org_lwjgl_input_Keyboard_KEY_YEN 125L
#undef org_lwjgl_input_Keyboard_KEY_NUMPADEQUALS
#define org_lwjgl_input_Keyboard_KEY_NUMPADEQUALS 141L
#undef org_lwjgl_input_Keyboard_KEY_CIRCUMFLEX
#define org_lwjgl_input_Keyboard_KEY_CIRCUMFLEX 144L
#undef org_lwjgl_input_Keyboard_KEY_AT
#define org_lwjgl_input_Keyboard_KEY_AT 145L
#undef org_lwjgl_input_Keyboard_KEY_COLON
#define org_lwjgl_input_Keyboard_KEY_COLON 146L
#undef org_lwjgl_input_Keyboard_KEY_UNDERLINE
#define org_lwjgl_input_Keyboard_KEY_UNDERLINE 147L
#undef org_lwjgl_input_Keyboard_KEY_KANJI
#define org_lwjgl_input_Keyboard_KEY_KANJI 148L
#undef org_lwjgl_input_Keyboard_KEY_STOP
#define org_lwjgl_input_Keyboard_KEY_STOP 149L
#undef org_lwjgl_input_Keyboard_KEY_AX
#define org_lwjgl_input_Keyboard_KEY_AX 150L
#undef org_lwjgl_input_Keyboard_KEY_UNLABELED
#define org_lwjgl_input_Keyboard_KEY_UNLABELED 151L
#undef org_lwjgl_input_Keyboard_KEY_NUMPADENTER
#define org_lwjgl_input_Keyboard_KEY_NUMPADENTER 156L
#undef org_lwjgl_input_Keyboard_KEY_RCONTROL
#define org_lwjgl_input_Keyboard_KEY_RCONTROL 157L
#undef org_lwjgl_input_Keyboard_KEY_SECTION
#define org_lwjgl_input_Keyboard_KEY_SECTION 167L
#undef org_lwjgl_input_Keyboard_KEY_NUMPADCOMMA
#define org_lwjgl_input_Keyboard_KEY_NUMPADCOMMA 179L
#undef org_lwjgl_input_Keyboard_KEY_DIVIDE
#define org_lwjgl_input_Keyboard_KEY_DIVIDE 181L
#undef org_lwjgl_input_Keyboard_KEY_SYSRQ
#define org_lwjgl_input_Keyboard_KEY_SYSRQ 183L
#undef org_lwjgl_input_Keyboard_KEY_RMENU
#define org_lwjgl_input_Keyboard_KEY_RMENU 184L
#undef org_lwjgl_input_Keyboard_KEY_FUNCTION
#define org_lwjgl_input_Keyboard_KEY_FUNCTION 196L
#undef org_lwjgl_input_Keyboard_KEY_PAUSE
#define org_lwjgl_input_Keyboard_KEY_PAUSE 197L
#undef org_lwjgl_input_Keyboard_KEY_HOME
#define org_lwjgl_input_Keyboard_KEY_HOME 199L
#undef org_lwjgl_input_Keyboard_KEY_UP
#define org_lwjgl_input_Keyboard_KEY_UP 200L
#undef org_lwjgl_input_Keyboard_KEY_PRIOR
#define org_lwjgl_input_Keyboard_KEY_PRIOR 201L
#undef org_lwjgl_input_Keyboard_KEY_LEFT
#define org_lwjgl_input_Keyboard_KEY_LEFT 203L
#undef org_lwjgl_input_Keyboard_KEY_RIGHT
#define org_lwjgl_input_Keyboard_KEY_RIGHT 205L
#undef org_lwjgl_input_Keyboard_KEY_END
#define org_lwjgl_input_Keyboard_KEY_END 207L
#undef org_lwjgl_input_Keyboard_KEY_DOWN
#define org_lwjgl_input_Keyboard_KEY_DOWN 208L
#undef org_lwjgl_input_Keyboard_KEY_NEXT
#define org_lwjgl_input_Keyboard_KEY_NEXT 209L
#undef org_lwjgl_input_Keyboard_KEY_INSERT
#define org_lwjgl_input_Keyboard_KEY_INSERT 210L
#undef org_lwjgl_input_Keyboard_KEY_DELETE
#define org_lwjgl_input_Keyboard_KEY_DELETE 211L
#undef org_lwjgl_input_Keyboard_KEY_CLEAR
#define org_lwjgl_input_Keyboard_KEY_CLEAR 218L
#undef org_lwjgl_input_Keyboard_KEY_LMETA
#define org_lwjgl_input_Keyboard_KEY_LMETA 219L
#undef org_lwjgl_input_Keyboard_KEY_LWIN
#define org_lwjgl_input_Keyboard_KEY_LWIN 219L
#undef org_lwjgl_input_Keyboard_KEY_RMETA
#define org_lwjgl_input_Keyboard_KEY_RMETA 220L
#undef org_lwjgl_input_Keyboard_KEY_RWIN
#define org_lwjgl_input_Keyboard_KEY_RWIN 220L
#undef org_lwjgl_input_Keyboard_KEY_APPS
#define org_lwjgl_input_Keyboard_KEY_APPS 221L
#undef org_lwjgl_input_Keyboard_KEY_POWER
#define org_lwjgl_input_Keyboard_KEY_POWER 222L
#undef org_lwjgl_input_Keyboard_KEY_SLEEP
#define org_lwjgl_input_Keyboard_KEY_SLEEP 223L
#undef org_lwjgl_input_Keyboard_KEYBOARD_SIZE
#define org_lwjgl_input_Keyboard_KEYBOARD_SIZE 256L
#undef org_lwjgl_input_Keyboard_BUFFER_SIZE
#define org_lwjgl_input_Keyboard_BUFFER_SIZE 50L
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,13 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_input_Keyboard_KeyEvent */
#ifndef _Included_org_lwjgl_input_Keyboard_KeyEvent
#define _Included_org_lwjgl_input_Keyboard_KeyEvent
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,17 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_input_Mouse */
#ifndef _Included_org_lwjgl_input_Mouse
#define _Included_org_lwjgl_input_Mouse
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_input_Mouse_EVENT_SIZE
#define org_lwjgl_input_Mouse_EVENT_SIZE 22L
#undef org_lwjgl_input_Mouse_BUFFER_SIZE
#define org_lwjgl_input_Mouse_BUFFER_SIZE 50L
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <jni.h>
#include "org_lwjgl_openal_AL.h"
#include "extal.h"
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreate(JNIEnv *env, jclass clazz, jstring oalPath) {
extal_LoadLibrary(env, oalPath);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nDestroy(JNIEnv *env, jclass clazz) {
extal_UnloadLibrary();
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_resetNativeStubs(JNIEnv *env, jclass clazz, jclass al_class) {
(*env)->UnregisterNatives(env, al_class);
}

View File

@ -0,0 +1,45 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_openal_AL */
#ifndef _Included_org_lwjgl_openal_AL
#define _Included_org_lwjgl_openal_AL
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_openal_AL
* Method: nCreate
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreate
(JNIEnv *, jclass, jstring);
/*
* Class: org_lwjgl_openal_AL
* Method: nCreateDefault
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreateDefault
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_openal_AL
* Method: nDestroy
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nDestroy
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_openal_AL
* Method: resetNativeStubs
* Signature: (Ljava/lang/Class;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_resetNativeStubs
(JNIEnv *, jclass, jclass);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,287 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id: org_lwjgl_openal_ALC.c 2279 2006-02-23 19:22:00Z elias_naur $
*
* This is the actual JNI implementation of the OpenAL context/device library.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision: 2279 $
*/
/* OpenAL includes */
#include "extal.h"
//alc
typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param);
typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data);
typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName);
typedef ALCboolean (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device);
typedef ALCcontext* (ALCAPIENTRY *alcCreateContextPROC)(ALCdevice *device,ALCint *attrList);
typedef ALCenum (ALCAPIENTRY *alcMakeContextCurrentPROC)(ALCcontext *context);
typedef ALCvoid (ALCAPIENTRY *alcProcessContextPROC)(ALCcontext *context);
typedef ALCdevice* (ALCAPIENTRY *alcGetContextsDevicePROC)(ALCcontext *context);
typedef ALCvoid (ALCAPIENTRY *alcSuspendContextPROC)(ALCcontext *context);
typedef ALCvoid (ALCAPIENTRY *alcDestroyContextPROC)(ALCcontext *context);
typedef ALCenum (ALCAPIENTRY *alcGetErrorPROC)(ALCdevice *device);
typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,ALCubyte *extName);
//typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName);
typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName);
typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid);
static alcGetCurrentContextPROC alcGetCurrentContext = NULL;
static alcGetStringPROC alcGetString;
static alcGetIntegervPROC alcGetIntegerv;
static alcOpenDevicePROC alcOpenDevice;
static alcCloseDevicePROC alcCloseDevice;
static alcCreateContextPROC alcCreateContext;
static alcMakeContextCurrentPROC alcMakeContextCurrent;
static alcProcessContextPROC alcProcessContext;
static alcGetContextsDevicePROC alcGetContextsDevice;
static alcSuspendContextPROC alcSuspendContext;
static alcDestroyContextPROC alcDestroyContext;
static alcGetErrorPROC alcGetError;
static alcIsExtensionPresentPROC alcIsExtensionPresent;
//static alcGetProcAddressPROC alcGetProcAddress;
static alcGetEnumValuePROC alcGetEnumValue;
/**
* This function returns strings related to the context.
*
* C Specification:
* ALubyte * alcGetString(ALCdevice *device, ALenum token);
*/
static jobject JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) {
char* alcString = (char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token);
size_t length;
int i=1;
if (alcString == NULL) {
return NULL;
}
// Special treatment of enumeration tokens
// These are encoded using \0 between elements and a finishing \0\0
switch(token) {
case 0x1005: // ALC_DEVICE_SPECIFIER
case 0x310: // ALC_CAPTURE_DEVICE_SPECIFIER
// If deviceaddress is not 0, OpenAL returns a single device terminated by a
// single \0 character, if token is ALC_DEVICE_SPECIFIER or
// ALC_CAPTURE_DEVICE_SPECIFIER.
if (deviceaddress != 0) {
length = strlen(alcString);
break;
}
case 0x1013: // ALC_ALL_DEVICES_SPECIFIER
while (alcString[i - 1] != '\0' || alcString[i] != '\0') {
i++;
}
length = i + 1;
break;
default: // e.g. ALC_DEFAULT_ALL_DEVICES_SPECIFIER
length = strlen(alcString);
}
//return NewStringNativeWithLength(env, alcString, length);
return safeNewBuffer(env, alcString, length);
}
/**
* This function returns integers related to the context.
*
* C Specification:
* ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest);
*/
static void JNICALL Java_org_lwjgl_openal_ALC10_nalcGetIntegerv (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token, jint size, jlong dest) {
ALint* dest_address = (ALint*)(intptr_t)dest;
alcGetIntegerv((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token, (ALsizei) size, dest_address);
}
/**
* This function opens a device by name.
*
* C Specification:
* ALCdevice *alcOpenDevice( const ALubyte *tokstr );
*/
static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcOpenDevice (JNIEnv *env, jclass clazz, jlong tokstr) {
return (jlong)(intptr_t)alcOpenDevice((ALubyte *)(intptr_t)tokstr);
}
/**
* This function closes a device by name.
*
* C Specification:
* bool alcCloseDevice( ALCdevice *dev );
*/
static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcCloseDevice (JNIEnv *env, jclass clazz, jlong deviceaddress) {
return alcCloseDevice((ALCdevice*)((intptr_t)deviceaddress));
}
/**
* This function creates a context using a specified device.
*
* C Specification:
* ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist );
*/
static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcCreateContext (JNIEnv *env, jclass clazz, jlong deviceaddress, jlong attrlist) {
ALint* attrlist_address = (ALint*)(intptr_t)attrlist;
ALCcontext* context;
context = alcCreateContext((ALCdevice*)((intptr_t)deviceaddress), attrlist_address);
return (jlong)((intptr_t)context);
}
/**
* This function makes a specified context the current context.
*
* C Specification:
* ALCboolean alcMakeContextCurrent(ALCcontext *context);
*/
static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) {
ALCcontext* context = (ALCcontext*)((intptr_t)contextaddress);
return alcMakeContextCurrent(context);
}
/**
* This function tells a context to begin processing.
*
* C Specification:
* void alcProcessContext(ALCcontext *context);
*/
static void JNICALL Java_org_lwjgl_openal_ALC10_nalcProcessContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
alcProcessContext((ALCcontext*)((intptr_t)contextaddress));
}
/**
* This function retrieves the current context.
*
* C Specification:
* ALCcontext* alcGetCurrentContext( ALvoid );
*/
static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext (JNIEnv *env, jclass clazz) {
ALCcontext* context = alcGetCurrentContext();
return (jlong)((intptr_t)context);
}
/**
* This function retrieves the specified contexts device
*
* C Specification:
* ALCdevice* alcGetContextsDevice(ALCcontext *context);
*/
static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice (JNIEnv *env, jclass clazz, jlong contextaddress) {
ALCdevice* device = alcGetContextsDevice((ALCcontext*)((intptr_t)contextaddress));
return (jlong)((intptr_t)device);
}
/**
* This function suspends processing on a specified context.
*
* C Specification:
* void alcSuspendContext(ALCcontext *context);
*/
static void JNICALL Java_org_lwjgl_openal_ALC10_nalcSuspendContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
alcSuspendContext((ALCcontext*)((intptr_t)contextaddress));
}
/**
* This function destroys a context.
*
* C Specification:
* void alcDestroyContext(ALCcontext *context);
*/
static void JNICALL Java_org_lwjgl_openal_ALC10_nalcDestroyContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
alcDestroyContext((ALCcontext*)((intptr_t)contextaddress));
}
/**
* This function retrieves the specified devices context error state.
*
* C Specification:
* ALCenum alcGetError(ALCdevice *device);
*/
static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetError (JNIEnv *env, jclass clazz, jlong deviceaddress) {
return alcGetError((ALCdevice*)((intptr_t)deviceaddress));
}
/**
* This function queries if a specified context extension is available.
*
* C Specification:
* ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName);
*/
static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jlong deviceaddress, jlong extName) {
return (jboolean) alcIsExtensionPresent((ALCdevice*)((intptr_t)deviceaddress), (ALubyte*)(intptr_t)extName);
}
/**
* This function retrieves the enum value for a specified enumeration name.
*
* C Specification:
* ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName);
*/
static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetEnumValue (JNIEnv *env, jclass clazz, jlong deviceaddress, jlong enumName) {
return (jint) alcGetEnumValue((ALCdevice*)((intptr_t)deviceaddress), (ALubyte*)(intptr_t)enumName);
}
/**
* Loads the context OpenAL functions
*
* @return true if all methods were loaded, false if one of the methods could not be loaded
*/
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC10_initNativeStubs(JNIEnv *env, jclass clazz) {
JavaMethodAndExtFunction functions[] = {
{"nalcGetString", "(JI)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString, false},
{"nalcGetIntegerv", "(JIIJ)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv, false},
{"nalcOpenDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice, false},
{"nalcCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice, false},
{"nalcCreateContext", "(JJ)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext, false},
{"nalcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent, false},
{"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext, false},
{"nalcGetCurrentContext", "()J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext, false},
{"nalcGetContextsDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice, false},
{"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext, false},
{"nalcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext, false},
{"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetError, "alcGetError", (void*)&alcGetError, false},
{"nalcIsExtensionPresent", "(JJ)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent, false},
{"nalcGetEnumValue", "(JJ)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue, false}
};
int num_functions = NUMFUNCTIONS(functions);
extal_InitializeClass(env, clazz, num_functions, functions);
}
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,125 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id: org_lwjgl_openal_ALC.c 2279 2006-02-23 19:22:00Z elias_naur $
*
* This is the actual JNI implementation of the OpenAL context/device library.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision: 2279 $
*/
/* OpenAL includes */
#include "extal.h"
//alc
typedef ALCdevice * (ALCAPIENTRY *alcCaptureOpenDevicePROC)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
typedef ALCboolean (ALCAPIENTRY *alcCaptureCloseDevicePROC)( ALCdevice *device );
typedef void (ALCAPIENTRY *alcCaptureStartPROC)( ALCdevice *device );
typedef void (ALCAPIENTRY *alcCaptureStopPROC)( ALCdevice *device );
typedef void (ALCAPIENTRY *alcCaptureSamplesPROC)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
static alcCaptureOpenDevicePROC alcCaptureOpenDevice;
static alcCaptureCloseDevicePROC alcCaptureCloseDevice;
static alcCaptureStartPROC alcCaptureStart;
static alcCaptureStopPROC alcCaptureStop;
static alcCaptureSamplesPROC alcCaptureSamples;
/*
* Class: org_lwjgl_openal_ALC11
* Method: nalcCaptureOpenDevice
* Signature: (Ljava/lang/String;III)J
*/
static jlong JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice(JNIEnv *env, jclass clazz, jlong devicename, jint frequency, jint format, jint buffersize) {
return (jlong)(intptr_t)alcCaptureOpenDevice((const char *)(intptr_t)devicename, (unsigned int) frequency, format, buffersize);
}
/*
* Class: org_lwjgl_openal_ALC11
* Method: nalcCaptureCloseDevice
* Signature: (J)Z
*/
static jboolean JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice(JNIEnv *env, jclass clazz, jlong device) {
return (jboolean) alcCaptureCloseDevice((ALCdevice*) ((intptr_t)device));
}
/*
* Class: org_lwjgl_openal_ALC11
* Method: nalcCaptureStart
* Signature: (J)V
*/
static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStart(JNIEnv *env, jclass clazz, jlong device) {
alcCaptureStart((ALCdevice*) ((intptr_t)device));
}
/*
* Class: org_lwjgl_openal_ALC11
* Method: nalcCaptureStop
* Signature: (J)V
*/
static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStop(JNIEnv * env, jclass clazz, jlong device) {
alcCaptureStop((ALCdevice*) ((intptr_t)device));
}
/*
* Class: org_lwjgl_openal_ALC11
* Method: nalcCaptureSamples
* Signature: (JLjava/nio/ByteBuffer;I)V
*/
static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureSamples(JNIEnv *env, jclass clazz, jlong device, jlong buffer, jint samples) {
ALvoid *buffer_address = (ALbyte *)(intptr_t)buffer;
alcCaptureSamples((ALCdevice*) ((intptr_t)device), buffer_address, samples);
}
/**
* Loads the context OpenAL functions
*
* @return true if all methods were loaded, false if one of the methods could not be loaded
*/
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC11_initNativeStubs(JNIEnv *env, jclass clazz) {
JavaMethodAndExtFunction functions[] = {
{"nalcCaptureOpenDevice", "(JIII)J", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice, "alcCaptureOpenDevice", (void*)&alcCaptureOpenDevice, false},
{"nalcCaptureCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice, "alcCaptureCloseDevice", (void*)&alcCaptureCloseDevice, false},
{"nalcCaptureStart", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStart, "alcCaptureStart", (void*)&alcCaptureStart, false},
{"nalcCaptureStop", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStop, "alcCaptureStop", (void*)&alcCaptureStop, false},
{"nalcCaptureSamples", "(JJI)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureSamples, "alcCaptureSamples", (void*)&alcCaptureSamples, false}
};
int num_functions = NUMFUNCTIONS(functions);
extal_InitializeClass(env, clazz, num_functions, functions);
}
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,55 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <jni.h>
#include "org_lwjgl_opencl_CL.h"
#include "extcl.h"
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CL_nCreate(JNIEnv *env, jclass clazz, jstring oclPath) {
extcl_LoadLibrary(env, oclPath);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CL_nDestroy(JNIEnv *env, jclass clazz) {
extcl_UnloadLibrary();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL_ngetFunctionAddress(JNIEnv *env, jclass clazz, jlong function_name) {
return (jlong)(intptr_t)extcl_GetProcAddress((char *)(intptr_t)function_name);
}
JNIEXPORT jobject JNICALL Java_org_lwjgl_opencl_CL_getHostBuffer(JNIEnv *env, jclass clazz, jlong address, jint size) {
return safeNewBuffer(env, (void *)(intptr_t)address, size);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CL_resetNativeStubs(JNIEnv *env, jclass clazz, jclass cl_class) {
(*env)->UnregisterNatives(env, cl_class);
}

View File

@ -0,0 +1,61 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opencl_CL */
#ifndef _Included_org_lwjgl_opencl_CL
#define _Included_org_lwjgl_opencl_CL
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opencl_CL
* Method: nCreate
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CL_nCreate
(JNIEnv *, jclass, jstring);
/*
* Class: org_lwjgl_opencl_CL
* Method: nCreateDefault
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CL_nCreateDefault
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CL
* Method: nDestroy
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CL_nDestroy
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CL
* Method: ngetFunctionAddress
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL_ngetFunctionAddress
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opencl_CL
* Method: getHostBuffer
* Signature: (JI)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_opencl_CL_getHostBuffer
(JNIEnv *, jclass, jlong, jint);
/*
* Class: org_lwjgl_opencl_CL
* Method: resetNativeStubs
* Signature: (Ljava/lang/Class;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CL_resetNativeStubs
(JNIEnv *, jclass, jclass);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,256 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* JNI implementation of the OpenCL function callbacks.
*
* @author Spasi
*/
#include <jni.h>
#include "common_tools.h"
#include "extcl.h"
#include "org_lwjgl_opencl_CallbackUtil.h"
static jmethodID contextCallbackJ;
static jmethodID memObjectDestructorCallbackJ;
static jmethodID programCallbackJ;
static jmethodID nativeKernelCallbackJ;
static jmethodID eventCallbackJ;
static jmethodID printfCallbackJ;
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_ncreateGlobalRef(JNIEnv *env, jclass clazz, jobject obj) {
return (intptr_t)(*env)->NewGlobalRef(env, obj);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CallbackUtil_deleteGlobalRef(JNIEnv *env, jclass clazz, jlong globalRef) {
(*env)->DeleteGlobalRef(env, (jobject)(intptr_t)globalRef);
}
// ----------------- [ CONTEXT CALLBACK ] -----------------
static void CL_CALLBACK contextCallback(const char *errinfo, const void *private_info, size_t cb, void *user_data) {
JNIEnv *env = attachCurrentThread();
jobject private_info_buffer = NULL;
if ( env != NULL && !(*env)->ExceptionOccurred(env) && contextCallbackJ != NULL ) {
if ( private_info != NULL )
private_info_buffer = NewReadOnlyDirectByteBuffer(env, private_info, cb);
(*env)->CallVoidMethod(env, (jobject)user_data, contextCallbackJ,
NewStringNativeWithLength(env, errinfo, (jsize)strlen(errinfo)),
private_info_buffer
);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getContextCallback(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( contextCallbackJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opencl/CLContextCallback");
if ( callbackClass != NULL )
contextCallbackJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(Ljava/lang/String;Ljava/nio/ByteBuffer;)V");
}
return (jlong)(intptr_t)&contextCallback;
}
// ----------------- [ MEM OBJECT DESTRUCTOR CALLBACK ] -----------------
static void CL_CALLBACK memObjectDestructorCallback(cl_mem memobj, void *user_data) {
JNIEnv *env = attachCurrentThread();
if ( env != NULL && !(*env)->ExceptionOccurred(env) && memObjectDestructorCallbackJ != NULL ) {
(*env)->CallVoidMethod(env, (jobject)user_data, memObjectDestructorCallbackJ,
(jlong)(intptr_t)memobj
);
(*env)->DeleteGlobalRef(env, (jobject)user_data);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getMemObjectDestructorCallback(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( memObjectDestructorCallbackJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opencl/CLMemObjectDestructorCallback");
if ( callbackClass != NULL )
memObjectDestructorCallbackJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(J)V");
}
return (jlong)(intptr_t)&memObjectDestructorCallback;
}
// ----------------- [ PROGRAM CALLBACK ] -----------------
static void CL_CALLBACK programCallback(cl_program program, void *user_data) {
JNIEnv *env = attachCurrentThread();
if ( env != NULL && !(*env)->ExceptionOccurred(env) && programCallbackJ != NULL ) {
(*env)->CallVoidMethod(env, (jobject)user_data, programCallbackJ,
(jlong)(intptr_t)program
);
(*env)->DeleteGlobalRef(env, (jobject)user_data);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getProgramCallback(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( programCallbackJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opencl/CLProgramCallback");
if ( callbackClass != NULL )
programCallbackJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(J)V");
}
return (jlong)(intptr_t)&programCallback;
}
// ----------------- [ NATIVE KERNEL CALLBACK ] -----------------
static void CL_CALLBACK nativeKernelCallback(void *args) {
JNIEnv *env = attachCurrentThread();
jobject user_func = (jobject)(intptr_t)*(jlong *)args;
jsize num_mem_objects = *(jsize *)((char *)args + 8);
jobjectArray memobjs = NULL;
jobject buffer;
jsize i;
if ( env != NULL && !(*env)->ExceptionOccurred(env) && nativeKernelCallbackJ != NULL ) {
if ( num_mem_objects > 0 ) {
memobjs = (*env)->NewObjectArray(env, num_mem_objects, (*env)->FindClass(env, "java/nio/ByteBuffer"), NULL);
for ( i = 0; i < num_mem_objects; i++ ) {
buffer = (*env)->NewDirectByteBuffer(env,
// Pointer to cl_mem buffer
(void *)((char *)args + (12 + 4 + (i * (4 + sizeof(void *))))),
// cl_mem buffer size
*((jint *)((char *)args + (12 + (i * (4 + sizeof(void *))))))
);
(*env)->SetObjectArrayElement(env, memobjs, i, buffer);
}
}
(*env)->CallVoidMethod(env, user_func, nativeKernelCallbackJ, memobjs);
if ( num_mem_objects > 0 )
(*env)->DeleteLocalRef(env, memobjs);
(*env)->DeleteGlobalRef(env, user_func);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getNativeKernelCallback(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( nativeKernelCallbackJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opencl/CLNativeKernel");
if ( callbackClass != NULL )
nativeKernelCallbackJ = (*env)->GetMethodID(env, callbackClass, "execute", "([Ljava/nio/ByteBuffer;)V");
}
return (jlong)(intptr_t)&nativeKernelCallback;
}
// ----------------- [ EVENT CALLBACK ] -----------------
static void CL_CALLBACK eventCallback(cl_event event, cl_int event_command_exec_status, void *user_data) {
JNIEnv *env = attachCurrentThread();
if ( env != NULL && !(*env)->ExceptionOccurred(env) && eventCallbackJ != NULL ) {
(*env)->CallVoidMethod(env, (jobject)user_data, eventCallbackJ,
(jlong)(intptr_t)event,
event_command_exec_status
);
(*env)->DeleteGlobalRef(env, (jobject)user_data);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getEventCallback(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( eventCallbackJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opencl/CLEventCallback");
if ( callbackClass != NULL )
eventCallbackJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(JI)V");
}
return (jlong)(intptr_t)&eventCallback;
}
// ----------------- [ PRINTF CALLBACK ] -----------------
static void CL_CALLBACK printfCallback(cl_context context, cl_uint printf_data_len, char *printf_data_ptr, void *user_data) {
JNIEnv *env = attachCurrentThread();
if ( env != NULL && !(*env)->ExceptionOccurred(env) && printfCallbackJ != NULL ) {
(*env)->CallVoidMethod(env, (jobject)user_data, printfCallbackJ,
NewStringNativeWithLength(env, printf_data_ptr, printf_data_len)
);
}
detachCurrentThread();
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getPrintfCallback(JNIEnv *env, jclass clazz) {
// Cache the callback methodID
jclass callbackClass;
if ( printfCallbackJ == NULL ) {
callbackClass = (*env)->FindClass(env, "org/lwjgl/opencl/CLPrintfCallback");
if ( callbackClass != NULL )
printfCallbackJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(Ljava/lang/String;)V");
}
return (jlong)(intptr_t)&printfCallback;
}
// ----------------- [ APPLE_ContextLoggingFunctions CALLBACKS ] -----------------
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getLogMessageToSystemLogAPPLE(JNIEnv *env, jclass clazz) {
return (jlong)(intptr_t)extcl_GetProcAddress("clLogMessagesToSystemLogAPPLE");
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getLogMessageToStdoutAPPLE(JNIEnv *env, jclass clazz) {
return (jlong)(intptr_t)extcl_GetProcAddress("getLogMessageToStdoutAPPLE");
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getLogMessageToStderrAPPLE(JNIEnv *env, jclass clazz) {
return (jlong)(intptr_t)extcl_GetProcAddress("getLogMessageToStderrAPPLE");
}

View File

@ -0,0 +1,101 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opencl_CallbackUtil */
#ifndef _Included_org_lwjgl_opencl_CallbackUtil
#define _Included_org_lwjgl_opencl_CallbackUtil
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: ncreateGlobalRef
* Signature: (Ljava/lang/Object;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_ncreateGlobalRef
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: deleteGlobalRef
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_CallbackUtil_deleteGlobalRef
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getContextCallback
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getContextCallback
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getMemObjectDestructorCallback
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getMemObjectDestructorCallback
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getProgramCallback
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getProgramCallback
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getNativeKernelCallback
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getNativeKernelCallback
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getEventCallback
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getEventCallback
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getPrintfCallback
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getPrintfCallback
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getLogMessageToSystemLogAPPLE
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getLogMessageToSystemLogAPPLE
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getLogMessageToStdoutAPPLE
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getLogMessageToStdoutAPPLE
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opencl_CallbackUtil
* Method: getLogMessageToStderrAPPLE
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getLogMessageToStderrAPPLE
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @author kappaOne <one.kappa@gmail.com>
* @version $Revision$
*/
#include <jni.h>
#ifdef __MACH__
#include <JavaVM/jawt_md.h>
#else
#ifndef PLATFORM_FCL
#include <jawt_md.h>
#endif
#endif
#include "org_lwjgl_opengl_AWTSurfaceLock.h"
#include "awt_tools.h"
#include "common_tools.h"
JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_createHandle
(JNIEnv *env, jclass clazz) {
return newJavaManagedByteBuffer(env, sizeof(AWTSurfaceLock));
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle
(JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas) {
#ifndef PLATFORM_FCL
JAWT awt;
JAWT_DrawingSurface* ds;
JAWT_DrawingSurfaceInfo *dsi;
AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
jboolean result = JNI_FALSE;
#ifdef __MACH__
// try get JAWT with JAWT_MACOSX_USE_CALAYER Opt In
awt.version = JAWT_VERSION_1_4 | 0x80000000;//JAWT_MACOSX_USE_CALAYER;
result = JAWT_GetAWT(env, &awt);
#endif
if (result == JNI_FALSE) {
// now try without CALAYER
awt.version = JAWT_VERSION_1_4;
if (JAWT_GetAWT(env, &awt) == JNI_FALSE) {
throwException(env, "Could not get the JAWT interface");
return JNI_FALSE;
}
}
ds = awt.GetDrawingSurface(env, canvas);
if (ds == NULL) {
throwException(env, "Could not get the drawing surface");
return JNI_FALSE;
}
if((ds->Lock(ds) & JAWT_LOCK_ERROR) != 0) {
awt.FreeDrawingSurface(ds);
throwException(env, "Could not lock the drawing surface");
return JNI_FALSE;
}
dsi = ds->GetDrawingSurfaceInfo(ds);
if (dsi != NULL) {
awt_lock->awt = awt;
awt_lock->ds = ds;
awt_lock->dsi = dsi;
return JNI_TRUE;
}
ds->Unlock(ds);
awt.FreeDrawingSurface(ds);
return JNI_FALSE;
#else // PLATFORM_FCL
return JNI_TRUE;
#endif
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_nUnlock
(JNIEnv *env, jclass clazz, jobject lock_buffer_handle) {
#ifndef PLATFORM_FCL
AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
awt_lock->ds->FreeDrawingSurfaceInfo(awt_lock->dsi);
awt_lock->ds->Unlock(awt_lock->ds);
awt_lock->awt.FreeDrawingSurface(awt_lock->ds);
#endif
}

View File

@ -0,0 +1,39 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_AWTSurfaceLock */
#ifndef _Included_org_lwjgl_opengl_AWTSurfaceLock
#define _Included_org_lwjgl_opengl_AWTSurfaceLock
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_opengl_AWTSurfaceLock_WAIT_DELAY_MILLIS
#define org_lwjgl_opengl_AWTSurfaceLock_WAIT_DELAY_MILLIS 100L
/*
* Class: org_lwjgl_opengl_AWTSurfaceLock
* Method: createHandle
* Signature: ()Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_createHandle
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_AWTSurfaceLock
* Method: lockAndInitHandle
* Signature: (Ljava/nio/ByteBuffer;Ljava/awt/Canvas;)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: org_lwjgl_opengl_AWTSurfaceLock
* Method: nUnlock
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_nUnlock
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,65 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "org_lwjgl_openal_AL.h"
#include "extal.h"
#include "common_tools.h"
#include <dlfcn.h>
static void* handleOAL;
void *extal_NativeGetFunctionPointer(const char *function) {
return dlsym(handleOAL, function);
}
void extal_LoadLibrary(JNIEnv *env, jstring path) {
char *path_str = GetStringNativeChars(env, path);
printfDebugJava(env, "Testing '%s'", path_str);
handleOAL = dlopen(path_str, RTLD_LAZY);
if (handleOAL != NULL) {
printfDebugJava(env, "Found OpenAL at '%s'", path_str);
} else {
throwException(env, "Could not load OpenAL library");
}
free(path_str);
}
void extal_UnloadLibrary() {
if (handleOAL != NULL) {
dlclose(handleOAL);
handleOAL = NULL;
}
}

View File

@ -0,0 +1,64 @@
/*
* Copyright (c) 2002-2010 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "extcl.h"
#include "common_tools.h"
#include <dlfcn.h>
static void* handleOCL;
void *extcl_NativeGetFunctionPointer(const char *function) {
return dlsym(handleOCL, function);
}
void extcl_LoadLibrary(JNIEnv *env, jstring path) {
char *path_str = GetStringNativeChars(env, path);
printfDebugJava(env, "Testing '%s'", path_str);
handleOCL = dlopen(path_str, RTLD_LAZY);
if (handleOCL != NULL) {
printfDebugJava(env, "Found OpenCL at '%s'", path_str);
} else {
throwException(env, "Could not load OpenCL library");
}
free(path_str);
}
void extcl_UnloadLibrary() {
if (handleOCL != NULL) {
dlclose(handleOCL);
handleOCL = NULL;
}
}

View File

@ -0,0 +1,7 @@
{
global:
Java_*;
JNI_OnLoad;
JNI_OnUnload;
local: *;
};

View File

@ -0,0 +1,74 @@
/*
* Copyright (c) 2002-2011 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* EGL extension stubs.
*
* @author Tungsten
*/
#include "EGL.h"
/* NV_present_video functions */
jint extgl_EnumerateVideoDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position) {
return 0;
}
jboolean extgl_BindVideoDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position) {
return false;
}
jboolean extgl_QueryContextNV(JNIEnv *env, jobject peer_info_handle, jobject context_handle, jint attrib, jobject value, jint value_position) {
return false;
}
/* NV_video_capture functions */
jboolean extgl_BindVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong device) {
return false;
}
jint extgl_EnumerateVideoCaptureDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position) {
return 0;
}
jboolean extgl_LockVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device) {
return false;
}
jboolean extgl_QueryVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device, jint attribute, jobject value, jint value_position) {
return false;
}
jboolean extgl_ReleaseVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device) {
return false;
}

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2002-2011 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* EGL extension stubs.
*
* @author Tungsten
*/
#ifndef __LWJGL_GLX_H
#define __LWJGL_GLX_H
#include <jni.h>
#include "common_tools.h"
#include "context.h"
#include "extgl.h"
#include "extgl_egl.h"
/* NV_present_video functions */
extern jint extgl_EnumerateVideoDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position);
extern jboolean extgl_BindVideoDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position);
extern jboolean extgl_QueryContextNV(JNIEnv *env, jobject peer_info_handle, jobject context_handle, jint attrib, jobject value, jint value_position);
/* NV_video_capture functions */
extern jboolean extgl_BindVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong device);
extern jint extgl_EnumerateVideoCaptureDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position);
extern jboolean extgl_LockVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device);
extern jboolean extgl_QueryVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device, jint attribute, jobject value, jint value_position);
extern jboolean extgl_ReleaseVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device);
#endif

View File

@ -0,0 +1,212 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* Include file to access public window features
*
* @author Tungsten
* @version $Revision$
*/
#include <jni.h>
#include <fcl_bridge.h>
#include "extgl_egl.h"
#include "context.h"
EGLConfig *getFBConfigFromPeerInfo(JNIEnv *env, FCLPeerInfo *peer_info) {
int attribs[] = {EGL_CONFIG_ID, peer_info->config_id, EGL_NONE, EGL_NONE};
int num_elements;
EGLBoolean ret;
ret = lwjgl_eglChooseConfig(peer_info->display, attribs, NULL, 0, &num_elements);
if (!ret) {
throwException(env, "Could not find EGL 1.4 config from peer info");
return NULL;
}
EGLConfig* configs = calloc(num_elements, sizeof(EGLConfig));
ret = lwjgl_eglChooseConfig(peer_info->display, attribs, configs, num_elements, &num_elements);
if (!ret) {
free(configs);
throwException(env, "Could not find EGL 1.4 config from peer info");
return NULL;
}
// Check that only one FBConfig matches the config id
if (num_elements != 1) {
free(configs);
throwException(env, "No unique EGL 1.4 config matches peer info");
return NULL;
}
return configs;
}
static int convertToBPE(int bpp) {
int bpe;
switch (bpp) {
case 0:
bpe = 0;
break;
case 32:
case 24:
bpe = 8;
break;
case 16: /* Fall through */
default:
bpe = 4;
break;
}
return bpe;
}
static EGLConfig *chooseVisualEGLFromBPP(JNIEnv *env, EGLDisplay disp, jobject pixel_format, int bpp, int drawable_type) {
jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
int alpha = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "alpha", "I"));
int depth = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "depth", "I"));
int stencil = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stencil", "I"));
int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
int bpe = convertToBPE(bpp);
attrib_list_t attrib_list;
initAttribList(&attrib_list);
putAttrib(&attrib_list, EGL_SURFACE_TYPE); putAttrib(&attrib_list, drawable_type);
putAttrib(&attrib_list, EGL_DEPTH_SIZE); putAttrib(&attrib_list, depth);
putAttrib(&attrib_list, EGL_RED_SIZE); putAttrib(&attrib_list, bpe);
putAttrib(&attrib_list, EGL_GREEN_SIZE); putAttrib(&attrib_list, bpe);
putAttrib(&attrib_list, EGL_BLUE_SIZE); putAttrib(&attrib_list, bpe);
putAttrib(&attrib_list, EGL_ALPHA_SIZE); putAttrib(&attrib_list, alpha);
putAttrib(&attrib_list, EGL_STENCIL_SIZE); putAttrib(&attrib_list, stencil);
// Assume the caller has checked support for multisample
if (samples > 0) {
putAttrib(&attrib_list, EGL_SAMPLE_BUFFERS); putAttrib(&attrib_list, 1);
putAttrib(&attrib_list, EGL_SAMPLES); putAttrib(&attrib_list, samples);
}
putAttrib(&attrib_list, EGL_NONE); putAttrib(&attrib_list, EGL_NONE);
int num_formats = 0;
EGLBoolean ret;
ret = lwjgl_eglChooseConfig(disp, attrib_list.attribs, NULL, 0, &num_formats);
if (!ret) {
return NULL;
}
EGLConfig* configs = calloc(num_formats, sizeof(EGLConfig));
ret = lwjgl_eglChooseConfig(disp, attrib_list.attribs, configs, num_formats, &num_formats);
if (ret && num_formats > 0) {
return configs;
} else {
if (configs != NULL)
free(configs);
return NULL;
}
}
EGLConfig *chooseVisualEGL(JNIEnv *env, EGLDisplay disp, jobject pixel_format, bool use_display_bpp, int drawable_type) {
jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
int bpp;
if (use_display_bpp) {
bpp = 32;
EGLConfig *configs = chooseVisualEGLFromBPP(env, disp, pixel_format, bpp, drawable_type);
if (configs != NULL)
return configs;
else
bpp = 24;
} else
bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
return chooseVisualEGLFromBPP(env, disp, pixel_format, bpp, drawable_type);
}
static void dumpVisualInfo(JNIEnv *env, EGLDisplay display, EGLConfig config) {
int alpha, depth, stencil, r, g, b;
int sample_buffers = 0;
int samples = 0;
lwjgl_eglGetConfigAttrib(display, config, EGL_RED_SIZE, &r);
lwjgl_eglGetConfigAttrib(display, config, EGL_GREEN_SIZE, &g);
lwjgl_eglGetConfigAttrib(display, config, EGL_BLUE_SIZE, &b);
lwjgl_eglGetConfigAttrib(display, config, EGL_ALPHA_SIZE, &alpha);
lwjgl_eglGetConfigAttrib(display, config, EGL_DEPTH_SIZE, &depth);
lwjgl_eglGetConfigAttrib(display, config, EGL_STENCIL_SIZE, &stencil);
lwjgl_eglGetConfigAttrib(display, config, EGL_SAMPLE_BUFFERS, &sample_buffers);
lwjgl_eglGetConfigAttrib(display, config, EGL_SAMPLES, &samples);
printfDebugJava(env, "Pixel format info: r = %d, g = %d, b = %d, a = %d, depth = %d, stencil = %d, sample buffers = %d, samples = %d", r, g, b, alpha, depth, stencil, sample_buffers, samples);
}
bool initPeerInfo(JNIEnv *env, jobject peer_info_handle, EGLDisplay display, jobject pixel_format, bool use_display_bpp, int drawable_type) {
if ((*env)->GetDirectBufferCapacity(env, peer_info_handle) < sizeof(FCLPeerInfo)) {
throwException(env, "Handle too small");
return false;
}
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
if (!extgl_InitEGL(display)) {
throwException(env, "Could not init EGL");
return false;
}
jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
int colorSamples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "colorSamples", "I"));
if (colorSamples > 0) {
throwException(env, "Color samples > 0 specified but there's no support.");
return false;
}
bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
if (floating_point) {
throwException(env, "Floating point specified but there's no support.");
return false;
}
bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
if (floating_point_packed) {
throwException(env, "Packed floating point specified but there's no support.");
return false;
}
bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
if (sRGB) {
throwException(env, "sRGB specified but there's no support.");
return false;
}
EGLConfig *configs = chooseVisualEGL(env, display, pixel_format, use_display_bpp, drawable_type);
if (configs == NULL) {
throwException(env, "Could not choose EGL config");
return false;
}
if (isDebugEnabled()) {
dumpVisualInfo(env, display, configs[0]);
}
EGLint config_id;
int result = lwjgl_eglGetConfigAttrib(display, configs[0], EGL_CONFIG_ID, &config_id);
free(configs);
if (result != EGL_TRUE) {
throwException(env, "Could not get EGL_CONFIG_ID from EGLConfig");
return false;
}
peer_info->config_id = config_id;
peer_info->display = display;
peer_info->drawable = EGL_NO_SURFACE;
return true;
}

View File

@ -0,0 +1,62 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* Include file to access public window features
*
* @author Tungsten
* @version $Revision$
*/
#ifndef _LWJGL_CONTEXT_H_INCLUDED_
#define _LWJGL_CONTEXT_H_INCLUDED_
#include <jni.h>
#include <fcl_bridge.h>
#include "extgl_egl.h"
typedef struct {
EGLDisplay display;
EGLSurface drawable;
EGLint config_id;
} FCLPeerInfo;
/* EGL 1.4 chooser */
extern EGLConfig *chooseVisualEGL(JNIEnv *env, EGLDisplay disp, jobject pixel_format, bool use_display_bpp, int drawable_type);
extern EGLConfig *getFBConfigFromPeerInfo(JNIEnv *env, FCLPeerInfo *peer_info);
extern bool initPeerInfo(JNIEnv *env, jobject peer_info_handle, EGLDisplay display, jobject pixel_format, bool use_display_bpp, int drawable_type);
#endif /* _LWJGL_CONTEXT_H_INCLUDED_ */

View File

@ -0,0 +1,92 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* FCL specific library for display handling.
*
* @author Tungsten
* @version $Revision$
*/
#include <fcl_bridge.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "common_tools.h"
#include "org_lwjgl_opengl_FCLDisplay.h"
typedef struct {
int width;
int height;
int freq;
} mode_info;
static mode_info *getDisplayModes(int *num_modes) {
mode_info *avail_modes = (mode_info *)malloc(sizeof(mode_info));
if (avail_modes == NULL) {
return NULL;
}
ANativeWindow* window = fclGetNativeWindow();
avail_modes[0].width = ANativeWindow_getWidth(window);
avail_modes[0].height = ANativeWindow_getHeight(window);
avail_modes[0].freq = 0; // No frequency support in FCL
*num_modes = 1;
return avail_modes;
}
static jobjectArray getAvailableDisplayModes(JNIEnv * env) {
int num_modes, i;
mode_info *avail_modes;
int bpp = 32;
avail_modes = getDisplayModes(&num_modes);
if (avail_modes == NULL) {
printfDebugJava(env, "Could not get display modes");
return NULL;
}
// Allocate an array of DisplayModes big enough
jclass displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode");
jobjectArray ret = (*env)->NewObjectArray(env, num_modes, displayModeClass, NULL);
jmethodID displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V");
for (i = 0; i < num_modes; i++) {
jobject displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, avail_modes[i].width, avail_modes[i].height, bpp, avail_modes[i].freq);
(*env)->SetObjectArrayElement(env, ret, i, displayMode);
}
free(avail_modes);
return ret;
}
JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz) {
return getAvailableDisplayModes(env);
}

View File

@ -0,0 +1,195 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <dlfcn.h>
#include "extgl_egl.h"
eglGetErrorPROC lwjgl_eglGetError = NULL;
eglGetDisplayPROC lwjgl_eglGetDisplay = NULL;
eglInitializePROC lwjgl_eglInitialize = NULL;
eglTerminatePROC lwjgl_eglTerminate = NULL;
eglQueryStringPROC lwjgl_eglQueryString = NULL;
eglGetConfigsPROC lwjgl_eglGetConfigs = NULL;
eglChooseConfigPROC lwjgl_eglChooseConfig = NULL;
eglGetConfigAttribPROC lwjgl_eglGetConfigAttrib = NULL;
eglCreateWindowSurfacePROC lwjgl_eglCreateWindowSurface = NULL;
eglCreatePbufferSurfacePROC lwjgl_eglCreatePbufferSurface = NULL;
eglCreatePixmapSurfacePROC lwjgl_eglCreatePixmapSurface = NULL;
eglDestroySurfacePROC lwjgl_eglDestroySurface = NULL;
eglQuerySurfacePROC lwjgl_eglQuerySurface = NULL;
eglBindAPIPROC lwjgl_eglBindAPI = NULL;
eglQueryAPIPROC lwjgl_eglQueryAPI = NULL;
eglWaitClientPROC lwjgl_eglWaitClient = NULL;
eglReleaseThreadPROC lwjgl_eglReleaseThread = NULL;
eglCreatePbufferFromClientBufferPROC lwjgl_eglCreatePbufferFromClientBuffer = NULL;
eglSurfaceAttribPROC lwjgl_eglSurfaceAttrib = NULL;
eglBindTexImagePROC lwjgl_eglBindTexImage = NULL;
eglReleaseTexImagePROC lwjgl_eglReleaseTexImage = NULL;
eglSwapIntervalPROC lwjgl_eglSwapInterval = NULL;
eglCreateContextPROC lwjgl_eglCreateContext = NULL;
eglDestroyContextPROC lwjgl_eglDestroyContext = NULL;
eglMakeCurrentPROC lwjgl_eglMakeCurrent = NULL;
eglGetCurrentContextPROC lwjgl_eglGetCurrentContext = NULL;
eglGetCurrentSurfacePROC lwjgl_eglGetCurrentSurface = NULL;
eglGetCurrentDisplayPROC lwjgl_eglGetCurrentDisplay = NULL;
eglQueryContextPROC lwjgl_eglQueryContext = NULL;
eglWaitGLPROC lwjgl_eglWaitGL = NULL;
eglWaitNativePROC lwjgl_eglWaitNative = NULL;
eglSwapBuffersPROC lwjgl_eglSwapBuffers = NULL;
eglCopyBuffersPROC lwjgl_eglCopyBuffers = NULL;
eglGetProcAddressPROC lwjgl_eglGetProcAddress = NULL;
static void * lib_gl_handle = NULL;
static void * lib_egl_handle = NULL;
typedef void * (APIENTRY * glXGetProcAddressARBPROC) (const GLubyte *procName);
static glXGetProcAddressARBPROC lwjgl_glXGetProcAddressARB;
static void *extgl_eglSym(const char *name) {
void *t = dlsym(lib_egl_handle, name);
if (t == NULL) {
printfDebug("Could not locate symbol %s\n", name);
}
return t;
}
static void extgl_InitEGL14(void) {
ExtFunction functions[] = {
{"eglGetError", (void*)&lwjgl_eglGetError},
{"eglGetDisplay", (void*)&lwjgl_eglGetDisplay},
{"eglInitialize", (void*)&lwjgl_eglInitialize},
{"eglTerminate", (void*)&lwjgl_eglTerminate},
{"eglQueryString", (void*)&lwjgl_eglQueryString},
{"eglGetConfigs", (void*)&lwjgl_eglGetConfigs},
{"eglChooseConfig", (void*)&lwjgl_eglChooseConfig},
{"eglGetConfigAttrib", (void*)&lwjgl_eglGetConfigAttrib},
{"eglCreateWindowSurface", (void*)&lwjgl_eglCreateWindowSurface},
{"eglCreatePbufferSurface", (void*)&lwjgl_eglCreatePbufferSurface},
{"eglCreatePixmapSurface", (void*)&lwjgl_eglCreatePixmapSurface},
{"eglDestroySurface", (void*)&lwjgl_eglDestroySurface},
{"eglQuerySurface", (void*)&lwjgl_eglQuerySurface},
{"eglBindAPI", (void*)&lwjgl_eglBindAPI},
{"eglQueryAPI", (void*)&lwjgl_eglQueryAPI},
{"eglWaitClient", (void*)&lwjgl_eglWaitClient},
{"eglReleaseThread", (void*)&lwjgl_eglReleaseThread},
{"eglCreatePbufferFromClientBuffer", (void*)&lwjgl_eglCreatePbufferFromClientBuffer},
{"eglSurfaceAttrib", (void*)&lwjgl_eglSurfaceAttrib},
{"eglBindTexImage", (void*)&lwjgl_eglBindTexImage},
{"eglReleaseTexImage", (void*)&lwjgl_eglReleaseTexImage},
{"eglSwapInterval", (void*)&lwjgl_eglSwapInterval},
{"eglCreateContext", (void*)&lwjgl_eglCreateContext},
{"eglDestroyContext", (void*)&lwjgl_eglDestroyContext},
{"eglMakeCurrent", (void*)&lwjgl_eglMakeCurrent},
{"eglGetCurrentContext", (void*)&lwjgl_eglGetCurrentContext},
{"eglGetCurrentSurface", (void*)&lwjgl_eglGetCurrentSurface},
{"eglGetCurrentDisplay", (void*)&lwjgl_eglGetCurrentDisplay},
{"eglQueryContext", (void*)&lwjgl_eglQueryContext},
{"eglWaitGL", (void*)&lwjgl_eglWaitGL},
{"eglWaitNative", (void*)&lwjgl_eglWaitNative},
{"eglSwapBuffers", (void*)&lwjgl_eglSwapBuffers},
{"eglCopyBuffers", (void*)&lwjgl_eglCopyBuffers},
{"eglGetProcAddress", (void*)&lwjgl_eglGetProcAddress}};
ext_InitializeFunctions(&extgl_eglSym, sizeof(functions)/sizeof(ExtFunction), functions);
}
bool extgl_Open(JNIEnv *env) {
const char* egl_name = "libEGL.so.1";
egl_name = getenv("LIBEGL_NAME");
const char* gl_name = "libGL.so.1";
gl_name = getenv("LIBGL_NAME");
if (lib_gl_handle != NULL && lib_egl_handle != NULL)
return true;
/*
* Actually we don't need the RTLD_GLOBAL flag, since the symbols
* we load should be private to us. However, according to the
* documentation at
*
* http://dri.sourceforge.net/doc/DRIuserguide.html
*
* DRI drivers need this flag to work properly
*/
lib_egl_handle = dlopen(egl_name, RTLD_LAZY | RTLD_LOCAL);
if (lib_egl_handle == NULL) {
throwFormattedException(env, "Error loading %s: %s", egl_name, dlerror());
return false;
}
lib_gl_handle = dlopen(gl_name, RTLD_LAZY | RTLD_GLOBAL);
if (lib_gl_handle == NULL) {
throwFormattedException(env, "Error loading %s: %s", gl_name, dlerror());
return false;
}
lwjgl_glXGetProcAddressARB = (glXGetProcAddressARBPROC)dlsym(lib_gl_handle, "glXGetProcAddressARB");
if (lwjgl_glXGetProcAddressARB == NULL) {
extgl_Close();
throwException(env, "Could not get address of glXGetProcAddressARB");
return false;
}
/* Unlike Windows, EGL function addresses are context-independent
* so we only have to initialize the addresses once at load
*/
extgl_InitEGL14();
return true;
}
void *extgl_GetProcAddress(const char *name) {
void *t = (void*)lwjgl_glXGetProcAddressARB((const GLubyte*)name);
if (t == NULL) {
t = dlsym(lib_gl_handle, name);
if (t == NULL) {
printfDebug("Could not locate symbol %s\n", name);
}
}
return t;
}
void extgl_Close(void) {
dlclose(lib_gl_handle);
lib_gl_handle = NULL;
dlclose(lib_egl_handle);
lib_egl_handle = NULL;
}
bool extgl_InitEGL(EGLDisplay disp) {
int major, minor;
if (lwjgl_eglInitialize(disp, &major, &minor) != EGL_TRUE)
return false;
bool egl14 = major > 1 || (major == 1 && minor >= 4);
// Check EGL 1.4 version
if (!egl14)
return false;
return true;
}

View File

@ -0,0 +1,326 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EXTGL_GLX_H
#define EXTGL_GLX_H
#include <fcl_bridge.h>
#include "extgl.h"
/* eglplatform.h */
typedef struct ANativeWindow* EGLNativeWindowType;
typedef void* EGLNativePixmapType;
typedef void* EGLNativeDisplayType;
typedef int EGLint;
/* EGL Types */
typedef unsigned int EGLBoolean;
typedef unsigned int EGLenum;
typedef void *EGLConfig;
typedef void *EGLContext;
typedef void *EGLDisplay;
typedef void *EGLSurface;
typedef void *EGLClientBuffer;
/* EGL Versioning */
#define EGL_VERSION_1_0 1
#define EGL_VERSION_1_1 1
#define EGL_VERSION_1_2 1
#define EGL_VERSION_1_3 1
#define EGL_VERSION_1_4 1
/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
* enums are assigned unique values starting at 0x3000.
*/
/* EGL aliases */
#define EGL_FALSE 0
#define EGL_TRUE 1
/* Out-of-band handle values */
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
#define EGL_NO_CONTEXT ((EGLContext)0)
#define EGL_NO_DISPLAY ((EGLDisplay)0)
#define EGL_NO_SURFACE ((EGLSurface)0)
/* Out-of-band attribute value */
#define EGL_DONT_CARE ((EGLint)-1)
/* Errors / GetError return values */
#define EGL_SUCCESS 0x3000
#define EGL_NOT_INITIALIZED 0x3001
#define EGL_BAD_ACCESS 0x3002
#define EGL_BAD_ALLOC 0x3003
#define EGL_BAD_ATTRIBUTE 0x3004
#define EGL_BAD_CONFIG 0x3005
#define EGL_BAD_CONTEXT 0x3006
#define EGL_BAD_CURRENT_SURFACE 0x3007
#define EGL_BAD_DISPLAY 0x3008
#define EGL_BAD_MATCH 0x3009
#define EGL_BAD_NATIVE_PIXMAP 0x300A
#define EGL_BAD_NATIVE_WINDOW 0x300B
#define EGL_BAD_PARAMETER 0x300C
#define EGL_BAD_SURFACE 0x300D
#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
/* Reserved 0x300F-0x301F for additional errors */
/* Config attributes */
#define EGL_BUFFER_SIZE 0x3020
#define EGL_ALPHA_SIZE 0x3021
#define EGL_BLUE_SIZE 0x3022
#define EGL_GREEN_SIZE 0x3023
#define EGL_RED_SIZE 0x3024
#define EGL_DEPTH_SIZE 0x3025
#define EGL_STENCIL_SIZE 0x3026
#define EGL_CONFIG_CAVEAT 0x3027
#define EGL_CONFIG_ID 0x3028
#define EGL_LEVEL 0x3029
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
#define EGL_MAX_PBUFFER_PIXELS 0x302B
#define EGL_MAX_PBUFFER_WIDTH 0x302C
#define EGL_NATIVE_RENDERABLE 0x302D
#define EGL_NATIVE_VISUAL_ID 0x302E
#define EGL_NATIVE_VISUAL_TYPE 0x302F
#define EGL_SAMPLES 0x3031
#define EGL_SAMPLE_BUFFERS 0x3032
#define EGL_SURFACE_TYPE 0x3033
#define EGL_TRANSPARENT_TYPE 0x3034
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
#define EGL_TRANSPARENT_RED_VALUE 0x3037
#define EGL_NONE 0x3038 /* Attrib list terminator */
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
#define EGL_MIN_SWAP_INTERVAL 0x303B
#define EGL_MAX_SWAP_INTERVAL 0x303C
#define EGL_LUMINANCE_SIZE 0x303D
#define EGL_ALPHA_MASK_SIZE 0x303E
#define EGL_COLOR_BUFFER_TYPE 0x303F
#define EGL_RENDERABLE_TYPE 0x3040
#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
#define EGL_CONFORMANT 0x3042
/* Reserved 0x3041-0x304F for additional config attributes */
/* Config attribute values */
#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
/* More config attribute values, for EGL_TEXTURE_FORMAT */
#define EGL_NO_TEXTURE 0x305C
#define EGL_TEXTURE_RGB 0x305D
#define EGL_TEXTURE_RGBA 0x305E
#define EGL_TEXTURE_2D 0x305F
/* Config attribute mask bits */
#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
/* QueryString targets */
#define EGL_VENDOR 0x3053
#define EGL_VERSION 0x3054
#define EGL_EXTENSIONS 0x3055
#define EGL_CLIENT_APIS 0x308D
/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
#define EGL_HEIGHT 0x3056
#define EGL_WIDTH 0x3057
#define EGL_LARGEST_PBUFFER 0x3058
#define EGL_TEXTURE_FORMAT 0x3080
#define EGL_TEXTURE_TARGET 0x3081
#define EGL_MIPMAP_TEXTURE 0x3082
#define EGL_MIPMAP_LEVEL 0x3083
#define EGL_RENDER_BUFFER 0x3086
#define EGL_VG_COLORSPACE 0x3087
#define EGL_VG_ALPHA_FORMAT 0x3088
#define EGL_HORIZONTAL_RESOLUTION 0x3090
#define EGL_VERTICAL_RESOLUTION 0x3091
#define EGL_PIXEL_ASPECT_RATIO 0x3092
#define EGL_SWAP_BEHAVIOR 0x3093
#define EGL_MULTISAMPLE_RESOLVE 0x3099
/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
#define EGL_BACK_BUFFER 0x3084
#define EGL_SINGLE_BUFFER 0x3085
/* OpenVG color spaces */
#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
/* OpenVG alpha formats */
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
/* Constant scale factor by which fractional display resolutions &
* aspect ratio are scaled when queried as integer values.
*/
#define EGL_DISPLAY_SCALING 10000
/* Unknown display resolution/aspect ratio */
#define EGL_UNKNOWN ((EGLint)-1)
/* Back buffer swap behaviors */
#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
/* CreatePbufferFromClientBuffer buffer types */
#define EGL_OPENVG_IMAGE 0x3096
/* QueryContext targets */
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
/* CreateContext attributes */
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
/* Multisample resolution behaviors */
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
/* BindAPI/QueryAPI targets */
#define EGL_OPENGL_ES_API 0x30A0
#define EGL_OPENVG_API 0x30A1
#define EGL_OPENGL_API 0x30A2
/* GetCurrentSurface targets */
#define EGL_DRAW 0x3059
#define EGL_READ 0x305A
/* WaitNative engines */
#define EGL_CORE_NATIVE_ENGINE 0x305B
/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
#define EGL_COLORSPACE EGL_VG_COLORSPACE
#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
#define EGLAPIENTRY
/* EGL Functions */
typedef EGLint (EGLAPIENTRY * eglGetErrorPROC) (void);
typedef EGLDisplay (EGLAPIENTRY * eglGetDisplayPROC) (EGLNativeDisplayType display_id);
typedef EGLBoolean (EGLAPIENTRY * eglInitializePROC) (EGLDisplay dpy, EGLint *major, EGLint *minor);
typedef EGLBoolean (EGLAPIENTRY * eglTerminatePROC) (EGLDisplay dpy);
typedef const char * (EGLAPIENTRY * eglQueryStringPROC) (EGLDisplay dpy, EGLint name);
typedef EGLBoolean (EGLAPIENTRY * eglGetConfigsPROC) (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
typedef EGLBoolean (EGLAPIENTRY * eglChooseConfigPROC) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
typedef EGLBoolean (EGLAPIENTRY * eglGetConfigAttribPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
typedef EGLSurface (EGLAPIENTRY * eglCreateWindowSurfacePROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
typedef EGLSurface (EGLAPIENTRY * eglCreatePbufferSurfacePROC) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
typedef EGLSurface (EGLAPIENTRY * eglCreatePixmapSurfacePROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRY * eglDestroySurfacePROC) (EGLDisplay dpy, EGLSurface surface);
typedef EGLBoolean (EGLAPIENTRY * eglQuerySurfacePROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRY * eglBindAPIPROC) (EGLenum api);
typedef EGLenum (EGLAPIENTRY * eglQueryAPIPROC) (void);
typedef EGLBoolean (EGLAPIENTRY * eglWaitClientPROC) (void);
typedef EGLBoolean (EGLAPIENTRY * eglReleaseThreadPROC) (void);
typedef EGLSurface (EGLAPIENTRY * eglCreatePbufferFromClientBufferPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRY * eglSurfaceAttribPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
typedef EGLBoolean (EGLAPIENTRY * eglBindTexImagePROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
typedef EGLBoolean (EGLAPIENTRY * eglReleaseTexImagePROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
typedef EGLBoolean (EGLAPIENTRY * eglSwapIntervalPROC) (EGLDisplay dpy, EGLint interval);
typedef EGLContext (EGLAPIENTRY * eglCreateContextPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRY * eglDestroyContextPROC) (EGLDisplay dpy, EGLContext ctx);
typedef EGLBoolean (EGLAPIENTRY * eglMakeCurrentPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
typedef EGLContext (EGLAPIENTRY * eglGetCurrentContextPROC) (void);
typedef EGLSurface (EGLAPIENTRY * eglGetCurrentSurfacePROC) (EGLint readdraw);
typedef EGLDisplay (EGLAPIENTRY * eglGetCurrentDisplayPROC) (void);
typedef EGLBoolean (EGLAPIENTRY * eglQueryContextPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRY * eglWaitGLPROC) (void);
typedef EGLBoolean (EGLAPIENTRY * eglWaitNativePROC) (EGLint engine);
typedef EGLBoolean (EGLAPIENTRY * eglSwapBuffersPROC) (EGLDisplay dpy, EGLSurface surface);
typedef EGLBoolean (EGLAPIENTRY * eglCopyBuffersPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
/* This is a generic function pointer type, whose name indicates it must
* be cast to the proper type *and calling convention* before use.
*/
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
/* Now, define eglGetProcAddress using the generic function ptr. type */
typedef __eglMustCastToProperFunctionPointerType (EGLAPIENTRY * eglGetProcAddressPROC) (const char *procname);
/* Add _ to global symbols to avoid symbol clash with the OpenGL library */
extern eglGetErrorPROC lwjgl_eglGetError;
extern eglGetDisplayPROC lwjgl_eglGetDisplay;
extern eglInitializePROC lwjgl_eglInitialize;
extern eglTerminatePROC lwjgl_eglTerminate;
extern eglQueryStringPROC lwjgl_eglQueryString;
extern eglGetConfigsPROC lwjgl_eglGetConfigs;
extern eglChooseConfigPROC lwjgl_eglChooseConfig;
extern eglGetConfigAttribPROC lwjgl_eglGetConfigAttrib;
extern eglCreateWindowSurfacePROC lwjgl_eglCreateWindowSurface;
extern eglCreatePbufferSurfacePROC lwjgl_eglCreatePbufferSurface;
extern eglCreatePixmapSurfacePROC lwjgl_eglCreatePixmapSurface;
extern eglDestroySurfacePROC lwjgl_eglDestroySurface;
extern eglQuerySurfacePROC lwjgl_eglQuerySurface;
extern eglBindAPIPROC lwjgl_eglBindAPI;
extern eglQueryAPIPROC lwjgl_eglQueryAPI;
extern eglWaitClientPROC lwjgl_eglWaitClient;
extern eglReleaseThreadPROC lwjgl_eglReleaseThread;
extern eglCreatePbufferFromClientBufferPROC lwjgl_eglCreatePbufferFromClientBuffer;
extern eglSurfaceAttribPROC lwjgl_eglSurfaceAttrib;
extern eglBindTexImagePROC lwjgl_eglBindTexImage;
extern eglReleaseTexImagePROC lwjgl_eglReleaseTexImage;
extern eglSwapIntervalPROC lwjgl_eglSwapInterval;
extern eglCreateContextPROC lwjgl_eglCreateContext;
extern eglDestroyContextPROC lwjgl_eglDestroyContext;
extern eglMakeCurrentPROC lwjgl_eglMakeCurrent;
extern eglGetCurrentContextPROC lwjgl_eglGetCurrentContext;
extern eglGetCurrentSurfacePROC lwjgl_eglGetCurrentSurface;
extern eglGetCurrentDisplayPROC lwjgl_eglGetCurrentDisplay;
extern eglQueryContextPROC lwjgl_eglQueryContext;
extern eglWaitGLPROC lwjgl_eglWaitGL;
extern eglWaitNativePROC lwjgl_eglWaitNative;
extern eglSwapBuffersPROC lwjgl_eglSwapBuffers;
extern eglCopyBuffersPROC lwjgl_eglCopyBuffers;
extern eglGetProcAddressPROC lwjgl_eglGetProcAddress;
extern bool extgl_InitEGL(EGLDisplay disp);
#endif

View File

@ -0,0 +1,161 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* FCL specific display functions.
*
* @author Tungsten
* @version $Revision$
*/
#include <fcl_bridge.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <jni.h>
#include "common_tools.h"
#include "extgl.h"
#include "extgl_egl.h"
#include "context.h"
#include "org_lwjgl_opengl_FCLDisplay.h"
#include "org_lwjgl_opengl_FCLDisplayPeerInfo.h"
#include "org_lwjgl_FCLSysImplementation.h"
static EGLSurface egl_window = EGL_NO_SURFACE;
static jlong openDisplay(JNIEnv *env) {
EGLDisplay display_connection = lwjgl_eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (display_connection == NULL) {
throwException(env, "Could not open EGL display connection");
return (intptr_t)NULL;
}
return (intptr_t)display_connection;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
(JNIEnv *env, jobject ignored) {
return org_lwjgl_FCLSysImplementation_JNI_VERSION;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLDisplay_openDisplay(JNIEnv *env, jclass clazz) {
return openDisplay(env);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLDisplay_closeDisplay(JNIEnv *env, jclass clazz, jlong display) {
EGLDisplay disp = (EGLDisplay)(intptr_t)display;
lwjgl_eglTerminate(disp);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLDisplayPeerInfo_initDrawable(JNIEnv *env, jclass clazz, jobject peer_info_handle) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
peer_info->drawable = egl_window;
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLDisplayPeerInfo_initDefaultPeerInfo(JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jobject pixel_format) {
EGLDisplay disp = (EGLDisplay)(intptr_t)display;
initPeerInfo(env, peer_info_handle, disp, pixel_format, true, EGL_WINDOW_BIT);
}
static void destroyWindow(JNIEnv *env, EGLDisplay disp, ANativeWindow* window) {
if (egl_window != EGL_NO_SURFACE) {
lwjgl_eglDestroySurface(disp, egl_window);
egl_window = EGL_NO_SURFACE;
}
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetX(JNIEnv *env, jclass unused, jlong window_ptr) {
return 0;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetY(JNIEnv *env, jclass unused, jlong window_ptr) {
return 0;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetWidth(JNIEnv *env, jclass unused, jlong window_ptr) {
ANativeWindow* win = (ANativeWindow*)(intptr_t)window_ptr;
return ANativeWindow_getWidth(win);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetHeight(JNIEnv *env, jclass unused, jlong window_ptr) {
ANativeWindow* win = (ANativeWindow*)(intptr_t)window_ptr;
return ANativeWindow_getHeight(win);
}
static ANativeWindow* createWindow(JNIEnv* env, EGLDisplay disp, jint window_mode, FCLPeerInfo *peer_info, int x, int y, int width, int height, jboolean resizable) {
ANativeWindow* win;
win = fclGetNativeWindow();
// printfDebugJava(env, "Created window");
return win;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean resizable) {
EGLDisplay disp = (EGLDisplay)(intptr_t)display;
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
EGLConfig *fb_config = NULL;
fb_config = getFBConfigFromPeerInfo(env, peer_info);
if (fb_config == NULL)
return 0;
jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
int width = (*env)->GetIntField(env, mode, fid_width);
int height = (*env)->GetIntField(env, mode, fid_height);
ANativeWindow* win = createWindow(env, disp, window_mode, peer_info, x, y, width, height, resizable);
if ((*env)->ExceptionOccurred(env)) {
return 0;
}
egl_window = lwjgl_eglCreateWindowSurface(disp, *fb_config, win, NULL);
free(fb_config);
return (jlong)(intptr_t)win;
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) {
EGLDisplay disp = (EGLDisplay)(intptr_t)display;
ANativeWindow* window = (ANativeWindow*)(intptr_t)window_ptr;
destroyWindow(env, disp, window);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGrabPointer(JNIEnv *env, jclass unused) {
fclSetCursorMode(CursorDisabled);
return 0; // GrabSuccess
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nUngrabPointer(JNIEnv *env, jclass unused) {
fclSetCursorMode(CursorEnabled);
return 0;
}

View File

@ -0,0 +1,153 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* @author Tungsten
* @version $Revision$
*/
#include <jni.h>
#include "org_lwjgl_opengl_FCLContextImplementation.h"
#include "extgl_egl.h"
#include "context.h"
#include "common_tools.h"
typedef struct {
EGLContext context;
} FCLContext;
static bool checkContext(JNIEnv *env, EGLDisplay display, EGLContext context) {
if (context == NULL) {
throwException(env, "Could not create EGL context");
return false;
}
return true;
}
static void createContextEGL(JNIEnv *env, FCLPeerInfo *peer_info, FCLContext *context_info, jobject attribs, EGLContext shared_context) {
EGLConfig *config = getFBConfigFromPeerInfo(env, peer_info);
if (config == NULL)
return;
if (!lwjgl_eglBindAPI(EGL_OPENGL_API)) {
throwException(env, "Could not bind OpenGL API");
return;
}
EGLContext context;
if (attribs) {
EGLint *attrib_list = (EGLint *)(*env)->GetDirectBufferAddress(env, attribs);
context = lwjgl_eglCreateContext(peer_info->display, *config, shared_context, attrib_list);
} else {
context = lwjgl_eglCreateContext(peer_info->display, *config, shared_context, NULL);
}
if (!checkContext(env, peer_info->display, context))
return;
context_info->context = context;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_getEGLContext(JNIEnv *env, jclass clazz, jobject context_handle) {
FCLContext *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
return (intptr_t)context_info->context;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_getDisplay(JNIEnv *env, jclass clazz, jobject peer_info_handle) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
return (intptr_t)peer_info->display;
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nSetSwapInterval(JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle, jint value) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
FCLContext *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
lwjgl_eglSwapInterval(peer_info->display, value);
}
JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nCreate
(JNIEnv *env , jclass clazz, jobject peer_handle, jobject attribs, jobject shared_context_handle) {
jobject context_handle = newJavaManagedByteBuffer(env, sizeof(FCLContext));
if (context_handle == NULL) {
throwException(env, "Could not allocate handle buffer");
return NULL;
}
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle);
FCLContext *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
if (!extgl_InitEGL(peer_info->display)) {
throwException(env, "Could not initialize EGL");
return NULL;
}
EGLContext shared_context = NULL;
if (shared_context_handle != NULL) {
FCLContext *shared_context_info = (*env)->GetDirectBufferAddress(env, shared_context_handle);
shared_context = shared_context_info->context;
}
createContextEGL(env, peer_info, context_info, attribs, shared_context);
return context_handle;
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nDestroy
(JNIEnv *env, jclass clazz, jobject peer_handle, jobject context_handle) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle);
FCLContext *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
lwjgl_eglDestroyContext(peer_info->display, context_info->context);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nReleaseCurrentContext
(JNIEnv *env , jclass clazz, jobject peer_info_handle) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
bool result;
result = lwjgl_eglMakeCurrent(peer_info->display, EGL_NO_SURFACE, EGL_NO_SURFACE, NULL);
if (!result)
throwException(env, "Could not release current context");
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nMakeCurrent
(JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
FCLContext *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
bool result;
result = lwjgl_eglMakeCurrent(peer_info->display, peer_info->drawable, peer_info->drawable, context_info->context);
if (!result)
throwException(env, "Could not make context current");
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nIsCurrent
(JNIEnv *env, jclass clazz, jobject context_handle) {
FCLContext *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
return context_info->context == lwjgl_eglGetCurrentContext();
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nSwapBuffers
(JNIEnv *env, jclass clazz, jobject peer_info_handle) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
lwjgl_eglSwapBuffers(peer_info->display, peer_info->drawable);
}

View File

@ -0,0 +1,85 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_FCLContextImplementation */
#ifndef _Included_org_lwjgl_opengl_FCLContextImplementation
#define _Included_org_lwjgl_opengl_FCLContextImplementation
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: nCreate
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nCreate
(JNIEnv *, jclass, jobject, jobject, jobject);
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: getEGLContext
* Signature: (Ljava/nio/ByteBuffer;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_getEGLContext
(JNIEnv *, jobject, jobject);
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: getDisplay
* Signature: (Ljava/nio/ByteBuffer;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_getDisplay
(JNIEnv *, jobject, jobject);
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: nSwapBuffers
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nSwapBuffers
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: nReleaseCurrentContext
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nReleaseCurrentContext
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: nMakeCurrent
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nMakeCurrent
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: nIsCurrent
* Signature: (Ljava/nio/ByteBuffer;)Z
*/
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nIsCurrent
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: nSetSwapInterval
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;I)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nSetSwapInterval
(JNIEnv *, jclass, jobject, jobject, jint);
/*
* Class: org_lwjgl_opengl_FCLContextImplementation
* Method: nDestroy
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLContextImplementation_nDestroy
(JNIEnv *, jclass, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,29 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_FCLDisplayPeerInfo */
#ifndef _Included_org_lwjgl_opengl_FCLDisplayPeerInfo
#define _Included_org_lwjgl_opengl_FCLDisplayPeerInfo
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opengl_FCLDisplayPeerInfo
* Method: initDefaultPeerInfo
* Signature: (JLjava/nio/ByteBuffer;Lorg/lwjgl/opengl/PixelFormat;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLDisplayPeerInfo_initDefaultPeerInfo
(JNIEnv *, jclass, jlong, jobject, jobject);
/*
* Class: org_lwjgl_opengl_FCLDisplayPeerInfo
* Method: initDrawable
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLDisplayPeerInfo_initDrawable
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,29 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_FCLPbufferPeerInfo */
#ifndef _Included_org_lwjgl_opengl_FCLPbufferPeerInfo
#define _Included_org_lwjgl_opengl_FCLPbufferPeerInfo
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opengl_FCLPbufferPeerInfo
* Method: nInitHandle
* Signature: (JLjava/nio/ByteBuffer;IILorg/lwjgl/opengl/PixelFormat;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLPbufferPeerInfo_nInitHandle
(JNIEnv *, jclass, jlong, jobject, jint, jint, jobject);
/*
* Class: org_lwjgl_opengl_FCLPbufferPeerInfo
* Method: nDestroy
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLPbufferPeerInfo_nDestroy
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,84 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* FCL Pbuffer.
*
* @author Tungsten
* @version $Revision$
*/
#include <stdlib.h>
#include "org_lwjgl_opengl_FCLPbufferPeerInfo.h"
#include "org_lwjgl_opengl_Pbuffer.h"
#include "extgl.h"
#include "context.h"
#include "common_tools.h"
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetPbufferCapabilities(JNIEnv *env, jclass clazz, jlong display) {
EGLDisplay disp = (EGLDisplay)(intptr_t)display;
if (!extgl_InitEGL(disp))
return 0;
// Only support the EGL 1.4 Pbuffers
return org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED;
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLPbufferPeerInfo_nInitHandle(JNIEnv *env, jclass clazz, jlong display, jobject peer_info_handle, jint width, jint height, jobject pixel_format) {
EGLDisplay disp = (EGLDisplay)(intptr_t)display;
if (!extgl_InitEGL(disp)) {
throwException(env, "No Pbuffer support");
return;
}
bool result = initPeerInfo(env, peer_info_handle, disp, pixel_format, false, EGL_PBUFFER_BIT);
if (!result)
return;
const int buffer_attribs[] = {EGL_WIDTH, width,
EGL_HEIGHT, height,
EGL_LARGEST_PBUFFER, EGL_FALSE,
EGL_NONE, EGL_NONE};
FCLPeerInfo *peer_info = (FCLPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
EGLConfig *config = getFBConfigFromPeerInfo(env, peer_info);
if (config != NULL) {
EGLSurface buffer = lwjgl_eglCreatePbufferSurface(peer_info->display, *config, buffer_attribs);
free(config);
peer_info->drawable = buffer;
}
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLPbufferPeerInfo_nDestroy
(JNIEnv *env, jclass clazz, jobject peer_info_handle) {
FCLPeerInfo *peer_info = (FCLPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
lwjgl_eglDestroySurface(peer_info->display, peer_info->drawable);
}

View File

@ -0,0 +1,15 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_FCLSysImplementation */
#ifndef _Included_org_lwjgl_FCLSysImplementation
#define _Included_org_lwjgl_FCLSysImplementation
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_FCLSysImplementation_JNI_VERSION
#define org_lwjgl_FCLSysImplementation_JNI_VERSION 23L
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* FCL cursor stubs.
*
* @author Tungsten
* @version $Revision$
*/
#include <fcl_bridge.h>
#include "org_lwjgl_input_Cursor.h"
#include "org_lwjgl_opengl_FCLDisplay.h"
#include "common_tools.h"
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetNativeCursorCapabilities
(JNIEnv *env, jclass clazz) {
int caps = 0;
caps |= org_lwjgl_input_Cursor_CURSOR_8_BIT_ALPHA | org_lwjgl_input_Cursor_CURSOR_ONE_BIT_TRANSPARENCY;
caps |= org_lwjgl_input_Cursor_CURSOR_ANIMATION;
return caps;
}

View File

@ -0,0 +1,123 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_FCLDisplay */
#ifndef _Included_org_lwjgl_opengl_FCLDisplay
#define _Included_org_lwjgl_opengl_FCLDisplay
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_opengl_FCLDisplay_GrabSuccess
#define org_lwjgl_opengl_FCLDisplay_GrabSuccess 0L
#undef org_lwjgl_opengl_FCLDisplay_FULLSCREEN_LEGACY
#define org_lwjgl_opengl_FCLDisplay_FULLSCREEN_LEGACY 1L
#undef org_lwjgl_opengl_FCLDisplay_WINDOWED
#define org_lwjgl_opengl_FCLDisplay_WINDOWED 3L
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: openDisplay
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLDisplay_openDisplay
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: closeDisplay
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLDisplay_closeDisplay
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nGrabPointer
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGrabPointer
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nUngrabPointer
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nUngrabPointer
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nCreateWindow
* Signature: (JLjava/nio/ByteBuffer;Lorg/lwjgl/opengl/DisplayMode;IIIZ)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLDisplay_nCreateWindow
(JNIEnv *, jclass, jlong, jobject, jobject, jint, jint, jint, jboolean);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nGetX
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetX
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nGetY
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetY
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nGetWidth
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetWidth
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nGetHeight
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetHeight
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nDestroyWindow
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_FCLDisplay_nDestroyWindow
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nGetAvailableDisplayModes
* Signature: ()[Lorg/lwjgl/opengl/DisplayMode;
*/
JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetAvailableDisplayModes
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nGetNativeCursorCapabilities
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetNativeCursorCapabilities
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_FCLDisplay
* Method: nGetPbufferCapabilities
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLDisplay_nGetPbufferCapabilities
(JNIEnv *, jclass, jlong);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
*
* @author Tungsten
*/
#include <fcl_bridge.h>
#include <jni.h>
#include "common_tools.h"
#include "org_lwjgl_opengl_FCLEvent.h"
JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_FCLEvent_createEventBuffer(JNIEnv *env, jclass unused) {
return newJavaManagedByteBuffer(env, sizeof(FCLEvent));
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_getPending(JNIEnv *env, jclass unused) {
return fclWaitForEvent(0);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nNextEvent(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return fclPollEvent(event);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetType(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->type;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetFCLMessageMessage(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->message;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonTime(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->time;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonState(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->state;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonType(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->type;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonButton(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->button;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonX(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->x;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonY(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->y;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyTime(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->time;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyType(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->type;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyKeyCode(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->keycode;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyState(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->state;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyKeyChar(JNIEnv *env, jclass unused, jobject event_buffer) {
FCLEvent *event = (FCLEvent *)(*env)->GetDirectBufferAddress(env, event_buffer);
return event->keychar;
}

View File

@ -0,0 +1,157 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_FCLEvent */
#ifndef _Included_org_lwjgl_opengl_FCLEvent
#define _Included_org_lwjgl_opengl_FCLEvent
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_opengl_FCLEvent_KeyPress
#define org_lwjgl_opengl_FCLEvent_KeyPress 2L
#undef org_lwjgl_opengl_FCLEvent_KeyRelease
#define org_lwjgl_opengl_FCLEvent_KeyRelease 3L
#undef org_lwjgl_opengl_FCLEvent_ButtonPress
#define org_lwjgl_opengl_FCLEvent_ButtonPress 4L
#undef org_lwjgl_opengl_FCLEvent_ButtonRelease
#define org_lwjgl_opengl_FCLEvent_ButtonRelease 5L
#undef org_lwjgl_opengl_FCLEvent_MotionNotify
#define org_lwjgl_opengl_FCLEvent_MotionNotify 6L
#undef org_lwjgl_opengl_FCLEvent_ConfigureNotify
#define org_lwjgl_opengl_FCLEvent_ConfigureNotify 22L
#undef org_lwjgl_opengl_FCLEvent_FCLMessage
#define org_lwjgl_opengl_FCLEvent_FCLMessage 37L
#undef org_lwjgl_opengl_FCLEvent_CloseRequest
#define org_lwjgl_opengl_FCLEvent_CloseRequest 0L
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: createEventBuffer
* Signature: ()Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_FCLEvent_createEventBuffer
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: getPending
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_getPending
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nNextEvent
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nNextEvent
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetType
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetType
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetFCLMessageMessage
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetFCLMessageMessage
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetButtonTime
* Signature: (Ljava/nio/ByteBuffer;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonTime
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetButtonState
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonState
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetButtonType
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonType
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetButtonButton
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonButton
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetButtonX
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonX
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetButtonY
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetButtonY
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetKeyTime
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyTime
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetKeyType
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyType
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetKeyKeyCode
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyKeyCode
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetKeyState
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyState
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLEvent
* Method: nGetKeyKeyChar
* Signature: (Ljava/nio/ByteBuffer;)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLEvent_nGetKeyKeyChar
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
*
* FCL keyboard handling.
*
* @author Tungsten
*/
#include <fcl_bridge.h>
#include "common_tools.h"
#include "org_lwjgl_opengl_FCLKeyboard.h"

View File

@ -0,0 +1,15 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_FCLKeyboard */
#ifndef _Included_org_lwjgl_opengl_FCLKeyboard
#define _Included_org_lwjgl_opengl_FCLKeyboard
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_opengl_FCLKeyboard_KEYBOARD_BUFFER_SIZE
#define org_lwjgl_opengl_FCLKeyboard_KEYBOARD_BUFFER_SIZE 50L
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,58 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
*
* FCL mouse handling.
*
* @author Tungsten
*/
#include <fcl_bridge.h>
#include "common_tools.h"
#include "org_lwjgl_opengl_FCLMouse.h"
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLMouse_nGetWindowHeight(JNIEnv *env, jclass unused, jlong window_ptr) {
ANativeWindow *win = (ANativeWindow *)(intptr_t)window_ptr;
return ANativeWindow_getHeight(win);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLMouse_nGetWindowWidth(JNIEnv *env, jclass unused, jlong window_ptr) {
ANativeWindow *win = (ANativeWindow *)(intptr_t)window_ptr;
return ANativeWindow_getWidth(win);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLMouse_nGetButtonCount(JNIEnv *env, jclass unused) {
int count = 16;
return count;
}

View File

@ -0,0 +1,61 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_FCLMouse */
#ifndef _Included_org_lwjgl_opengl_FCLMouse
#define _Included_org_lwjgl_opengl_FCLMouse
#ifdef __cplusplus
extern "C" {
#endif
#undef org_lwjgl_opengl_FCLMouse_WHEEL_SCALE
#define org_lwjgl_opengl_FCLMouse_WHEEL_SCALE 120L
#undef org_lwjgl_opengl_FCLMouse_Button1
#define org_lwjgl_opengl_FCLMouse_Button1 1L
#undef org_lwjgl_opengl_FCLMouse_Button2
#define org_lwjgl_opengl_FCLMouse_Button2 2L
#undef org_lwjgl_opengl_FCLMouse_Button3
#define org_lwjgl_opengl_FCLMouse_Button3 3L
#undef org_lwjgl_opengl_FCLMouse_Button4
#define org_lwjgl_opengl_FCLMouse_Button4 4L
#undef org_lwjgl_opengl_FCLMouse_Button5
#define org_lwjgl_opengl_FCLMouse_Button5 5L
#undef org_lwjgl_opengl_FCLMouse_Button6
#define org_lwjgl_opengl_FCLMouse_Button6 6L
#undef org_lwjgl_opengl_FCLMouse_Button7
#define org_lwjgl_opengl_FCLMouse_Button7 7L
#undef org_lwjgl_opengl_FCLMouse_Button8
#define org_lwjgl_opengl_FCLMouse_Button8 8L
#undef org_lwjgl_opengl_FCLMouse_Button9
#define org_lwjgl_opengl_FCLMouse_Button9 9L
#undef org_lwjgl_opengl_FCLMouse_ButtonPress
#define org_lwjgl_opengl_FCLMouse_ButtonPress 4L
#undef org_lwjgl_opengl_FCLMouse_ButtonRelease
#define org_lwjgl_opengl_FCLMouse_ButtonRelease 5L
/*
* Class: org_lwjgl_opengl_FCLMouse
* Method: nGetWindowHeight
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLMouse_nGetWindowHeight
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_FCLMouse
* Method: nGetWindowWidth
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLMouse_nGetWindowWidth
(JNIEnv *, jclass, jlong);
/*
* Class: org_lwjgl_opengl_FCLMouse
* Method: nGetButtonCount
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_FCLMouse_nGetButtonCount
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,58 @@
/*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* @author Tungsten
* @version $Revision$
*/
#include <jni.h>
#include "org_lwjgl_opengl_FCLPeerInfo.h"
#include "context.h"
#include "common_tools.h"
JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_FCLPeerInfo_createHandle
(JNIEnv *env, jclass clazz) {
return newJavaManagedByteBuffer(env, sizeof(FCLPeerInfo));
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLPeerInfo_nGetDisplay(JNIEnv *env, jclass unused, jobject handle) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, handle);
return (jlong)(intptr_t)peer_info->display;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLPeerInfo_nGetDrawable(JNIEnv *env, jclass unused, jobject handle) {
FCLPeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, handle);
return (jlong)(intptr_t)peer_info->drawable;
}

View File

@ -0,0 +1,37 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_lwjgl_opengl_FCLPeerInfo */
#ifndef _Included_org_lwjgl_opengl_FCLPeerInfo
#define _Included_org_lwjgl_opengl_FCLPeerInfo
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_lwjgl_opengl_FCLPeerInfo
* Method: createHandle
* Signature: ()Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_FCLPeerInfo_createHandle
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_opengl_FCLPeerInfo
* Method: nGetDisplay
* Signature: (Ljava/nio/ByteBuffer;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLPeerInfo_nGetDisplay
(JNIEnv *, jclass, jobject);
/*
* Class: org_lwjgl_opengl_FCLPeerInfo
* Method: nGetDrawable
* Signature: (Ljava/nio/ByteBuffer;)J
*/
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_FCLPeerInfo_nGetDrawable
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,444 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extal.h"
typedef ALvoid (ALAPIENTRY *alEnablePROC) (ALint capability);
typedef ALvoid (ALAPIENTRY *alDisablePROC) (ALenum capability);
typedef ALboolean (ALAPIENTRY *alIsEnabledPROC) (ALenum capability);
typedef ALboolean (ALAPIENTRY *alGetBooleanPROC) (ALenum pname);
typedef ALint (ALAPIENTRY *alGetIntegerPROC) (ALenum pname);
typedef ALfloat (ALAPIENTRY *alGetFloatPROC) (ALenum pname);
typedef ALdouble (ALAPIENTRY *alGetDoublePROC) (ALenum pname);
typedef ALvoid (ALAPIENTRY *alGetIntegervPROC) (ALenum pname, ALint * data);
typedef ALvoid (ALAPIENTRY *alGetFloatvPROC) (ALenum pname, ALfloat * data);
typedef ALvoid (ALAPIENTRY *alGetDoublevPROC) (ALenum pname, ALdouble * data);
typedef ALubyte * (ALAPIENTRY *alGetStringPROC) (ALenum pname);
typedef ALenum (ALAPIENTRY *alGetErrorPROC) ();
typedef ALboolean (ALAPIENTRY *alIsExtensionPresentPROC) (ALubyte * fname);
typedef ALenum (ALAPIENTRY *alGetEnumValuePROC) (ALubyte * ename);
typedef ALvoid (ALAPIENTRY *alListeneriPROC) (ALenum pname, ALint value);
typedef ALvoid (ALAPIENTRY *alListenerfPROC) (ALenum pname, ALfloat value);
typedef ALvoid (ALAPIENTRY *alListenerfvPROC) (ALenum pname, const ALfloat * value);
typedef ALvoid (ALAPIENTRY *alListener3fPROC) (ALenum pname, ALfloat v1, ALfloat v2, ALfloat v3);
typedef void (ALAPIENTRY *alGetListeneriPROC) (ALenum pname, ALint* value);
typedef void (ALAPIENTRY *alGetListenerfPROC) (ALenum pname, ALfloat* value);
typedef ALvoid (ALAPIENTRY *alGetListenerfvPROC) (ALenum pname, ALfloat * floatdata);
typedef ALvoid (ALAPIENTRY *alGenSourcesPROC) (ALsizei n, ALuint * sources);
typedef ALvoid (ALAPIENTRY *alDeleteSourcesPROC) (ALsizei n, ALuint * sources);
typedef ALboolean (ALAPIENTRY *alIsSourcePROC) (ALuint id);
typedef ALvoid (ALAPIENTRY *alSourceiPROC) (ALuint source, ALenum pname, ALint value);
typedef ALvoid (ALAPIENTRY *alSourcefPROC) (ALuint source, ALenum pname, ALfloat value);
typedef ALvoid (ALAPIENTRY *alSourcefvPROC) (ALuint source, ALenum pname, const ALfloat * value);
typedef ALvoid (ALAPIENTRY *alSource3fPROC) (ALuint source, ALenum pname, ALfloat v1, ALfloat v2, ALfloat v3);
typedef ALvoid (ALAPIENTRY *alGetSourceiPROC) (ALuint source, ALenum pname, ALint* value);
typedef ALvoid (ALAPIENTRY *alGetSourcefPROC) (ALuint source, ALenum pname, ALfloat* value);
typedef ALvoid (ALAPIENTRY *alGetSourcefvPROC) (ALuint source, ALenum pname, ALfloat * floatdata);
typedef ALvoid (ALAPIENTRY *alSourcePlayvPROC) (ALsizei n, ALuint * sources);
typedef ALvoid (ALAPIENTRY *alSourcePausevPROC) (ALsizei n, ALuint * sources);
typedef ALvoid (ALAPIENTRY *alSourceStopvPROC) (ALsizei n, ALuint * sources);
typedef ALvoid (ALAPIENTRY *alSourceRewindvPROC) (ALsizei n, ALuint * sources);
typedef ALvoid (ALAPIENTRY *alSourcePlayPROC) (ALuint source);
typedef ALvoid (ALAPIENTRY *alSourcePausePROC) (ALuint source);
typedef ALvoid (ALAPIENTRY *alSourceStopPROC) (ALuint source);
typedef ALvoid (ALAPIENTRY *alSourceRewindPROC) (ALuint source);
typedef ALvoid (ALAPIENTRY *alGenBuffersPROC) (ALsizei n, ALuint * buffers);
typedef ALvoid (ALAPIENTRY *alDeleteBuffersPROC) (ALsizei n, ALuint * buffers);
typedef ALboolean (ALAPIENTRY *alIsBufferPROC) (ALuint buffer);
typedef ALvoid (ALAPIENTRY *alBufferDataPROC) (ALuint buffer, ALenum format, ALvoid * data, ALsizei size, ALsizei freq);
typedef ALvoid (ALAPIENTRY *alGetBufferiPROC) (ALuint buffer, ALenum pname, ALint* value);
typedef ALvoid (ALAPIENTRY *alGetBufferfPROC) (ALuint buffer, ALenum pname, ALfloat* value);
typedef ALvoid (ALAPIENTRY *alSourceQueueBuffersPROC) (ALuint source, ALsizei n, ALuint * buffers);
typedef ALvoid (ALAPIENTRY *alSourceUnqueueBuffersPROC) (ALuint source, ALsizei n, ALuint * buffers);
typedef ALvoid (ALAPIENTRY *alDistanceModelPROC) (ALenum value);
typedef ALvoid (ALAPIENTRY *alDopplerFactorPROC) (ALfloat value);
typedef ALvoid (ALAPIENTRY *alDopplerVelocityPROC) (ALfloat value);
static alEnablePROC alEnable;
static alDisablePROC alDisable;
static alIsEnabledPROC alIsEnabled;
static alGetBooleanPROC alGetBoolean;
static alGetIntegerPROC alGetInteger;
static alGetFloatPROC alGetFloat;
static alGetDoublePROC alGetDouble;
static alGetIntegervPROC alGetIntegerv;
static alGetFloatvPROC alGetFloatv;
static alGetDoublevPROC alGetDoublev;
static alGetStringPROC alGetString;
static alGetErrorPROC alGetError;
static alIsExtensionPresentPROC alIsExtensionPresent;
static alGetEnumValuePROC alGetEnumValue;
static alListeneriPROC alListeneri;
static alListenerfPROC alListenerf;
static alListenerfvPROC alListenerfv;
static alListener3fPROC alListener3f;
static alGetListeneriPROC alGetListeneri;
static alGetListenerfPROC alGetListenerf;
static alGetListenerfvPROC alGetListenerfv;
static alGenSourcesPROC alGenSources;
static alDeleteSourcesPROC alDeleteSources;
static alIsSourcePROC alIsSource;
static alSourceiPROC alSourcei;
static alSourcefPROC alSourcef;
static alSourcefvPROC alSourcefv;
static alSource3fPROC alSource3f;
static alGetSourceiPROC alGetSourcei;
static alGetSourcefPROC alGetSourcef;
static alGetSourcefvPROC alGetSourcefv;
static alSourcePlayvPROC alSourcePlayv;
static alSourcePausevPROC alSourcePausev;
static alSourceStopvPROC alSourceStopv;
static alSourceRewindvPROC alSourceRewindv;
static alSourcePlayPROC alSourcePlay;
static alSourcePausePROC alSourcePause;
static alSourceStopPROC alSourceStop;
static alSourceRewindPROC alSourceRewind;
static alGenBuffersPROC alGenBuffers;
static alDeleteBuffersPROC alDeleteBuffers;
static alIsBufferPROC alIsBuffer;
static alBufferDataPROC alBufferData;
static alGetBufferiPROC alGetBufferi;
static alGetBufferfPROC alGetBufferf;
static alSourceQueueBuffersPROC alSourceQueueBuffers;
static alSourceUnqueueBuffersPROC alSourceUnqueueBuffers;
static alDistanceModelPROC alDistanceModel;
static alDopplerFactorPROC alDopplerFactor;
static alDopplerVelocityPROC alDopplerVelocity;
static void JNICALL Java_org_lwjgl_openal_AL10_nalEnable(JNIEnv *env, jclass clazz, jint capability) {
alEnable(capability);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalDisable(JNIEnv *env, jclass clazz, jint capability) {
alDisable(capability);
}
static jboolean JNICALL Java_org_lwjgl_openal_AL10_nalIsEnabled(JNIEnv *env, jclass clazz, jint capability) {
ALboolean __result = alIsEnabled(capability);
return __result;
}
static jboolean JNICALL Java_org_lwjgl_openal_AL10_nalGetBoolean(JNIEnv *env, jclass clazz, jint pname) {
ALboolean __result = alGetBoolean(pname);
return __result;
}
static jint JNICALL Java_org_lwjgl_openal_AL10_nalGetInteger(JNIEnv *env, jclass clazz, jint pname) {
ALint __result = alGetInteger(pname);
return __result;
}
static jfloat JNICALL Java_org_lwjgl_openal_AL10_nalGetFloat(JNIEnv *env, jclass clazz, jint pname) {
ALfloat __result = alGetFloat(pname);
return __result;
}
static jdouble JNICALL Java_org_lwjgl_openal_AL10_nalGetDouble(JNIEnv *env, jclass clazz, jint pname) {
ALdouble __result = alGetDouble(pname);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalGetIntegerv(JNIEnv *env, jclass clazz, jint pname, jlong data) {
ALint *data_address = (ALint *)(intptr_t)data;
alGetIntegerv(pname, data_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalGetFloatv(JNIEnv *env, jclass clazz, jint pname, jlong data) {
ALfloat *data_address = (ALfloat *)(intptr_t)data;
alGetFloatv(pname, data_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalGetDoublev(JNIEnv *env, jclass clazz, jint pname, jlong data) {
ALdouble *data_address = (ALdouble *)(intptr_t)data;
alGetDoublev(pname, data_address);
}
static jobject JNICALL Java_org_lwjgl_openal_AL10_nalGetString(JNIEnv *env, jclass clazz, jint pname) {
ALubyte * __result = alGetString(pname);
return NewStringNativeUnsigned(env, __result);
}
static jint JNICALL Java_org_lwjgl_openal_AL10_nalGetError(JNIEnv *env, jclass clazz) {
ALenum __result = alGetError();
return __result;
}
static jboolean JNICALL Java_org_lwjgl_openal_AL10_nalIsExtensionPresent(JNIEnv *env, jclass clazz, jobject fname) {
ALubyte *fname_address = (ALubyte *)(intptr_t)GetStringNativeChars(env, fname);
ALboolean __result = alIsExtensionPresent(fname_address);
free(fname_address);
return __result;
}
static jint JNICALL Java_org_lwjgl_openal_AL10_nalGetEnumValue(JNIEnv *env, jclass clazz, jobject ename) {
ALubyte *ename_address = (ALubyte *)(intptr_t)GetStringNativeChars(env, ename);
ALenum __result = alGetEnumValue(ename_address);
free(ename_address);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalListeneri(JNIEnv *env, jclass clazz, jint pname, jint value) {
alListeneri(pname, value);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalListenerf(JNIEnv *env, jclass clazz, jint pname, jfloat value) {
alListenerf(pname, value);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalListenerfv(JNIEnv *env, jclass clazz, jint pname, jlong value) {
const ALfloat *value_address = (const ALfloat *)(intptr_t)value;
alListenerfv(pname, value_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalListener3f(JNIEnv *env, jclass clazz, jint pname, jfloat v1, jfloat v2, jfloat v3) {
alListener3f(pname, v1, v2, v3);
}
static jint JNICALL Java_org_lwjgl_openal_AL10_nalGetListeneri(JNIEnv *env, jclass clazz, jint pname) {
ALint __result;
alGetListeneri(pname, &__result);
return __result;
}
static jfloat JNICALL Java_org_lwjgl_openal_AL10_nalGetListenerf(JNIEnv *env, jclass clazz, jint pname) {
ALfloat __result;
alGetListenerf(pname, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalGetListenerfv(JNIEnv *env, jclass clazz, jint pname, jlong floatdata) {
ALfloat *floatdata_address = (ALfloat *)(intptr_t)floatdata;
alGetListenerfv(pname, floatdata_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalGenSources(JNIEnv *env, jclass clazz, jint n, jlong sources) {
ALuint *sources_address = (ALuint *)(intptr_t)sources;
alGenSources(n, sources_address);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_openal_AL10_nalGenSources2(JNIEnv *env, jclass clazz, jint n) {
ALuint __result;
alGenSources(n, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalDeleteSources(JNIEnv *env, jclass clazz, jint n, jlong sources) {
ALuint *sources_address = (ALuint *)(intptr_t)sources;
alDeleteSources(n, sources_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL10_nalDeleteSources2(JNIEnv *env, jclass clazz, jint n, jint source) {
alDeleteSources(n, (ALuint*)&source);
}
static jboolean JNICALL Java_org_lwjgl_openal_AL10_nalIsSource(JNIEnv *env, jclass clazz, jint id) {
ALboolean __result = alIsSource(id);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourcei(JNIEnv *env, jclass clazz, jint source, jint pname, jint value) {
alSourcei(source, pname, value);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourcef(JNIEnv *env, jclass clazz, jint source, jint pname, jfloat value) {
alSourcef(source, pname, value);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourcefv(JNIEnv *env, jclass clazz, jint source, jint pname, jlong value) {
const ALfloat *value_address = (const ALfloat *)(intptr_t)value;
alSourcefv(source, pname, value_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSource3f(JNIEnv *env, jclass clazz, jint source, jint pname, jfloat v1, jfloat v2, jfloat v3) {
alSource3f(source, pname, v1, v2, v3);
}
static jint JNICALL Java_org_lwjgl_openal_AL10_nalGetSourcei(JNIEnv *env, jclass clazz, jint source, jint pname) {
ALint __result;
alGetSourcei(source, pname, &__result);
return __result;
}
static jfloat JNICALL Java_org_lwjgl_openal_AL10_nalGetSourcef(JNIEnv *env, jclass clazz, jint source, jint pname) {
ALfloat __result;
alGetSourcef(source, pname, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalGetSourcefv(JNIEnv *env, jclass clazz, jint source, jint pname, jlong floatdata) {
ALfloat *floatdata_address = (ALfloat *)(intptr_t)floatdata;
alGetSourcefv(source, pname, floatdata_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourcePlayv(JNIEnv *env, jclass clazz, jint n, jlong sources) {
ALuint *sources_address = (ALuint *)(intptr_t)sources;
alSourcePlayv(n, sources_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourcePausev(JNIEnv *env, jclass clazz, jint n, jlong sources) {
ALuint *sources_address = (ALuint *)(intptr_t)sources;
alSourcePausev(n, sources_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourceStopv(JNIEnv *env, jclass clazz, jint n, jlong sources) {
ALuint *sources_address = (ALuint *)(intptr_t)sources;
alSourceStopv(n, sources_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourceRewindv(JNIEnv *env, jclass clazz, jint n, jlong sources) {
ALuint *sources_address = (ALuint *)(intptr_t)sources;
alSourceRewindv(n, sources_address);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourcePlay(JNIEnv *env, jclass clazz, jint source) {
alSourcePlay(source);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourcePause(JNIEnv *env, jclass clazz, jint source) {
alSourcePause(source);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourceStop(JNIEnv *env, jclass clazz, jint source) {
alSourceStop(source);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourceRewind(JNIEnv *env, jclass clazz, jint source) {
alSourceRewind(source);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalGenBuffers(JNIEnv *env, jclass clazz, jint n, jlong buffers) {
ALuint *buffers_address = (ALuint *)(intptr_t)buffers;
alGenBuffers(n, buffers_address);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_openal_AL10_nalGenBuffers2(JNIEnv *env, jclass clazz, jint n) {
ALuint __result;
alGenBuffers(n, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalDeleteBuffers(JNIEnv *env, jclass clazz, jint n, jlong buffers) {
ALuint *buffers_address = (ALuint *)(intptr_t)buffers;
alDeleteBuffers(n, buffers_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL10_nalDeleteBuffers2(JNIEnv *env, jclass clazz, jint n, jint buffer) {
alDeleteBuffers(n, (ALuint*)&buffer);
}
static jboolean JNICALL Java_org_lwjgl_openal_AL10_nalIsBuffer(JNIEnv *env, jclass clazz, jint buffer) {
ALboolean __result = alIsBuffer(buffer);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalBufferData(JNIEnv *env, jclass clazz, jint buffer, jint format, jlong data, jint size, jint freq) {
ALvoid *data_address = (ALvoid *)(intptr_t)data;
alBufferData(buffer, format, data_address, size, freq);
}
static jint JNICALL Java_org_lwjgl_openal_AL10_nalGetBufferi(JNIEnv *env, jclass clazz, jint buffer, jint pname) {
ALint __result;
alGetBufferi(buffer, pname, &__result);
return __result;
}
static jfloat JNICALL Java_org_lwjgl_openal_AL10_nalGetBufferf(JNIEnv *env, jclass clazz, jint buffer, jint pname) {
ALfloat __result;
alGetBufferf(buffer, pname, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourceQueueBuffers(JNIEnv *env, jclass clazz, jint source, jint n, jlong buffers) {
ALuint *buffers_address = (ALuint *)(intptr_t)buffers;
alSourceQueueBuffers(source, n, buffers_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL10_nalSourceQueueBuffers2(JNIEnv *env, jclass clazz, jint source, jint n, jint buffer) {
alSourceQueueBuffers(source, n, (ALuint*)&buffer);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalSourceUnqueueBuffers(JNIEnv *env, jclass clazz, jint source, jint n, jlong buffers) {
ALuint *buffers_address = (ALuint *)(intptr_t)buffers;
alSourceUnqueueBuffers(source, n, buffers_address);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_openal_AL10_nalSourceUnqueueBuffers2(JNIEnv *env, jclass clazz, jint source, jint n) {
ALuint __result;
alSourceUnqueueBuffers(source, n, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalDistanceModel(JNIEnv *env, jclass clazz, jint value) {
alDistanceModel(value);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalDopplerFactor(JNIEnv *env, jclass clazz, jfloat value) {
alDopplerFactor(value);
}
static void JNICALL Java_org_lwjgl_openal_AL10_nalDopplerVelocity(JNIEnv *env, jclass clazz, jfloat value) {
alDopplerVelocity(value);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL10_initNativeStubs(JNIEnv *env, jclass clazz) {
JavaMethodAndExtFunction functions[] = {
{"nalEnable", "(I)V", (void *)&Java_org_lwjgl_openal_AL10_nalEnable, "alEnable", (void *)&alEnable, false},
{"nalDisable", "(I)V", (void *)&Java_org_lwjgl_openal_AL10_nalDisable, "alDisable", (void *)&alDisable, false},
{"nalIsEnabled", "(I)Z", (void *)&Java_org_lwjgl_openal_AL10_nalIsEnabled, "alIsEnabled", (void *)&alIsEnabled, false},
{"nalGetBoolean", "(I)Z", (void *)&Java_org_lwjgl_openal_AL10_nalGetBoolean, "alGetBoolean", (void *)&alGetBoolean, false},
{"nalGetInteger", "(I)I", (void *)&Java_org_lwjgl_openal_AL10_nalGetInteger, "alGetInteger", (void *)&alGetInteger, false},
{"nalGetFloat", "(I)F", (void *)&Java_org_lwjgl_openal_AL10_nalGetFloat, "alGetFloat", (void *)&alGetFloat, false},
{"nalGetDouble", "(I)D", (void *)&Java_org_lwjgl_openal_AL10_nalGetDouble, "alGetDouble", (void *)&alGetDouble, false},
{"nalGetIntegerv", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalGetIntegerv, "alGetIntegerv", (void *)&alGetIntegerv, false},
{"nalGetFloatv", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalGetFloatv, "alGetFloatv", (void *)&alGetFloatv, false},
{"nalGetDoublev", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalGetDoublev, "alGetDoublev", (void *)&alGetDoublev, false},
{"nalGetString", "(I)Ljava/lang/String;", (void *)&Java_org_lwjgl_openal_AL10_nalGetString, "alGetString", (void *)&alGetString, false},
{"nalGetError", "()I", (void *)&Java_org_lwjgl_openal_AL10_nalGetError, "alGetError", (void *)&alGetError, false},
{"nalIsExtensionPresent", "(Ljava/lang/String;)Z", (void *)&Java_org_lwjgl_openal_AL10_nalIsExtensionPresent, "alIsExtensionPresent", (void *)&alIsExtensionPresent, false},
{"nalGetEnumValue", "(Ljava/lang/String;)I", (void *)&Java_org_lwjgl_openal_AL10_nalGetEnumValue, "alGetEnumValue", (void *)&alGetEnumValue, false},
{"nalListeneri", "(II)V", (void *)&Java_org_lwjgl_openal_AL10_nalListeneri, "alListeneri", (void *)&alListeneri, false},
{"nalListenerf", "(IF)V", (void *)&Java_org_lwjgl_openal_AL10_nalListenerf, "alListenerf", (void *)&alListenerf, false},
{"nalListenerfv", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalListenerfv, "alListenerfv", (void *)&alListenerfv, false},
{"nalListener3f", "(IFFF)V", (void *)&Java_org_lwjgl_openal_AL10_nalListener3f, "alListener3f", (void *)&alListener3f, false},
{"nalGetListeneri", "(I)I", (void *)&Java_org_lwjgl_openal_AL10_nalGetListeneri, "alGetListeneri", (void *)&alGetListeneri, false},
{"nalGetListenerf", "(I)F", (void *)&Java_org_lwjgl_openal_AL10_nalGetListenerf, "alGetListenerf", (void *)&alGetListenerf, false},
{"nalGetListenerfv", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalGetListenerfv, "alGetListenerfv", (void *)&alGetListenerfv, false},
{"nalGenSources", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalGenSources, "alGenSources", (void *)&alGenSources, false},
{"nalGenSources2", "(I)I", (void *)&Java_org_lwjgl_openal_AL10_nalGenSources2, "alGenSources", (void *)&alGenSources, false},
{"nalDeleteSources", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalDeleteSources, "alDeleteSources", (void *)&alDeleteSources, false},
{"nalDeleteSources2", "(II)V", (void *)&Java_org_lwjgl_openal_AL10_nalDeleteSources2, "alDeleteSources", (void *)&alDeleteSources, false},
{"nalIsSource", "(I)Z", (void *)&Java_org_lwjgl_openal_AL10_nalIsSource, "alIsSource", (void *)&alIsSource, false},
{"nalSourcei", "(III)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourcei, "alSourcei", (void *)&alSourcei, false},
{"nalSourcef", "(IIF)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourcef, "alSourcef", (void *)&alSourcef, false},
{"nalSourcefv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourcefv, "alSourcefv", (void *)&alSourcefv, false},
{"nalSource3f", "(IIFFF)V", (void *)&Java_org_lwjgl_openal_AL10_nalSource3f, "alSource3f", (void *)&alSource3f, false},
{"nalGetSourcei", "(II)I", (void *)&Java_org_lwjgl_openal_AL10_nalGetSourcei, "alGetSourcei", (void *)&alGetSourcei, false},
{"nalGetSourcef", "(II)F", (void *)&Java_org_lwjgl_openal_AL10_nalGetSourcef, "alGetSourcef", (void *)&alGetSourcef, false},
{"nalGetSourcefv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalGetSourcefv, "alGetSourcefv", (void *)&alGetSourcefv, false},
{"nalSourcePlayv", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourcePlayv, "alSourcePlayv", (void *)&alSourcePlayv, false},
{"nalSourcePausev", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourcePausev, "alSourcePausev", (void *)&alSourcePausev, false},
{"nalSourceStopv", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourceStopv, "alSourceStopv", (void *)&alSourceStopv, false},
{"nalSourceRewindv", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourceRewindv, "alSourceRewindv", (void *)&alSourceRewindv, false},
{"nalSourcePlay", "(I)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourcePlay, "alSourcePlay", (void *)&alSourcePlay, false},
{"nalSourcePause", "(I)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourcePause, "alSourcePause", (void *)&alSourcePause, false},
{"nalSourceStop", "(I)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourceStop, "alSourceStop", (void *)&alSourceStop, false},
{"nalSourceRewind", "(I)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourceRewind, "alSourceRewind", (void *)&alSourceRewind, false},
{"nalGenBuffers", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalGenBuffers, "alGenBuffers", (void *)&alGenBuffers, false},
{"nalGenBuffers2", "(I)I", (void *)&Java_org_lwjgl_openal_AL10_nalGenBuffers2, "alGenBuffers", (void *)&alGenBuffers, false},
{"nalDeleteBuffers", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalDeleteBuffers, "alDeleteBuffers", (void *)&alDeleteBuffers, false},
{"nalDeleteBuffers2", "(II)V", (void *)&Java_org_lwjgl_openal_AL10_nalDeleteBuffers2, "alDeleteBuffers", (void *)&alDeleteBuffers, false},
{"nalIsBuffer", "(I)Z", (void *)&Java_org_lwjgl_openal_AL10_nalIsBuffer, "alIsBuffer", (void *)&alIsBuffer, false},
{"nalBufferData", "(IIJII)V", (void *)&Java_org_lwjgl_openal_AL10_nalBufferData, "alBufferData", (void *)&alBufferData, false},
{"nalGetBufferi", "(II)I", (void *)&Java_org_lwjgl_openal_AL10_nalGetBufferi, "alGetBufferi", (void *)&alGetBufferi, false},
{"nalGetBufferf", "(II)F", (void *)&Java_org_lwjgl_openal_AL10_nalGetBufferf, "alGetBufferf", (void *)&alGetBufferf, false},
{"nalSourceQueueBuffers", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourceQueueBuffers, "alSourceQueueBuffers", (void *)&alSourceQueueBuffers, false},
{"nalSourceQueueBuffers2", "(III)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourceQueueBuffers2, "alSourceQueueBuffers", (void *)&alSourceQueueBuffers, false},
{"nalSourceUnqueueBuffers", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL10_nalSourceUnqueueBuffers, "alSourceUnqueueBuffers", (void *)&alSourceUnqueueBuffers, false},
{"nalSourceUnqueueBuffers2", "(II)I", (void *)&Java_org_lwjgl_openal_AL10_nalSourceUnqueueBuffers2, "alSourceUnqueueBuffers", (void *)&alSourceUnqueueBuffers, false},
{"nalDistanceModel", "(I)V", (void *)&Java_org_lwjgl_openal_AL10_nalDistanceModel, "alDistanceModel", (void *)&alDistanceModel, false},
{"nalDopplerFactor", "(F)V", (void *)&Java_org_lwjgl_openal_AL10_nalDopplerFactor, "alDopplerFactor", (void *)&alDopplerFactor, false},
{"nalDopplerVelocity", "(F)V", (void *)&Java_org_lwjgl_openal_AL10_nalDopplerVelocity, "alDopplerVelocity", (void *)&alDopplerVelocity, false}
};
int num_functions = NUMFUNCTIONS(functions);
extal_InitializeClass(env, clazz, num_functions, functions);
}

View File

@ -0,0 +1,128 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extal.h"
typedef ALvoid (ALAPIENTRY *alListener3iPROC) (ALenum pname, ALint v1, ALint v2, ALint v3);
typedef ALvoid (ALAPIENTRY *alGetListenerivPROC) (ALenum pname, ALfloat * intdata);
typedef ALvoid (ALAPIENTRY *alSource3iPROC) (ALuint source, ALenum pname, ALint v1, ALint v2, ALint v3);
typedef ALvoid (ALAPIENTRY *alSourceivPROC) (ALuint source, ALenum pname, const ALint * value);
typedef ALvoid (ALAPIENTRY *alBufferfPROC) (ALuint buffer, ALenum pname, ALfloat value);
typedef ALvoid (ALAPIENTRY *alBuffer3fPROC) (ALuint buffer, ALenum pname, ALfloat v1, ALfloat v2, ALfloat v3);
typedef ALvoid (ALAPIENTRY *alBufferfvPROC) (ALuint buffer, ALenum pname, const ALfloat * value);
typedef ALvoid (ALAPIENTRY *alBufferiPROC) (ALuint buffer, ALenum pname, ALint value);
typedef ALvoid (ALAPIENTRY *alBuffer3iPROC) (ALuint buffer, ALenum pname, ALint v1, ALint v2, ALint v3);
typedef ALvoid (ALAPIENTRY *alBufferivPROC) (ALuint buffer, ALenum pname, const ALint * value);
typedef ALvoid (ALAPIENTRY *alGetBufferiPROC) (ALuint buffer, ALenum pname, ALint* value);
typedef ALvoid (ALAPIENTRY *alGetBufferivPROC) (ALuint buffer, ALenum pname, ALint * values);
typedef ALvoid (ALAPIENTRY *alGetBufferfPROC) (ALuint buffer, ALenum pname, ALfloat* value);
typedef ALvoid (ALAPIENTRY *alGetBufferfvPROC) (ALuint buffer, ALenum pname, ALfloat * values);
typedef ALvoid (ALAPIENTRY *alSpeedOfSoundPROC) (ALfloat value);
static alListener3iPROC alListener3i;
static alGetListenerivPROC alGetListeneriv;
static alSource3iPROC alSource3i;
static alSourceivPROC alSourceiv;
static alBufferfPROC alBufferf;
static alBuffer3fPROC alBuffer3f;
static alBufferfvPROC alBufferfv;
static alBufferiPROC alBufferi;
static alBuffer3iPROC alBuffer3i;
static alBufferivPROC alBufferiv;
static alGetBufferiPROC alGetBufferi;
static alGetBufferivPROC alGetBufferiv;
static alGetBufferfPROC alGetBufferf;
static alGetBufferfvPROC alGetBufferfv;
static alSpeedOfSoundPROC alSpeedOfSound;
static void JNICALL Java_org_lwjgl_openal_AL11_nalListener3i(JNIEnv *env, jclass clazz, jint pname, jint v1, jint v2, jint v3) {
alListener3i(pname, v1, v2, v3);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalGetListeneriv(JNIEnv *env, jclass clazz, jint pname, jlong intdata) {
ALfloat *intdata_address = (ALfloat *)(intptr_t)intdata;
alGetListeneriv(pname, intdata_address);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalSource3i(JNIEnv *env, jclass clazz, jint source, jint pname, jint v1, jint v2, jint v3) {
alSource3i(source, pname, v1, v2, v3);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalSourceiv(JNIEnv *env, jclass clazz, jint source, jint pname, jlong value) {
const ALint *value_address = (const ALint *)(intptr_t)value;
alSourceiv(source, pname, value_address);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalBufferf(JNIEnv *env, jclass clazz, jint buffer, jint pname, jfloat value) {
alBufferf(buffer, pname, value);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalBuffer3f(JNIEnv *env, jclass clazz, jint buffer, jint pname, jfloat v1, jfloat v2, jfloat v3) {
alBuffer3f(buffer, pname, v1, v2, v3);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalBufferfv(JNIEnv *env, jclass clazz, jint buffer, jint pname, jlong value) {
const ALfloat *value_address = (const ALfloat *)(intptr_t)value;
alBufferfv(buffer, pname, value_address);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalBufferi(JNIEnv *env, jclass clazz, jint buffer, jint pname, jint value) {
alBufferi(buffer, pname, value);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalBuffer3i(JNIEnv *env, jclass clazz, jint buffer, jint pname, jint v1, jint v2, jint v3) {
alBuffer3i(buffer, pname, v1, v2, v3);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalBufferiv(JNIEnv *env, jclass clazz, jint buffer, jint pname, jlong value) {
const ALint *value_address = (const ALint *)(intptr_t)value;
alBufferiv(buffer, pname, value_address);
}
static jint JNICALL Java_org_lwjgl_openal_AL11_nalGetBufferi(JNIEnv *env, jclass clazz, jint buffer, jint pname) {
ALint __result;
alGetBufferi(buffer, pname, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalGetBufferiv(JNIEnv *env, jclass clazz, jint buffer, jint pname, jlong values) {
ALint *values_address = (ALint *)(intptr_t)values;
alGetBufferiv(buffer, pname, values_address);
}
static jfloat JNICALL Java_org_lwjgl_openal_AL11_nalGetBufferf(JNIEnv *env, jclass clazz, jint buffer, jint pname) {
ALfloat __result;
alGetBufferf(buffer, pname, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalGetBufferfv(JNIEnv *env, jclass clazz, jint buffer, jint pname, jlong values) {
ALfloat *values_address = (ALfloat *)(intptr_t)values;
alGetBufferfv(buffer, pname, values_address);
}
static void JNICALL Java_org_lwjgl_openal_AL11_nalSpeedOfSound(JNIEnv *env, jclass clazz, jfloat value) {
alSpeedOfSound(value);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL11_initNativeStubs(JNIEnv *env, jclass clazz) {
JavaMethodAndExtFunction functions[] = {
{"nalListener3i", "(IIII)V", (void *)&Java_org_lwjgl_openal_AL11_nalListener3i, "alListener3i", (void *)&alListener3i, false},
{"nalGetListeneriv", "(IJ)V", (void *)&Java_org_lwjgl_openal_AL11_nalGetListeneriv, "alGetListeneriv", (void *)&alGetListeneriv, false},
{"nalSource3i", "(IIIII)V", (void *)&Java_org_lwjgl_openal_AL11_nalSource3i, "alSource3i", (void *)&alSource3i, false},
{"nalSourceiv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL11_nalSourceiv, "alSourceiv", (void *)&alSourceiv, false},
{"nalBufferf", "(IIF)V", (void *)&Java_org_lwjgl_openal_AL11_nalBufferf, "alBufferf", (void *)&alBufferf, false},
{"nalBuffer3f", "(IIFFF)V", (void *)&Java_org_lwjgl_openal_AL11_nalBuffer3f, "alBuffer3f", (void *)&alBuffer3f, false},
{"nalBufferfv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL11_nalBufferfv, "alBufferfv", (void *)&alBufferfv, false},
{"nalBufferi", "(III)V", (void *)&Java_org_lwjgl_openal_AL11_nalBufferi, "alBufferi", (void *)&alBufferi, false},
{"nalBuffer3i", "(IIIII)V", (void *)&Java_org_lwjgl_openal_AL11_nalBuffer3i, "alBuffer3i", (void *)&alBuffer3i, false},
{"nalBufferiv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL11_nalBufferiv, "alBufferiv", (void *)&alBufferiv, false},
{"nalGetBufferi", "(II)I", (void *)&Java_org_lwjgl_openal_AL11_nalGetBufferi, "alGetBufferi", (void *)&alGetBufferi, false},
{"nalGetBufferiv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL11_nalGetBufferiv, "alGetBufferiv", (void *)&alGetBufferiv, false},
{"nalGetBufferf", "(II)F", (void *)&Java_org_lwjgl_openal_AL11_nalGetBufferf, "alGetBufferf", (void *)&alGetBufferf, false},
{"nalGetBufferfv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_AL11_nalGetBufferfv, "alGetBufferfv", (void *)&alGetBufferfv, false},
{"nalSpeedOfSound", "(F)V", (void *)&Java_org_lwjgl_openal_AL11_nalSpeedOfSound, "alSpeedOfSound", (void *)&alSpeedOfSound, false}
};
int num_functions = NUMFUNCTIONS(functions);
extal_InitializeClass(env, clazz, num_functions, functions);
}

View File

@ -0,0 +1,313 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extal.h"
typedef ALvoid (ALAPIENTRY *alGenAuxiliaryEffectSlotsPROC) (ALsizei n, ALuint * auxiliaryeffectslots);
typedef ALvoid (ALAPIENTRY *alDeleteAuxiliaryEffectSlotsPROC) (ALsizei n, ALuint * auxiliaryeffectslots);
typedef ALboolean (ALAPIENTRY *alIsAuxiliaryEffectSlotPROC) (ALuint auxiliaryeffectslot);
typedef ALvoid (ALAPIENTRY *alAuxiliaryEffectSlotiPROC) (ALuint auxiliaryeffectslot, ALenum param, ALint value);
typedef ALvoid (ALAPIENTRY *alAuxiliaryEffectSlotivPROC) (ALuint auxiliaryeffectslot, ALenum param, const ALint * values);
typedef ALvoid (ALAPIENTRY *alAuxiliaryEffectSlotfPROC) (ALuint auxiliaryeffectslot, ALenum param, ALfloat value);
typedef ALvoid (ALAPIENTRY *alAuxiliaryEffectSlotfvPROC) (ALuint auxiliaryeffectslot, ALenum param, const ALfloat * values);
typedef ALvoid (ALAPIENTRY *alGetAuxiliaryEffectSlotiPROC) (ALuint auxiliaryeffectslot, ALenum param, ALint* value);
typedef ALvoid (ALAPIENTRY *alGetAuxiliaryEffectSlotivPROC) (ALuint auxiliaryeffectslot, ALenum param, ALint * intdata);
typedef ALvoid (ALAPIENTRY *alGetAuxiliaryEffectSlotfPROC) (ALuint auxiliaryeffectslot, ALenum param, ALfloat* value);
typedef ALvoid (ALAPIENTRY *alGetAuxiliaryEffectSlotfvPROC) (ALuint auxiliaryeffectslot, ALenum param, ALfloat * floatdata);
typedef ALvoid (ALAPIENTRY *alGenEffectsPROC) (ALsizei n, ALuint * effects);
typedef ALvoid (ALAPIENTRY *alDeleteEffectsPROC) (ALsizei n, ALuint * effects);
typedef ALboolean (ALAPIENTRY *alIsEffectPROC) (ALuint effect);
typedef ALvoid (ALAPIENTRY *alEffectiPROC) (ALuint effect, ALenum param, ALint value);
typedef ALvoid (ALAPIENTRY *alEffectivPROC) (ALuint effect, ALenum param, const ALint * values);
typedef ALvoid (ALAPIENTRY *alEffectfPROC) (ALuint effect, ALenum param, ALfloat value);
typedef ALvoid (ALAPIENTRY *alEffectfvPROC) (ALuint effect, ALenum param, const ALfloat * values);
typedef ALvoid (ALAPIENTRY *alGetEffectiPROC) (ALuint effect, ALenum param, ALint* value);
typedef ALvoid (ALAPIENTRY *alGetEffectivPROC) (ALuint effect, ALenum param, ALint * intdata);
typedef ALvoid (ALAPIENTRY *alGetEffectfPROC) (ALuint effect, ALenum param, ALfloat* value);
typedef ALvoid (ALAPIENTRY *alGetEffectfvPROC) (ALuint effect, ALenum param, ALfloat * floatdata);
typedef ALvoid (ALAPIENTRY *alGenFiltersPROC) (ALsizei n, ALuint * filters);
typedef ALvoid (ALAPIENTRY *alDeleteFiltersPROC) (ALsizei n, ALuint * filters);
typedef ALboolean (ALAPIENTRY *alIsFilterPROC) (ALuint filter);
typedef ALvoid (ALAPIENTRY *alFilteriPROC) (ALuint filter, ALenum param, ALint value);
typedef ALvoid (ALAPIENTRY *alFilterivPROC) (ALuint filter, ALenum param, const ALint * values);
typedef ALvoid (ALAPIENTRY *alFilterfPROC) (ALuint filter, ALenum param, ALfloat value);
typedef ALvoid (ALAPIENTRY *alFilterfvPROC) (ALuint filter, ALenum param, const ALfloat * values);
typedef ALvoid (ALAPIENTRY *alGetFilteriPROC) (ALuint filter, ALenum param, ALint* value);
typedef ALvoid (ALAPIENTRY *alGetFilterivPROC) (ALuint filter, ALenum param, ALint * intdata);
typedef ALvoid (ALAPIENTRY *alGetFilterfPROC) (ALuint filter, ALenum param, ALfloat* value);
typedef ALvoid (ALAPIENTRY *alGetFilterfvPROC) (ALuint filter, ALenum param, ALfloat * floatdata);
static alGenAuxiliaryEffectSlotsPROC alGenAuxiliaryEffectSlots;
static alDeleteAuxiliaryEffectSlotsPROC alDeleteAuxiliaryEffectSlots;
static alIsAuxiliaryEffectSlotPROC alIsAuxiliaryEffectSlot;
static alAuxiliaryEffectSlotiPROC alAuxiliaryEffectSloti;
static alAuxiliaryEffectSlotivPROC alAuxiliaryEffectSlotiv;
static alAuxiliaryEffectSlotfPROC alAuxiliaryEffectSlotf;
static alAuxiliaryEffectSlotfvPROC alAuxiliaryEffectSlotfv;
static alGetAuxiliaryEffectSlotiPROC alGetAuxiliaryEffectSloti;
static alGetAuxiliaryEffectSlotivPROC alGetAuxiliaryEffectSlotiv;
static alGetAuxiliaryEffectSlotfPROC alGetAuxiliaryEffectSlotf;
static alGetAuxiliaryEffectSlotfvPROC alGetAuxiliaryEffectSlotfv;
static alGenEffectsPROC alGenEffects;
static alDeleteEffectsPROC alDeleteEffects;
static alIsEffectPROC alIsEffect;
static alEffectiPROC alEffecti;
static alEffectivPROC alEffectiv;
static alEffectfPROC alEffectf;
static alEffectfvPROC alEffectfv;
static alGetEffectiPROC alGetEffecti;
static alGetEffectivPROC alGetEffectiv;
static alGetEffectfPROC alGetEffectf;
static alGetEffectfvPROC alGetEffectfv;
static alGenFiltersPROC alGenFilters;
static alDeleteFiltersPROC alDeleteFilters;
static alIsFilterPROC alIsFilter;
static alFilteriPROC alFilteri;
static alFilterivPROC alFilteriv;
static alFilterfPROC alFilterf;
static alFilterfvPROC alFilterfv;
static alGetFilteriPROC alGetFilteri;
static alGetFilterivPROC alGetFilteriv;
static alGetFilterfPROC alGetFilterf;
static alGetFilterfvPROC alGetFilterfv;
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGenAuxiliaryEffectSlots(JNIEnv *env, jclass clazz, jint n, jlong auxiliaryeffectslots) {
ALuint *auxiliaryeffectslots_address = (ALuint *)(intptr_t)auxiliaryeffectslots;
alGenAuxiliaryEffectSlots(n, auxiliaryeffectslots_address);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_openal_EFX10_nalGenAuxiliaryEffectSlots2(JNIEnv *env, jclass clazz, jint n) {
ALuint __result;
alGenAuxiliaryEffectSlots(n, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalDeleteAuxiliaryEffectSlots(JNIEnv *env, jclass clazz, jint n, jlong auxiliaryeffectslots) {
ALuint *auxiliaryeffectslots_address = (ALuint *)(intptr_t)auxiliaryeffectslots;
alDeleteAuxiliaryEffectSlots(n, auxiliaryeffectslots_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_EFX10_nalDeleteAuxiliaryEffectSlots2(JNIEnv *env, jclass clazz, jint n, jint auxiliaryeffectslot) {
alDeleteAuxiliaryEffectSlots(n, (ALuint*)&auxiliaryeffectslot);
}
static jboolean JNICALL Java_org_lwjgl_openal_EFX10_nalIsAuxiliaryEffectSlot(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot) {
ALboolean __result = alIsAuxiliaryEffectSlot(auxiliaryeffectslot);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalAuxiliaryEffectSloti(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot, jint param, jint value) {
alAuxiliaryEffectSloti(auxiliaryeffectslot, param, value);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalAuxiliaryEffectSlotiv(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot, jint param, jlong values) {
const ALint *values_address = (const ALint *)(intptr_t)values;
alAuxiliaryEffectSlotiv(auxiliaryeffectslot, param, values_address);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalAuxiliaryEffectSlotf(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot, jint param, jfloat value) {
alAuxiliaryEffectSlotf(auxiliaryeffectslot, param, value);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalAuxiliaryEffectSlotfv(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot, jint param, jlong values) {
const ALfloat *values_address = (const ALfloat *)(intptr_t)values;
alAuxiliaryEffectSlotfv(auxiliaryeffectslot, param, values_address);
}
static jint JNICALL Java_org_lwjgl_openal_EFX10_nalGetAuxiliaryEffectSloti(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot, jint param) {
ALint __result;
alGetAuxiliaryEffectSloti(auxiliaryeffectslot, param, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGetAuxiliaryEffectSlotiv(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot, jint param, jlong intdata) {
ALint *intdata_address = (ALint *)(intptr_t)intdata;
alGetAuxiliaryEffectSlotiv(auxiliaryeffectslot, param, intdata_address);
}
static jfloat JNICALL Java_org_lwjgl_openal_EFX10_nalGetAuxiliaryEffectSlotf(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot, jint param) {
ALfloat __result;
alGetAuxiliaryEffectSlotf(auxiliaryeffectslot, param, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGetAuxiliaryEffectSlotfv(JNIEnv *env, jclass clazz, jint auxiliaryeffectslot, jint param, jlong floatdata) {
ALfloat *floatdata_address = (ALfloat *)(intptr_t)floatdata;
alGetAuxiliaryEffectSlotfv(auxiliaryeffectslot, param, floatdata_address);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGenEffects(JNIEnv *env, jclass clazz, jint n, jlong effects) {
ALuint *effects_address = (ALuint *)(intptr_t)effects;
alGenEffects(n, effects_address);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_openal_EFX10_nalGenEffects2(JNIEnv *env, jclass clazz, jint n) {
ALuint __result;
alGenEffects(n, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalDeleteEffects(JNIEnv *env, jclass clazz, jint n, jlong effects) {
ALuint *effects_address = (ALuint *)(intptr_t)effects;
alDeleteEffects(n, effects_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_EFX10_nalDeleteEffects2(JNIEnv *env, jclass clazz, jint n, jint effect) {
alDeleteEffects(n, (ALuint*)&effect);
}
static jboolean JNICALL Java_org_lwjgl_openal_EFX10_nalIsEffect(JNIEnv *env, jclass clazz, jint effect) {
ALboolean __result = alIsEffect(effect);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalEffecti(JNIEnv *env, jclass clazz, jint effect, jint param, jint value) {
alEffecti(effect, param, value);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalEffectiv(JNIEnv *env, jclass clazz, jint effect, jint param, jlong values) {
const ALint *values_address = (const ALint *)(intptr_t)values;
alEffectiv(effect, param, values_address);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalEffectf(JNIEnv *env, jclass clazz, jint effect, jint param, jfloat value) {
alEffectf(effect, param, value);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalEffectfv(JNIEnv *env, jclass clazz, jint effect, jint param, jlong values) {
const ALfloat *values_address = (const ALfloat *)(intptr_t)values;
alEffectfv(effect, param, values_address);
}
static jint JNICALL Java_org_lwjgl_openal_EFX10_nalGetEffecti(JNIEnv *env, jclass clazz, jint effect, jint param) {
ALint __result;
alGetEffecti(effect, param, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGetEffectiv(JNIEnv *env, jclass clazz, jint effect, jint param, jlong intdata) {
ALint *intdata_address = (ALint *)(intptr_t)intdata;
alGetEffectiv(effect, param, intdata_address);
}
static jfloat JNICALL Java_org_lwjgl_openal_EFX10_nalGetEffectf(JNIEnv *env, jclass clazz, jint effect, jint param) {
ALfloat __result;
alGetEffectf(effect, param, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGetEffectfv(JNIEnv *env, jclass clazz, jint effect, jint param, jlong floatdata) {
ALfloat *floatdata_address = (ALfloat *)(intptr_t)floatdata;
alGetEffectfv(effect, param, floatdata_address);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGenFilters(JNIEnv *env, jclass clazz, jint n, jlong filters) {
ALuint *filters_address = (ALuint *)(intptr_t)filters;
alGenFilters(n, filters_address);
}
JNIEXPORT jint JNICALL Java_org_lwjgl_openal_EFX10_nalGenFilters2(JNIEnv *env, jclass clazz, jint n) {
ALuint __result;
alGenFilters(n, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalDeleteFilters(JNIEnv *env, jclass clazz, jint n, jlong filters) {
ALuint *filters_address = (ALuint *)(intptr_t)filters;
alDeleteFilters(n, filters_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_EFX10_nalDeleteFilters2(JNIEnv *env, jclass clazz, jint n, jint filter) {
alDeleteFilters(n, (ALuint*)&filter);
}
static jboolean JNICALL Java_org_lwjgl_openal_EFX10_nalIsFilter(JNIEnv *env, jclass clazz, jint filter) {
ALboolean __result = alIsFilter(filter);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalFilteri(JNIEnv *env, jclass clazz, jint filter, jint param, jint value) {
alFilteri(filter, param, value);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalFilteriv(JNIEnv *env, jclass clazz, jint filter, jint param, jlong values) {
const ALint *values_address = (const ALint *)(intptr_t)values;
alFilteriv(filter, param, values_address);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalFilterf(JNIEnv *env, jclass clazz, jint filter, jint param, jfloat value) {
alFilterf(filter, param, value);
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalFilterfv(JNIEnv *env, jclass clazz, jint filter, jint param, jlong values) {
const ALfloat *values_address = (const ALfloat *)(intptr_t)values;
alFilterfv(filter, param, values_address);
}
static jint JNICALL Java_org_lwjgl_openal_EFX10_nalGetFilteri(JNIEnv *env, jclass clazz, jint filter, jint param) {
ALint __result;
alGetFilteri(filter, param, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGetFilteriv(JNIEnv *env, jclass clazz, jint filter, jint param, jlong intdata) {
ALint *intdata_address = (ALint *)(intptr_t)intdata;
alGetFilteriv(filter, param, intdata_address);
}
static jfloat JNICALL Java_org_lwjgl_openal_EFX10_nalGetFilterf(JNIEnv *env, jclass clazz, jint filter, jint param) {
ALfloat __result;
alGetFilterf(filter, param, &__result);
return __result;
}
static void JNICALL Java_org_lwjgl_openal_EFX10_nalGetFilterfv(JNIEnv *env, jclass clazz, jint filter, jint param, jlong floatdata) {
ALfloat *floatdata_address = (ALfloat *)(intptr_t)floatdata;
alGetFilterfv(filter, param, floatdata_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_openal_EFX10_initNativeStubs(JNIEnv *env, jclass clazz) {
JavaMethodAndExtFunction functions[] = {
{"nalGenAuxiliaryEffectSlots", "(IJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGenAuxiliaryEffectSlots, "alGenAuxiliaryEffectSlots", (void *)&alGenAuxiliaryEffectSlots, false},
{"nalGenAuxiliaryEffectSlots2", "(I)I", (void *)&Java_org_lwjgl_openal_EFX10_nalGenAuxiliaryEffectSlots2, "alGenAuxiliaryEffectSlots", (void *)&alGenAuxiliaryEffectSlots, false},
{"nalDeleteAuxiliaryEffectSlots", "(IJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalDeleteAuxiliaryEffectSlots, "alDeleteAuxiliaryEffectSlots", (void *)&alDeleteAuxiliaryEffectSlots, false},
{"nalDeleteAuxiliaryEffectSlots2", "(II)V", (void *)&Java_org_lwjgl_openal_EFX10_nalDeleteAuxiliaryEffectSlots2, "alDeleteAuxiliaryEffectSlots", (void *)&alDeleteAuxiliaryEffectSlots, false},
{"nalIsAuxiliaryEffectSlot", "(I)Z", (void *)&Java_org_lwjgl_openal_EFX10_nalIsAuxiliaryEffectSlot, "alIsAuxiliaryEffectSlot", (void *)&alIsAuxiliaryEffectSlot, false},
{"nalAuxiliaryEffectSloti", "(III)V", (void *)&Java_org_lwjgl_openal_EFX10_nalAuxiliaryEffectSloti, "alAuxiliaryEffectSloti", (void *)&alAuxiliaryEffectSloti, false},
{"nalAuxiliaryEffectSlotiv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalAuxiliaryEffectSlotiv, "alAuxiliaryEffectSlotiv", (void *)&alAuxiliaryEffectSlotiv, false},
{"nalAuxiliaryEffectSlotf", "(IIF)V", (void *)&Java_org_lwjgl_openal_EFX10_nalAuxiliaryEffectSlotf, "alAuxiliaryEffectSlotf", (void *)&alAuxiliaryEffectSlotf, false},
{"nalAuxiliaryEffectSlotfv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalAuxiliaryEffectSlotfv, "alAuxiliaryEffectSlotfv", (void *)&alAuxiliaryEffectSlotfv, false},
{"nalGetAuxiliaryEffectSloti", "(II)I", (void *)&Java_org_lwjgl_openal_EFX10_nalGetAuxiliaryEffectSloti, "alGetAuxiliaryEffectSloti", (void *)&alGetAuxiliaryEffectSloti, false},
{"nalGetAuxiliaryEffectSlotiv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGetAuxiliaryEffectSlotiv, "alGetAuxiliaryEffectSlotiv", (void *)&alGetAuxiliaryEffectSlotiv, false},
{"nalGetAuxiliaryEffectSlotf", "(II)F", (void *)&Java_org_lwjgl_openal_EFX10_nalGetAuxiliaryEffectSlotf, "alGetAuxiliaryEffectSlotf", (void *)&alGetAuxiliaryEffectSlotf, false},
{"nalGetAuxiliaryEffectSlotfv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGetAuxiliaryEffectSlotfv, "alGetAuxiliaryEffectSlotfv", (void *)&alGetAuxiliaryEffectSlotfv, false},
{"nalGenEffects", "(IJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGenEffects, "alGenEffects", (void *)&alGenEffects, false},
{"nalGenEffects2", "(I)I", (void *)&Java_org_lwjgl_openal_EFX10_nalGenEffects2, "alGenEffects", (void *)&alGenEffects, false},
{"nalDeleteEffects", "(IJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalDeleteEffects, "alDeleteEffects", (void *)&alDeleteEffects, false},
{"nalDeleteEffects2", "(II)V", (void *)&Java_org_lwjgl_openal_EFX10_nalDeleteEffects2, "alDeleteEffects", (void *)&alDeleteEffects, false},
{"nalIsEffect", "(I)Z", (void *)&Java_org_lwjgl_openal_EFX10_nalIsEffect, "alIsEffect", (void *)&alIsEffect, false},
{"nalEffecti", "(III)V", (void *)&Java_org_lwjgl_openal_EFX10_nalEffecti, "alEffecti", (void *)&alEffecti, false},
{"nalEffectiv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalEffectiv, "alEffectiv", (void *)&alEffectiv, false},
{"nalEffectf", "(IIF)V", (void *)&Java_org_lwjgl_openal_EFX10_nalEffectf, "alEffectf", (void *)&alEffectf, false},
{"nalEffectfv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalEffectfv, "alEffectfv", (void *)&alEffectfv, false},
{"nalGetEffecti", "(II)I", (void *)&Java_org_lwjgl_openal_EFX10_nalGetEffecti, "alGetEffecti", (void *)&alGetEffecti, false},
{"nalGetEffectiv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGetEffectiv, "alGetEffectiv", (void *)&alGetEffectiv, false},
{"nalGetEffectf", "(II)F", (void *)&Java_org_lwjgl_openal_EFX10_nalGetEffectf, "alGetEffectf", (void *)&alGetEffectf, false},
{"nalGetEffectfv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGetEffectfv, "alGetEffectfv", (void *)&alGetEffectfv, false},
{"nalGenFilters", "(IJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGenFilters, "alGenFilters", (void *)&alGenFilters, false},
{"nalGenFilters2", "(I)I", (void *)&Java_org_lwjgl_openal_EFX10_nalGenFilters2, "alGenFilters", (void *)&alGenFilters, false},
{"nalDeleteFilters", "(IJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalDeleteFilters, "alDeleteFilters", (void *)&alDeleteFilters, false},
{"nalDeleteFilters2", "(II)V", (void *)&Java_org_lwjgl_openal_EFX10_nalDeleteFilters2, "alDeleteFilters", (void *)&alDeleteFilters, false},
{"nalIsFilter", "(I)Z", (void *)&Java_org_lwjgl_openal_EFX10_nalIsFilter, "alIsFilter", (void *)&alIsFilter, false},
{"nalFilteri", "(III)V", (void *)&Java_org_lwjgl_openal_EFX10_nalFilteri, "alFilteri", (void *)&alFilteri, false},
{"nalFilteriv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalFilteriv, "alFilteriv", (void *)&alFilteriv, false},
{"nalFilterf", "(IIF)V", (void *)&Java_org_lwjgl_openal_EFX10_nalFilterf, "alFilterf", (void *)&alFilterf, false},
{"nalFilterfv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalFilterfv, "alFilterfv", (void *)&alFilterfv, false},
{"nalGetFilteri", "(II)I", (void *)&Java_org_lwjgl_openal_EFX10_nalGetFilteri, "alGetFilteri", (void *)&alGetFilteri, false},
{"nalGetFilteriv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGetFilteriv, "alGetFilteriv", (void *)&alGetFilteriv, false},
{"nalGetFilterf", "(II)F", (void *)&Java_org_lwjgl_openal_EFX10_nalGetFilterf, "alGetFilterf", (void *)&alGetFilterf, false},
{"nalGetFilterfv", "(IIJ)V", (void *)&Java_org_lwjgl_openal_EFX10_nalGetFilterfv, "alGetFilterfv", (void *)&alGetFilterfv, false}
};
int num_functions = NUMFUNCTIONS(functions);
extal_InitializeClass(env, clazz, num_functions, functions);
}

View File

@ -0,0 +1,33 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY void (CL_API_CALL *clLogMessagesToSystemLogAPPLEPROC) (const cl_char * errstr, const cl_void * private_info, size_t cb, cl_void * user_data);
typedef CL_API_ENTRY void (CL_API_CALL *clLogMessagesToStdoutAPPLEPROC) (const cl_char * errstr, const cl_void * private_info, size_t cb, cl_void * user_data);
typedef CL_API_ENTRY void (CL_API_CALL *clLogMessagesToStderrAPPLEPROC) (const cl_char * errstr, const cl_void * private_info, size_t cb, cl_void * user_data);
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_APPLEContextLoggingFunctions_nclLogMessagesToSystemLogAPPLE(JNIEnv *env, jclass clazz, jlong errstr, jlong private_info, jlong cb, jlong user_data, jlong function_pointer) {
const cl_char *errstr_address = (const cl_char *)(intptr_t)errstr;
const cl_void *private_info_address = (const cl_void *)(intptr_t)private_info;
cl_void *user_data_address = (cl_void *)(intptr_t)user_data;
clLogMessagesToSystemLogAPPLEPROC clLogMessagesToSystemLogAPPLE = (clLogMessagesToSystemLogAPPLEPROC)((intptr_t)function_pointer);
clLogMessagesToSystemLogAPPLE(errstr_address, private_info_address, cb, user_data_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_APPLEContextLoggingFunctions_nclLogMessagesToStdoutAPPLE(JNIEnv *env, jclass clazz, jlong errstr, jlong private_info, jlong cb, jlong user_data, jlong function_pointer) {
const cl_char *errstr_address = (const cl_char *)(intptr_t)errstr;
const cl_void *private_info_address = (const cl_void *)(intptr_t)private_info;
cl_void *user_data_address = (cl_void *)(intptr_t)user_data;
clLogMessagesToStdoutAPPLEPROC clLogMessagesToStdoutAPPLE = (clLogMessagesToStdoutAPPLEPROC)((intptr_t)function_pointer);
clLogMessagesToStdoutAPPLE(errstr_address, private_info_address, cb, user_data_address);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opencl_APPLEContextLoggingFunctions_nclLogMessagesToStderrAPPLE(JNIEnv *env, jclass clazz, jlong errstr, jlong private_info, jlong cb, jlong user_data, jlong function_pointer) {
const cl_char *errstr_address = (const cl_char *)(intptr_t)errstr;
const cl_void *private_info_address = (const cl_void *)(intptr_t)private_info;
cl_void *user_data_address = (cl_void *)(intptr_t)user_data;
clLogMessagesToStderrAPPLEPROC clLogMessagesToStderrAPPLE = (clLogMessagesToStderrAPPLEPROC)((intptr_t)function_pointer);
clLogMessagesToStderrAPPLE(errstr_address, private_info_address, cb, user_data_address);
}

View File

@ -0,0 +1,16 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoAPPLEPROC) (cl_context context, cl_void * platform_gl_ctx, cl_gl_platform_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_APPLEGLSharing_nclGetGLContextInfoAPPLE(JNIEnv *env, jclass clazz, jlong context, jlong platform_gl_ctx, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *platform_gl_ctx_address = (cl_void *)(intptr_t)platform_gl_ctx;
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetGLContextInfoAPPLEPROC clGetGLContextInfoAPPLE = (clGetGLContextInfoAPPLEPROC)((intptr_t)function_pointer);
cl_int __result = clGetGLContextInfoAPPLE((cl_context)(intptr_t)context, platform_gl_ctx_address, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}

View File

@ -0,0 +1,13 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_int (CL_API_CALL *clSetMemObjectDestructorAPPLEPROC) (cl_mem memobj, cl_mem_object_destructor_callback pfn_notify, void * user_data);
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_APPLESetMemObjectDestructor_nclSetMemObjectDestructorAPPLE(JNIEnv *env, jclass clazz, jlong memobj, jlong pfn_notify, jlong user_data, jlong function_pointer) {
clSetMemObjectDestructorAPPLEPROC clSetMemObjectDestructorAPPLE = (clSetMemObjectDestructorAPPLEPROC)((intptr_t)function_pointer);
cl_int __result = clSetMemObjectDestructorAPPLE((cl_mem)(intptr_t)memobj, (cl_mem_object_destructor_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data);
return __result;
}

View File

@ -0,0 +1,732 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetPlatformIDsPROC) (cl_uint num_entries, cl_platform_id * platforms, cl_uint * num_platforms);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetPlatformInfoPROC) (cl_platform_id platform, cl_platform_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsPROC) (cl_platform_id platform, cl_device_type device_type, cl_uint num_entries, cl_device_id * devices, cl_uint * num_devices);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceInfoPROC) (cl_device_id device, cl_device_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_context (CL_API_CALL *clCreateContextPROC) (const cl_context_properties * properties, cl_uint num_devices, const cl_device_id * devices, cl_create_context_callback pfn_notify, void * user_data, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_context (CL_API_CALL *clCreateContextFromTypePROC) (const cl_context_properties * properties, cl_device_type device_type, cl_create_context_callback pfn_notify, void * user_data, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainContextPROC) (cl_context context);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseContextPROC) (cl_context context);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetContextInfoPROC) (cl_context context, cl_context_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_command_queue (CL_API_CALL *clCreateCommandQueuePROC) (cl_context context, cl_device_id device, cl_command_queue_properties properties, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainCommandQueuePROC) (cl_command_queue command_queue);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseCommandQueuePROC) (cl_command_queue command_queue);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetCommandQueueInfoPROC) (cl_command_queue command_queue, cl_command_queue_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateBufferPROC) (cl_context context, cl_mem_flags flags, size_t size, cl_void * host_ptr, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReadBufferPROC) (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, size_t offset, size_t size, cl_void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueWriteBufferPROC) (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_write, size_t offset, size_t size, const cl_void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyBufferPROC) (cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer, size_t src_offset, size_t dst_offset, size_t size, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_void * (CL_API_CALL *clEnqueueMapBufferPROC) (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_map, cl_map_flags map_flags, size_t offset, size_t size, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateImage2DPROC) (cl_context context, cl_mem_flags flags, const cl_image_format * image_format, size_t image_width, size_t image_height, size_t image_row_pitch, cl_void * host_ptr, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateImage3DPROC) (cl_context context, cl_mem_flags flags, const cl_image_format * image_format, size_t image_width, size_t image_height, size_t image_depth, size_t image_row_pitch, size_t image_slice_pitch, cl_void * host_ptr, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetSupportedImageFormatsPROC) (cl_context context, cl_mem_flags flags, cl_mem_object_type image_type, cl_uint num_entries, cl_image_format * image_formats, cl_uint * num_image_formats);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReadImagePROC) (cl_command_queue command_queue, cl_mem image, cl_bool blocking_read, const size_t * origin, const size_t * region, size_t row_pitch, size_t slice_pitch, cl_void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueWriteImagePROC) (cl_command_queue command_queue, cl_mem image, cl_bool blocking_write, const size_t * origin, const size_t * region, size_t input_row_pitch, size_t input_slice_pitch, const cl_void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyImagePROC) (cl_command_queue command_queue, cl_mem src_image, cl_mem dst_image, const size_t * src_origin, const size_t * dst_origin, const size_t * region, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyImageToBufferPROC) (cl_command_queue command_queue, cl_mem src_image, cl_mem dst_buffer, const size_t * src_origin, const size_t * region, size_t dst_offset, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyBufferToImagePROC) (cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_image, size_t src_offset, const size_t * dst_origin, const size_t * region, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_void * (CL_API_CALL *clEnqueueMapImagePROC) (cl_command_queue command_queue, cl_mem image, cl_bool blocking_map, cl_map_flags map_flags, const size_t * origin, const size_t * region, size_t * image_row_pitch, size_t * image_slice_pitch, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetImageInfoPROC) (cl_mem image, cl_image_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainMemObjectPROC) (cl_mem memobj);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseMemObjectPROC) (cl_mem memobj);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueUnmapMemObjectPROC) (cl_command_queue command_queue, cl_mem memobj, cl_void * mapped_ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetMemObjectInfoPROC) (cl_mem memobj, cl_mem_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_sampler (CL_API_CALL *clCreateSamplerPROC) (cl_context context, cl_bool normalized_coords, cl_addressing_mode addressing_mode, cl_filter_mode filter_mode, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainSamplerPROC) (cl_sampler sampler);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseSamplerPROC) (cl_sampler sampler);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetSamplerInfoPROC) (cl_sampler sampler, cl_sampler_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_program (CL_API_CALL *clCreateProgramWithSourcePROC) (cl_context context, cl_uint count, const cl_char ** string, const size_t* lengths, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_program (CL_API_CALL *clCreateProgramWithBinaryPROC) (cl_context context, cl_uint num_devices, const cl_device_id* device, const size_t* lengths, const cl_uchar ** binary, cl_int * binary_status, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainProgramPROC) (cl_program program);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseProgramPROC) (cl_program program);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clBuildProgramPROC) (cl_program program, cl_uint num_devices, const cl_device_id * device_list, const cl_char * options, cl_program_callback pfn_notify, void * user_data);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clUnloadCompilerPROC) ();
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetProgramInfoPROC) (cl_program program, cl_program_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetProgramBuildInfoPROC) (cl_program program, cl_device_id device, cl_program_build_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_kernel (CL_API_CALL *clCreateKernelPROC) (cl_program program, const cl_char * kernel_name, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clCreateKernelsInProgramPROC) (cl_program program, cl_uint num_kernels, cl_kernel * kernels, cl_uint * num_kernels_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainKernelPROC) (cl_kernel kernel);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseKernelPROC) (cl_kernel kernel);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clSetKernelArgPROC) (cl_kernel kernel, cl_uint arg_index, size_t arg_size, const cl_void * arg_value);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetKernelInfoPROC) (cl_kernel kernel, cl_kernel_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetKernelWorkGroupInfoPROC) (cl_kernel kernel, cl_device_id device, cl_kernel_work_group_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueNDRangeKernelPROC) (cl_command_queue command_queue, cl_kernel kernel, cl_uint work_dim, const size_t * global_work_offset, const size_t * global_work_size, const size_t * local_work_size, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueTaskPROC) (cl_command_queue command_queue, cl_kernel kernel, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueNativeKernelPROC) (cl_command_queue command_queue, cl_native_kernel_func user_func, cl_void * args, size_t cb_args, cl_uint num_mem_objects, const cl_mem* mem_list, const cl_void ** args_mem_loc, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clWaitForEventsPROC) (cl_uint num_events, const cl_event * event_list);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetEventInfoPROC) (cl_event event, cl_event_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainEventPROC) (cl_event event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseEventPROC) (cl_event event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueMarkerPROC) (cl_command_queue command_queue, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueBarrierPROC) (cl_command_queue command_queue);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueWaitForEventsPROC) (cl_command_queue command_queue, cl_uint num_events, const cl_event * event_list);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetEventProfilingInfoPROC) (cl_event event, cl_profiling_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clFlushPROC) (cl_command_queue command_queue);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clFinishPROC) (cl_command_queue command_queue);
typedef CL_API_ENTRY void * (CL_API_CALL *clGetExtensionFunctionAddressPROC) (const cl_char * func_name);
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetPlatformIDs(JNIEnv *env, jclass clazz, jint num_entries, jlong platforms, jlong num_platforms, jlong function_pointer) {
cl_platform_id *platforms_address = (cl_platform_id *)(intptr_t)platforms;
cl_uint *num_platforms_address = (cl_uint *)(intptr_t)num_platforms;
clGetPlatformIDsPROC clGetPlatformIDs = (clGetPlatformIDsPROC)((intptr_t)function_pointer);
cl_int __result = clGetPlatformIDs(num_entries, platforms_address, num_platforms_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetPlatformInfo(JNIEnv *env, jclass clazz, jlong platform, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetPlatformInfoPROC clGetPlatformInfo = (clGetPlatformInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetPlatformInfo((cl_platform_id)(intptr_t)platform, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetDeviceIDs(JNIEnv *env, jclass clazz, jlong platform, jlong device_type, jint num_entries, jlong devices, jlong num_devices, jlong function_pointer) {
cl_device_id *devices_address = (cl_device_id *)(intptr_t)devices;
cl_uint *num_devices_address = (cl_uint *)(intptr_t)num_devices;
clGetDeviceIDsPROC clGetDeviceIDs = (clGetDeviceIDsPROC)((intptr_t)function_pointer);
cl_int __result = clGetDeviceIDs((cl_platform_id)(intptr_t)platform, device_type, num_entries, devices_address, num_devices_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetDeviceInfo(JNIEnv *env, jclass clazz, jlong device, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetDeviceInfoPROC clGetDeviceInfo = (clGetDeviceInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetDeviceInfo((cl_device_id)(intptr_t)device, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateContext(JNIEnv *env, jclass clazz, jlong properties, jint num_devices, jlong devices, jlong pfn_notify, jlong user_data, jlong errcode_ret, jlong function_pointer) {
const cl_context_properties *properties_address = (const cl_context_properties *)(intptr_t)properties;
const cl_device_id *devices_address = (const cl_device_id *)(intptr_t)devices;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateContextPROC clCreateContext = (clCreateContextPROC)((intptr_t)function_pointer);
cl_context __result = clCreateContext(properties_address, num_devices, devices_address, (cl_create_context_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateContextFromType(JNIEnv *env, jclass clazz, jlong properties, jlong device_type, jlong pfn_notify, jlong user_data, jlong errcode_ret, jlong function_pointer) {
const cl_context_properties *properties_address = (const cl_context_properties *)(intptr_t)properties;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateContextFromTypePROC clCreateContextFromType = (clCreateContextFromTypePROC)((intptr_t)function_pointer);
cl_context __result = clCreateContextFromType(properties_address, device_type, (cl_create_context_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclRetainContext(JNIEnv *env, jclass clazz, jlong context, jlong function_pointer) {
clRetainContextPROC clRetainContext = (clRetainContextPROC)((intptr_t)function_pointer);
cl_int __result = clRetainContext((cl_context)(intptr_t)context);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclReleaseContext(JNIEnv *env, jclass clazz, jlong context, jlong function_pointer) {
clReleaseContextPROC clReleaseContext = (clReleaseContextPROC)((intptr_t)function_pointer);
cl_int __result = clReleaseContext((cl_context)(intptr_t)context);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetContextInfo(JNIEnv *env, jclass clazz, jlong context, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetContextInfoPROC clGetContextInfo = (clGetContextInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetContextInfo((cl_context)(intptr_t)context, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateCommandQueue(JNIEnv *env, jclass clazz, jlong context, jlong device, jlong properties, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateCommandQueuePROC clCreateCommandQueue = (clCreateCommandQueuePROC)((intptr_t)function_pointer);
cl_command_queue __result = clCreateCommandQueue((cl_context)(intptr_t)context, (cl_device_id)(intptr_t)device, properties, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclRetainCommandQueue(JNIEnv *env, jclass clazz, jlong command_queue, jlong function_pointer) {
clRetainCommandQueuePROC clRetainCommandQueue = (clRetainCommandQueuePROC)((intptr_t)function_pointer);
cl_int __result = clRetainCommandQueue((cl_command_queue)(intptr_t)command_queue);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclReleaseCommandQueue(JNIEnv *env, jclass clazz, jlong command_queue, jlong function_pointer) {
clReleaseCommandQueuePROC clReleaseCommandQueue = (clReleaseCommandQueuePROC)((intptr_t)function_pointer);
cl_int __result = clReleaseCommandQueue((cl_command_queue)(intptr_t)command_queue);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetCommandQueueInfo(JNIEnv *env, jclass clazz, jlong command_queue, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetCommandQueueInfoPROC clGetCommandQueueInfo = (clGetCommandQueueInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetCommandQueueInfo((cl_command_queue)(intptr_t)command_queue, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateBuffer(JNIEnv *env, jclass clazz, jlong context, jlong flags, jlong size, jlong host_ptr, jlong errcode_ret, jlong function_pointer) {
cl_void *host_ptr_address = (cl_void *)(intptr_t)host_ptr;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateBufferPROC clCreateBuffer = (clCreateBufferPROC)((intptr_t)function_pointer);
cl_mem __result = clCreateBuffer((cl_context)(intptr_t)context, flags, size, host_ptr_address, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueReadBuffer(JNIEnv *env, jclass clazz, jlong command_queue, jlong buffer, jint blocking_read, jlong offset, jlong size, jlong ptr, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
cl_void *ptr_address = (cl_void *)(intptr_t)ptr;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueReadBufferPROC clEnqueueReadBuffer = (clEnqueueReadBufferPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueReadBuffer((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)buffer, blocking_read, offset, size, ptr_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueWriteBuffer(JNIEnv *env, jclass clazz, jlong command_queue, jlong buffer, jint blocking_write, jlong offset, jlong size, jlong ptr, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_void *ptr_address = (const cl_void *)(intptr_t)ptr;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueWriteBufferPROC clEnqueueWriteBuffer = (clEnqueueWriteBufferPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueWriteBuffer((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)buffer, blocking_write, offset, size, ptr_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueCopyBuffer(JNIEnv *env, jclass clazz, jlong command_queue, jlong src_buffer, jlong dst_buffer, jlong src_offset, jlong dst_offset, jlong size, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueCopyBufferPROC clEnqueueCopyBuffer = (clEnqueueCopyBufferPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueCopyBuffer((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)src_buffer, (cl_mem)(intptr_t)dst_buffer, src_offset, dst_offset, size, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jobject JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueMapBuffer(JNIEnv *env, jclass clazz, jlong command_queue, jlong buffer, jint blocking_map, jlong map_flags, jlong offset, jlong size, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong errcode_ret, jlong result_size, jlong function_pointer) {
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clEnqueueMapBufferPROC clEnqueueMapBuffer = (clEnqueueMapBufferPROC)((intptr_t)function_pointer);
cl_void * __result = clEnqueueMapBuffer((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)buffer, blocking_map, map_flags, offset, size, num_events_in_wait_list, event_wait_list_address, event_address, errcode_ret_address);
return safeNewBuffer(env, __result, result_size);
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateImage2D(JNIEnv *env, jclass clazz, jlong context, jlong flags, jlong image_format, jlong image_width, jlong image_height, jlong image_row_pitch, jlong host_ptr, jlong errcode_ret, jlong function_pointer) {
const cl_image_format *image_format_address = (const cl_image_format *)(intptr_t)image_format;
cl_void *host_ptr_address = (cl_void *)(intptr_t)host_ptr;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateImage2DPROC clCreateImage2D = (clCreateImage2DPROC)((intptr_t)function_pointer);
cl_mem __result = clCreateImage2D((cl_context)(intptr_t)context, flags, image_format_address, image_width, image_height, image_row_pitch, host_ptr_address, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateImage3D(JNIEnv *env, jclass clazz, jlong context, jlong flags, jlong image_format, jlong image_width, jlong image_height, jlong image_depth, jlong image_row_pitch, jlong image_slice_pitch, jlong host_ptr, jlong errcode_ret, jlong function_pointer) {
const cl_image_format *image_format_address = (const cl_image_format *)(intptr_t)image_format;
cl_void *host_ptr_address = (cl_void *)(intptr_t)host_ptr;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateImage3DPROC clCreateImage3D = (clCreateImage3DPROC)((intptr_t)function_pointer);
cl_mem __result = clCreateImage3D((cl_context)(intptr_t)context, flags, image_format_address, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch, host_ptr_address, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetSupportedImageFormats(JNIEnv *env, jclass clazz, jlong context, jlong flags, jint image_type, jint num_entries, jlong image_formats, jlong num_image_formats, jlong function_pointer) {
cl_image_format *image_formats_address = (cl_image_format *)(intptr_t)image_formats;
cl_uint *num_image_formats_address = (cl_uint *)(intptr_t)num_image_formats;
clGetSupportedImageFormatsPROC clGetSupportedImageFormats = (clGetSupportedImageFormatsPROC)((intptr_t)function_pointer);
cl_int __result = clGetSupportedImageFormats((cl_context)(intptr_t)context, flags, image_type, num_entries, image_formats_address, num_image_formats_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueReadImage(JNIEnv *env, jclass clazz, jlong command_queue, jlong image, jint blocking_read, jlong origin, jlong region, jlong row_pitch, jlong slice_pitch, jlong ptr, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *origin_address = (const size_t *)(intptr_t)origin;
const size_t *region_address = (const size_t *)(intptr_t)region;
cl_void *ptr_address = (cl_void *)(intptr_t)ptr;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueReadImagePROC clEnqueueReadImage = (clEnqueueReadImagePROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueReadImage((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)image, blocking_read, origin_address, region_address, row_pitch, slice_pitch, ptr_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueWriteImage(JNIEnv *env, jclass clazz, jlong command_queue, jlong image, jint blocking_write, jlong origin, jlong region, jlong input_row_pitch, jlong input_slice_pitch, jlong ptr, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *origin_address = (const size_t *)(intptr_t)origin;
const size_t *region_address = (const size_t *)(intptr_t)region;
const cl_void *ptr_address = (const cl_void *)(intptr_t)ptr;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueWriteImagePROC clEnqueueWriteImage = (clEnqueueWriteImagePROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueWriteImage((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)image, blocking_write, origin_address, region_address, input_row_pitch, input_slice_pitch, ptr_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueCopyImage(JNIEnv *env, jclass clazz, jlong command_queue, jlong src_image, jlong dst_image, jlong src_origin, jlong dst_origin, jlong region, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *src_origin_address = (const size_t *)(intptr_t)src_origin;
const size_t *dst_origin_address = (const size_t *)(intptr_t)dst_origin;
const size_t *region_address = (const size_t *)(intptr_t)region;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueCopyImagePROC clEnqueueCopyImage = (clEnqueueCopyImagePROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueCopyImage((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)src_image, (cl_mem)(intptr_t)dst_image, src_origin_address, dst_origin_address, region_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueCopyImageToBuffer(JNIEnv *env, jclass clazz, jlong command_queue, jlong src_image, jlong dst_buffer, jlong src_origin, jlong region, jlong dst_offset, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *src_origin_address = (const size_t *)(intptr_t)src_origin;
const size_t *region_address = (const size_t *)(intptr_t)region;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueCopyImageToBufferPROC clEnqueueCopyImageToBuffer = (clEnqueueCopyImageToBufferPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueCopyImageToBuffer((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)src_image, (cl_mem)(intptr_t)dst_buffer, src_origin_address, region_address, dst_offset, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueCopyBufferToImage(JNIEnv *env, jclass clazz, jlong command_queue, jlong src_buffer, jlong dst_image, jlong src_offset, jlong dst_origin, jlong region, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *dst_origin_address = (const size_t *)(intptr_t)dst_origin;
const size_t *region_address = (const size_t *)(intptr_t)region;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueCopyBufferToImagePROC clEnqueueCopyBufferToImage = (clEnqueueCopyBufferToImagePROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueCopyBufferToImage((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)src_buffer, (cl_mem)(intptr_t)dst_image, src_offset, dst_origin_address, region_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jobject JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueMapImage(JNIEnv *env, jclass clazz, jlong command_queue, jlong image, jint blocking_map, jlong map_flags, jlong origin, jlong region, jlong image_row_pitch, jlong image_slice_pitch, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong errcode_ret, jlong function_pointer) {
const size_t *origin_address = (const size_t *)(intptr_t)origin;
const size_t *region_address = (const size_t *)(intptr_t)region;
size_t *image_row_pitch_address = (size_t *)(intptr_t)image_row_pitch;
size_t *image_slice_pitch_address = (size_t *)(intptr_t)image_slice_pitch;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clEnqueueMapImagePROC clEnqueueMapImage = (clEnqueueMapImagePROC)((intptr_t)function_pointer);
cl_void * __result = clEnqueueMapImage((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)image, blocking_map, map_flags, origin_address, region_address, image_row_pitch_address, image_slice_pitch_address, num_events_in_wait_list, event_wait_list_address, event_address, errcode_ret_address);
return safeNewBuffer(env, __result, extcl_CalculateImageSize(region_address, *image_row_pitch_address, image_slice_pitch_address == NULL ? 0 : *image_slice_pitch_address));
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetImageInfo(JNIEnv *env, jclass clazz, jlong image, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetImageInfoPROC clGetImageInfo = (clGetImageInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetImageInfo((cl_mem)(intptr_t)image, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclRetainMemObject(JNIEnv *env, jclass clazz, jlong memobj, jlong function_pointer) {
clRetainMemObjectPROC clRetainMemObject = (clRetainMemObjectPROC)((intptr_t)function_pointer);
cl_int __result = clRetainMemObject((cl_mem)(intptr_t)memobj);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclReleaseMemObject(JNIEnv *env, jclass clazz, jlong memobj, jlong function_pointer) {
clReleaseMemObjectPROC clReleaseMemObject = (clReleaseMemObjectPROC)((intptr_t)function_pointer);
cl_int __result = clReleaseMemObject((cl_mem)(intptr_t)memobj);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueUnmapMemObject(JNIEnv *env, jclass clazz, jlong command_queue, jlong memobj, jlong mapped_ptr, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
cl_void *mapped_ptr_address = (cl_void *)(intptr_t)mapped_ptr;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueUnmapMemObjectPROC clEnqueueUnmapMemObject = (clEnqueueUnmapMemObjectPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueUnmapMemObject((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)memobj, mapped_ptr_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetMemObjectInfo(JNIEnv *env, jclass clazz, jlong memobj, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetMemObjectInfoPROC clGetMemObjectInfo = (clGetMemObjectInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetMemObjectInfo((cl_mem)(intptr_t)memobj, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateSampler(JNIEnv *env, jclass clazz, jlong context, jint normalized_coords, jint addressing_mode, jint filter_mode, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateSamplerPROC clCreateSampler = (clCreateSamplerPROC)((intptr_t)function_pointer);
cl_sampler __result = clCreateSampler((cl_context)(intptr_t)context, normalized_coords, addressing_mode, filter_mode, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclRetainSampler(JNIEnv *env, jclass clazz, jlong sampler, jlong function_pointer) {
clRetainSamplerPROC clRetainSampler = (clRetainSamplerPROC)((intptr_t)function_pointer);
cl_int __result = clRetainSampler((cl_sampler)(intptr_t)sampler);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclReleaseSampler(JNIEnv *env, jclass clazz, jlong sampler, jlong function_pointer) {
clReleaseSamplerPROC clReleaseSampler = (clReleaseSamplerPROC)((intptr_t)function_pointer);
cl_int __result = clReleaseSampler((cl_sampler)(intptr_t)sampler);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetSamplerInfo(JNIEnv *env, jclass clazz, jlong sampler, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetSamplerInfoPROC clGetSamplerInfo = (clGetSamplerInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetSamplerInfo((cl_sampler)(intptr_t)sampler, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateProgramWithSource(JNIEnv *env, jclass clazz, jlong context, jint count, jlong string, jlong lengths, jlong errcode_ret, jlong function_pointer) {
const cl_char *string_address = (const cl_char *)(intptr_t)string;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateProgramWithSourcePROC clCreateProgramWithSource = (clCreateProgramWithSourcePROC)((intptr_t)function_pointer);
cl_program __result = clCreateProgramWithSource((cl_context)(intptr_t)context, count, (const cl_char **)&string_address, (const size_t*)&lengths, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateProgramWithSource2(JNIEnv *env, jclass clazz, jlong context, jint count, jlong strings, jlong lengths, jlong errcode_ret, jlong function_pointer) {
const cl_char *strings_address = (const cl_char *)(intptr_t)strings;
int _str_i;
cl_char *_str_address;
cl_char **strings_str = (cl_char **) malloc(count * sizeof(cl_char *));
const size_t *lengths_address = (const size_t *)(intptr_t)lengths;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateProgramWithSourcePROC clCreateProgramWithSource = (clCreateProgramWithSourcePROC)((intptr_t)function_pointer);
cl_program __result;
_str_i = 0;
_str_address = (cl_char *)strings_address;
while ( _str_i < count ) {
strings_str[_str_i] = _str_address;
_str_address += lengths_address[_str_i++];
}
__result = clCreateProgramWithSource((cl_context)(intptr_t)context, count, (const cl_char **)strings_str, lengths_address, errcode_ret_address);
free(strings_str);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateProgramWithSource3(JNIEnv *env, jclass clazz, jlong context, jint count, jobjectArray strings, jlong lengths, jlong errcode_ret, jlong function_pointer) {
int _ptr_i;
jobject _ptr_object;
cl_char **strings_ptr = (cl_char **) malloc(count * sizeof(cl_char *));
const size_t *lengths_address = (const size_t *)(intptr_t)lengths;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateProgramWithSourcePROC clCreateProgramWithSource = (clCreateProgramWithSourcePROC)((intptr_t)function_pointer);
cl_program __result;
_ptr_i = 0;
while ( _ptr_i < count ) {
_ptr_object = (*env)->GetObjectArrayElement(env, strings, _ptr_i);
strings_ptr[_ptr_i++] = (cl_char *)(*env)->GetDirectBufferAddress(env, _ptr_object);
}
__result = clCreateProgramWithSource((cl_context)(intptr_t)context, count, (const cl_char **)strings_ptr, lengths_address, errcode_ret_address);
free(strings_ptr);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateProgramWithSource4(JNIEnv *env, jclass clazz, jlong context, jint count, jlong strings, jlong lengths, jlong errcode_ret, jlong function_pointer) {
const cl_char *strings_address = (const cl_char *)(intptr_t)strings;
int _str_i;
cl_char *_str_address;
cl_char **strings_str = (cl_char **) malloc(count * sizeof(cl_char *));
const size_t *lengths_address = (const size_t *)(intptr_t)lengths;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateProgramWithSourcePROC clCreateProgramWithSource = (clCreateProgramWithSourcePROC)((intptr_t)function_pointer);
cl_program __result;
_str_i = 0;
_str_address = (cl_char *)strings_address;
while ( _str_i < count ) {
strings_str[_str_i] = _str_address;
_str_address += lengths_address[_str_i++];
}
__result = clCreateProgramWithSource((cl_context)(intptr_t)context, count, (const cl_char **)strings_str, lengths_address, errcode_ret_address);
free(strings_str);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateProgramWithBinary(JNIEnv *env, jclass clazz, jlong context, jint num_devices, jlong device, jlong lengths, jlong binary, jlong binary_status, jlong errcode_ret, jlong function_pointer) {
const cl_uchar *binary_address = (const cl_uchar *)(intptr_t)binary;
cl_int *binary_status_address = (cl_int *)(intptr_t)binary_status;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateProgramWithBinaryPROC clCreateProgramWithBinary = (clCreateProgramWithBinaryPROC)((intptr_t)function_pointer);
cl_program __result = clCreateProgramWithBinary((cl_context)(intptr_t)context, num_devices, (const cl_device_id*)(cl_device_id)(intptr_t)&device, (const size_t*)&lengths, (const cl_uchar **)&binary_address, binary_status_address, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateProgramWithBinary2(JNIEnv *env, jclass clazz, jlong context, jint num_devices, jlong device_list, jlong lengths, jlong binaries, jlong binary_status, jlong errcode_ret, jlong function_pointer) {
const cl_device_id *device_list_address = (const cl_device_id *)(intptr_t)device_list;
const size_t *lengths_address = (const size_t *)(intptr_t)lengths;
const cl_uchar *binaries_address = (const cl_uchar *)(intptr_t)binaries;
int _str_i;
cl_uchar *_str_address;
cl_uchar **binaries_str = (cl_uchar **) malloc(num_devices * sizeof(cl_uchar *));
cl_int *binary_status_address = (cl_int *)(intptr_t)binary_status;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateProgramWithBinaryPROC clCreateProgramWithBinary = (clCreateProgramWithBinaryPROC)((intptr_t)function_pointer);
cl_program __result;
_str_i = 0;
_str_address = (cl_uchar *)binaries_address;
while ( _str_i < num_devices ) {
binaries_str[_str_i] = _str_address;
_str_address += lengths_address[_str_i++];
}
__result = clCreateProgramWithBinary((cl_context)(intptr_t)context, num_devices, device_list_address, lengths_address, (const cl_uchar **)binaries_str, binary_status_address, errcode_ret_address);
free(binaries_str);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateProgramWithBinary3(JNIEnv *env, jclass clazz, jlong context, jint num_devices, jlong device_list, jlong lengths, jobjectArray binaries, jlong binary_status, jlong errcode_ret, jlong function_pointer) {
const cl_device_id *device_list_address = (const cl_device_id *)(intptr_t)device_list;
const size_t *lengths_address = (const size_t *)(intptr_t)lengths;
int _ptr_i;
jobject _ptr_object;
cl_uchar **binaries_ptr = (cl_uchar **) malloc(num_devices * sizeof(cl_uchar *));
cl_int *binary_status_address = (cl_int *)(intptr_t)binary_status;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateProgramWithBinaryPROC clCreateProgramWithBinary = (clCreateProgramWithBinaryPROC)((intptr_t)function_pointer);
cl_program __result;
_ptr_i = 0;
while ( _ptr_i < num_devices ) {
_ptr_object = (*env)->GetObjectArrayElement(env, binaries, _ptr_i);
binaries_ptr[_ptr_i++] = (cl_uchar *)(*env)->GetDirectBufferAddress(env, _ptr_object);
}
__result = clCreateProgramWithBinary((cl_context)(intptr_t)context, num_devices, device_list_address, lengths_address, (const cl_uchar **)binaries_ptr, binary_status_address, errcode_ret_address);
free(binaries_ptr);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclRetainProgram(JNIEnv *env, jclass clazz, jlong program, jlong function_pointer) {
clRetainProgramPROC clRetainProgram = (clRetainProgramPROC)((intptr_t)function_pointer);
cl_int __result = clRetainProgram((cl_program)(intptr_t)program);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclReleaseProgram(JNIEnv *env, jclass clazz, jlong program, jlong function_pointer) {
clReleaseProgramPROC clReleaseProgram = (clReleaseProgramPROC)((intptr_t)function_pointer);
cl_int __result = clReleaseProgram((cl_program)(intptr_t)program);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclBuildProgram(JNIEnv *env, jclass clazz, jlong program, jint num_devices, jlong device_list, jlong options, jlong pfn_notify, jlong user_data, jlong function_pointer) {
const cl_device_id *device_list_address = (const cl_device_id *)(intptr_t)device_list;
const cl_char *options_address = (const cl_char *)(intptr_t)options;
clBuildProgramPROC clBuildProgram = (clBuildProgramPROC)((intptr_t)function_pointer);
cl_int __result = clBuildProgram((cl_program)(intptr_t)program, num_devices, device_list_address, options_address, (cl_program_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclUnloadCompiler(JNIEnv *env, jclass clazz, jlong function_pointer) {
clUnloadCompilerPROC clUnloadCompiler = (clUnloadCompilerPROC)((intptr_t)function_pointer);
cl_int __result = clUnloadCompiler();
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetProgramInfo(JNIEnv *env, jclass clazz, jlong program, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetProgramInfoPROC clGetProgramInfo = (clGetProgramInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetProgramInfo((cl_program)(intptr_t)program, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetProgramInfo2(JNIEnv *env, jclass clazz, jlong program, jint param_name, jlong sizes_len, jlong sizes, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
const size_t *sizes_address = (const size_t *)(intptr_t)sizes;
cl_uchar *param_value_address = (cl_uchar *)(intptr_t)param_value;
int _str_i;
cl_uchar *_str_address;
cl_uchar **param_value_str = (cl_uchar **) malloc(sizes_len * sizeof(cl_uchar *));
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetProgramInfoPROC clGetProgramInfo = (clGetProgramInfoPROC)((intptr_t)function_pointer);
cl_int __result;
_str_i = 0;
_str_address = (cl_uchar *)param_value_address;
while ( _str_i < sizes_len ) {
param_value_str[_str_i] = _str_address;
_str_address += sizes_address[_str_i++];
}
__result = clGetProgramInfo((cl_program)(intptr_t)program, param_name, sizes_len * sizeof(cl_uchar *), (cl_uchar **)param_value_str, param_value_size_ret_address);
free(param_value_str);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetProgramInfo3(JNIEnv *env, jclass clazz, jlong program, jint param_name, jlong param_value_len, jobjectArray param_value, jlong param_value_size_ret, jlong function_pointer) {
int _ptr_i;
jobject _ptr_object;
cl_uchar **param_value_ptr = (cl_uchar **) malloc(param_value_len * sizeof(cl_uchar *));
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetProgramInfoPROC clGetProgramInfo = (clGetProgramInfoPROC)((intptr_t)function_pointer);
cl_int __result;
_ptr_i = 0;
while ( _ptr_i < param_value_len ) {
_ptr_object = (*env)->GetObjectArrayElement(env, param_value, _ptr_i);
param_value_ptr[_ptr_i++] = (cl_uchar *)(*env)->GetDirectBufferAddress(env, _ptr_object);
}
__result = clGetProgramInfo((cl_program)(intptr_t)program, param_name, param_value_len * sizeof(cl_uchar *), (cl_uchar **)param_value_ptr, param_value_size_ret_address);
free(param_value_ptr);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetProgramBuildInfo(JNIEnv *env, jclass clazz, jlong program, jlong device, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetProgramBuildInfoPROC clGetProgramBuildInfo = (clGetProgramBuildInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetProgramBuildInfo((cl_program)(intptr_t)program, (cl_device_id)(intptr_t)device, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclCreateKernel(JNIEnv *env, jclass clazz, jlong program, jlong kernel_name, jlong errcode_ret, jlong function_pointer) {
const cl_char *kernel_name_address = (const cl_char *)(intptr_t)kernel_name;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateKernelPROC clCreateKernel = (clCreateKernelPROC)((intptr_t)function_pointer);
cl_kernel __result = clCreateKernel((cl_program)(intptr_t)program, kernel_name_address, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclCreateKernelsInProgram(JNIEnv *env, jclass clazz, jlong program, jint num_kernels, jlong kernels, jlong num_kernels_ret, jlong function_pointer) {
cl_kernel *kernels_address = (cl_kernel *)(intptr_t)kernels;
cl_uint *num_kernels_ret_address = (cl_uint *)(intptr_t)num_kernels_ret;
clCreateKernelsInProgramPROC clCreateKernelsInProgram = (clCreateKernelsInProgramPROC)((intptr_t)function_pointer);
cl_int __result = clCreateKernelsInProgram((cl_program)(intptr_t)program, num_kernels, kernels_address, num_kernels_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclRetainKernel(JNIEnv *env, jclass clazz, jlong kernel, jlong function_pointer) {
clRetainKernelPROC clRetainKernel = (clRetainKernelPROC)((intptr_t)function_pointer);
cl_int __result = clRetainKernel((cl_kernel)(intptr_t)kernel);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclReleaseKernel(JNIEnv *env, jclass clazz, jlong kernel, jlong function_pointer) {
clReleaseKernelPROC clReleaseKernel = (clReleaseKernelPROC)((intptr_t)function_pointer);
cl_int __result = clReleaseKernel((cl_kernel)(intptr_t)kernel);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclSetKernelArg(JNIEnv *env, jclass clazz, jlong kernel, jint arg_index, jlong arg_size, jlong arg_value, jlong function_pointer) {
const cl_void *arg_value_address = (const cl_void *)(intptr_t)arg_value;
clSetKernelArgPROC clSetKernelArg = (clSetKernelArgPROC)((intptr_t)function_pointer);
cl_int __result = clSetKernelArg((cl_kernel)(intptr_t)kernel, arg_index, arg_size, arg_value_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetKernelInfo(JNIEnv *env, jclass clazz, jlong kernel, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetKernelInfoPROC clGetKernelInfo = (clGetKernelInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetKernelInfo((cl_kernel)(intptr_t)kernel, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetKernelWorkGroupInfo(JNIEnv *env, jclass clazz, jlong kernel, jlong device, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetKernelWorkGroupInfoPROC clGetKernelWorkGroupInfo = (clGetKernelWorkGroupInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetKernelWorkGroupInfo((cl_kernel)(intptr_t)kernel, (cl_device_id)(intptr_t)device, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueNDRangeKernel(JNIEnv *env, jclass clazz, jlong command_queue, jlong kernel, jint work_dim, jlong global_work_offset, jlong global_work_size, jlong local_work_size, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *global_work_offset_address = (const size_t *)(intptr_t)global_work_offset;
const size_t *global_work_size_address = (const size_t *)(intptr_t)global_work_size;
const size_t *local_work_size_address = (const size_t *)(intptr_t)local_work_size;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueNDRangeKernelPROC clEnqueueNDRangeKernel = (clEnqueueNDRangeKernelPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueNDRangeKernel((cl_command_queue)(intptr_t)command_queue, (cl_kernel)(intptr_t)kernel, work_dim, global_work_offset_address, global_work_size_address, local_work_size_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueTask(JNIEnv *env, jclass clazz, jlong command_queue, jlong kernel, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueTaskPROC clEnqueueTask = (clEnqueueTaskPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueTask((cl_command_queue)(intptr_t)command_queue, (cl_kernel)(intptr_t)kernel, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueNativeKernel(JNIEnv *env, jclass clazz, jlong command_queue, jlong user_func, jlong args, jlong cb_args, jint num_mem_objects, jobjectArray mem_list, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
cl_void *args_address = (cl_void *)(intptr_t)args;
int _ptr_i;
jobject _ptr_object;
cl_mem *mem_list_ptr = num_mem_objects == 0 ? NULL : (cl_mem *) malloc(num_mem_objects * sizeof(cl_mem ));
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueNativeKernelPROC clEnqueueNativeKernel = (clEnqueueNativeKernelPROC)((intptr_t)function_pointer);
cl_int __result;
void **args_mem_loc = num_mem_objects == 0 ? NULL : (void **)malloc(num_mem_objects * sizeof(void *));
_ptr_i = 0;
while ( _ptr_i < num_mem_objects ) {
_ptr_object = (*env)->GetObjectArrayElement(env, mem_list, _ptr_i);
mem_list_ptr[_ptr_i++] = (cl_mem)(intptr_t)getPointerWrapperAddress(env, _ptr_object);
}
_ptr_i = 0;
while ( _ptr_i < num_mem_objects ) {
args_mem_loc[_ptr_i] = (cl_void *)((char *)args_address + (12 + 4 + _ptr_i * (4 + sizeof(void *))));
_ptr_i++;
}
__result = clEnqueueNativeKernel((cl_command_queue)(intptr_t)command_queue, (cl_native_kernel_func)(intptr_t)user_func, args_address, cb_args, num_mem_objects, (const cl_mem*)mem_list_ptr, (const void**)args_mem_loc, num_events_in_wait_list, event_wait_list_address, event_address);
free(args_mem_loc);
free(mem_list_ptr);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclWaitForEvents(JNIEnv *env, jclass clazz, jint num_events, jlong event_list, jlong function_pointer) {
const cl_event *event_list_address = (const cl_event *)(intptr_t)event_list;
clWaitForEventsPROC clWaitForEvents = (clWaitForEventsPROC)((intptr_t)function_pointer);
cl_int __result = clWaitForEvents(num_events, event_list_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetEventInfo(JNIEnv *env, jclass clazz, jlong event, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetEventInfoPROC clGetEventInfo = (clGetEventInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetEventInfo((cl_event)(intptr_t)event, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclRetainEvent(JNIEnv *env, jclass clazz, jlong event, jlong function_pointer) {
clRetainEventPROC clRetainEvent = (clRetainEventPROC)((intptr_t)function_pointer);
cl_int __result = clRetainEvent((cl_event)(intptr_t)event);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclReleaseEvent(JNIEnv *env, jclass clazz, jlong event, jlong function_pointer) {
clReleaseEventPROC clReleaseEvent = (clReleaseEventPROC)((intptr_t)function_pointer);
cl_int __result = clReleaseEvent((cl_event)(intptr_t)event);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueMarker(JNIEnv *env, jclass clazz, jlong command_queue, jlong event, jlong function_pointer) {
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueMarkerPROC clEnqueueMarker = (clEnqueueMarkerPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueMarker((cl_command_queue)(intptr_t)command_queue, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueBarrier(JNIEnv *env, jclass clazz, jlong command_queue, jlong function_pointer) {
clEnqueueBarrierPROC clEnqueueBarrier = (clEnqueueBarrierPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueBarrier((cl_command_queue)(intptr_t)command_queue);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclEnqueueWaitForEvents(JNIEnv *env, jclass clazz, jlong command_queue, jint num_events, jlong event_list, jlong function_pointer) {
const cl_event *event_list_address = (const cl_event *)(intptr_t)event_list;
clEnqueueWaitForEventsPROC clEnqueueWaitForEvents = (clEnqueueWaitForEventsPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueWaitForEvents((cl_command_queue)(intptr_t)command_queue, num_events, event_list_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclGetEventProfilingInfo(JNIEnv *env, jclass clazz, jlong event, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetEventProfilingInfoPROC clGetEventProfilingInfo = (clGetEventProfilingInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetEventProfilingInfo((cl_event)(intptr_t)event, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclFlush(JNIEnv *env, jclass clazz, jlong command_queue, jlong function_pointer) {
clFlushPROC clFlush = (clFlushPROC)((intptr_t)function_pointer);
cl_int __result = clFlush((cl_command_queue)(intptr_t)command_queue);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10_nclFinish(JNIEnv *env, jclass clazz, jlong command_queue, jlong function_pointer) {
clFinishPROC clFinish = (clFinishPROC)((intptr_t)function_pointer);
cl_int __result = clFinish((cl_command_queue)(intptr_t)command_queue);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10_nclGetExtensionFunctionAddress(JNIEnv *env, jclass clazz, jlong func_name, jlong function_pointer) {
const cl_char *func_name_address = (const cl_char *)(intptr_t)func_name;
clGetExtensionFunctionAddressPROC clGetExtensionFunctionAddress = (clGetExtensionFunctionAddressPROC)((intptr_t)function_pointer);
void * __result = clGetExtensionFunctionAddress(func_name_address);
return (intptr_t)__result;
}

View File

@ -0,0 +1,76 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLBufferPROC) (cl_context context, cl_mem_flags flags, GLuint bufobj, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLTexture2DPROC) (cl_context context, cl_mem_flags flags, GLenum target, GLint miplevel, GLuint texture, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLTexture3DPROC) (cl_context context, cl_mem_flags flags, GLenum target, GLint miplevel, GLuint texture, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLRenderbufferPROC) (cl_context context, cl_mem_flags flags, GLuint renderbuffer, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLObjectInfoPROC) (cl_mem memobj, cl_gl_object_type * gl_object_type, GLuint * gl_object_name);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLTextureInfoPROC) (cl_mem memobj, cl_gl_texture_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireGLObjectsPROC) (cl_command_queue command_queue, cl_uint num_objects, const cl_mem * mem_objects, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseGLObjectsPROC) (cl_command_queue command_queue, cl_uint num_objects, const cl_mem * mem_objects, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10GL_nclCreateFromGLBuffer(JNIEnv *env, jclass clazz, jlong context, jlong flags, jint bufobj, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateFromGLBufferPROC clCreateFromGLBuffer = (clCreateFromGLBufferPROC)((intptr_t)function_pointer);
cl_mem __result = clCreateFromGLBuffer((cl_context)(intptr_t)context, flags, bufobj, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10GL_nclCreateFromGLTexture2D(JNIEnv *env, jclass clazz, jlong context, jlong flags, jint target, jint miplevel, jint texture, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateFromGLTexture2DPROC clCreateFromGLTexture2D = (clCreateFromGLTexture2DPROC)((intptr_t)function_pointer);
cl_mem __result = clCreateFromGLTexture2D((cl_context)(intptr_t)context, flags, target, miplevel, texture, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10GL_nclCreateFromGLTexture3D(JNIEnv *env, jclass clazz, jlong context, jlong flags, jint target, jint miplevel, jint texture, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateFromGLTexture3DPROC clCreateFromGLTexture3D = (clCreateFromGLTexture3DPROC)((intptr_t)function_pointer);
cl_mem __result = clCreateFromGLTexture3D((cl_context)(intptr_t)context, flags, target, miplevel, texture, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL10GL_nclCreateFromGLRenderbuffer(JNIEnv *env, jclass clazz, jlong context, jlong flags, jint renderbuffer, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateFromGLRenderbufferPROC clCreateFromGLRenderbuffer = (clCreateFromGLRenderbufferPROC)((intptr_t)function_pointer);
cl_mem __result = clCreateFromGLRenderbuffer((cl_context)(intptr_t)context, flags, renderbuffer, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10GL_nclGetGLObjectInfo(JNIEnv *env, jclass clazz, jlong memobj, jlong gl_object_type, jlong gl_object_name, jlong function_pointer) {
cl_gl_object_type *gl_object_type_address = (cl_gl_object_type *)(intptr_t)gl_object_type;
GLuint *gl_object_name_address = (GLuint *)(intptr_t)gl_object_name;
clGetGLObjectInfoPROC clGetGLObjectInfo = (clGetGLObjectInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetGLObjectInfo((cl_mem)(intptr_t)memobj, gl_object_type_address, gl_object_name_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10GL_nclGetGLTextureInfo(JNIEnv *env, jclass clazz, jlong memobj, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetGLTextureInfoPROC clGetGLTextureInfo = (clGetGLTextureInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetGLTextureInfo((cl_mem)(intptr_t)memobj, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10GL_nclEnqueueAcquireGLObjects(JNIEnv *env, jclass clazz, jlong command_queue, jint num_objects, jlong mem_objects, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_mem *mem_objects_address = (const cl_mem *)(intptr_t)mem_objects;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueAcquireGLObjectsPROC clEnqueueAcquireGLObjects = (clEnqueueAcquireGLObjectsPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueAcquireGLObjects((cl_command_queue)(intptr_t)command_queue, num_objects, mem_objects_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL10GL_nclEnqueueReleaseGLObjects(JNIEnv *env, jclass clazz, jlong command_queue, jint num_objects, jlong mem_objects, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_mem *mem_objects_address = (const cl_mem *)(intptr_t)mem_objects;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueReleaseGLObjectsPROC clEnqueueReleaseGLObjects = (clEnqueueReleaseGLObjectsPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueReleaseGLObjects((cl_command_queue)(intptr_t)command_queue, num_objects, mem_objects_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}

View File

@ -0,0 +1,82 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateSubBufferPROC) (cl_mem buffer, cl_mem_flags flags, cl_buffer_create_type buffer_create_type, const cl_void * buffer_create_info, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clSetMemObjectDestructorCallbackPROC) (cl_mem memobj, cl_mem_object_destructor_callback pfn_notify, void * user_data);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReadBufferRectPROC) (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, const size_t * buffer_offset, const size_t * host_offset, const size_t * region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, cl_void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueWriteBufferRectPROC) (cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_write, const size_t * buffer_offset, const size_t * host_offset, const size_t * region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, const cl_void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyBufferRectPROC) (cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer, const size_t * src_origin, const size_t * dst_origin, const size_t * region, size_t src_row_pitch, size_t src_slice_pitch, size_t dst_row_pitch, size_t dst_slice_pitch, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateUserEventPROC) (cl_context context, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clSetUserEventStatusPROC) (cl_event event, cl_int execution_status);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clSetEventCallbackPROC) (cl_event event, cl_int command_exec_callback_type, cl_event_callback pfn_notify, void * user_data);
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL11_nclCreateSubBuffer(JNIEnv *env, jclass clazz, jlong buffer, jlong flags, jint buffer_create_type, jlong buffer_create_info, jlong errcode_ret, jlong function_pointer) {
const cl_void *buffer_create_info_address = (const cl_void *)(intptr_t)buffer_create_info;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateSubBufferPROC clCreateSubBuffer = (clCreateSubBufferPROC)((intptr_t)function_pointer);
cl_mem __result = clCreateSubBuffer((cl_mem)(intptr_t)buffer, flags, buffer_create_type, buffer_create_info_address, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL11_nclSetMemObjectDestructorCallback(JNIEnv *env, jclass clazz, jlong memobj, jlong pfn_notify, jlong user_data, jlong function_pointer) {
clSetMemObjectDestructorCallbackPROC clSetMemObjectDestructorCallback = (clSetMemObjectDestructorCallbackPROC)((intptr_t)function_pointer);
cl_int __result = clSetMemObjectDestructorCallback((cl_mem)(intptr_t)memobj, (cl_mem_object_destructor_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL11_nclEnqueueReadBufferRect(JNIEnv *env, jclass clazz, jlong command_queue, jlong buffer, jint blocking_read, jlong buffer_offset, jlong host_offset, jlong region, jlong buffer_row_pitch, jlong buffer_slice_pitch, jlong host_row_pitch, jlong host_slice_pitch, jlong ptr, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *buffer_offset_address = (const size_t *)(intptr_t)buffer_offset;
const size_t *host_offset_address = (const size_t *)(intptr_t)host_offset;
const size_t *region_address = (const size_t *)(intptr_t)region;
cl_void *ptr_address = (cl_void *)(intptr_t)ptr;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueReadBufferRectPROC clEnqueueReadBufferRect = (clEnqueueReadBufferRectPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueReadBufferRect((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)buffer, blocking_read, buffer_offset_address, host_offset_address, region_address, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL11_nclEnqueueWriteBufferRect(JNIEnv *env, jclass clazz, jlong command_queue, jlong buffer, jint blocking_write, jlong buffer_offset, jlong host_offset, jlong region, jlong buffer_row_pitch, jlong buffer_slice_pitch, jlong host_row_pitch, jlong host_slice_pitch, jlong ptr, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *buffer_offset_address = (const size_t *)(intptr_t)buffer_offset;
const size_t *host_offset_address = (const size_t *)(intptr_t)host_offset;
const size_t *region_address = (const size_t *)(intptr_t)region;
const cl_void *ptr_address = (const cl_void *)(intptr_t)ptr;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueWriteBufferRectPROC clEnqueueWriteBufferRect = (clEnqueueWriteBufferRectPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueWriteBufferRect((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)buffer, blocking_write, buffer_offset_address, host_offset_address, region_address, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL11_nclEnqueueCopyBufferRect(JNIEnv *env, jclass clazz, jlong command_queue, jlong src_buffer, jlong dst_buffer, jlong src_origin, jlong dst_origin, jlong region, jlong src_row_pitch, jlong src_slice_pitch, jlong dst_row_pitch, jlong dst_slice_pitch, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const size_t *src_origin_address = (const size_t *)(intptr_t)src_origin;
const size_t *dst_origin_address = (const size_t *)(intptr_t)dst_origin;
const size_t *region_address = (const size_t *)(intptr_t)region;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueCopyBufferRectPROC clEnqueueCopyBufferRect = (clEnqueueCopyBufferRectPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueCopyBufferRect((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)src_buffer, (cl_mem)(intptr_t)dst_buffer, src_origin_address, dst_origin_address, region_address, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL11_nclCreateUserEvent(JNIEnv *env, jclass clazz, jlong context, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateUserEventPROC clCreateUserEvent = (clCreateUserEventPROC)((intptr_t)function_pointer);
cl_event __result = clCreateUserEvent((cl_context)(intptr_t)context, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL11_nclSetUserEventStatus(JNIEnv *env, jclass clazz, jlong event, jint execution_status, jlong function_pointer) {
clSetUserEventStatusPROC clSetUserEventStatus = (clSetUserEventStatusPROC)((intptr_t)function_pointer);
cl_int __result = clSetUserEventStatus((cl_event)(intptr_t)event, execution_status);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL11_nclSetEventCallback(JNIEnv *env, jclass clazz, jlong event, jint command_exec_callback_type, jlong pfn_notify, jlong user_data, jlong function_pointer) {
clSetEventCallbackPROC clSetEventCallback = (clSetEventCallbackPROC)((intptr_t)function_pointer);
cl_int __result = clSetEventCallback((cl_event)(intptr_t)event, command_exec_callback_type, (cl_event_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data);
return __result;
}

View File

@ -0,0 +1,194 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainDevicePROC) (cl_device_id device);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseDevicePROC) (cl_device_id device);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clCreateSubDevicesPROC) (cl_device_id in_device, const cl_device_partition_property * properties, cl_uint num_devices, cl_device_id * out_devices, cl_uint * num_devices_ret);
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateImagePROC) (cl_context context, cl_mem_flags flags, const cl_image_format * image_format, const cl_image_desc * image_desc, cl_void * host_ptr, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_program (CL_API_CALL *clCreateProgramWithBuiltInKernelsPROC) (cl_context context, cl_uint num_devices, const cl_device_id * device_list, const cl_char * kernel_names, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clCompileProgramPROC) (cl_program program, cl_uint num_devices, const cl_device_id * device_list, const cl_char * options, cl_uint num_input_headers, const cl_program * input_header, const cl_char ** header_include_name, cl_program_callback pfn_notify, void * user_data);
typedef CL_API_ENTRY cl_program (CL_API_CALL *clLinkProgramPROC) (cl_context context, cl_uint num_devices, const cl_device_id * device_list, const cl_char * options, cl_uint num_input_programs, const cl_program * input_programs, cl_program_callback pfn_notify, void * user_data, cl_int * errcode_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clUnloadPlatformCompilerPROC) (cl_platform_id platform);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetKernelArgInfoPROC) (cl_kernel kernel, cl_uint arg_indx, cl_kernel_arg_info param_name, size_t param_value_size, cl_void * param_value, size_t * param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueFillBufferPROC) (cl_command_queue command_queue, cl_mem buffer, const cl_void * pattern, size_t pattern_size, size_t offset, size_t size, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueFillImagePROC) (cl_command_queue command_queue, cl_mem image, const cl_void * fill_color, const size_t * origin, const size_t * region, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueMigrateMemObjectsPROC) (cl_command_queue command_queue, cl_uint num_mem_objects, const cl_mem * mem_objects, cl_mem_migration_flags flags, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueMarkerWithWaitListPROC) (cl_command_queue command_queue, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueBarrierWithWaitListPROC) (cl_command_queue command_queue, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clSetPrintfCallbackPROC) (cl_context context, cl_printf_callback pfn_notify, void * user_data);
typedef CL_API_ENTRY void * (CL_API_CALL *clGetExtensionFunctionAddressForPlatformPROC) (cl_platform_id platform, const cl_char * func_name);
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclRetainDevice(JNIEnv *env, jclass clazz, jlong device, jlong function_pointer) {
clRetainDevicePROC clRetainDevice = (clRetainDevicePROC)((intptr_t)function_pointer);
cl_int __result = clRetainDevice((cl_device_id)(intptr_t)device);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclReleaseDevice(JNIEnv *env, jclass clazz, jlong device, jlong function_pointer) {
clReleaseDevicePROC clReleaseDevice = (clReleaseDevicePROC)((intptr_t)function_pointer);
cl_int __result = clReleaseDevice((cl_device_id)(intptr_t)device);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclCreateSubDevices(JNIEnv *env, jclass clazz, jlong in_device, jlong properties, jint num_devices, jlong out_devices, jlong num_devices_ret, jlong function_pointer) {
const cl_device_partition_property *properties_address = (const cl_device_partition_property *)(intptr_t)properties;
cl_device_id *out_devices_address = (cl_device_id *)(intptr_t)out_devices;
cl_uint *num_devices_ret_address = (cl_uint *)(intptr_t)num_devices_ret;
clCreateSubDevicesPROC clCreateSubDevices = (clCreateSubDevicesPROC)((intptr_t)function_pointer);
cl_int __result = clCreateSubDevices((cl_device_id)(intptr_t)in_device, properties_address, num_devices, out_devices_address, num_devices_ret_address);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL12_nclCreateImage(JNIEnv *env, jclass clazz, jlong context, jlong flags, jlong image_format, jlong image_desc, jlong host_ptr, jlong errcode_ret, jlong function_pointer) {
const cl_image_format *image_format_address = (const cl_image_format *)(intptr_t)image_format;
const cl_image_desc *image_desc_address = (const cl_image_desc *)(intptr_t)image_desc;
cl_void *host_ptr_address = (cl_void *)(intptr_t)host_ptr;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateImagePROC clCreateImage = (clCreateImagePROC)((intptr_t)function_pointer);
cl_mem __result = clCreateImage((cl_context)(intptr_t)context, flags, image_format_address, image_desc_address, host_ptr_address, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL12_nclCreateProgramWithBuiltInKernels(JNIEnv *env, jclass clazz, jlong context, jint num_devices, jlong device_list, jlong kernel_names, jlong errcode_ret, jlong function_pointer) {
const cl_device_id *device_list_address = (const cl_device_id *)(intptr_t)device_list;
const cl_char *kernel_names_address = (const cl_char *)(intptr_t)kernel_names;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateProgramWithBuiltInKernelsPROC clCreateProgramWithBuiltInKernels = (clCreateProgramWithBuiltInKernelsPROC)((intptr_t)function_pointer);
cl_program __result = clCreateProgramWithBuiltInKernels((cl_context)(intptr_t)context, num_devices, device_list_address, kernel_names_address, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclCompileProgram(JNIEnv *env, jclass clazz, jlong program, jint num_devices, jlong device_list, jlong options, jint num_input_headers, jlong input_header, jlong header_include_name, jlong pfn_notify, jlong user_data, jlong function_pointer) {
const cl_device_id *device_list_address = (const cl_device_id *)(intptr_t)device_list;
const cl_char *options_address = (const cl_char *)(intptr_t)options;
const cl_program *input_header_address = (const cl_program *)(intptr_t)input_header;
const cl_char *header_include_name_address = (const cl_char *)(intptr_t)header_include_name;
clCompileProgramPROC clCompileProgram = (clCompileProgramPROC)((intptr_t)function_pointer);
cl_int __result = clCompileProgram((cl_program)(intptr_t)program, num_devices, device_list_address, options_address, num_input_headers, input_header_address, (const cl_char **)&header_include_name_address, (cl_program_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclCompileProgramMulti(JNIEnv *env, jclass clazz, jlong program, jint num_devices, jlong device_list, jlong options, jint num_input_headers, jlong input_headers, jlong header_include_names, jlong pfn_notify, jlong user_data, jlong function_pointer) {
const cl_device_id *device_list_address = (const cl_device_id *)(intptr_t)device_list;
const cl_char *options_address = (const cl_char *)(intptr_t)options;
const cl_program *input_headers_address = (const cl_program *)(intptr_t)input_headers;
const cl_char *header_include_names_address = (const cl_char *)(intptr_t)header_include_names;
int _str_i;
cl_char *_str_address;
cl_char **header_include_names_str = (cl_char **) malloc(num_input_headers * sizeof(cl_char *));
clCompileProgramPROC clCompileProgram = (clCompileProgramPROC)((intptr_t)function_pointer);
cl_int __result;
_str_i = 0;
_str_address = (cl_char *)header_include_names_address;
while ( _str_i < num_input_headers ) {
header_include_names_str[_str_i++] = _str_address;
_str_address += strlen((const char *)_str_address) + 1;
}
__result = clCompileProgram((cl_program)(intptr_t)program, num_devices, device_list_address, options_address, num_input_headers, input_headers_address, (const cl_char **)&header_include_names_str, (cl_program_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data);
free(header_include_names_str);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclCompileProgram3(JNIEnv *env, jclass clazz, jlong program, jint num_devices, jlong device_list, jlong options, jint num_input_headers, jlong input_headers, jobjectArray header_include_names, jlong pfn_notify, jlong user_data, jlong function_pointer) {
const cl_device_id *device_list_address = (const cl_device_id *)(intptr_t)device_list;
const cl_char *options_address = (const cl_char *)(intptr_t)options;
const cl_program *input_headers_address = (const cl_program *)(intptr_t)input_headers;
int _ptr_i;
jobject _ptr_object;
cl_char **header_include_names_ptr = (cl_char **) malloc(num_input_headers * sizeof(cl_char *));
clCompileProgramPROC clCompileProgram = (clCompileProgramPROC)((intptr_t)function_pointer);
cl_int __result;
_ptr_i = 0;
while ( _ptr_i < num_input_headers ) {
_ptr_object = (*env)->GetObjectArrayElement(env, header_include_names, _ptr_i);
header_include_names_ptr[_ptr_i++] = (cl_char *)(*env)->GetDirectBufferAddress(env, _ptr_object);
}
__result = clCompileProgram((cl_program)(intptr_t)program, num_devices, device_list_address, options_address, num_input_headers, input_headers_address, (const cl_char **)header_include_names_ptr, (cl_program_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data);
free(header_include_names_ptr);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL12_nclLinkProgram(JNIEnv *env, jclass clazz, jlong context, jint num_devices, jlong device_list, jlong options, jint num_input_programs, jlong input_programs, jlong pfn_notify, jlong user_data, jlong errcode_ret, jlong function_pointer) {
const cl_device_id *device_list_address = (const cl_device_id *)(intptr_t)device_list;
const cl_char *options_address = (const cl_char *)(intptr_t)options;
const cl_program *input_programs_address = (const cl_program *)(intptr_t)input_programs;
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clLinkProgramPROC clLinkProgram = (clLinkProgramPROC)((intptr_t)function_pointer);
cl_program __result = clLinkProgram((cl_context)(intptr_t)context, num_devices, device_list_address, options_address, num_input_programs, input_programs_address, (cl_program_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data, errcode_ret_address);
return (intptr_t)__result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclUnloadPlatformCompiler(JNIEnv *env, jclass clazz, jlong platform, jlong function_pointer) {
clUnloadPlatformCompilerPROC clUnloadPlatformCompiler = (clUnloadPlatformCompilerPROC)((intptr_t)function_pointer);
cl_int __result = clUnloadPlatformCompiler((cl_platform_id)(intptr_t)platform);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclGetKernelArgInfo(JNIEnv *env, jclass clazz, jlong kernel, jint arg_indx, jint param_name, jlong param_value_size, jlong param_value, jlong param_value_size_ret, jlong function_pointer) {
cl_void *param_value_address = (cl_void *)(intptr_t)param_value;
size_t *param_value_size_ret_address = (size_t *)(intptr_t)param_value_size_ret;
clGetKernelArgInfoPROC clGetKernelArgInfo = (clGetKernelArgInfoPROC)((intptr_t)function_pointer);
cl_int __result = clGetKernelArgInfo((cl_kernel)(intptr_t)kernel, arg_indx, param_name, param_value_size, param_value_address, param_value_size_ret_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclEnqueueFillBuffer(JNIEnv *env, jclass clazz, jlong command_queue, jlong buffer, jlong pattern, jlong pattern_size, jlong offset, jlong size, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_void *pattern_address = (const cl_void *)(intptr_t)pattern;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueFillBufferPROC clEnqueueFillBuffer = (clEnqueueFillBufferPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueFillBuffer((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)buffer, pattern_address, pattern_size, offset, size, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclEnqueueFillImage(JNIEnv *env, jclass clazz, jlong command_queue, jlong image, jlong fill_color, jlong origin, jlong region, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_void *fill_color_address = (const cl_void *)(intptr_t)fill_color;
const size_t *origin_address = (const size_t *)(intptr_t)origin;
const size_t *region_address = (const size_t *)(intptr_t)region;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueFillImagePROC clEnqueueFillImage = (clEnqueueFillImagePROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueFillImage((cl_command_queue)(intptr_t)command_queue, (cl_mem)(intptr_t)image, fill_color_address, origin_address, region_address, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclEnqueueMigrateMemObjects(JNIEnv *env, jclass clazz, jlong command_queue, jint num_mem_objects, jlong mem_objects, jlong flags, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_mem *mem_objects_address = (const cl_mem *)(intptr_t)mem_objects;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueMigrateMemObjectsPROC clEnqueueMigrateMemObjects = (clEnqueueMigrateMemObjectsPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueMigrateMemObjects((cl_command_queue)(intptr_t)command_queue, num_mem_objects, mem_objects_address, flags, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclEnqueueMarkerWithWaitList(JNIEnv *env, jclass clazz, jlong command_queue, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueMarkerWithWaitListPROC clEnqueueMarkerWithWaitList = (clEnqueueMarkerWithWaitListPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueMarkerWithWaitList((cl_command_queue)(intptr_t)command_queue, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclEnqueueBarrierWithWaitList(JNIEnv *env, jclass clazz, jlong command_queue, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueBarrierWithWaitListPROC clEnqueueBarrierWithWaitList = (clEnqueueBarrierWithWaitListPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueBarrierWithWaitList((cl_command_queue)(intptr_t)command_queue, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_CL12_nclSetPrintfCallback(JNIEnv *env, jclass clazz, jlong context, jlong pfn_notify, jlong user_data, jlong function_pointer) {
clSetPrintfCallbackPROC clSetPrintfCallback = (clSetPrintfCallbackPROC)((intptr_t)function_pointer);
cl_int __result = clSetPrintfCallback((cl_context)(intptr_t)context, (cl_printf_callback)(intptr_t)pfn_notify, (void *)(intptr_t)user_data);
return __result;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL12_nclGetExtensionFunctionAddressForPlatform(JNIEnv *env, jclass clazz, jlong platform, jlong func_name, jlong function_pointer) {
const cl_char *func_name_address = (const cl_char *)(intptr_t)func_name;
clGetExtensionFunctionAddressForPlatformPROC clGetExtensionFunctionAddressForPlatform = (clGetExtensionFunctionAddressForPlatformPROC)((intptr_t)function_pointer);
void * __result = clGetExtensionFunctionAddressForPlatform((cl_platform_id)(intptr_t)platform, func_name_address);
return (intptr_t)__result;
}

View File

@ -0,0 +1,14 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLTexturePROC) (cl_context context, cl_mem_flags flags, GLenum target, GLint miplevel, GLuint texture, cl_int * errcode_ret);
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CL12GL_nclCreateFromGLTexture(JNIEnv *env, jclass clazz, jlong context, jlong flags, jint target, jint miplevel, jint texture, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateFromGLTexturePROC clCreateFromGLTexture = (clCreateFromGLTexturePROC)((intptr_t)function_pointer);
cl_mem __result = clCreateFromGLTexture((cl_context)(intptr_t)context, flags, target, miplevel, texture, errcode_ret_address);
return (intptr_t)__result;
}

View File

@ -0,0 +1,30 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainDeviceEXTPROC) (cl_device_id device);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseDeviceEXTPROC) (cl_device_id device);
typedef CL_API_ENTRY cl_int (CL_API_CALL *clCreateSubDevicesEXTPROC) (cl_device_id in_device, const cl_device_partition_property_ext * properties, cl_uint num_entries, cl_device_id * out_devices, cl_uint * num_devices);
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_EXTDeviceFission_nclRetainDeviceEXT(JNIEnv *env, jclass clazz, jlong device, jlong function_pointer) {
clRetainDeviceEXTPROC clRetainDeviceEXT = (clRetainDeviceEXTPROC)((intptr_t)function_pointer);
cl_int __result = clRetainDeviceEXT((cl_device_id)(intptr_t)device);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_EXTDeviceFission_nclReleaseDeviceEXT(JNIEnv *env, jclass clazz, jlong device, jlong function_pointer) {
clReleaseDeviceEXTPROC clReleaseDeviceEXT = (clReleaseDeviceEXTPROC)((intptr_t)function_pointer);
cl_int __result = clReleaseDeviceEXT((cl_device_id)(intptr_t)device);
return __result;
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_EXTDeviceFission_nclCreateSubDevicesEXT(JNIEnv *env, jclass clazz, jlong in_device, jlong properties, jint num_entries, jlong out_devices, jlong num_devices, jlong function_pointer) {
const cl_device_partition_property_ext *properties_address = (const cl_device_partition_property_ext *)(intptr_t)properties;
cl_device_id *out_devices_address = (cl_device_id *)(intptr_t)out_devices;
cl_uint *num_devices_address = (cl_uint *)(intptr_t)num_devices;
clCreateSubDevicesEXTPROC clCreateSubDevicesEXT = (clCreateSubDevicesEXTPROC)((intptr_t)function_pointer);
cl_int __result = clCreateSubDevicesEXT((cl_device_id)(intptr_t)in_device, properties_address, num_entries, out_devices_address, num_devices_address);
return __result;
}

View File

@ -0,0 +1,16 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueMigrateMemObjectEXTPROC) (cl_command_queue command_queue, cl_uint num_mem_objects, const cl_mem * mem_objects, cl_mem_migration_flags_ext flags, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
JNIEXPORT jint JNICALL Java_org_lwjgl_opencl_EXTMigrateMemobject_nclEnqueueMigrateMemObjectEXT(JNIEnv *env, jclass clazz, jlong command_queue, jint num_mem_objects, jlong mem_objects, jlong flags, jint num_events_in_wait_list, jlong event_wait_list, jlong event, jlong function_pointer) {
const cl_mem *mem_objects_address = (const cl_mem *)(intptr_t)mem_objects;
const cl_event *event_wait_list_address = (const cl_event *)(intptr_t)event_wait_list;
cl_event *event_address = (cl_event *)(intptr_t)event;
clEnqueueMigrateMemObjectEXTPROC clEnqueueMigrateMemObjectEXT = (clEnqueueMigrateMemObjectEXTPROC)((intptr_t)function_pointer);
cl_int __result = clEnqueueMigrateMemObjectEXT((cl_command_queue)(intptr_t)command_queue, num_mem_objects, mem_objects_address, flags, num_events_in_wait_list, event_wait_list_address, event_address);
return __result;
}

View File

@ -0,0 +1,14 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extcl.h"
typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromGLsyncKHRPROC) (cl_context context, cl_GLsync sync, cl_int * errcode_ret);
JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_KHRGLEvent_nclCreateEventFromGLsyncKHR(JNIEnv *env, jclass clazz, jlong context, jlong sync, jlong errcode_ret, jlong function_pointer) {
cl_int *errcode_ret_address = (cl_int *)(intptr_t)errcode_ret;
clCreateEventFromGLsyncKHRPROC clCreateEventFromGLsyncKHR = (clCreateEventFromGLsyncKHRPROC)((intptr_t)function_pointer);
cl_event __result = clCreateEventFromGLsyncKHR((cl_context)(intptr_t)context, (cl_GLsync)(intptr_t)sync, errcode_ret_address);
return (intptr_t)__result;
}

Some files were not shown because too many files have changed in this diff Show More