From: <sp...@us...> - 2011-07-10 16:58:31
|
Revision: 3561 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3561&view=rev Author: spasi Date: 2011-07-10 16:58:16 +0000 (Sun, 10 Jul 2011) Log Message: ----------- Merged OpenGL ES branch. Modified Paths: -------------- trunk/LWJGL/build.xml trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/platform_build/build-generator.xml trunk/LWJGL/platform_build/linux_ant/build.xml trunk/LWJGL/platform_build/macosx_ant/build.xml trunk/LWJGL/platform_build/mingw_ant/build.xml trunk/LWJGL/platform_build/windows_ant/build.xml trunk/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java trunk/LWJGL/src/java/org/lwjgl/opencl/CallbackUtil.java trunk/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java trunk/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java trunk/LWJGL/src/java/org/lwjgl/opengl/CallbackUtil.java trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java trunk/LWJGL/src/java/org/lwjgl/opengl/PixelFormat.java trunk/LWJGL/src/java/org/lwjgl/opengl/SharedDrawable.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java trunk/LWJGL/src/java/org/lwjgl/util/generator/FieldsGenerator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java trunk/LWJGL/src/java/org/lwjgl/util/vector/Matrix4f.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_texture_lod_bias.java Added Paths: ----------- trunk/LWJGL/libs/linux/libEGL.so trunk/LWJGL/libs/linux/libGLESv2.so trunk/LWJGL/libs/linux/x64/ trunk/LWJGL/libs/linux/x64/libEGL.so trunk/LWJGL/libs/linux/x64/libGLESv2.so trunk/LWJGL/libs/windows/libEGL.dll trunk/LWJGL/libs/windows/libEGL.lib trunk/LWJGL/libs/windows/libGLESv2.dll trunk/LWJGL/platform_build/linux_ant/build_es.xml trunk/LWJGL/platform_build/windows_ant/build_es.xml trunk/LWJGL/src/java/org/lwjgl/opengl/Context.java trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGLES.java trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGLES.java trunk/LWJGL/src/java/org/lwjgl/opengl/NVPresentVideoUtil.java trunk/LWJGL/src/java/org/lwjgl/opengl/NVVideoCaptureUtil.java trunk/LWJGL/src/java/org/lwjgl/opengl/PixelFormatLWJGL.java trunk/LWJGL/src/java/org/lwjgl/opengles/ trunk/LWJGL/src/java/org/lwjgl/opengles/APIUtil.java trunk/LWJGL/src/java/org/lwjgl/opengles/ContextAttribs.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGL.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLConfig.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLContext.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLImageOES.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLKHRFenceSync.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLKHRReusableSync.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLNVSync.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLSurface.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLSyncKHR.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLSyncNV.java trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java trunk/LWJGL/src/java/org/lwjgl/opengles/GLContext.java trunk/LWJGL/src/java/org/lwjgl/opengles/PeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengles/PixelFormat.java trunk/LWJGL/src/java/org/lwjgl/opengles/PowerManagementEventException.java trunk/LWJGL/src/java/org/lwjgl/opengles/StateTracker.java trunk/LWJGL/src/java/org/lwjgl/opengles/Util.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/ trunk/LWJGL/src/java/org/lwjgl/test/opengles/FullScreenWindowedTest.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/Gears.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/MappedIndexedVBOTest.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/QuadRenderer.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObject.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObjectArray.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObjectElement.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/GLLight.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/GLMatrix.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/GLObject.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Geometry.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ImmediateModeBuffer.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Shader.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ShaderProgram.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Sphere.java trunk/LWJGL/src/java/org/lwjgl/util/generator/opengl/EGLint64NV.java trunk/LWJGL/src/java/org/lwjgl/util/generator/opengl/EGLuint64NV.java trunk/LWJGL/src/java/org/lwjgl/util/generator/opengl/GLESCapabilitiesGenerator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/opengl/GLESGeneratorProcessorFactory.java trunk/LWJGL/src/java/org/lwjgl/util/generator/opengl/GLESTypeMap.java trunk/LWJGL/src/native/common/EGL/ trunk/LWJGL/src/native/common/EGL/egl.h trunk/LWJGL/src/native/common/EGL/eglext.h trunk/LWJGL/src/native/common/EGL/eglplatform.h trunk/LWJGL/src/native/common/GLES2/ trunk/LWJGL/src/native/common/GLES2/gl2.h trunk/LWJGL/src/native/common/GLES2/gl2ext.h trunk/LWJGL/src/native/common/GLES2/gl2extimg.h trunk/LWJGL/src/native/common/GLES2/gl2platform.h trunk/LWJGL/src/native/common/KHR/ trunk/LWJGL/src/native/common/KHR/khrplatform.h trunk/LWJGL/src/native/common/opengl/ trunk/LWJGL/src/native/common/opengl/extgl.c trunk/LWJGL/src/native/common/opengl/extgl.h trunk/LWJGL/src/native/common/opengl/extgl_types.h trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_CallbackUtil.c trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_GLContext.c trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVPresentVideoUtil.c trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVVideoCaptureUtil.c trunk/LWJGL/src/native/common/opengles/ trunk/LWJGL/src/native/common/opengles/extgl.c trunk/LWJGL/src/native/common/opengles/extgl.h trunk/LWJGL/src/native/common/opengles/extgl_egl.c trunk/LWJGL/src/native/common/opengles/extgl_egl.h trunk/LWJGL/src/native/common/opengles/extgl_types.h trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGL.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRFenceSync.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRReusableSync.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLNVSync.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_GLContext.c trunk/LWJGL/src/native/linux/opengl/ trunk/LWJGL/src/native/linux/opengl/GLX.c trunk/LWJGL/src/native/linux/opengl/GLX.h trunk/LWJGL/src/native/linux/opengl/context.c trunk/LWJGL/src/native/linux/opengl/context.h trunk/LWJGL/src/native/linux/opengl/display.c trunk/LWJGL/src/native/linux/opengl/extgl_glx.c trunk/LWJGL/src/native/linux/opengl/extgl_glx.h trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxCanvasImplementation.c trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Pbuffer.c trunk/LWJGL/src/native/linux/opengles/ trunk/LWJGL/src/native/linux/opengles/context.c trunk/LWJGL/src/native/linux/opengles/context.h trunk/LWJGL/src/native/linux/opengles/display.c trunk/LWJGL/src/native/linux/opengles/extgl_glx.c trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/windows/opengl/ trunk/LWJGL/src/native/windows/opengl/WGL.c trunk/LWJGL/src/native/windows/opengl/WGL.h trunk/LWJGL/src/native/windows/opengl/context.c trunk/LWJGL/src/native/windows/opengl/context.h trunk/LWJGL/src/native/windows/opengl/extgl_wgl.c trunk/LWJGL/src/native/windows/opengl/extgl_wgl.h trunk/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_Pbuffer.c trunk/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_WindowsContextImplementation.c trunk/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_WindowsPeerInfo.c trunk/LWJGL/src/native/windows/opengles/ trunk/LWJGL/src/native/windows/opengles/context.c trunk/LWJGL/src/native/windows/opengles/context.h trunk/LWJGL/src/native/windows/opengles/extgl_wgl.c trunk/LWJGL/src/native/windows/opengles/org_lwjgl_opengl_WindowsPeerInfo.c trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_multi_draw_indirect.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_present_video.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_video_capture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ trunk/LWJGL/src/templates/org/lwjgl/opengles/AMD_compressed_3DC_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/AMD_compressed_ATC_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/AMD_performance_monitor.java trunk/LWJGL/src/templates/org/lwjgl/opengles/AMD_program_binary_Z400.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ANGLE_framebuffer_blit.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ANGLE_framebuffer_multisample.java trunk/LWJGL/src/templates/org/lwjgl/opengles/APPLE_framebuffer_multisample.java trunk/LWJGL/src/templates/org/lwjgl/opengles/APPLE_rgb_422.java trunk/LWJGL/src/templates/org/lwjgl/opengles/APPLE_texture_format_BGRA8888.java trunk/LWJGL/src/templates/org/lwjgl/opengles/APPLE_texture_max_level.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARB_draw_buffers.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARB_half_float_pixel.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARB_texture_rectangle.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARM_mali_shader_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARM_rgba8.java trunk/LWJGL/src/templates/org/lwjgl/opengles/DMP_shader_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_Cg_shader.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_bgra.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_blend_minmax.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_discard_framebuffer.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_frag_depth.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_multi_draw_arrays.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_packed_float.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_read_format_bgra.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_shader_texture_lod.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_array.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_dxt1.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_latc.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_s3tc.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_filter_anisotropic.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_format_BGRA8888.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_lod_bias.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_type_2_10_10_10_REV.java trunk/LWJGL/src/templates/org/lwjgl/opengles/GLES20.java trunk/LWJGL/src/templates/org/lwjgl/opengles/IMG_multisamples_render_to_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/IMG_program_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/IMG_shader_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/IMG_texture_compression_pvrtc.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_coverage_sample.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_depth_nonlinear.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_draw_path.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_fbo_color_attachments.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_fence.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_framebuffer_vertex_attrib_array.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_get_tex_image.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_read_buffer.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_shader_framebuffer_fetch.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_system_time.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_image.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_image_external.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_sync.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_equation_separate.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_func_separate.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_subtract.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_compressed_ETC1_RGB8_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_compressed_paletted_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_depth24.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_depth32.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_depth_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_element_index_uint.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_fbo_render_mipmap.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_framebuffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_get_program_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_mapbuffer.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_packed_depth_stencil.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_rgb8_rgba8.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_standard_derivatives.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil1.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil4.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil8.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_3D.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_float.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_float_linear.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_half_float.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_half_float_linear.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_npot.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_array_object.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_half_float.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_type_10_10_10_2.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_driver_control.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_extended_get.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_extended_get2.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_performance_monitor_global_mode.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_tiled_rendering.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_writeonly_rendering.java trunk/LWJGL/src/templates/org/lwjgl/opengles/VIV_shader_binary.java Removed Paths: ------------- trunk/LWJGL/libs/linux/x64/libEGL.so trunk/LWJGL/libs/linux/x64/libGLESv2.so trunk/LWJGL/src/java/org/lwjgl/opengl/AbstractDrawable.java trunk/LWJGL/src/java/org/lwjgl/opengl/Context.java trunk/LWJGL/src/java/org/lwjgl/opengles/APIUtil.java trunk/LWJGL/src/java/org/lwjgl/opengles/ContextAttribs.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGL.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLConfig.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLContext.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLImageOES.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLKHRFenceSync.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLKHRReusableSync.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLNVSync.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLSurface.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLSyncKHR.java trunk/LWJGL/src/java/org/lwjgl/opengles/EGLSyncNV.java trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java trunk/LWJGL/src/java/org/lwjgl/opengles/GLContext.java trunk/LWJGL/src/java/org/lwjgl/opengles/PeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengles/PixelFormat.java trunk/LWJGL/src/java/org/lwjgl/opengles/PowerManagementEventException.java trunk/LWJGL/src/java/org/lwjgl/opengles/StateTracker.java trunk/LWJGL/src/java/org/lwjgl/opengles/Util.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/FullScreenWindowedTest.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/Gears.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/MappedIndexedVBOTest.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/QuadRenderer.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObject.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObjectArray.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObjectElement.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/GLLight.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/GLMatrix.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/GLObject.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Geometry.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ImmediateModeBuffer.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Shader.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/ShaderProgram.java trunk/LWJGL/src/java/org/lwjgl/test/opengles/util/Sphere.java trunk/LWJGL/src/native/common/EGL/egl.h trunk/LWJGL/src/native/common/EGL/eglext.h trunk/LWJGL/src/native/common/EGL/eglplatform.h trunk/LWJGL/src/native/common/GLES2/gl2.h trunk/LWJGL/src/native/common/GLES2/gl2ext.h trunk/LWJGL/src/native/common/GLES2/gl2extimg.h trunk/LWJGL/src/native/common/GLES2/gl2platform.h trunk/LWJGL/src/native/common/KHR/khrplatform.h trunk/LWJGL/src/native/common/extgl.c trunk/LWJGL/src/native/common/extgl.h trunk/LWJGL/src/native/common/extgl_types.h trunk/LWJGL/src/native/common/opengl/extgl.c trunk/LWJGL/src/native/common/opengl/extgl.h trunk/LWJGL/src/native/common/opengl/extgl_types.h trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_CallbackUtil.c trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_GLContext.c trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVPresentVideoUtil.c trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVVideoCaptureUtil.c trunk/LWJGL/src/native/common/opengles/extgl.c trunk/LWJGL/src/native/common/opengles/extgl.h trunk/LWJGL/src/native/common/opengles/extgl_egl.c trunk/LWJGL/src/native/common/opengles/extgl_egl.h trunk/LWJGL/src/native/common/opengles/extgl_types.h trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGL.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRFenceSync.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRReusableSync.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLNVSync.c trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_GLContext.c trunk/LWJGL/src/native/common/org_lwjgl_opengl_CallbackUtil.c trunk/LWJGL/src/native/common/org_lwjgl_opengl_GLContext.c trunk/LWJGL/src/native/linux/context.c trunk/LWJGL/src/native/linux/context.h trunk/LWJGL/src/native/linux/display.c trunk/LWJGL/src/native/linux/extgl_glx.c trunk/LWJGL/src/native/linux/extgl_glx.h trunk/LWJGL/src/native/linux/opengl/GLX.c trunk/LWJGL/src/native/linux/opengl/GLX.h trunk/LWJGL/src/native/linux/opengl/context.c trunk/LWJGL/src/native/linux/opengl/context.h trunk/LWJGL/src/native/linux/opengl/display.c trunk/LWJGL/src/native/linux/opengl/extgl_glx.c trunk/LWJGL/src/native/linux/opengl/extgl_glx.h trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxCanvasImplementation.c trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Pbuffer.c trunk/LWJGL/src/native/linux/opengles/context.c trunk/LWJGL/src/native/linux/opengles/context.h trunk/LWJGL/src/native/linux/opengles/display.c trunk/LWJGL/src/native/linux/opengles/extgl_glx.c trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c trunk/LWJGL/src/native/windows/context.c trunk/LWJGL/src/native/windows/context.h trunk/LWJGL/src/native/windows/extgl_wgl.c trunk/LWJGL/src/native/windows/extgl_wgl.h trunk/LWJGL/src/native/windows/opengl/WGL.c trunk/LWJGL/src/native/windows/opengl/WGL.h trunk/LWJGL/src/native/windows/opengl/context.c trunk/LWJGL/src/native/windows/opengl/context.h trunk/LWJGL/src/native/windows/opengl/extgl_wgl.c trunk/LWJGL/src/native/windows/opengl/extgl_wgl.h trunk/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_Pbuffer.c trunk/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_WindowsContextImplementation.c trunk/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_WindowsPeerInfo.c trunk/LWJGL/src/native/windows/opengles/context.c trunk/LWJGL/src/native/windows/opengles/context.h trunk/LWJGL/src/native/windows/opengles/extgl_wgl.c trunk/LWJGL/src/native/windows/opengles/org_lwjgl_opengl_WindowsPeerInfo.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c trunk/LWJGL/src/templates/org/lwjgl/opengles/AMD_compressed_3DC_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/AMD_compressed_ATC_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/AMD_performance_monitor.java trunk/LWJGL/src/templates/org/lwjgl/opengles/AMD_program_binary_Z400.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ANGLE_framebuffer_blit.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ANGLE_framebuffer_multisample.java trunk/LWJGL/src/templates/org/lwjgl/opengles/APPLE_framebuffer_multisample.java trunk/LWJGL/src/templates/org/lwjgl/opengles/APPLE_rgb_422.java trunk/LWJGL/src/templates/org/lwjgl/opengles/APPLE_texture_format_BGRA8888.java trunk/LWJGL/src/templates/org/lwjgl/opengles/APPLE_texture_max_level.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARB_draw_buffers.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARB_half_float_pixel.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARB_texture_rectangle.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARM_mali_shader_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/ARM_rgba8.java trunk/LWJGL/src/templates/org/lwjgl/opengles/DMP_shader_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_Cg_shader.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_bgra.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_blend_minmax.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_discard_framebuffer.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_frag_depth.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_multi_draw_arrays.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_packed_float.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_read_format_bgra.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_shader_texture_lod.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_array.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_dxt1.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_latc.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_s3tc.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_filter_anisotropic.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_format_BGRA8888.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_lod_bias.java trunk/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_type_2_10_10_10_REV.java trunk/LWJGL/src/templates/org/lwjgl/opengles/GLES20.java trunk/LWJGL/src/templates/org/lwjgl/opengles/IMG_multisamples_render_to_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/IMG_program_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/IMG_shader_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/IMG_texture_compression_pvrtc.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_coverage_sample.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_depth_nonlinear.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_draw_path.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_fbo_color_attachments.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_fence.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_framebuffer_vertex_attrib_array.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_get_tex_image.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_read_buffer.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_shader_framebuffer_fetch.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_system_time.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_image.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_image_external.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_sync.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_equation_separate.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_func_separate.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_subtract.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_compressed_ETC1_RGB8_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_compressed_paletted_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_depth24.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_depth32.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_depth_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_element_index_uint.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_fbo_render_mipmap.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_framebuffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_get_program_binary.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_mapbuffer.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_packed_depth_stencil.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_rgb8_rgba8.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_standard_derivatives.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil1.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil4.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil8.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_3D.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_float.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_float_linear.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_half_float.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_half_float_linear.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_npot.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_array_object.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_half_float.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_type_10_10_10_2.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_driver_control.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_extended_get.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_extended_get2.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_performance_monitor_global_mode.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_tiled_rendering.java trunk/LWJGL/src/templates/org/lwjgl/opengles/QCOM_writeonly_rendering.java trunk/LWJGL/src/templates/org/lwjgl/opengles/VIV_shader_binary.java Property Changed: ---------------- trunk/LWJGL/ trunk/LWJGL/libs/ trunk/LWJGL/libs/windows/ trunk/LWJGL/src/native/common/ trunk/LWJGL/src/native/linux/ Property changes on: trunk/LWJGL ___________________________________________________________________ Modified: svn:ignore - .classpath *.class *.class~ *.java~ .nbattrs .project dist libs temp + *.class *.class~ *.java~ .classpath .nbattrs .project bin dist libs temp Added: svn:mergeinfo + /branches/opengles/LWJGL:3533-3560 Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2011-07-10 10:26:36 UTC (rev 3560) +++ trunk/LWJGL/build.xml 2011-07-10 16:58:16 UTC (rev 3561) @@ -9,16 +9,17 @@ <import file="platform_build/build-maven.xml"/> <!-- ================================================================== --> - <!-- Everything below this line is targets. --> - <!-- Do not modify, unless you know what you're doing --> + <!-- Everything below this line is targets. --> + <!-- Do not modify, unless you know what you're doing --> <!-- ================================================================== --> <!-- ================================================================== --> - <!-- Initialize build --> + <!-- Initialize build --> <!-- ================================================================== --> <target name="-initialize"> <mkdir dir="${lwjgl.bin}" taskname="initialiazing bin folder" /> <mkdir dir="${lwjgl.bin}/lwjgl" taskname="initialiazing native bin folder" /> + <mkdir dir="${lwjgl.bin}/lwjgles" taskname="initialiazing native OpenGL ES bin folder"/> <mkdir dir="${lwjgl.lib}" taskname="initialiazing lib folder" /> <mkdir dir="${lwjgl.dist}" taskname="initialiazing dist folder" /> <mkdir dir="${lwjgl.docs}/javadoc" taskname="initialiazing docs folder" /> @@ -48,6 +49,7 @@ <!-- Useful when we need to force native recompilation --> <target name="clean-native" description="Cleans native files generated by this ant script" depends="clean-generated-native"> <delete dir="${lwjgl.bin}/lwjgl" quiet="true" failonerror="false" taskname="cleaning native bin folder" /> + <delete dir="${lwjgl.bin}/lwjgles" quiet="true" failonerror="false" taskname="cleaning native OpenGL ES bin folder"/> </target> <!-- Creates a distribution of LWJGL --> @@ -111,6 +113,12 @@ <antcall target="-jars_NoDEP" /> </target> + <!-- Create ONLY the jar archives for the ES build --> + <target name="jars_es" description="Creates the Java archives ONLY for the ES build and places them in libs/" + depends="-initialize, generate-all, compile, -createjars_es"> + <antcall target="-jars_NoDEP"/> + </target> + <target name="-jars_NoDEP"> <move todir="libs/"> <fileset dir="${lwjgl.temp}/jar"> @@ -161,6 +169,22 @@ </jar> </target> + <!-- Packages the java files for the ES build --> + <target name="-createjars_es"> + <!-- Create lwjgl.jar --> + <jar destfile="${lwjgl.temp}/jar/lwjgl.jar" taskname="lwjgl.jar"> + <fileset refid="lwjgl_es.fileset"/> + <manifest> + <attribute name="Sealed" value="true"/> + </manifest> + </jar> + + <!-- Create lwjgl_test.jar --> + <jar destfile="${lwjgl.temp}/jar/lwjgl_test.jar" taskname="lwjgl_test.jar"> + <fileset refid="lwjgl_test_es.fileset"/> + </jar> + </target> + <!-- Distributes files --> <target name="-distribute"> <delete> @@ -227,25 +251,35 @@ <class name="org.lwjgl.opengl.LinuxKeyboard" /> <class name="org.lwjgl.opengl.LinuxDisplay" /> <class name="org.lwjgl.opengl.LinuxPeerInfo" /> - <class name="org.lwjgl.opengl.LinuxPbufferPeerInfo" /> - <class name="org.lwjgl.opengl.LinuxDisplayPeerInfo" /> - <class name="org.lwjgl.opengl.LinuxAWTGLCanvasPeerInfo" /> - <class name="org.lwjgl.opengl.LinuxContextImplementation" /> - <class name="org.lwjgl.opengl.LinuxCanvasImplementation" /> </javah> + <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux/opengl" force="yes"> + <class name="org.lwjgl.opengl.LinuxPbufferPeerInfo"/> + <class name="org.lwjgl.opengl.LinuxDisplayPeerInfo"/> + <class name="org.lwjgl.opengl.LinuxAWTGLCanvasPeerInfo"/> + <class name="org.lwjgl.opengl.LinuxContextImplementation"/> + <class name="org.lwjgl.opengl.LinuxCanvasImplementation"/> + </javah> + <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows" force="yes"> + <class name="org.lwjgl.WindowsSysImplementation"/> <class name="org.lwjgl.opengl.WindowsKeyboard" /> - <class name="org.lwjgl.opengl.WindowsPbufferPeerInfo" /> - <class name="org.lwjgl.opengl.WindowsDisplay" /> <class name="org.lwjgl.opengl.WindowsRegistry" /> - <class name="org.lwjgl.WindowsSysImplementation" /> - <class name="org.lwjgl.opengl.WindowsAWTGLCanvasPeerInfo" /> - <class name="org.lwjgl.opengl.WindowsPeerInfo" /> - <class name="org.lwjgl.opengl.WindowsDisplayPeerInfo" /> - <class name="org.lwjgl.opengl.WindowsContextImplementation" /> + <class name="org.lwjgl.opengl.WindowsDisplay"/> + <class name="org.lwjgl.opengl.WindowsDisplayPeerInfo"/> + <class name="org.lwjgl.opengl.WindowsAWTGLCanvasPeerInfo"/> </javah> + <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows/opengl" force="yes"> + <class name="org.lwjgl.opengl.WindowsPbufferPeerInfo"/> + <class name="org.lwjgl.opengl.WindowsPeerInfo"/> + <class name="org.lwjgl.opengl.WindowsContextImplementation"/> + </javah> + + <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows/opengles" force="yes"> + <class name="org.lwjgl.opengl.WindowsPeerInfo"/> + </javah> + <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes"> <class name="org.lwjgl.MacOSXSysImplementation" /> <class name="org.lwjgl.opengl.MacOSXMouseEventQueue" /> @@ -263,13 +297,26 @@ <class name="org.lwjgl.input.Keyboard" /> <class name="org.lwjgl.input.Mouse" /> <class name="org.lwjgl.openal.AL" /> - <class name="org.lwjgl.opengl.GLContext" /> - <class name="org.lwjgl.opengl.Pbuffer" /> - <class name="org.lwjgl.opengl.CallbackUtil" /> - <class name="org.lwjgl.opencl.CL" /> + <class name="org.lwjgl.opencl.CL" /> <class name="org.lwjgl.opencl.CallbackUtil" /> - <class name="org.lwjgl.BufferUtils" /> + <class name="org.lwjgl.BufferUtils" /> </javah> + + <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}/opengl" force="yes"> + <class name="org.lwjgl.opengl.GLContext"/> + <class name="org.lwjgl.opengl.Pbuffer"/> + <class name="org.lwjgl.opengl.CallbackUtil"/> + <class name="org.lwjgl.opengl.NVPresentVideoUtil"/> + <class name="org.lwjgl.opengl.NVVideoCaptureUtil"/> + </javah> + + <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}/opengles" force="yes"> + <class name="org.lwjgl.opengles.EGL"/> + <class name="org.lwjgl.opengles.EGLKHRFenceSync"/> + <class name="org.lwjgl.opengles.EGLKHRReusableSync"/> + <class name="org.lwjgl.opengles.EGLNVSync"/> + <class name="org.lwjgl.opengles.GLContext"/> + </javah> </target> <target name="touch-version"> @@ -364,6 +411,7 @@ <include name="org/lwjgl/*.java"/> <include name="org/lwjgl/input/**"/> <include name="org/lwjgl/opengl/**"/> + <include name="org/lwjgl/opengles/**"/> <include name="org/lwjgl/openal/**"/> <include name="org/lwjgl/opencl/**"/> <include name="org/lwjgl/util/**"/> @@ -430,6 +478,34 @@ <version-check platform="macosx"/> </target> + <target name="compile_native_es" depends="-initialize, headers, touch-version, version-mismatch" description="Compiles the native files"> + <condition property="lwjgl.platform.windows"> + <os family="windows"/> + </condition> + <antcall target="-compile_native_win32_es"/> + + <condition property="lwjgl.platform.linux"> + <os name="Linux"/> + </condition> + <antcall target="-compile_native_linux_es"/> + </target> + + <!-- Compiles LWJGL ES on Win32 platforms --> + <target name="-compile_native_win32_es" if="lwjgl.platform.windows"> + <ant antfile="platform_build/windows_ant/build_es.xml" inheritAll="false"/> + <copy todir="${lwjgl.lib}/windows"> + <fileset dir="${lwjgl.bin}/lwjgles" includes="lwjgl*.dll"/> + </copy> + </target> + + <!-- Compiles LWJGL ES on Linux platforms --> + <target name="-compile_native_linux_es" if="lwjgl.platform.linux"> + <ant antfile="platform_build/linux_ant/build_es.xml" inheritAll="false"/> + <copy todir="${lwjgl.lib}/linux"> + <fileset dir="${lwjgl.bin}/lwjgles" includes="liblwjgl*.so"/> + </copy> + </target> + <target name="repack200" description="Pack200-repack a jar file"> <pack200 src="${input}" destfile="${output}" repack="true"/> </target> Property changes on: trunk/LWJGL/libs ___________________________________________________________________ Added: svn:ignore + lwjgl-debug.jar lwjgl.jar lwjgl_test.jar lwjgl_util.jar lwjgl_util_applet.jar Copied: trunk/LWJGL/libs/linux/libEGL.so (from rev 3560, branches/opengles/LWJGL/libs/linux/libEGL.so) =================================================================== (Binary files differ) Copied: trunk/LWJGL/libs/linux/libGLESv2.so (from rev 3560, branches/opengles/LWJGL/libs/linux/libGLESv2.so) =================================================================== (Binary files differ) Deleted: trunk/LWJGL/libs/linux/x64/libEGL.so =================================================================== (Binary files differ) Copied: trunk/LWJGL/libs/linux/x64/libEGL.so (from rev 3560, branches/opengles/LWJGL/libs/linux/x64/libEGL.so) =================================================================== (Binary files differ) Deleted: trunk/LWJGL/libs/linux/x64/libGLESv2.so =================================================================== (Binary files differ) Copied: trunk/LWJGL/libs/linux/x64/libGLESv2.so (from rev 3560, branches/opengles/LWJGL/libs/linux/x64/libGLESv2.so) =================================================================== (Binary files differ) Property changes on: trunk/LWJGL/libs/windows ___________________________________________________________________ Added: svn:ignore + lwjgl.dll Copied: trunk/LWJGL/libs/windows/libEGL.dll (from rev 3560, branches/opengles/LWJGL/libs/windows/libEGL.dll) =================================================================== (Binary files differ) Copied: trunk/LWJGL/libs/windows/libEGL.lib (from rev 3560, branches/opengles/LWJGL/libs/windows/libEGL.lib) =================================================================== (Binary files differ) Copied: trunk/LWJGL/libs/windows/libGLESv2.dll (from rev 3560, branches/opengles/LWJGL/libs/windows/libGLESv2.dll) =================================================================== (Binary files differ) Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2011-07-10 10:26:36 UTC (rev 3560) +++ trunk/LWJGL/platform_build/build-definitions.xml 2011-07-10 16:58:16 UTC (rev 3561) @@ -16,6 +16,7 @@ <property name="lwjgl.web" location="www" /> <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> + <property name="opengles-template-pattern" value="org/lwjgl/opengles/GLES*.java,org/lwjgl/opengles/ARB*.java,org/lwjgl/opengles/EXT*.java,org/lwjgl/opengles/AMD*.java,org/lwjgl/opengles/ANGLE*.java,org/lwjgl/opengles/APPLE*.java,org/lwjgl/opengles/ARM*.java,org/lwjgl/opengles/DMP*.java,org/lwjgl/opengles/IMG*.java,org/lwjgl/opengles/NV*.java,org/lwjgl/opengles/OES*.java,org/lwjgl/opengles/QCOM*.java,org/lwjgl/opengles/VIV*.java"/> <property name="opencl-template-pattern-extensions" value="org/lwjgl/opencl/KHR*.java,org/lwjgl/opencl/EXT*.java,org/lwjgl/opencl/APPLE*.java,org/lwjgl/opencl/AMD*.java,org/lwjgl/opencl/NV*.java"/> <property name="opencl-template-pattern" value="org/lwjgl/opencl/CL*.java,${opencl-template-pattern-extensions}"/> @@ -27,13 +28,25 @@ <fileset id="lwjgl.fileset" dir="${lwjgl.bin}"> <patternset id="lwjgl.package.pattern"> <include name="org/**/*" /> + <exclude name="org/lwjgl/opengles/**"/> <exclude name="org/lwjgl/d3d/**" /> <exclude name="org/lwjgl/test/**" /> <exclude name="org/lwjgl/util/**" /> <exclude name="org/lwjgl/examples/**" /> </patternset> </fileset> - + + <!-- Files to include in the lwjgl.jar file, for the ES build --> + <fileset id="lwjgl_es.fileset" dir="${lwjgl.bin}"> + <patternset id="lwjgl_es.package.pattern"> + <include name="org/**/*"/> + <exclude name="org/lwjgl/d3d/**"/> + <exclude name="org/lwjgl/test/**"/> + <exclude name="org/lwjgl/util/**"/> + <exclude name="org/lwjgl/examples/**"/> + </patternset> + </fileset> + <!-- Files to include in the lwjgl_util_applet.jar file --> <fileset id="lwjgl_util_applet.fileset" dir="${lwjgl.bin}"> <patternset id="lwjgl_util_applet.package.pattern"> @@ -46,6 +59,7 @@ <fileset id="lwjgl_test.fileset" dir="${lwjgl.bin}"> <exclude name="**.*" /> <include name="org/lwjgl/test/**" /> + <exclude name="org/lwjgl/test/opengles/**"/> <include name="org/lwjgl/examples/**" /> </fileset> @@ -59,6 +73,14 @@ <include name="org/lwjgl/test/opencl/gl/*.cl" /> </fileset> + <!-- Files to include in the lwjgl_test.jar file for the ES build --> + <fileset id="lwjgl_test_es.fileset" dir="${lwjgl.bin}"> + <exclude name="**.*"/> + <include name="org/lwjgl/test/**"/> + <exclude name="org/lwjgl/test/opengl/**"/> + <exclude name="org/lwjgl/test/*.*"/> + </fileset> + <!-- Files to include in the lwjgl_util.jar file --> <fileset id="lwjgl_util.fileset" dir="${lwjgl.bin}"> <patternset id="lwjgl_util.package.pattern"> @@ -68,8 +90,8 @@ <include name="org/lwjgl/util/**" /> </patternset> </fileset> - + <!-- Files to include in the lwjgl_applet.jar file --> <fileset id="lwjgl_applet.fileset" dir="${lwjgl.bin}"> <exclude name="**.*"/> @@ -116,7 +138,7 @@ <include name="liblwjgl*.so" /> <include name="libopenal*.so" /> </patternset> - <patternset id="lwjgl-linux-jinput.fileset"> + <patternset id="lwjgl-linux-jinput.fileset"> <include name="libjinput-linux.so" /> <include name="libjinput-linux64.so" /> </patternset> Modified: trunk/LWJGL/platform_build/build-generator.xml =================================================================== --- trunk/LWJGL/platform_build/build-generator.xml 2011-07-10 10:26:36 UTC (rev 3560) +++ trunk/LWJGL/platform_build/build-generator.xml 2011-07-10 16:58:16 UTC (rev 3561) @@ -18,6 +18,7 @@ <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/util/generator/**.java" source="1.5" target="1.5" taskname="generator"> <include name="org/lwjgl/util/generator/openal/**.java"/> <include name="org/lwjgl/util/generator/opengl/**.java"/> + <include name="org/lwjgl/util/generator/opengles/**.java"/> <include name="org/lwjgl/util/generator/opencl/**.java"/> <compilerarg value="-Xlint:all"/> </javac> @@ -29,6 +30,8 @@ <include name="org/lwjgl/opengl/GLSync.java"/> <include name="org/lwjgl/opengl/AMDDebugOutputCallback.java"/> <include name="org/lwjgl/opengl/ARBDebugOutputCallback.java"/> + <!-- OpenGL ES --> + <include name="org/lwjgl/opengles/EGLImageOES.java"/> <!-- OpenCL --> <include name="org/lwjgl/opencl/CLPlatform.java"/> <include name="org/lwjgl/opencl/CLDevice.java"/> @@ -45,10 +48,16 @@ </target> <!-- Proxy target to generate it all --> - <target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities, generate-opengl-references, generate-opencl, generate-opencl-capabilities" description="Generates java and native source"/> + <target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities, generate-opengl-references, generate-opengles, generate-opengles-capabilities, generate-opencl, generate-opencl-capabilities" description="Generates java and native source"/> <target name="generate-debug" depends="generate-openal-debug, generate-opengl-debug, generate-opengl-capabilities-debug, generate-opengl-references, generate-opencl-debug, generate-opencl-capabilities-debug" description="Generates java and native source with debug functionality"/> + <!-- ******************************************************************************** + ********************************************************************************* + OPENAL + ********************************************************************************* + **************************************************************************** --> + <!-- Generate OpenAL --> <target name="generate-openal" depends="generators" description="Generates java and native source for AL"> <apply executable="apt" parallel="true"> @@ -60,7 +69,7 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> - <arg path="${lwjgl.src.native}/generated"/> + <arg path="${lwjgl.src.native}/generated/openal"/> <arg value="-Atypemap=org.lwjgl.util.generator.openal.ALTypeMap"/> <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java, org/lwjgl/openal/EFX10.java"/> </apply> @@ -77,13 +86,19 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> - <arg path="${lwjgl.src.native}/generated"/> + <arg path="${lwjgl.src.native}/generated/openal"/> <arg value="-Atypemap=org.lwjgl.util.generator.openal.ALTypeMap"/> <arg value="-Ageneratechecks"/> <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java, org/lwjgl/openal/EFX10.java"/> </apply> </target> + <!-- ******************************************************************************** + ********************************************************************************* + OPENGL + ********************************************************************************* + **************************************************************************** --> + <!-- Generate OpenGL --> <target name="generate-opengl" depends="generators" description="Generates java and native source for GL"> <apply executable="apt" parallel="true"> @@ -95,7 +110,7 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> - <arg path="${lwjgl.src.native}/generated"/> + <arg path="${lwjgl.src.native}/generated/opengl"/> <arg value="-Acontextspecific"/> <arg value="-Atypemap=org.lwjgl.util.generator.opengl.GLTypeMap"/> <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/> @@ -103,7 +118,7 @@ </target> <!-- Generate OpenGL [DEBUG] --> - <target name="generate-opengl-debug" depends="generators" description="Generates java and native source for GL"> + <target name="generate-opengl-debug" depends="generators" description="Generates debug java and native source for GL"> <apply executable="apt" parallel="true"> <arg value="-nocompile"/> <arg value="-factory"/> @@ -113,7 +128,7 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> - <arg path="${lwjgl.src.native}/generated"/> + <arg path="${lwjgl.src.native}/generated/opengl"/> <arg value="-Ageneratechecks"/> <arg value="-Acontextspecific"/> <arg value="-Atypemap=org.lwjgl.util.generator.opengl.GLTypeMap"/> @@ -151,7 +166,7 @@ </target> <!-- Generate OpenGL context capabilities [DEBUG] --> - <target name="generate-opengl-capabilities-debug" depends="generators" description="Generates java and native source for GL"> + <target name="generate-opengl-capabilities-debug" depends="generators" description="Generates debug java and native source for GL"> <apply executable="apt" parallel="true"> <arg value="-nocompile"/> <arg value="-factory"/> @@ -166,7 +181,87 @@ </apply> </target> - <!-- Generate OpenCL --> + <!-- ******************************************************************************** + ********************************************************************************* + OPENGL ES + ********************************************************************************* + **************************************************************************** --> + + <!-- Generate OpenGL ES --> + <target name="generate-opengles" depends="generators" description="Generates java and native source for GL ES"> + <apply executable="apt" parallel="true"> + <arg value="-nocompile"/> + <arg value="-factory"/> + <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> + <arg value="-cp"/> + <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/> + <arg value="-s"/> + <arg path="${lwjgl.src}/generated"/> + <arg value="-d"/> + <arg path="${lwjgl.src.native}/generated/opengles"/> + <!--<arg value="-Acontextspecific"/>--> + <arg value="-Atypemap=org.lwjgl.util.generator.opengl.GLESTypeMap"/> + <fileset dir="${lwjgl.src.templates}" includes="${opengles-template-pattern}"/> + </apply> + </target> + + <!-- Generate OpenGL ES [DEBUG] --> + <target name="generate-opengles-debug" depends="generators" description="Generates debug java and native source for GL ES"> + <apply executable="apt" parallel="true"> + <arg value="-nocompile"/> + <arg value="-factory"/> + <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> + <arg value="-cp"/> + <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/> + <arg value="-s"/> + <arg path="${lwjgl.src}/generated"/> + <arg value="-d"/> + <arg path="${lwjgl.src.native}/generated/opengles"/> + <arg value="-Ageneratechecks"/> + <!--<arg value="-Acontextspecific"/>--> + <arg value="-Atypemap=org.lwjgl.util.generator.opengl.GLESTypeMap"/> + <fileset dir="${lwjgl.src.templates}" includes="${opengles-template-pattern}"/> + </apply> + </target> + + <!-- Generate OpenGL ES context capabilities --> + <target name="generate-opengles-capabilities" depends="generators" description="Generates java and native source for GL ES"> + <apply executable="apt" parallel="true"> + <arg value="-nocompile"/> + <arg value="-factory"/> + <arg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessorFactory"/> + <arg value="-cp"/> + <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/> + <arg value="-s"/> + <arg path="${lwjgl.src}/generated"/> + <!--<arg value="-Acontextspecific"/>--> + <fileset dir="${lwjgl.src.templates}" includes="${opengles-template-pattern}"/> + </apply> + </target> + + <!-- Generate OpenGL ES context capabilities [DEBUG] --> + <target name="generate-opengles-capabilities-debug" depends="generators" description="Generates debug java and native source for GL ES"> + <apply executable="apt" parallel="true"> + <arg value="-nocompile"/> + <arg value="-factory"/> + <arg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessorFactory"/> + <arg value="-cp"/> + <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/> + <arg value="-s"/> + <arg path="${lwjgl.src}/generated"/> + <arg value="-Ageneratechecks"/> + <!--<arg value="-Acontextspecific"/>--> + <fileset dir="${lwjgl.src.templates}" includes="${opengles-template-pattern}"/> + </apply> + </target> + + <!-- ******************************************************************************** + ********************************************************************************* + OPENCL + ********************************************************************************* + **************************************************************************** --> + + <!-- Generate OpenCL --> <target name="generate-opencl" depends="generators" description="Generates java and native source for CL"> <apply executable="apt" parallel="true"> <arg value="-nocompile"/> @@ -177,7 +272,7 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> - <arg path="${lwjgl.src.native}/generated"/> + <arg path="${lwjgl.src.native}/generated/opencl"/> <arg value="-Acontextspecific"/> <arg value="-Atypemap=org.lwjgl.util.generator.opencl.CLTypeMap"/> <fileset dir="${lwjgl.src.templates}" includes="${opencl-template-pattern}"/> @@ -185,7 +280,7 @@ </target> <!-- Generate OpenCL [DEBUG] --> - <target name="generate-opencl-debug" depends="generators" description="Generates java and native source for CL"> + <target name="generate-opencl-debug" depends="generators" description="Generates debug java and native source for CL"> <apply executable="apt" parallel="true"> <arg value="-nocompile"/> <arg value="-factory"/> @@ -195,7 +290,7 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> - <arg path="${lwjgl.src.native}/generated"/> + <arg path="${lwjgl.src.native}/generated/opencl"/> <arg value="-Ageneratechecks"/> <arg value="-Acontextspecific"/> <arg value="-Atypemap=org.lwjgl.util.generator.opencl.CLTypeMap"/> @@ -219,7 +314,7 @@ </target> <!-- Generate OpenCL capabilities [DEBUG] --> - <target name="generate-opencl-capabilities-debug" depends="generators" description="Generates capabilities for CL"> + <target name="generate-opencl-capabilities-debug" depends="generators" description="Generates debug capabilities for CL"> <apply executable="apt" parallel="true"> <arg value="-nocompile"/> <arg value="-factory"/> Modified: trunk/LWJGL/platform_build/linux_ant/build.xml =================================================================== --- trunk/LWJGL/platform_build/linux_ant/build.xml 2011-07-10 10:26:36 UTC (rev 3560) +++ trunk/LWJGL/platform_build/linux_ant/build.xml 2011-07-10 16:58:16 UTC (rev 3561) @@ -73,12 +73,18 @@ <arg value="-I${java.home}/../include/linux"/> <arg value="-I${java.home}/../include/solaris"/> <arg value="-I${native}/common"/> + <arg value="-I${native}/common/opengl"/> <arg value="-I${native}/linux"/> + <arg value="-I${native}/linux/opengl"/> <mapper type="glob" from="*.c" to="*.o"/> - <fileset dir="${native}/linux" includes="*.c"/> - <fileset dir="${native}/generated" includes="*.c"/> - <fileset dir="${native}/common" includes="*.c"/> - </apply> + <fileset dir="${native}/common" includes="*.c"/> + <fileset dir="${native}/common/opengl" includes="*.c"/> + <fileset dir="${native}/generated/openal" includes="*.c"/> + <fileset dir="${native}/generated/opencl" includes="*.c"/> + <fileset dir="${native}/generated/opengl" includes="*.c"/> + <fileset dir="${native}/linux" includes="*.c"/> + <fileset dir="${native}/linux/opengl" includes="*.c"/> + </apply> <apply dir="." parallel="true" executable="gcc" failonerror="true"> <srcfile/> <arg line="${linker_flags32}"/> @@ -99,12 +105,16 @@ <arg value="-I${java.home}/../include/linux"/> <arg value="-I${java.home}/../include/solaris"/> <arg value="-I${native}/common"/> + <arg value="-I${native}/common/opengl"/> <arg value="-I${native}/linux"/> + <arg value="-I${native}/linux/opengl"/> <mapper type="glob" from="*.c" to="*.o"/> - <fileset dir="${native}/linux" includes="*.c"/> - <fileset dir="${native}/generated" includes="*.c"/> - <fileset dir="${native}/common" includes="*.c"/> - </apply> + <fileset dir="${native}/common" includes="*.c"/> + <fileset dir="${native}/common/opengl" includes="*.c"/> + <fileset dir="${native}/generated/opengl" includes="*.c"/> + <fileset dir="${native}/linux" includes="*.c"/> + <fileset dir="${native}/linux/opengl" includes="*.c"/> + </apply> <apply dir="." parallel="true" executable="gcc" failonerror="true"> <srcfile/> <arg line="${linker_flags64}"/> Copied: trunk/LWJGL/platform_build/linux_ant/build_es.xml (from rev 3560, branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml) =================================================================== --- trunk/LWJGL/platform_build/linux_ant/build_es.xml (rev 0) +++ trunk/LWJGL/platform_build/linux_ant/build_es.xml 2011-07-10 16:58:16 UTC (rev 3561) @@ -0,0 +1,127 @@ +<?xml version="1.0"?> + +<project name="lwjgl native code, linux" basedir="../../bin/lwjgles" default="compile"> + <property name="native" location="../../src/native"/> + <property name="libname32" value="liblwjgl.so"/> + <property name="libname64" value="liblwjgl64.so"/> + <property name="libs32" value="-L/home/spasi/lwjgl/libs/linux -lEGL -L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXext -lXcursor -lXrandr -lpthread -L${java.home}/lib/i386 -ljawt" /> + <property name="libs64" value="-L${lib_folder}/x64 -lEGL -L/usr/X11R6/lib64 -L/usr/X11/lib64 -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/amd64 -ljawt" /> + <property name="cflags32" value="-O2 -Wall -c -fPIC -std=c99 -Wunused"/> + + <target name="clean"> + <delete> + <fileset dir="x32"/> + <fileset dir="x64"/> + <fileset dir="." includes="*.o"/> + <fileset dir="." includes="*.so"/> + </delete> + </target> + + <target name="compile"> + <exec executable="uname" outputproperty="hwplatform"> + <arg value="-m"/> + </exec> + <cond... [truncated message content] |
From: <riv...@us...> - 2011-07-11 21:46:08
|
Revision: 3568 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3568&view=rev Author: riven-lwjgl Date: 2011-07-11 21:46:00 +0000 (Mon, 11 Jul 2011) Log Message: ----------- Initial release of mapped objects library (v0.10) in LWJGL. Added Paths: ----------- trunk/LWJGL/libs/asm-util.jar trunk/LWJGL/libs/asm.jar trunk/LWJGL/src/java/org/lwjgl/util/mapped/ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedField.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectClassLoader.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectUnsafe.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedType.java Added: trunk/LWJGL/libs/asm-util.jar =================================================================== (Binary files differ) Property changes on: trunk/LWJGL/libs/asm-util.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/LWJGL/libs/asm.jar =================================================================== (Binary files differ) Property changes on: trunk/LWJGL/libs/asm.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/LWJGL/src/java/org/lwjgl/util/mapped ___________________________________________________________________ Added: bugtraq:number + true Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedField.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedField.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedField.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,19 @@ +/* + * Created on Jun 24, 2011 + */ + +package org.lwjgl.util.mapped; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * @author Riven + */ + +@Retention(RetentionPolicy.RUNTIME) +public @interface MappedField { + long byteOffset(); + + long byteLength() default -1; +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,52 @@ +/* + * Created on Jul 4, 2011 + */ + +package org.lwjgl.util.mapped; + +import java.util.Iterator; + +/** + * @author Riven + */ + +public class MappedForeach<T extends MappedObject> implements Iterable<T> +{ + final T mapped; + final int elementCount; + + MappedForeach(T mapped, int elementCount) + { + this.mapped = mapped; + this.elementCount = elementCount; + } + + @Override + public Iterator<T> iterator() + { + return new Iterator<T>() + { + private int index = 0; + + @Override + public boolean hasNext() + { + return this.index < (MappedForeach.this.elementCount); + } + + @Override + public T next() + { + mapped.viewAddress = mapped.baseAddress + (this.index++) * mapped.stride; + + return mapped; + } + + @Override + public void remove() + { + throw new UnsupportedOperationException(); + } + }; + } +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,181 @@ +/* + * Created on Jun 28, 2011 + */ + +package org.lwjgl.util.mapped; + +import java.nio.ByteBuffer; + +/** + * @author Riven + */ + +public class MappedHelper +{ + public static void setup(MappedObject mo, ByteBuffer buffer, int align, int sizeof) + { + if (mo.baseAddress != 0L) + throw new IllegalStateException("this method should not be called by user-code"); + + if (buffer == null) + throw new NullPointerException("buffer"); + if (!buffer.isDirect()) + throw new IllegalArgumentException("bytebuffer must be direct"); + mo.preventGC = buffer; + + if (align <= 0) + throw new IllegalArgumentException("invalid alignment"); + mo.align = align; + + if (sizeof % align != 0) + throw new IllegalStateException("sizeof not a multiple of alignment"); + mo.stride = sizeof; + + long addr = MappedObjectUnsafe.getBufferBaseAddress(buffer); + if (addr % align != 0) + throw new IllegalStateException("buffer address not aligned on " + align + " bytes"); + + mo.baseAddress = mo.viewAddress = addr; + } + + public static void put_views(MappedSet2 set, int view) + { + set.view(view); + } + + public static void put_views(MappedSet3 set, int view) + { + set.view(view); + } + + public static void put_views(MappedSet4 set, int view) + { + set.view(view); + } + + public static void put_view(MappedObject mapped, int view) + { + mapped.viewAddress = mapped.baseAddress + view * mapped.stride; + } + + public static int get_view(MappedObject mapped) + { + return (int) (mapped.viewAddress - mapped.baseAddress) / mapped.stride; + } + + public static MappedObject dup(MappedObject src, MappedObject dst) + { + dst.baseAddress = src.baseAddress; + dst.viewAddress = src.viewAddress; + dst.stride = src.stride; + dst.align = src.align; + dst.preventGC = src.preventGC; + return dst; + } + + public static MappedObject slice(MappedObject src, MappedObject dst) + { + dst.baseAddress = src.viewAddress; // ! + dst.viewAddress = src.viewAddress; + dst.stride = src.stride; + dst.align = src.align; + dst.preventGC = src.preventGC; + return dst; + } + + public static void copy(MappedObject src, MappedObject dst, int bytes) + { + MappedObjectUnsafe.INSTANCE.copyMemory(src.viewAddress, dst.viewAddress, bytes); + } + + public static ByteBuffer newBuffer(long address, int capacity) + { + return MappedObjectUnsafe.newBuffer(address, capacity); + } + + // ---- primitive fields read/write + + // byte + + public static void bput(byte value, long addr) + { + MappedObjectUnsafe.INSTANCE.putByte(addr, value); + } + + public static byte bget(long addr) + { + return MappedObjectUnsafe.INSTANCE.getByte(addr); + } + + // short + + public static void sput(short value, long addr) + { + MappedObjectUnsafe.INSTANCE.putShort(addr, value); + } + + public static short sget(long addr) + { + return MappedObjectUnsafe.INSTANCE.getShort(addr); + } + + // char + + public static void cput(char value, long addr) + { + MappedObjectUnsafe.INSTANCE.putChar(addr, value); + } + + public static char cget(long addr) + { + return MappedObjectUnsafe.INSTANCE.getChar(addr); + } + + // int + + public static void iput(int value, long addr) + { + MappedObjectUnsafe.INSTANCE.putInt(addr, value); + } + + public static int iget(long addr) + { + return MappedObjectUnsafe.INSTANCE.getInt(addr); + } + + // float + + public static void fput(float value, long addr) + { + MappedObjectUnsafe.INSTANCE.putFloat(addr, value); + } + + public static float fget(long addr) + { + return MappedObjectUnsafe.INSTANCE.getFloat(addr); + } + + // long + + public static void jput(long value, long addr) + { + MappedObjectUnsafe.INSTANCE.putLong(addr, value); + } + + public static long jget(long addr) + { + return MappedObjectUnsafe.INSTANCE.getLong(addr); + } + + // double + + public static void dput(double value, long addr) + { + MappedObjectUnsafe.INSTANCE.putDouble(addr, value); + } + + public static double dget(long addr) + { + return MappedObjectUnsafe.INSTANCE.getDouble(addr); + } +} \ No newline at end of file Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,185 @@ +/* + * Created on Jun 25, 2011 + */ + +package org.lwjgl.util.mapped; + +import java.nio.ByteBuffer; + +/** + * @author Riven + */ + +public class MappedObject +{ + public MappedObject() + { + // + } + + // these fields are not assignable/writable by user-code + public long baseAddress; + public long viewAddress; + public int stride; + public int align; + + /** + * Holds the value of sizeof of the sub-type of this MappedObject<br> + * <br> + * The behavior of this (transformed) method does not follow the normal Java behavior.<br> + * <code>Vec2.SIZEOF</code> will yield 8 (2 floats)<br> + * <code>Vec3.SIZEOF</code> will yield 12 (3 floats)<br> + * This (required) notation might cause compiler warnings, which can be suppressed with @SuppressWarnings("static-access").<br> + * Using Java 5.0's static-import on this method will break functionality. + */ + + // any method that calls these field will have its call-site modified + public static int SIZEOF = -1; // 'final' per subtype + public int view; // read/write + + public final void next() + { + this.viewAddress += this.stride; + } + + /** + * Creates a MappedObject instance, mapping the memory region of the specified direct ByteBuffer.<br> + * <br> + * The behavior of this (transformed) method does not follow the normal Java behavior.<br> + * <code>Vec2.map(buffer)</code> will return a mapped Vec2 instance.<br> + * <code>Vec3.map(buffer)</code> will return a mapped Vec3 instance.<br> + * This (required) notation might cause compiler warnings, which can be suppressed with @SuppressWarnings("static-access").<br> + * Using Java 5.0's static-import on this method will break functionality. + */ + + @SuppressWarnings("unused") + public static <T extends MappedObject> T map(ByteBuffer bb) + { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + + @SuppressWarnings("unused") + public static <T extends MappedObject> T map(long address, int capacity) + { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + + /** + * Creates a MappedObject instance, mapping the memory region of an allocated direct ByteBuffer with a capacity of <code>elementCount*SIZEOF</code> + * <br> + * The behavior of this (transformed) method does not follow the normal Java behavior.<br> + * <code>Vec2.malloc(int)</code> will return a mapped Vec2 instance.<br> + * <code>Vec3.malloc(int)</code> will return a mapped Vec3 instance.<br> + * This (required) notation might cause compiler warnings, which can be suppressed with @SuppressWarnings("static-access").<br> + * Using Java 5.0's static-import on this method will break functionality. + */ + + @SuppressWarnings("unused") + public static <T extends MappedObject> T malloc(int elementCount) + { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + + /** + * Creates an identical new MappedObject instance, comparable to the + * contract of ByteBuffer.duplicate() + */ + + public final <T extends MappedObject> T dup() + { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + + /** + * Creates a new MappedObject instance, with a base offset equal to + * the offset of the current view, comparable to the contract of ByteBuffer.slice() + */ + + public final <T extends MappedObject> T slice() + { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + + public final <T extends MappedObject> void runViewConstructor() + { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + + /** + * Copies and amount of <code>SIZEOF</code> bytes, from the current + * mapped object, to the specified mapped object. + */ + + @SuppressWarnings("unused") + public final <T extends MappedObject> void copyTo(T target) + { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + + /** + * Copies and amount of <code>SIZEOF*instances<c/ode> bytes, from the + * current mapped object, to the specified mapped object. + */ + + @SuppressWarnings("unused") + public final <T extends MappedObject> void copyRange(T target, int instances) + { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + + /** + * Creates an Iterable<MappedObject> that will step through + * <code>elementCount</code> views, leaving the <code>view</code> at + * the last valid value.<br> + * <br> + * For convenience you are encouraged to static-import this specific method: + * <code>import static org.lwjgl.util.mapped.MappedObject.foreach;</code> + */ + + public static <T extends MappedObject> MappedForeach<T> foreach(T mapped, int elementCount) + { + return new MappedForeach<T>(mapped, elementCount); + } + + /** + * Configures a newly initiated mapped object with the specified stride and offset. + * @throws IllegalStateException if view is not at index 0 + */ + + public static final <T extends MappedObject> T configure(T mapped, int stride, int offset) + { + if (mapped.baseAddress != mapped.viewAddress) + throw new IllegalStateException("view must be zero"); + + if (offset < 0) + throw new IllegalStateException("offset must not be negative: " + offset); + if (offset % mapped.align != 0) + throw new IllegalStateException("offset not a multiple of alignment: " + offset); + + if (stride < mapped.stride) + throw new IllegalStateException("new stride must not be smaller than current stride: " + stride); + if (stride % mapped.align != 0) + throw new IllegalStateException("stride not a multiple of alignment: " + stride); + + mapped.baseAddress += offset; + mapped.viewAddress += offset; + mapped.stride = stride; + + return mapped; + } + + ByteBuffer preventGC; + + public ByteBuffer backingByteBuffer() + { + return this.preventGC; + } +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectClassLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectClassLoader.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectClassLoader.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,136 @@ +/* + * Created on Jun 24, 2011 + */ + +package org.lwjgl.util.mapped; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URLClassLoader; +import java.util.Arrays; + +/** + * @author Riven + */ + +public class MappedObjectClassLoader extends URLClassLoader +{ + static final String MAPPEDOBJECT_PACKAGE_PREFIX; + + static + { + MAPPEDOBJECT_PACKAGE_PREFIX = MappedObjectClassLoader.class.getPackage().getName() + "."; + } + + static boolean FORKED = false; + + public static boolean fork(Class< ? > mainClass, String[] args) + { + if (FORKED) + { + return false; + } + + FORKED = true; + + try + { + URLClassLoader loader = new MappedObjectClassLoader(mainClass); + Class< ? > replacedMainClass = loader.loadClass(mainClass.getName()); + Method mainMethod = replacedMainClass.getMethod("main", String[].class); + mainMethod.invoke(null, new Object[] { args }); + } + catch (InvocationTargetException exc) + { + Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), exc.getCause()); + } + catch (Throwable cause) + { + throw new Error("failed to fork", cause); + } + + return true; + } + + private MappedObjectClassLoader(Class< ? > mainClass) + { + super(((URLClassLoader) mainClass.getClassLoader()).getURLs()); + } + + private static long total_time_transforming; + + @Override + protected synchronized Class< ? > loadClass(String name, boolean resolve) throws ClassNotFoundException + { + if (name.startsWith("java.")) + return super.loadClass(name, resolve); + if (name.startsWith("javax.")) + return super.loadClass(name, resolve); + + if (name.startsWith("sun.")) + return super.loadClass(name, resolve); + if (name.startsWith("sunw.")) + return super.loadClass(name, resolve); + + // never transform classes in this very package, sub-packages should be transformed + if (name.startsWith(MAPPEDOBJECT_PACKAGE_PREFIX)) + if (name.substring(MAPPEDOBJECT_PACKAGE_PREFIX.length()).indexOf('.') == -1) + return super.loadClass(name, resolve); + + String className = name.replace('.', '/'); + + if (MappedObjectTransformer.PRINT_ACTIVITY) + System.out.println(MappedObjectClassLoader.class.getSimpleName() + ": " + className); + + byte[] bytecode = readStream(this.getResourceAsStream(className.concat(".class"))); + + long t0 = System.nanoTime(); + bytecode = MappedObjectTransformer.transformFieldAccess(className, bytecode); + long t1 = System.nanoTime(); + total_time_transforming += (t1 - t0); + + if (MappedObjectTransformer.PRINT_TIMING) + System.out.println("transforming " + className + " took " + (t1 - t0) / 1000 + " micros (total: " + (total_time_transforming / 1000 / 1000) + "ms)"); + + Class< ? > clazz = super.defineClass(name, bytecode, 0, bytecode.length); + if (resolve) + resolveClass(clazz); + return clazz; + } + + static byte[] readStream(InputStream in) + { + byte[] bytecode = new byte[256]; + int len = 0; + try + { + while (true) + { + if (bytecode.length == len) + bytecode = Arrays.copyOf(bytecode, len * 2); + int got = in.read(bytecode, len, bytecode.length - len); + if (got == -1) + break; + len += got; + } + } + catch (IOException exc) + { + // stop! + } + finally + { + try + { + in.close(); + } + catch (IOException exc) + { + // ignore... + } + } + return Arrays.copyOf(bytecode, len); + } +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,588 @@ +/* + * Created on Jun 23, 2011 + */ + +package org.lwjgl.util.mapped; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.nio.ByteBuffer; +import java.util.HashMap; +import java.util.Map; + +import org.objectweb.asm.*; +import org.objectweb.asm.util.TraceClassVisitor; +import static org.objectweb.asm.Opcodes.*; + +/** + * @author Riven + */ + +public class MappedObjectTransformer +{ + static final boolean PRINT_TIMING = true; + static final boolean PRINT_ACTIVITY = false; + static final boolean PRINT_BYTECODE = false; + static final Map<String, MappedSubtypeInfo> className_to_subtype; + + static + { + className_to_subtype = new HashMap<String, MappedSubtypeInfo>(); + + { + // HACK: required for mapped.view++ + // + // because the compiler generates: + // => GETFIELD MappedObject.view + // => ICONST_1 + // => IADD + // => PUTFIELD MyMappedType.view + // + // instead of: + // => GETFIELD MyMappedType.view + // => ICONST_1 + // => IADD + // => PUTFIELD MyMappedType.view + // + MappedSubtypeInfo info = new MappedSubtypeInfo(jvmClassName(MappedObject.class), -1, -1); + className_to_subtype.put(info.className, info); + } + + String vmName = System.getProperty("java.vm.name"); + if (vmName != null && !vmName.contains("Server")) + { + System.err.println("Warning: " + MappedObject.class.getSimpleName() + "s have inferiour performance on Client VMs, please consider switching to a Server VM."); + } + } + + public static void register(Class< ? > type) + { + if (MappedObjectClassLoader.FORKED) + return; + + MappedType mapped = type.getAnnotation(MappedType.class); + if (mapped == null) + throw new InternalError("missing " + MappedType.class.getName() + " annotation"); + + String className = jvmClassName(type); + + MappedSubtypeInfo mappedType = new MappedSubtypeInfo(className, mapped.sizeof(), mapped.align()); + + int advancingOffset = 0; + + for (Field field : type.getDeclaredFields()) + { + // static fields are never mapped + if ((field.getModifiers() & Modifier.STATIC) != 0) + continue; + + // we only support primitives and ByteBuffers + if (!field.getType().isPrimitive() && field.getType() != ByteBuffer.class) + throw new InternalError("field '" + className + "." + field.getName() + "' not supported: " + field.getType()); + + MappedField meta = field.getAnnotation(MappedField.class); + if (meta == null && !mapped.autoGenerateOffsets()) + throw new InternalError("field '" + className + "." + field.getName() + "' missing annotation " + MappedField.class.getName() + ": " + className); + + // quick hack + long byteOffset = meta == null ? advancingOffset : meta.byteOffset(); + long byteLength; + if (field.getType() == long.class || field.getType() == double.class) + byteLength = 8; + else if (field.getType() == int.class || field.getType() == float.class) + byteLength = 4; + else if (field.getType() == char.class || field.getType() == short.class) + byteLength = 2; + else if (field.getType() == byte.class) + byteLength = 1; + else if (field.getType() == ByteBuffer.class) + byteLength = meta.byteLength(); + else + throw new IllegalStateException(field.getType().getName()); + + if (field.getType() != ByteBuffer.class) + if ((advancingOffset % byteLength) != 0) + throw new IllegalStateException("misaligned mapped type: " + className + "." + field.getName()); + + if (PRINT_ACTIVITY) + System.out.println(MappedObjectTransformer.class.getSimpleName() + ": " + className + "." + field.getName() + " [type=" + field.getType().getSimpleName() + ", offset=" + byteOffset + "]"); + + mappedType.fieldToOffset.put(field.getName(), Long.valueOf(byteOffset)); + mappedType.fieldToLength.put(field.getName(), Long.valueOf(byteLength)); + + advancingOffset += byteLength; + } + + if (className_to_subtype.put(className, mappedType) != null) + { + throw new InternalError("duplicate mapped type: " + className); + } + } + + public static final String view_constructor_method = "_construct_view_"; + + public static byte[] transformFieldAccess(final String className, byte[] bytecode) + { + int flags = ClassWriter.COMPUTE_FRAMES; + + ClassWriter writer = new ClassWriter(flags); + + ClassAdapter adapter = new ClassAdapter(writer) + { + @Override + public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) + { + { + MappedSubtypeInfo mappedSubtype = className_to_subtype.get(className); + + if (mappedSubtype != null && !mappedSubtype.className.equals(jvmClassName(MappedObject.class))) + { + if (name.equals("<init>")) + { + if (!desc.equals("()V")) + throw new IllegalStateException(className + " can only have a default constructor, found: " + desc); + + MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, jvmClassName(MappedObject.class), "<init>", "()V"); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + + // put the method body in another method + name = view_constructor_method; + } + } + } + + return new MappedInstanceMethodAdapter(className, name, desc, super.visitMethod(access, name, desc, signature, exceptions)); + } + + @Override + public FieldVisitor visitField(int access, String fieldName, String typeName, String dunno, Object value) + { + // remove redirected fields + MappedSubtypeInfo mappedSubtype = className_to_subtype.get(className); + + if (mappedSubtype != null && mappedSubtype.fieldToOffset.containsKey(fieldName)) + { + if (PRINT_ACTIVITY) + System.out.println(MappedObjectTransformer.class.getSimpleName() + ": discarding field: " + className + "." + fieldName + ":" + typeName); + return null; + } + + return super.visitField(access, fieldName, typeName, dunno, value); + } + }; + + new ClassReader(bytecode).accept(adapter, 0); + bytecode = writer.toByteArray(); + + if (PRINT_BYTECODE) + printBytecode(bytecode, adapter); + + return bytecode; + } + + static void printBytecode(byte[] bytecode, ClassAdapter adapter) + { + StringWriter sw = new StringWriter(); + ClassVisitor tracer = new TraceClassVisitor(adapter, new PrintWriter(sw)); + new ClassReader(bytecode).accept(tracer, 0); + String dump = sw.toString(); + + System.out.println(dump); + } + + static void throwException0(MethodVisitor visitor, Class< ? > type, String msg) + { + String errorType = jvmClassName(type); + + visitor.visitTypeInsn(NEW, errorType); + visitor.visitInsn(DUP); + visitor.visitLdcInsn(msg); + visitor.visitMethodInsn(INVOKESPECIAL, errorType, "<init>", "(Ljava/lang/String;)V"); + visitor.visitInsn(ATHROW); + } + + static class MappedInstanceMethodAdapter extends MethodAdapter + { + private final String className; + private final String methodName; + private final String descr; + + public MappedInstanceMethodAdapter(String className, String methodName, String descr, MethodVisitor backing) + { + super(backing); + this.className = className; + this.methodName = methodName; + this.descr = descr; + } + + @Override + public void visitTypeInsn(int opcode, String typeName) + { + if (opcode == NEW && className_to_subtype.containsKey(typeName)) + { + throw new IllegalAccessError("must not manually create instances of " + typeName + " in method " + this.className + "." + this.methodName + this.descr); + } + + super.visitTypeInsn(opcode, typeName); + } + + @Override + public void visitMethodInsn(int opcode, String className, String methodName, String signature) + { + if (opcode == INVOKESPECIAL && className.equals(jvmClassName(MappedObject.class)) && methodName.equals("<init>") && signature.equals("()V")) + { + // stack: instance + visitInsn(POP); + // stack: - + return; + } + + for (MappedSubtypeInfo mappedType : className_to_subtype.values()) + { + boolean isMapDirectMethod = (opcode == INVOKESTATIC && methodName.equals("map") && className.equals(mappedType.className) && signature.equals("(JI)L" + jvmClassName(MappedObject.class) + ";")); + boolean isMapBufferMethod = (opcode == INVOKESTATIC && methodName.equals("map") && className.equals(mappedType.className) && signature.equals("(Ljava/nio/ByteBuffer;)L" + jvmClassName(MappedObject.class) + ";")); + boolean isMallocMethod = (opcode == INVOKESTATIC && methodName.equals("malloc") && className.equals(mappedType.className) && signature.equals("(I)L" + jvmClassName(MappedObject.class) + ";")); + + if ((isMapDirectMethod || isMapBufferMethod) || isMallocMethod) + { + if (isMallocMethod) + { + // stack: count + pushInt(super.mv, mappedType.sizeof); + // stack: sizeof, count + super.visitInsn(IMUL); + // stack: bytes + super.visitMethodInsn(INVOKESTATIC, jvmClassName(ByteBuffer.class), "allocateDirect", "(I)L" + jvmClassName(ByteBuffer.class) + ";"); + // stack: buffer + } + else if (isMapDirectMethod) + { + // stack: capacity, address + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "newBuffer", "(JI)L" + jvmClassName(ByteBuffer.class) + ";"); + // stack: buffer + } + + // stack: buffer + super.visitTypeInsn(NEW, className); + // stack: new, buffer + super.visitInsn(DUP); + // stack: new, new, buffer + super.visitMethodInsn(INVOKESPECIAL, className, "<init>", "()V"); + // stack: new, buffer + super.visitInsn(DUP_X1); + // stack: new, buffer, new + super.visitInsn(SWAP); + // stack: buffer, new, new + pushInt(super.mv, mappedType.align); + // stack: int, buffer, new, new + pushInt(super.mv, mappedType.sizeof); + // stack: int, int, buffer, new, new + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "setup", "(L" + jvmClassName(MappedObject.class) + ";Ljava/nio/ByteBuffer;II)V"); + // stack: new + return; + } + + if (opcode == INVOKEVIRTUAL && methodName.equals("dup") && className.equals(mappedType.className) && signature.equals("()L" + jvmClassName(MappedObject.class) + ";")) + { + // stack: this + super.visitTypeInsn(NEW, className); + // stack: new, this + super.visitInsn(DUP); + // stack: new, new, this + super.visitMethodInsn(INVOKESPECIAL, className, "<init>", "()V"); + // stack: new, this + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "dup", "(L" + jvmClassName(MappedObject.class) + ";L" + jvmClassName(MappedObject.class) + ";)L" + jvmClassName(MappedObject.class) + ";"); + // stack: new + return; + } + + if (opcode == INVOKEVIRTUAL && methodName.equals("slice") && className.equals(mappedType.className) && signature.equals("()L" + jvmClassName(MappedObject.class) + ";")) + { + // stack: this + super.visitTypeInsn(NEW, className); + // stack: new, this + super.visitInsn(DUP); + // stack: new, new, this + super.visitMethodInsn(INVOKESPECIAL, className, "<init>", "()V"); + // stack: new, this + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "slice", "(L" + jvmClassName(MappedObject.class) + ";L" + jvmClassName(MappedObject.class) + ";)L" + jvmClassName(MappedObject.class) + ";"); + // stack: new + return; + } + + // + + if (opcode == INVOKEVIRTUAL && methodName.equals("runViewConstructor") && className.equals(mappedType.className) && signature.equals("()V")) + { + // stack: this + super.visitInsn(DUP); + // stack: this, this + super.visitMethodInsn(INVOKEVIRTUAL, className, view_constructor_method, "()V"); + // stack: this + return; + } + + // + + if (opcode == INVOKEVIRTUAL && methodName.equals("copyTo") && className.equals(mappedType.className) && signature.equals("(L" + jvmClassName(MappedObject.class) + ";)V")) + { + // stack: target, this + pushInt(super.mv, mappedType.sizeof); + // stack: sizeof, target, this + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "copy", "(L" + jvmClassName(MappedObject.class) + ";L" + jvmClassName(MappedObject.class) + ";I)V"); + // stack: - + return; + } + + if (opcode == INVOKEVIRTUAL && methodName.equals("copyRange") && className.equals(mappedType.className) && signature.equals("(L" + jvmClassName(MappedObject.class) + ";I)V")) + { + // stack: instances, target, this + pushInt(super.mv, mappedType.sizeof); + // stack: sizeof, instances, target, this + super.visitInsn(IMUL); + // stack: bytes, target, this + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "copy", "(L" + jvmClassName(MappedObject.class) + ";L" + jvmClassName(MappedObject.class) + ";I)V"); + // stack: - + return; + } + } + + super.visitMethodInsn(opcode, className, methodName, signature); + } + + static void throwAccessErrorOnReadOnlyField(String className, String fieldName) + { + throw new IllegalAccessError("field '" + className + "." + fieldName + "' is final"); + } + + @Override + public void visitFieldInsn(int opcode, String className, String fieldName, String typeName) + { + MappedSubtypeInfo mappedSubtype = className_to_subtype.get(className); + if (mappedSubtype == null) + { + String mappedSetPrefix = jvmClassName(MappedSet.class); + + outer: if (fieldName.equals("view") && className.startsWith(mappedSetPrefix)) + { + if (opcode == GETFIELD) + throwAccessErrorOnReadOnlyField(className, fieldName); + if (opcode != PUTFIELD) + break outer; + + // stack: index, this + if (false) + break outer; + else if (className.equals(jvmClassName(MappedSet2.class))) + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "put_views", "(L" + jvmClassName(MappedSet2.class) + ";I)V"); + else if (className.equals(jvmClassName(MappedSet3.class))) + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "put_views", "(L" + jvmClassName(MappedSet3.class) + ";I)V"); + else if (className.equals(jvmClassName(MappedSet4.class))) + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "put_views", "(L" + jvmClassName(MappedSet4.class) + ";I)V"); + else + break outer; + // stack: - + return; + } + + // early out + super.visitFieldInsn(opcode, className, fieldName, typeName); + return; + } + + if (fieldName.equals("SIZEOF")) + { + if (!typeName.equals("I")) + throw new IllegalStateException(); + + if (opcode == GETSTATIC) + { + pushInt(super.mv, mappedSubtype.sizeof); + return; + } + if (opcode == PUTSTATIC) + { + throwAccessErrorOnReadOnlyField(className, fieldName); + } + } + + if (fieldName.equals("view")) + { + if (!typeName.equals("I")) + throw new IllegalStateException(); + + if (opcode == GETFIELD) + { + // stack: instance + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "get_view", "(L" + jvmClassName(MappedObject.class) + ";)I"); + return; + } + if (opcode == PUTFIELD) + { + // stack: int, instance + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "put_view", "(L" + jvmClassName(MappedObject.class) + ";I)V"); + return; + } + } + + if (fieldName.equals("align")) + { + if (!typeName.equals("I")) + throw new IllegalStateException(); + + if (opcode == GETFIELD) + { + // stack: instance + super.visitInsn(POP); + // stack: - + pushInt(super.mv, mappedSubtype.align); + // stack: int + return; + } + if (opcode == PUTFIELD) + { + throwAccessErrorOnReadOnlyField(className, fieldName); + } + } + + if (fieldName.equals("stride")) + { + if (!typeName.equals("I")) + throw new IllegalStateException(); + + if (opcode == GETFIELD) + { + // do not change a thing + } + if (opcode == PUTFIELD) + { + throwAccessErrorOnReadOnlyField(className, fieldName); + } + } + + if (fieldName.equals("baseAddress") || fieldName.equals("viewAddress")) + { + if (!typeName.equals("J")) + throw new IllegalStateException(); + + if (opcode == GETFIELD) + { + // do not change a thing + } + if (opcode == PUTFIELD) + { + throwAccessErrorOnReadOnlyField(className, fieldName); + } + } + + Long fieldOffset = mappedSubtype.fieldToOffset.get(fieldName); + if (fieldOffset == null) + { + // early out + super.visitFieldInsn(opcode, className, fieldName, typeName); + return; + } + + if (typeName.equals("L" + jvmClassName(ByteBuffer.class) + ";")) + { + if (opcode == PUTFIELD) + { + throwAccessErrorOnReadOnlyField(className, fieldName); + } + if (opcode == GETFIELD) + { + Long fieldLength = mappedSubtype.fieldToLength.get(fieldName); + + super.visitFieldInsn(GETFIELD, mappedSubtype.className, "viewAddress", "J"); + super.visitLdcInsn(fieldOffset); + super.visitInsn(LADD); + super.visitLdcInsn(fieldLength); + super.visitInsn(L2I); + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), "newBuffer", "(JI)L" + jvmClassName(ByteBuffer.class) + ";"); + + return; + } + } + + if (opcode == PUTFIELD) + { + super.visitInsn(SWAP); + super.visitFieldInsn(GETFIELD, mappedSubtype.className, "viewAddress", "J"); + super.visitLdcInsn(fieldOffset); + super.visitInsn(LADD); + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), typeName.toLowerCase() + "put", "(" + typeName + "J)V"); + return; + } + if (opcode == GETFIELD) + { + super.visitFieldInsn(GETFIELD, mappedSubtype.className, "viewAddress", "J"); + super.visitLdcInsn(fieldOffset); + super.visitInsn(LADD); + super.visitMethodInsn(INVOKESTATIC, jvmClassName(MappedHelper.class), typeName.toLowerCase() + "get", "(J)" + typeName); + return; + } + + // original field access + super.visitFieldInsn(opcode, className, fieldName, typeName); + return; + } + } + + static void pushInt(MethodVisitor mv, int value) + { + if (value == -1) + mv.visitInsn(ICONST_M1); + else if (value == 0) + mv.visitInsn(ICONST_0); + else if (value == 1) + mv.visitInsn(ICONST_1); + else if (value == 2) + mv.visitInsn(ICONST_2); + else if (value == 3) + mv.visitInsn(ICONST_3); + else if (value == 4) + mv.visitInsn(ICONST_4); + else if (value == 5) + mv.visitInsn(ICONST_5); + else if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) + mv.visitIntInsn(BIPUSH, value); + else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) + mv.visitIntInsn(SIPUSH, value); + else + mv.visitLdcInsn(Integer.valueOf(value)); + } + + static String jvmClassName(Class< ? > type) + { + return type.getName().replace('.', '/'); + } + + static class MappedSubtypeInfo + { + public final String className; + + public int sizeof; + public int align; + + public Map<String, Long> fieldToOffset; + public Map<String, Long> fieldToLength; + + public MappedSubtypeInfo(String className, int sizeof, int align) + { + this.className = className; + + this.sizeof = sizeof; + this.align = align; + + this.fieldToOffset = new HashMap<String, Long>(); + this.fieldToLength = new HashMap<String, Long>(); + } + } +} \ No newline at end of file Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectUnsafe.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectUnsafe.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectUnsafe.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,83 @@ +/* + * Created on Jun 24, 2011 + */ + +package org.lwjgl.util.mapped; + +import java.lang.reflect.Field; +import java.nio.Buffer; +import java.nio.ByteBuffer; + +import sun.misc.Unsafe; + +/** + * @author Riven + */ + +public class MappedObjectUnsafe +{ + public static final Unsafe INSTANCE = getUnsafeInstance(); + public static final int ADDRESS_SIZE = INSTANCE.addressSize(); + private static final Object[] ARRAY = new Object[1]; + private static final long ARRAY_ELEMENT_OFFSET = INSTANCE.arrayBaseOffset(ARRAY.getClass()); + + private static final long BUFFER_ADDRESS_OFFSET = getObjectFieldOffset(ByteBuffer.class, "address"); + private static final long BUFFER_CAPACITY_OFFSET = getObjectFieldOffset(ByteBuffer.class, "capacity"); + + // + + public static long getBufferBaseAddress(Buffer buffer) + { + return INSTANCE.getLong(buffer, BUFFER_ADDRESS_OFFSET); + } + + private static final ByteBuffer global = ByteBuffer.allocateDirect(4 * 1024); + + public static ByteBuffer newBuffer(long address, int capacity) + { + if (address <= 0L || capacity < 0) + throw new IllegalStateException("you almost crashed the jvm"); + + ByteBuffer buffer = global.duplicate(); + INSTANCE.putLong(buffer, BUFFER_ADDRESS_OFFSET, address); + INSTANCE.putInt(buffer, BUFFER_CAPACITY_OFFSET, capacity); + buffer.position(0); + buffer.limit(capacity); + return buffer; + } + + + + private static long getObjectFieldOffset(Class< ? > type, String fieldName) + { + while (type != null) + { + try + { + return INSTANCE.objectFieldOffset(type.getDeclaredField(fieldName)); + } + catch (Throwable t) + { + type = type.getSuperclass(); + } + } + throw new InternalError(); + } + + private static Unsafe getUnsafeInstance() + { + try + { + ByteBuffer buffer = ByteBuffer.allocateDirect(1); + Field unsafeField = buffer.getClass().getDeclaredField("unsafe"); + unsafeField.setAccessible(true); + Unsafe instance = (Unsafe) unsafeField.get(buffer); + buffer.flip(); // prevented 'buffer' from being gc'ed + return instance; + } + catch (Exception exc) + { + throw new InternalError(); + } + } +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,23 @@ +/* + * Created on Jul 11, 2011 + */ + +package org.lwjgl.util.mapped; + +public class MappedSet +{ + public static MappedSet2 create(MappedObject a, MappedObject b) + { + return new MappedSet2(a, b); + } + + public static MappedSet3 create(MappedObject a, MappedObject b, MappedObject c) + { + return new MappedSet3(a, b, c); + } + + public static MappedSet4 create(MappedObject a, MappedObject b, MappedObject c, MappedObject d) + { + return new MappedSet4(a, b, c, d); + } +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,30 @@ +/* + * Created on Jul 11, 2011 + */ + +package org.lwjgl.util.mapped; + +public class MappedSet2 +{ + private final MappedObject a, b; + + MappedSet2(MappedObject a, MappedObject b) + { + this.a = a; + this.b = b; + } + + public int view; + + void view(int view) + { + this.a.viewAddress = this.a.baseAddress + this.a.stride * view; + this.b.viewAddress = this.b.baseAddress + this.b.stride * view; + } + + public void next() + { + this.a.viewAddress += this.a.stride; + this.b.viewAddress += this.b.stride; + } +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,33 @@ +/* + * Created on Jul 11, 2011 + */ + +package org.lwjgl.util.mapped; + +public class MappedSet3 +{ + private final MappedObject a, b, c; + + MappedSet3(MappedObject a, MappedObject b, MappedObject c) + { + this.a = a; + this.b = b; + this.c = c; + } + + public int view; + + void view(int view) + { + this.a.viewAddress = this.a.baseAddress + this.a.stride * view; + this.b.viewAddress = this.b.baseAddress + this.b.stride * view; + this.c.viewAddress = this.c.baseAddress + this.c.stride * view; + } + + public void next() + { + this.a.viewAddress += this.a.stride; + this.b.viewAddress += this.b.stride; + this.c.viewAddress += this.c.stride; + } +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,36 @@ +/* + * Created on Jul 11, 2011 + */ + +package org.lwjgl.util.mapped; + +public class MappedSet4 +{ + private final MappedObject a, b, c, d; + + MappedSet4(MappedObject a, MappedObject b, MappedObject c, MappedObject d) + { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + } + + public int view; + + void view(int view) + { + this.a.viewAddress = this.a.baseAddress + this.a.stride * view; + this.b.viewAddress = this.b.baseAddress + this.b.stride * view; + this.c.viewAddress = this.c.baseAddress + this.c.stride * view; + this.d.viewAddress = this.d.baseAddress + this.d.stride * view; + } + + public void next() + { + this.a.viewAddress += this.a.stride; + this.b.viewAddress += this.b.stride; + this.c.viewAddress += this.c.stride; + this.d.viewAddress += this.d.stride; + } +} Added: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedType.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedType.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedType.java 2011-07-11 21:46:00 UTC (rev 3568) @@ -0,0 +1,21 @@ +/* + * Created on Jun 24, 2011 + */ + +package org.lwjgl.util.mapped; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * @author Riven + */ + +@Retention(RetentionPolicy.RUNTIME) +public @interface MappedType { + int sizeof(); + + int align() default 4; + + boolean autoGenerateOffsets() default true; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-07-12 15:36:22
|
Revision: 3574 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3574&view=rev Author: spasi Date: 2011-07-12 15:36:16 +0000 (Tue, 12 Jul 2011) Log Message: ----------- Added GLES classes on which Display depends to the main jar. Modified Paths: -------------- trunk/LWJGL/build.xml trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGLES.java trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java trunk/LWJGL/src/java/org/lwjgl/opengl/PixelFormatLWJGL.java Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2011-07-12 14:21:29 UTC (rev 3573) +++ trunk/LWJGL/build.xml 2011-07-12 15:36:16 UTC (rev 3574) @@ -143,6 +143,12 @@ <!-- Create lwjgl.jar --> <jar destfile="${lwjgl.temp}/jar/lwjgl.jar" taskname="lwjgl.jar"> <fileset refid="lwjgl.fileset" /> + <fileset dir="${lwjgl.bin}"> <!-- Display has a dependency on these --> + <patternset> + <include name="org/lwjgl/opengles/ContextAttribs.*"/> + <include name="org/lwjgl/opengles/PixelFormat.*"/> + </patternset> + </fileset> <manifest> <attribute name="Sealed" value="true"/> </manifest> Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java 2011-07-12 14:21:29 UTC (rev 3573) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java 2011-07-12 15:36:16 UTC (rev 3574) @@ -1,3 +1,34 @@ +/* + * 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. + */ package org.lwjgl.opengl; import org.lwjgl.LWJGLException; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGLES.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGLES.java 2011-07-12 14:21:29 UTC (rev 3573) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableGLES.java 2011-07-12 15:36:16 UTC (rev 3574) @@ -1,3 +1,34 @@ +/* + * 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. + */ package org.lwjgl.opengl; import org.lwjgl.LWJGLException; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java 2011-07-12 14:21:29 UTC (rev 3573) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java 2011-07-12 15:36:16 UTC (rev 3574) @@ -1,3 +1,34 @@ +/* + * 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. + */ package org.lwjgl.opengl; import org.lwjgl.LWJGLException; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/PixelFormatLWJGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/PixelFormatLWJGL.java 2011-07-12 14:21:29 UTC (rev 3573) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/PixelFormatLWJGL.java 2011-07-12 15:36:16 UTC (rev 3574) @@ -1,3 +1,34 @@ +/* + * 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. + */ package org.lwjgl.opengl; /** @@ -4,7 +35,6 @@ * [INTERNAL USE ONLY] * * @author Spasi - * @since 15/5/2011 */ public interface PixelFormatLWJGL { // Marker interface This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-07-22 02:02:05
|
Revision: 3597 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3597&view=rev Author: spasi Date: 2011-07-22 02:01:56 +0000 (Fri, 22 Jul 2011) Log Message: ----------- Added support for array access to mapped objects. Added SpriteShootout test that uses mapped objects. Modified Paths: -------------- trunk/LWJGL/build.xml trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectBench.java trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests1.java trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests3.java trunk/LWJGL/src/java/org/lwjgl/test/mapped/TestMappedObject.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectClassLoader.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectUnsafe.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet2.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet3.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedSet4.java Added Paths: ----------- trunk/LWJGL/libs/asm-debug-all.jar trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests4.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutMapped.java Removed Paths: ------------- trunk/LWJGL/libs/asm-util.jar trunk/LWJGL/libs/asm.jar Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/build.xml 2011-07-22 02:01:56 UTC (rev 3597) @@ -410,7 +410,7 @@ <!-- Compiles the Java source code --> <target name="compile" description="Compiles the java source code" depends="-initialize"> - <javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar;${lwjgl.lib}/asm.jar;${lwjgl.lib}/asm-util.jar" taskname="core"> + <javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core"> <!--<compilerarg value="-Xlint:unchecked"/>--> <src path="${lwjgl.src}/java/"/> <src path="${lwjgl.src}/generated/"/> Added: trunk/LWJGL/libs/asm-debug-all.jar =================================================================== (Binary files differ) Property changes on: trunk/LWJGL/libs/asm-debug-all.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/LWJGL/libs/asm-util.jar =================================================================== (Binary files differ) Deleted: trunk/LWJGL/libs/asm.jar =================================================================== (Binary files differ) Modified: trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectBench.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectBench.java 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectBench.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -31,6 +31,7 @@ */ package org.lwjgl.test.mapped; +import org.lwjgl.MemoryUtil; import org.lwjgl.util.mapped.MappedObjectUnsafe; import java.nio.ByteBuffer; @@ -212,7 +213,7 @@ final int iterations = 64 * 1024; ByteBuffer bb = ByteBuffer.allocateDirect(200); - long addr = MappedObjectUnsafe.getBufferBaseAddress(bb); + long addr = MemoryUtil.getAddress(bb); long[] took = new long[runs]; for ( int run = 0; run < runs; run++ ) { Modified: trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests1.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests1.java 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests1.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -31,6 +31,7 @@ */ package org.lwjgl.test.mapped; +import org.lwjgl.MemoryUtil; import org.lwjgl.util.mapped.MappedHelper; import org.lwjgl.util.mapped.MappedObjectUnsafe; @@ -143,9 +144,9 @@ // test newBuffer { - long addr1 = MappedObjectUnsafe.getBufferBaseAddress(bb); + long addr1 = MemoryUtil.getAddress(bb); ByteBuffer bb2 = MappedHelper.newBuffer(addr1, bb.capacity()); - long addr2 = MappedObjectUnsafe.getBufferBaseAddress(bb); + long addr2 = MemoryUtil.getAddress(bb); System.out.println(bb); System.out.println(bb2); Modified: trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests3.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests3.java 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests3.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -31,7 +31,11 @@ */ package org.lwjgl.test.mapped; -import org.lwjgl.util.mapped.*; +import org.lwjgl.MemoryUtil; +import org.lwjgl.util.mapped.MappedObject; +import org.lwjgl.util.mapped.MappedSet; +import org.lwjgl.util.mapped.MappedSet2; +import org.lwjgl.util.mapped.MappedType; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -49,10 +53,10 @@ assert (some.data != some.data); - long addr1 = MappedObjectUnsafe.getBufferBaseAddress(some.backingByteBuffer()); + long addr1 = MemoryUtil.getAddress(some.backingByteBuffer()); ByteBuffer mapped = some.data; // creates new ByteBuffer instance - long addr2 = MappedObjectUnsafe.getBufferBaseAddress(mapped); + long addr2 = MemoryUtil.getAddress(mapped); assert (addr2 - addr1 == 4); assert (mapped.capacity() == MappedSomething.SIZEOF - 4); @@ -60,7 +64,7 @@ some.view++; mapped = some.data; // creates new ByteBuffer instance - long addr3 = MappedObjectUnsafe.getBufferBaseAddress(mapped); + long addr3 = MemoryUtil.getAddress(mapped); assert (addr3 - addr1 == 4 + MappedSomething.SIZEOF); assert (addr3 - addr2 == 0 + MappedSomething.SIZEOF); assert (mapped.capacity() == MappedSomething.SIZEOF - 4); @@ -87,7 +91,7 @@ static void testConstructor() { int capacity = 1024; ByteBuffer bb = ByteBuffer.allocateDirect(capacity).order(ByteOrder.nativeOrder()); - long address = MappedObjectUnsafe.getBufferBaseAddress(bb); + long address = MemoryUtil.getAddress(bb); MappedFloat mf = MappedFloat.map(address, capacity); Added: trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests4.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests4.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/MappedObjectTests4.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -0,0 +1,115 @@ +/* + * 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. + */ +package org.lwjgl.test.mapped; + +import org.lwjgl.MemoryUtil; +import org.lwjgl.opengl.Display; + +import java.io.File; +import java.nio.ByteBuffer; + +/** @author Riven */ +@SuppressWarnings("static-access") +public class MappedObjectTests4 { + + public static void testLWJGL() throws Exception { + System.out.println(new File(System.getProperty("java.library.path")).getCanonicalPath()); + Display.create(); + } + + public static void testLocalView() { + MappedFloat mapped1 = MappedFloat.malloc(5); + MappedFloat mapped2 = MappedFloat.malloc(5); + + testLocalView(mapped1); + testLocalView(mapped1, mapped2); + + MappedSomething some = MappedSomething.malloc(5); + testLocalView(some); + } + + private static void testLocalView(MappedFloat mapped1) { + final MappedFloat[] array = mapped1.asArray(); + + assert (array.length == 5); + + int l = 10 * array.length; + for ( int localView1 = 0; localView1 < 5; localView1++ ) { + array[localView1].value = localView1 * 5; + array[localView1].value *= 2.0f; + } + System.out.println(); + float x = 0.0f; + for ( int localView1 = 0; localView1 < 5; localView1++ ) { + System.out.println("[" + localView1 + "] =>" + array[localView1].value); + x += array[localView1].value; + } + System.out.println("x = " + x); + } + + private static void testLocalView(MappedFloat mo1, MappedFloat mo2) { + final MappedFloat[] array1 = mo1.<MappedFloat>asArray(); + for ( int v1 = 0; v1 < 5; v1++ ) { + array1[v1].value = (float)Math.random(); + array1[v1].value *= 2.0f; + } + final MappedFloat[] array2 = mo2.<MappedFloat>asArray(); + for ( int v2 = 0; v2 < 5; v2++ ) { + array2[v2].value = (float)Math.random(); + array2[v2].value *= 2.0f; + } + + System.out.println(); + + for ( int v1 = 0; v1 < 5; v1++ ) { + System.out.println("[" + v1 + "] =>" + array1[v1].value); + } + for ( int v2 = 0; v2 < 5; v2++ ) { + System.out.println("[" + v2 + "] =>" + array2[v2].value); + } + } + + private static void testLocalView(MappedSomething some) { + final MappedSomething[] array = some.asArray(); + + assert (array.length == 5); + + final long baseAddress = MemoryUtil.getAddress(some.backingByteBuffer()); + for ( int i = 0; i < array.length; i++ ) { + ByteBuffer data = array[i].data; + + assert (data.capacity() == (64 - 4)); + assert (MemoryUtil.getAddress(data) == baseAddress + i * MappedSomething.SIZEOF + 4); + } + } + +} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/test/mapped/TestMappedObject.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/mapped/TestMappedObject.java 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/src/java/org/lwjgl/test/mapped/TestMappedObject.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -71,6 +71,11 @@ MappedObjectTests3.testConstructor(); MappedObjectTests3.testMappedSet(); + MappedObjectTests4.testLocalView(); + + //MappedObjectTests4.testLWJGL(); + + System.out.println("done"); } Added: trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutMapped.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutMapped.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutMapped.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -0,0 +1,831 @@ +/* + * 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. + */ +package org.lwjgl.test.opengl.sprites; + +import org.lwjgl.BufferUtils; +import org.lwjgl.LWJGLException; +import org.lwjgl.Sys; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.*; +import org.lwjgl.util.mapped.MappedObject; +import org.lwjgl.util.mapped.MappedObjectClassLoader; +import org.lwjgl.util.mapped.MappedObjectTransformer; +import org.lwjgl.util.mapped.MappedType; + +import java.awt.image.BufferedImage; +import java.awt.image.Raster; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Random; +import javax.imageio.ImageIO; + +import static org.lwjgl.opengl.EXTTransformFeedback.*; +import static org.lwjgl.opengl.GL11.*; +import static org.lwjgl.opengl.GL12.*; +import static org.lwjgl.opengl.GL15.*; +import static org.lwjgl.opengl.GL20.*; +import static org.lwjgl.opengl.GL30.*; + +/** + * Sprite rendering demo. Three implementations are supported: + * a) CPU animation + BufferData VBO update. + * b) CPU animation + MapBufferRange VBO update. + * c) GPU animation using transform feedback with a vertex shader. + * + * @author Spasi + * @since 18/3/2011 + */ +public final class SpriteShootoutMapped { + + static final int SCREEN_WIDTH = 800; + static final int SCREEN_HEIGHT = 600; + + private static final int ANIMATION_TICKS = 60; + + private boolean run = true; + private boolean render = true; + private boolean colorMask = true; + private boolean animate = true; + private boolean smooth; + private boolean vsync; + + int ballSize = 42; + int ballCount = 100 * 1000; + + private SpriteRenderer renderer; + + // OpenGL stuff + private int texID; + private int texBigID; + private int texSmallID; + + private SpriteShootoutMapped() { + } + + public static void main(String[] args) { + MappedObjectTransformer.register(Pixel4b.class); + MappedObjectTransformer.register(Pixel3b.class); + MappedObjectTransformer.register(Sprite.class); + MappedObjectTransformer.register(SpriteRender.class); + + if ( MappedObjectClassLoader.fork(SpriteShootoutMapped.class, args) ) + return; + + try { + new SpriteShootoutMapped().start(); + } catch (LWJGLException e) { + e.printStackTrace(); + } + } + + private void start() throws LWJGLException { + try { + initGL(); + + final ContextCapabilities caps = GLContext.getCapabilities(); + if ( !true && (caps.OpenGL30 || caps.GL_EXT_transform_feedback) ) + renderer = new SpriteRendererTF(); + else if ( true && caps.GL_ARB_map_buffer_range ) + renderer = new SpriteRendererMapped(); + else + renderer = new SpriteRendererPlain(); + + updateBalls(ballCount); + run(); + } catch (Throwable t) { + t.printStackTrace(); + } finally { + destroy(); + } + } + + private void initGL() throws LWJGLException { + Display.setLocation((Display.getDisplayMode().getWidth() - SCREEN_WIDTH) / 2, + (Display.getDisplayMode().getHeight() - SCREEN_HEIGHT) / 2); + Display.setDisplayMode(new DisplayMode(SCREEN_WIDTH, SCREEN_HEIGHT)); + Display.setTitle("Sprite Shootout"); + Display.create(); + //Display.create(new PixelFormat(), new ContextAttribs(4, 1).withProfileCompatibility(true).withDebug(true)); + //AMDDebugOutput.glDebugMessageCallbackAMD(new AMDDebugOutputCallback()); + + if ( !GLContext.getCapabilities().OpenGL20 ) + throw new RuntimeException("OpenGL 2.0 is required for this demo."); + + // Setup viewport + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0, SCREEN_WIDTH, 0, SCREEN_HEIGHT, -1.0, 1.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + + glClearColor(1.0f, 1.0f, 1.0f, 0.0f); + + // Create textures + + try { + texSmallID = createTexture("res/ball_sm.png"); + texBigID = createTexture("res/ball.png"); + } catch (IOException e) { + e.printStackTrace(); + System.exit(-1); + } + texID = texBigID; + + // Setup rendering state + + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GREATER, 0.0f); + + glColorMask(colorMask, colorMask, colorMask, false); + glDepthMask(false); + glDisable(GL_DEPTH_TEST); + + // Setup geometry + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + Util.checkGLError(); + } + + private static int createTexture(final String path) throws IOException { + final BufferedImage img = ImageIO.read(SpriteShootoutMapped.class.getClassLoader().getResource(path)); + + final int w = img.getWidth(); + final int h = img.getHeight(); + + final ByteBuffer buffer = readImage(img); + + final int texID = glGenTextures(); + + glBindTexture(GL_TEXTURE_2D, texID); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, buffer); + + return texID; + } + + @MappedType(sizeof = 4) + public static class Pixel4b extends MappedObject { + + public byte r, g, b, a; + + } + + @MappedType(sizeof = 3, align = 3) + public static class Pixel3b extends MappedObject { + + public byte r, g, b; + + } + + private static ByteBuffer readImage(final BufferedImage img) throws IOException { + final Raster raster = img.getRaster(); + + final int bands = raster.getNumBands(); + + final int w = img.getWidth(); + final int h = img.getHeight(); + + final int count = w * h; + + final byte[] pixels = new byte[count * bands]; + raster.getDataElements(0, 0, w, h, pixels); + + if ( bands == 4 ) { + Pixel4b p = Pixel4b.malloc(count); + + int b = 0; + for ( int i = 0; i < count; i++, b += 4 ) { + // Pre-multiply alpha + final float a = unpackUByte01(pixels[b + 3]); + + p.view = i; + p.r = packUByte01(unpackUByte01(pixels[b + 2]) * a); + p.g = packUByte01(unpackUByte01(pixels[b + 1]) * a); + p.b = packUByte01(unpackUByte01(pixels[b + 0]) * a); + p.a = pixels[b + 3]; + } + + return p.backingByteBuffer(); + } else if ( bands == 3 ) { + Pixel3b p = Pixel3b.malloc(count); + + int b = 0; + for ( int i = 0; i < count; i++, b += 3 ) { + p.view = i; + p.r = pixels[b + 2]; + p.g = pixels[b + 1]; + p.b = pixels[b + 0]; + } + + return p.backingByteBuffer(); + } else { + ByteBuffer p = BufferUtils.createByteBuffer(count * bands); + p.put(pixels, 0, p.capacity()); + p.flip(); + return p; + } + + } + + private static float unpackUByte01(final byte x) { + return (x & 0xFF) / 255.0f; + } + + private static byte packUByte01(final float x) { + return (byte)(x * 255.0f); + } + + private void updateBalls(final int count) { + System.out.println("NUMBER OF BALLS: " + count); + renderer.updateBalls(ballCount); + } + + private void run() { + long startTime = System.currentTimeMillis() + 5000; + long fps = 0; + + long time = Sys.getTime(); + final int ticksPerUpdate = (int)(Sys.getTimerResolution() / ANIMATION_TICKS); + + renderer.render(false, true, 0); + + while ( run ) { + Display.processMessages(); + handleInput(); + + glClear(GL_COLOR_BUFFER_BIT); + + final long currTime = Sys.getTime(); + final int delta = (int)(currTime - time); + if ( smooth || delta >= ticksPerUpdate ) { + renderer.render(render, animate, delta); + time = currTime; + } else + renderer.render(render, false, 0); + + Display.update(false); + //Display.sync(60); + + if ( startTime > System.currentTimeMillis() ) { + fps++; + } else { + long timeUsed = 5000 + (startTime - System.currentTimeMillis()); + startTime = System.currentTimeMillis() + 5000; + System.out.println("FPS: " + (Math.round(fps / (timeUsed / 1000.0) * 10) / 10.0) + ", Balls: " + ballCount); + fps = 0; + } + } + } + + private void handleInput() { + if ( Display.isCloseRequested() ) + run = false; + + while ( Keyboard.next() ) { + if ( Keyboard.getEventKeyState() ) + continue; + + switch ( Keyboard.getEventKey() ) { + case Keyboard.KEY_1: + case Keyboard.KEY_2: + case Keyboard.KEY_3: + case Keyboard.KEY_4: + case Keyboard.KEY_5: + case Keyboard.KEY_6: + case Keyboard.KEY_7: + case Keyboard.KEY_8: + case Keyboard.KEY_9: + case Keyboard.KEY_0: + ballCount = 1 << (Keyboard.getEventKey() - Keyboard.KEY_1); + updateBalls(ballCount); + break; + case Keyboard.KEY_ADD: + case Keyboard.KEY_SUBTRACT: + int mult; + if ( Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) ) + mult = 1000; + else if ( Keyboard.isKeyDown(Keyboard.KEY_LMENU) || Keyboard.isKeyDown(Keyboard.KEY_RMENU) ) + mult = 100; + else if ( Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL) ) + mult = 10; + else + mult = 1; + if ( Keyboard.getEventKey() == Keyboard.KEY_SUBTRACT ) + mult = -mult; + ballCount += mult * 100; + if ( ballCount <= 0 ) + ballCount = 1; + updateBalls(ballCount); + break; + case Keyboard.KEY_ESCAPE: + run = false; + break; + case Keyboard.KEY_A: + animate = !animate; + System.out.println("Animation is now " + (animate ? "on" : "off") + "."); + break; + case Keyboard.KEY_C: + colorMask = !colorMask; + glColorMask(colorMask, colorMask, colorMask, false); + System.out.println("Color mask is now " + (colorMask ? "on" : "off") + "."); + // Disable alpha test when color mask is off, else we get no benefit. + if ( colorMask ) { + glEnable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + } else { + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); + } + break; + case Keyboard.KEY_R: + render = !render; + System.out.println("Rendering is now " + (render ? "on" : "off") + "."); + break; + case Keyboard.KEY_S: + smooth = !smooth; + System.out.println("Smooth animation is now " + (smooth ? "on" : "off") + "."); + break; + case Keyboard.KEY_T: + if ( texID == texBigID ) { + texID = texSmallID; + ballSize = 16; + } else { + texID = texBigID; + ballSize = 42; + } + renderer.updateBallSize(); + glBindTexture(GL_TEXTURE_2D, texID); + System.out.println("Now using the " + (texID == texBigID ? "big" : "small") + " texture."); + break; + case Keyboard.KEY_V: + vsync = !vsync; + Display.setVSyncEnabled(vsync); + System.out.println("VSYNC is now " + (vsync ? "enabled" : "disabled") + "."); + break; + } + } + + while ( Mouse.next() ) ; + } + + private void destroy() { + Display.destroy(); + } + + @MappedType(sizeof = 4 * 4) + public static class Sprite extends MappedObject { + + public float x, y; + public float dx, dy; + + } + + @MappedType(sizeof = 2 * 4) + public static class SpriteRender extends MappedObject { + + public float x, y; + + } + + private abstract class SpriteRenderer { + + protected Sprite sprites; + + protected int spriteCount; + + protected int vshID; + protected int progID; + + protected void createProgram() { + final int fshID = glCreateShader(GL_FRAGMENT_SHADER); + glShaderSource(fshID, "uniform sampler2D COLOR_MAP;\n" + + "void main(void) {\n" + + " gl_FragColor = texture2D(COLOR_MAP, gl_PointCoord);\n" + + "}"); + glCompileShader(fshID); + if ( glGetShader(fshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(fshID, glGetShader(fshID, GL_INFO_LOG_LENGTH))); + throw new RuntimeException("Failed to compile fragment shader."); + } + + progID = glCreateProgram(); + glAttachShader(progID, vshID); + glAttachShader(progID, fshID); + glLinkProgram(progID); + if ( glGetProgram(progID, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progID, glGetProgram(progID, GL_INFO_LOG_LENGTH))); + throw new RuntimeException("Failed to link shader program."); + } + + glUseProgram(progID); + glUniform1i(glGetUniformLocation(progID, "COLOR_MAP"), 0); + + updateBallSize(); + + glEnableClientState(GL_VERTEX_ARRAY); + } + + public void updateBallSize() { + glPointSize(ballSize); + } + + public abstract void updateBalls(int count); + + protected abstract void render(boolean render, boolean animate, int delta); + + } + + private abstract class SpriteRendererBatched extends SpriteRenderer { + + protected static final int BALLS_PER_BATCH = 10 * 1000; + + SpriteRendererBatched() { + vshID = glCreateShader(GL_VERTEX_SHADER); + glShaderSource(vshID, "void main(void) {\n" + + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + + "}"); + glCompileShader(vshID); + if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + throw new RuntimeException("Failed to compile vertex shader."); + } + + createProgram(); + } + + public void updateBalls(final int count) { + final Random random = new Random(); + + final Sprite newSprites = Sprite.malloc(count); + if ( sprites != null ) { + sprites.view = 0; + sprites.copyRange(newSprites, Math.min(count, spriteCount)); + } + + if ( count > spriteCount ) { + for ( int i = spriteCount; i < count; i++ ) { + newSprites.view = i; + + newSprites.x = (int)(random.nextFloat() * (SCREEN_WIDTH - ballSize) + ballSize * 0.5f); + newSprites.y = (int)(random.nextFloat() * (SCREEN_HEIGHT - ballSize) + ballSize * 0.5f); + newSprites.dx = random.nextFloat() * 0.4f - 0.2f; + newSprites.dy = random.nextFloat() * 0.4f - 0.2f; + } + } + + sprites = newSprites; + spriteCount = count; + } + + protected void animate( + final Sprite sprite, + final SpriteRender spriteRender, + final int ballSize, final int ballIndex, final int batchSize, final int delta + ) { + final float ballRadius = ballSize * 0.5f; + final float boundW = SCREEN_WIDTH - ballRadius; + final float boundH = SCREEN_HEIGHT - ballRadius; + + final Sprite[] sprites = sprite.asArray(); + final SpriteRender[] spritesRender = spriteRender.asArray(); + for ( int b = ballIndex, r = 0, len = (ballIndex + batchSize); b < len; b++, r++ ) { + float x = sprites[b].x; + float dx = sprites[b].dx; + + x += dx * delta; + if ( x < ballRadius ) { + x = ballRadius; + sprites[b].dx = -dx; + } else if ( x > boundW ) { + x = boundW; + sprites[b].dx = -dx; + } + sprites[b].x = x; + + float y = sprites[b].y; + float dy = sprites[b].dy; + + y += dy * delta; + if ( y < ballRadius ) { + y = ballRadius; + sprites[b].dy = -dy; + } else if ( y > boundH ) { + y = boundH; + sprites[b].dy = -dy; + } + sprites[b].y = y; + + spritesRender[r].x = x; + spritesRender[r].y = y; + } + } + + } + + private class SpriteRendererPlain extends SpriteRendererBatched { + + private final int DATA_PER_BATCH = BALLS_PER_BATCH * 2 * 4; // balls * 2 floats * 4 bytes + + protected int[] animVBO; + + private SpriteRender spritesRender; + + SpriteRendererPlain() { + System.out.println("Shootout Implementation: CPU animation & BufferData"); + spritesRender = SpriteRender.malloc(BALLS_PER_BATCH); + } + + public void updateBalls(final int count) { + super.updateBalls(count); + + final int batchCount = count / BALLS_PER_BATCH + (count % BALLS_PER_BATCH == 0 ? 0 : 1); + if ( animVBO != null && batchCount == animVBO.length ) + return; + + final int[] newAnimVBO = new int[batchCount]; + if ( animVBO != null ) { + System.arraycopy(animVBO, 0, newAnimVBO, 0, Math.min(animVBO.length, newAnimVBO.length)); + for ( int i = newAnimVBO.length; i < animVBO.length; i++ ) + glDeleteBuffers(animVBO[i]); + } + for ( int i = animVBO == null ? 0 : animVBO.length; i < newAnimVBO.length; i++ ) { + newAnimVBO[i] = glGenBuffers(); + glBindBuffer(GL_ARRAY_BUFFER, newAnimVBO[i]); + } + + animVBO = newAnimVBO; + } + + public void render(final boolean render, final boolean animate, final int delta) { + int batchSize = Math.min(ballCount, BALLS_PER_BATCH); + int ballIndex = 0; + int batchIndex = 0; + while ( ballIndex < ballCount ) { + glBindBuffer(GL_ARRAY_BUFFER, animVBO[batchIndex]); + + if ( animate ) + animate(ballIndex, batchSize, delta); + + if ( render ) { + glVertexPointer(2, GL_FLOAT, 0, 0); + glDrawArrays(GL_POINTS, 0, batchSize); + } + + ballIndex += batchSize; + batchSize = Math.min(ballCount - ballIndex, BALLS_PER_BATCH); + batchIndex++; + } + } + + private void animate(final int ballIndex, final int batchSize, final int delta) { + animate( + sprites, spritesRender, + ballSize, ballIndex, batchSize, delta + ); + + glBufferData(GL_ARRAY_BUFFER, DATA_PER_BATCH, GL_STREAM_DRAW); + glBufferSubData(GL_ARRAY_BUFFER, 0, spritesRender.backingByteBuffer()); + } + + } + + private class SpriteRendererMapped extends SpriteRendererBatched { + + private StreamVBO animVBO; + + SpriteRendererMapped() { + System.out.println("Shootout Implementation: CPU animation & MapBufferRange"); + } + + public void updateBalls(final int count) { + super.updateBalls(count); + + if ( animVBO != null ) + animVBO.destroy(); + + animVBO = new StreamVBO(GL_ARRAY_BUFFER, ballCount * (2 * 4)); + } + + public void render(final boolean render, final boolean animate, final int delta) { + int batchSize = Math.min(ballCount, BALLS_PER_BATCH); + int ballIndex = 0; + while ( ballIndex < ballCount ) { + if ( animate ) { + final ByteBuffer buffer = animVBO.map(batchSize * (2 * 4)); + + animate(sprites, SpriteRender.<SpriteRender>map(buffer), ballSize, ballIndex, batchSize, delta); + + animVBO.unmap(); + } + + if ( render ) { + glVertexPointer(2, GL_FLOAT, 0, ballIndex * (2 * 4)); + glDrawArrays(GL_POINTS, 0, batchSize); + } + + ballIndex += batchSize; + batchSize = Math.min(ballCount - ballIndex, BALLS_PER_BATCH); + } + } + + } + + private class SpriteRendererTF extends SpriteRenderer { + + private int progIDTF; + private int ballSizeLoc; + private int deltaLoc; + + private int[] tfVBO = new int[2]; + private int currVBO; + + SpriteRendererTF() { + System.out.println("Shootout Implementation: TF GPU animation"); + + // Transform-feedback program + + final int vshID = glCreateShader(GL_VERTEX_SHADER); + glShaderSource(vshID, "#version 130\n" + + "const float WIDTH = " + SCREEN_WIDTH + ";\n" + + "const float HEIGHT = " + SCREEN_HEIGHT + ";\n" + + "uniform float ballSize;\n" + // ballSize / 2 + "uniform float delta;\n" + + "void main(void) {\n" + + " vec4 anim = gl_Vertex;\n" + + " anim.xy = anim.xy + anim.zw * delta;\n" + + " vec2 animC = clamp(anim.xy, vec2(ballSize), vec2(WIDTH - ballSize, HEIGHT - ballSize));\n" + + " if ( anim.x != animC.x ) anim.z = -anim.z;\n" + + " if ( anim.y != animC.y ) anim.w = -anim.w;\n" + + " gl_Position = vec4(animC, anim.zw);\n" + + "}"); + glCompileShader(vshID); + if ( glGetShader(vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(vshID, glGetShader(vshID, GL_INFO_LOG_LENGTH))); + throw new RuntimeException("Failed to compile vertex shader."); + } + + progIDTF = glCreateProgram(); + glAttachShader(progIDTF, vshID); + glTransformFeedbackVaryings(progIDTF, new CharSequence[] { "gl_Position" }, GL_SEPARATE_ATTRIBS); + glLinkProgram(progIDTF); + if ( glGetProgram(progIDTF, GL_LINK_STATUS) == GL_FALSE ) { + System.out.println(glGetProgramInfoLog(progIDTF, glGetProgram(progIDTF, GL_INFO_LOG_LENGTH))); + throw new RuntimeException("Failed to link shader program."); + } + + glUseProgram(progIDTF); + + ballSizeLoc = glGetUniformLocation(progIDTF, "ballSize"); + deltaLoc = glGetUniformLocation(progIDTF, "delta"); + + glUniform1f(ballSizeLoc, ballSize * 0.5f); + + // ----------------- + + this.vshID = glCreateShader(GL_VERTEX_SHADER); + glShaderSource(this.vshID, "void main(void) {\n" + + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + + "}"); + glCompileShader(this.vshID); + if ( glGetShader(this.vshID, GL_COMPILE_STATUS) == GL_FALSE ) { + System.out.println(glGetShaderInfoLog(this.vshID, glGetShader(this.vshID, GL_INFO_LOG_LENGTH))); + throw new RuntimeException("Failed to compile vertex shader."); + } + + createProgram(); + } + + public void updateBallSize() { + glUseProgram(progIDTF); + glUniform1f(ballSizeLoc, ballSize * 0.5f); + + glUseProgram(progID); + super.updateBallSize(); + } + + private void doUpdateBalls(final int count) { + final Random random = new Random(); + + final Sprite newSprites = Sprite.malloc(count); + if ( sprites != null ) { + sprites.view = 0; + sprites.copyRange(newSprites, Math.min(count, spriteCount)); + } + + if ( count > spriteCount ) { + for ( int i = spriteCount; i < count; i++ ) { + newSprites.view = i; + + newSprites.x = (int)(random.nextFloat() * (SCREEN_WIDTH - ballSize) + ballSize * 0.5f); + newSprites.y = (int)(random.nextFloat() * (SCREEN_HEIGHT - ballSize) + ballSize * 0.5f); + newSprites.dx = random.nextFloat() * 0.4f - 0.2f; + newSprites.dy = random.nextFloat() * 0.4f - 0.2f; + } + } + + sprites = newSprites; + spriteCount = count; + } + + public void updateBalls(final int count) { + if ( tfVBO[0] != 0 ) { + // Fetch current animation state + glGetBufferSubData(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sprites.backingByteBuffer()); + } + + doUpdateBalls(count); + + if ( tfVBO[0] != 0 ) { + for ( int i = 0; i < tfVBO.length; i++ ) + glDeleteBuffers(tfVBO[i]); + } + + for ( int i = 0; i < tfVBO.length; i++ ) { + tfVBO[i] = glGenBuffers(); + glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, tfVBO[i]); + glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sprites.backingByteBuffer(), GL_STATIC_DRAW); + } + + glBindBuffer(GL_ARRAY_BUFFER, tfVBO[0]); + glVertexPointer(2, GL_FLOAT, (4 * 4), 0); + } + + public void render(final boolean render, final boolean animate, final int delta) { + if ( animate ) { + glUseProgram(progIDTF); + glUniform1f(deltaLoc, delta); + + final int vbo = currVBO; + currVBO = 1 - currVBO; + + glBindBuffer(GL_ARRAY_BUFFER, tfVBO[vbo]); + glVertexPointer(4, GL_FLOAT, 0, 0); + + glEnable(GL_RASTERIZER_DISCARD); + if ( GLContext.getCapabilities().OpenGL30 ) { + glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, tfVBO[1 - vbo]); + + glBeginTransformFeedback(GL_POINTS); + glDrawArrays(GL_POINTS, 0, ballCount); + glEndTransformFeedback(); + } else { + glBindBufferBaseEXT(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, 0, tfVBO[1 - vbo]); + + glBeginTransformFeedbackEXT(GL_POINTS); + glDrawArrays(GL_POINTS, 0, ballCount); + glEndTransformFeedbackEXT(); + } + glDisable(GL_RASTERIZER_DISCARD); + + glUseProgram(progID); + glVertexPointer(2, GL_FLOAT, (4 * 4), 0); + } + + if ( render ) + glDrawArrays(GL_POINTS, 0, ballCount); + } + + } + +} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedHelper.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -31,6 +31,9 @@ */ package org.lwjgl.util.mapped; +import org.lwjgl.LWJGLUtil; +import org.lwjgl.MemoryUtil; + import java.nio.ByteBuffer; /** @@ -43,30 +46,32 @@ public class MappedHelper { public static void setup(MappedObject mo, ByteBuffer buffer, int align, int sizeof) { - if ( mo.baseAddress != 0L ) + if ( LWJGLUtil.CHECKS && mo.baseAddress != 0L ) throw new IllegalStateException("this method should not be called by user-code"); - if ( buffer == null ) - throw new NullPointerException("buffer"); - if ( !buffer.isDirect() ) + if ( LWJGLUtil.CHECKS && !buffer.isDirect() ) throw new IllegalArgumentException("bytebuffer must be direct"); mo.preventGC = buffer; - if ( align <= 0 ) + if ( LWJGLUtil.CHECKS && align <= 0 ) throw new IllegalArgumentException("invalid alignment"); mo.align = align; - if ( sizeof % align != 0 ) + if ( LWJGLUtil.CHECKS && (sizeof <= 0 || sizeof % align != 0) ) throw new IllegalStateException("sizeof not a multiple of alignment"); mo.sizeof = sizeof; - long addr = MappedObjectUnsafe.getBufferBaseAddress(buffer) + buffer.position(); - if ( addr % align != 0 ) + long addr = MemoryUtil.getAddress(buffer); + if ( LWJGLUtil.CHECKS && addr % align != 0 ) throw new IllegalStateException("buffer address not aligned on " + align + " bytes"); mo.baseAddress = mo.viewAddress = addr; } + public static void checkAddress(MappedObject mapped, long viewAddress) { + mapped.checkAddress(viewAddress); + } + public static void put_views(MappedSet2 set, int view) { set.view(view); } @@ -87,6 +92,14 @@ return (int)(mapped.viewAddress - mapped.baseAddress) / sizeof; } + public static void put_view_shift(MappedObject mapped, int view, int sizeof_shift) { + mapped.setViewAddress(mapped.baseAddress + (view << sizeof_shift)); + } + + public static int get_view_shift(MappedObject mapped, int sizeof_shift) { + return ((int)(mapped.viewAddress - mapped.baseAddress)) >> sizeof_shift; + } + public static void put_view_next(MappedObject mapped, int sizeof) { mapped.setViewAddress(mapped.viewAddress + sizeof); } @@ -130,68 +143,124 @@ MappedObjectUnsafe.INSTANCE.putByte(addr, value); } + public static void bput(MappedObject mapped, byte value, int fieldOffset) { + MappedObjectUnsafe.INSTANCE.putByte(mapped.viewAddress + fieldOffset, value); + } + public static byte bget(long addr) { return MappedObjectUnsafe.INSTANCE.getByte(addr); } + public static byte bget(MappedObject mapped, int fieldOffset) { + return MappedObjectUnsafe.INSTANCE.getByte(mapped.viewAddress + fieldOffset); + } + // short public static void sput(short value, long addr) { MappedObjectUnsafe.INSTANCE.putShort(addr, value); } + public static void sput(MappedObject mapped, short value, int fieldOffset) { + MappedObjectUnsafe.INSTANCE.putShort(mapped.viewAddress + fieldOffset, value); + } + public static short sget(long addr) { return MappedObjectUnsafe.INSTANCE.getShort(addr); } + public static short sget(MappedObject mapped, int fieldOffset) { + return MappedObjectUnsafe.INSTANCE.getShort(mapped.viewAddress + fieldOffset); + } + // char public static void cput(char value, long addr) { MappedObjectUnsafe.INSTANCE.putChar(addr, value); } + public static void cput(MappedObject mapped, char value, int fieldOffset) { + MappedObjectUnsafe.INSTANCE.putChar(mapped.viewAddress + fieldOffset, value); + } + public static char cget(long addr) { return MappedObjectUnsafe.INSTANCE.getChar(addr); } + public static char cget(MappedObject mapped, int fieldOffset) { + return MappedObjectUnsafe.INSTANCE.getChar(mapped.viewAddress + fieldOffset); + } + // int public static void iput(int value, long addr) { MappedObjectUnsafe.INSTANCE.putInt(addr, value); } - public static int iget(long addr) { - return MappedObjectUnsafe.INSTANCE.getInt(addr); + public static void iput(MappedObject mapped, int value, int fieldOffset) { + MappedObjectUnsafe.INSTANCE.putInt(mapped.viewAddress + fieldOffset, value); } + public static int iget(long address) { + return MappedObjectUnsafe.INSTANCE.getInt(address); + } + + public static int iget(MappedObject mapped, int fieldOffset) { + return MappedObjectUnsafe.INSTANCE.getInt(mapped.viewAddress + fieldOffset); + } + // float public static void fput(float value, long addr) { MappedObjectUnsafe.INSTANCE.putFloat(addr, value); } + public static void fput(MappedObject mapped, float value, int fieldOffset) { + MappedObjectUnsafe.INSTANCE.putFloat(mapped.viewAddress + fieldOffset, value); + } + public static float fget(long addr) { return MappedObjectUnsafe.INSTANCE.getFloat(addr); } + public static float fget(MappedObject mapped, int fieldOffset) { + return MappedObjectUnsafe.INSTANCE.getFloat(mapped.viewAddress + fieldOffset); + } + // long public static void jput(long value, long addr) { MappedObjectUnsafe.INSTANCE.putLong(addr, value); } + public static void jput(MappedObject mapped, long value, int fieldOffset) { + MappedObjectUnsafe.INSTANCE.putLong(mapped.viewAddress + fieldOffset, value); + } + public static long jget(long addr) { return MappedObjectUnsafe.INSTANCE.getLong(addr); } + public static long lget(MappedObject mapped, int fieldOffset) { + return MappedObjectUnsafe.INSTANCE.getLong(mapped.viewAddress + fieldOffset); + } + // double public static void dput(double value, long addr) { MappedObjectUnsafe.INSTANCE.putDouble(addr, value); } + public static void dput(MappedObject mapped, double value, int fieldOffset) { + MappedObjectUnsafe.INSTANCE.putDouble(mapped.viewAddress + fieldOffset, value); + } + public static double dget(long addr) { return MappedObjectUnsafe.INSTANCE.getDouble(addr); } + public static double dget(MappedObject mapped, int fieldOffset) { + return MappedObjectUnsafe.INSTANCE.getDouble(mapped.viewAddress + fieldOffset); + } + } \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -32,6 +32,7 @@ package org.lwjgl.util.mapped; import org.lwjgl.LWJGLUtil; +import org.lwjgl.MemoryUtil; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; @@ -93,7 +94,7 @@ } final void checkAddress(final long address) { - final long base = MappedObjectUnsafe.getBufferBaseAddress(preventGC); + final long base = MemoryUtil.getAddress0(preventGC); final int offset = (int)(address - base); if ( address < base || preventGC.capacity() < (offset + this.sizeof) ) throw new IndexOutOfBoundsException(Integer.toString(offset / sizeof)); @@ -103,7 +104,7 @@ if ( bytes < 0 ) throw new IllegalArgumentException(); - if ( preventGC.capacity() < (viewAddress - MappedObjectUnsafe.getBufferBaseAddress(preventGC) + bytes) ) + if ( preventGC.capacity() < (viewAddress - MemoryUtil.getAddress0(preventGC) + bytes) ) throw new BufferOverflowException(); } @@ -155,7 +156,7 @@ /** * Creates an identical new MappedObject instance, comparable to the - * contract of {@link ByteBuffer#duplicate}. This is useful when more than one + * contract of {@link java.nio.ByteBuffer#duplicate}. This is useful when more than one * views of the mapped object are required at the same time, e.g. in * multithreaded access. */ @@ -166,7 +167,7 @@ /** * Creates a new MappedObject instance, with a base offset equal to - * the offset of the current view, comparable to the contract of {@link ByteBuffer#slice}. + * the offset of the current view, comparable to the contract of {@link java.nio.ByteBuffer#slice}. */ public final <T extends MappedObject> T slice() { // any method that calls this method will have its call-site modified @@ -188,6 +189,11 @@ throw new InternalError("type not registered"); } + /** Moves the current view to the next element. Non-transformed implementation for MappedSets. */ + final void nextSet() { + setViewAddress(viewAddress + sizeof); + } + /** * Copies and amount of <code>SIZEOF</code> bytes, from the current * mapped object, to the specified mapped object. @@ -220,10 +226,16 @@ return new MappedForeach<T>(mapped, elementCount); } + @SuppressWarnings("unused") + public final <T extends MappedObject> T[] asArray() { + // any method that calls this method will have its call-site modified + throw new InternalError("type not registered"); + } + ByteBuffer preventGC; /** - * Returns the {@link ByteBuffer} that backs this mapped object. + * Returns the {@link java.nio.ByteBuffer} that backs this mapped object. * * @return the backing buffer */ Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectClassLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectClassLoader.java 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectClassLoader.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -117,7 +117,7 @@ byte[] bytecode = readStream(this.getResourceAsStream(className.concat(".class"))); long t0 = System.nanoTime(); - bytecode = MappedObjectTransformer.transformFieldAccess(className, bytecode); + bytecode = MappedObjectTransformer.transformMappedAPI(className, bytecode); long t1 = System.nanoTime(); total_time_transforming += (t1 - t0); Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java 2011-07-21 22:52:16 UTC (rev 3596) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObjectTransformer.java 2011-07-22 02:01:56 UTC (rev 3597) @@ -1,21 +1,51 @@ /* - * Created on Jun 23, 2011 + * 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. */ - package org.lwjgl.util.mapped; import org.lwjgl.LWJGLUtil; import org.objectweb.asm.*; +import org.objectweb.asm.tree.*; +import org.objectweb.asm.tree.analysis.*; import org.objectweb.asm.util.TraceClassVisitor; -import java.io.*; +import java.io.PrintWriter; +import java.io.StringWriter; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.nio.ByteBuffer; import java.util.HashMap; import java.util.Map; -import java.util.StringTokenizer; +import static org.objectweb.asm.ClassWriter.*; import static org.objectweb.asm.Opcodes.*; /** @@ -25,7 +55,7 @@ * The transformer supports some debugging tools, enabled through JVM system properties:<br/> * org.lwjgl.util.mapped.PrintTiming=true, prints timing information for the transformation step.<br/> * org.lwjgl.util.mapped.PrintActivity=true, prints activity information.<br/> - * org.lwjgl.util.mapped.PrintBytecode=true, prints the transformed bytecode. [not working atm]<br/> + * org.lwjgl.util.mapped.PrintBytecode=true, prints the transformed bytecode.<br/> * org.lwjgl.util.Debug must also be set to true for the above to work. * * @author Riven @@ -41,7 +71,24 @@ static final String MAPPED_OBJECT_JVM = jvmClassName(MappedObject.class); static final String MAPPED_HELPER_JVM = jvmClassName(MappedHelper.class); + static final String MAPPEDSET_PREFIX = jvmClassName(MappedSet.class); + static final String MAPPED_SET2_JVM = jvmClassName(MappedSet2.class); + static final String MAPPED_SET3_JVM = jvmClassName(MappedSet3.class); + static final String MAPPED_SET4_JVM = jvmClassName(MappedSet4.class); + + static final String LENGTH_METHOD_NAME = "length$LWJGL"; + static final String VIEWADDRESS_METHOD_NAME = "getViewAddress$LWJGL"; + static final String VIEW_CONSTRUCTOR_NAME = "constructView$LWJGL"; + + static final Map<Integer, String> OPCODE_TO_NAME = new HashMap<Integer, String>(); + static final Map<Integer, String> INSNTYPE_TO_NAME = new HashMap<Integer, String>(); + + static boolean is_currently_computing_frames; + static { + getClassEnums(Opcodes.class, OPCODE_TO_NAME, "V1_", "ACC_", "T_", "F_", "MH_"); + getClassEnums(AbstractInsnNode.class, INSNTYPE_TO_NAME); + className_to_subtype = new HashMap<String, MappedSubtypeInfo>(); { @@ -59,11 +106,10 @@ // => IADD // => PUTFIELD MyMappedType.view // - MappedSubtypeInfo info = new MappedSubtypeInfo(MAPPED_OBJECT_JVM, -1, -1); - className_to_subtype.put(info.className, info); + className_to_subtype.put(MAPPED_OBJECT_JVM, new MappedSubtypeInfo(MAPPED_OBJECT_JVM, -1, -1)); } - String vmName = System.getProperty("java.vm.name"); + final String vmName = System.getProperty("java.vm.name"); if ( vmName != null && !vmName.contains("Server") ) { System.err.println("Warning: " + MappedObject.class.getSimpleName() + "s have inferiour performance on Client VMs, please consider switching to a Server VM."); } @@ -71,7 +117,7 @@ /** * Registers a class as a mapped object. - * The class must extend {@link MappedObject} and be annotated with {@link MappedField}. + * The class must extend {@link org.lwjgl.util.mapped.MappedObject} and be annotated with {@link org.lwjgl.util.mapped.MappedField}. * * @param type the mapped object class. */ @@ -79,585 +125,992 @@ if ( MappedObjectClassLoader.FORKED ) return; - MappedType mapped = type.getAnnotation(MappedType.class); + final MappedType mapped = type.getAnnotation(MappedType.class); if ( mapped == null ) throw new InternalError("missing " + MappedType.class.getName() + " annotation"); if ( type.getEnclosingClass() != null && !Modifier.isStatic(type.getModifiers()) ) throw new InternalError("only top-level or static inner classes are allowed"); - String className = jvmClassName(type); + final MappedSubtypeInfo mappedType = new MappedSubtypeInfo(jvmClassName(type), mapped.sizeof(), mapped.align()); - MappedSubtypeInfo mappedType = new MappedSubtypeInfo(className, mapped.sizeof(), mapped.align()); - int advancingOffset = 0; + for ( Field field : type.getDeclaredFields() ) + advancingOffset += registerField(mapped, mappedType.className, mappedType, advancingOffset, field); - for ( Field field : type.getDeclaredFields() ) { - // static fields are never mapped - if ( Modifier.isStatic(field.getModifiers()) ) - continue; + if ( className_to_subtype.put(mappedType.className, mappedType) != null ) + throw new InternalError("duplicate mapped type: " + mappedType.className); + } - // we only support primitives and ByteBuffers - if ( !field.getType().isPrimitive() && field.getType() != ByteBuffer.class ) - throw new InternalError("field '" + className + "." + field.getName() + "' not supported: " + field.getType()); + private static int registerField(final MappedType mapped, final String className, final MappedSubtypeInfo mappedType, int advancingOffset, final Field field) { + if ( Modifier.isStatic(field.getModifiers()) ) // static fields are never mapped + return 0; - MappedField meta = field.getAnnotation(MappedField.class); - if ( meta == null && !mapped.autoGenerateOffsets() ) - throw new InternalError("field '" + className + "." + field.getName() + "' missing annotation " + MappedField.class.getName() + ": " + className); + // we only support primitives and ByteBuffers + if ( !field.getType().isPrimitive() && field.getType() != ByteBuffer.class ) + throw new InternalError("field '" + className + "." + field.getName() + "' not supported: " + field.getType()); - // quick hack - long byteOffset = meta == null ? advancingOffset : meta.byteOffset(); - long byteLength; - if ( field.getType() == long.class || field.getType() == double.class ) - byteLength = 8; - else if ( field.getType() == int.class || field.getType() == float.class ) - byteLength = 4; - else if ( field.getType() == char.class || field.getType() == short.class ) - byteLength = 2; - else if ( field.getType() == byte.class ) - byteLength = 1; - else if ( field.getType() == ByteBuffer.class ) { - byteLength = meta.byteLength(); - if ( byteLength < 0 ) - throw new IllegalStateException("invalid byte length for mapped ByteBuffer field: " + className + "." + field.getName() + " [length=" + byteLength + "]"); - } else - throw new IllegalStateException(field.getType().getName()); + MappedField meta = field.getAnnotation(MappedField.class); + if ( meta == null && !mapped.autoGenerateOffsets() ) + throw new InternalError("field '" + className + "." + field.getName() + "' missing annotation " + MappedField.class.getName() + ": " + className); - if ( field.getType() != ByteBuffer.class ) - if ( (advancingOffset % byteLength) != 0 ) - throw new IllegalStateException("misaligned mapped type: " + className + "." + field.getName()); + // quick hack + long byteOffset = meta == null ? advancingOffset : meta.byteOffset(); + long byteLength; + if ( field.getType() == long.class || field.getType() == double.class ) + byteLength = 8; + else if ( field.getType() == int.class || field.getType() == float.class ) + byteLength = 4; + else if ( field.getType() == char.class || field.getType() == short.class ) + byteLength = 2; + else if ( field.getType() == byte.class ) + byteLength = 1; + else if ( field.getType() == ByteBuffer.class ) { + byteLength = meta.byteLength(); + if ( byteLength < 0 ) + throw new IllegalStateException("invalid byte length for mapped ByteBuffer field: " + className + "." + field.getName() + " [length=" + byteLength + "]"); + } else + throw new InternalError(field.getType().getName()); - if ( PRINT_ACTIVITY ) - LWJGLUtil.log(MappedObjectTransformer.class.getSimpleName() + ": " + className + "." + field.getName() + " [type=" + field.getType().getSimpleName() + ", offset=" + byteOffset + "]"); + if ( field.getType() != ByteBuffer.class && (advancingOffset % byteLength) != 0 ) + throw new IllegalStateException("misaligned mapped type: " + className + "." + field.getName()); - mappedType.fieldToOffset.put(field.getName(), byteOffset); - mappedType.fieldToLength.put(field.getName(), byteLength); + if ( PRINT_ACTIVITY ) + LWJGLUtil.log(MappedObjectTransformer.class.getSimpleName() + ": " + className + "." + field.getName() + " [type=" + field.getType().getSimpleName() + ", offset=" + byteOffset + "]"); - advancingOffset += byteLength; - } + mappedType.fieldToOffset.put(field.getName(), byteOffset); + mappedType.fieldToLength.put(field.getName(), byteLength); + mappedType.fieldToType.put(field.getName(), Type.getType(field.getType())); - if ( className_to_subtype.put(className, mappedType) != null ) { - throw new InternalError("duplicate mapped type: " + className); - } + return (int)byteLength; } - static boolean is_currently_computing_frames = false; - static final String view_constructor_method = "_construct_view_"; + static byte[] transformMappedAPI(final String className, byte[] bytecode) { + final ClassWriter cw = new ClassWriter(COMPUTE_FRAMES) { - static byte[] transformFieldAccess(final String className, byte[] bytecode) { - int flags = ClassWriter.COMPUTE_FRAMES; - - ClassWriter writer = new ClassWriter(flags) { - // HACK: prevent user-code static-initialization-blocks to be executed - @Override protected String getCommonSuperClass(String a, String b) { - if ( is_currently_computing_frames ) - if ( !a.startsWith("java/") || !b.startsWith("java/") ) - return "java/lang/Object"; + // HACK: prevent user-code static-initialization-blocks to be executed + if ( is_currently_computing_frames && !a.startsWith("java/") || !b.startsWith("java/") ) + return "java/lang/Object"; + return super.getCommonSuperClass(a, b); } + }; - ClassAdapter adapter = new ClassAdapter(writer) { + ClassVisitor cv = getTransformationAdapter(className, cw); + if ( className_to_subtype.containsKey(className) ) // Do a first pass to generate address getters + cv = getMethodGenAdapter(className, cv); + + //cr.accept(cv, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); + new ClassReader(bytecode).accept(cv, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); + bytecode = cw.toByteArray(); + + if ( PRINT_BYTECODE ) + printBytecode(bytecode); + + return bytecode; + } + + private static ClassAdapter getMethodGenAdapter(final String className, final ClassVisitor cv) { + return new ClassAdapter(cv) { + @Override - public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - { - MappedSubtypeInfo mappedSubtype = className_to_subtype.get(className); + public void visitEnd() { + generateViewAddressGetter(); + generateLengthGetter(); - if ( mappedSubtype != null && !mappedSubtype.className.equals(MAPPED_OBJECT_JVM) ) { - if ( "<init>".equals(name) ) { - if ( !"()V".equals(desc) ) - throw new IllegalStateException(className + " can only have a default constructor, found: " + desc); + final MappedSubtypeInfo mappedSubtype = className_to_subtype.get(className); - MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); - mv.visitCode(... [truncated message content] |
From: <ka...@us...> - 2011-08-14 17:07:29
|
Revision: 3614 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3614&view=rev Author: kappa1 Date: 2011-08-14 17:07:23 +0000 (Sun, 14 Aug 2011) Log Message: ----------- AppletLoader: al_version tag now uses a case insensitive String (instead of float), much nicer for specifying application versions (e.g. "10.3.3.1 Beta"), still backwards compatible too :) Modified Paths: -------------- trunk/LWJGL/applet/advance/appletloader.html trunk/LWJGL/applet/basic/basicapplet.html trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Modified: trunk/LWJGL/applet/advance/appletloader.html =================================================================== --- trunk/LWJGL/applet/advance/appletloader.html 2011-08-14 10:46:00 UTC (rev 3613) +++ trunk/LWJGL/applet/advance/appletloader.html 2011-08-14 17:07:23 UTC (rev 3614) @@ -32,12 +32,12 @@ <!-- Tags under here are optional --> - <!-- Version of Applet, important otherwise applet won't be cached, version change will update applet, must be int or float --> - <!-- <param name="al_version" value="0.1"> --> - <!-- whether to use cache - defaults to true --> <!-- <param name="al_cache" value="true"> --> + <!-- Version of Applet (case insensitive String), applet files not redownloaded if same version already in cache --> + <!-- <param name="al_version" value="0.1"> --> + <!-- background color to paint with, defaults to white --> <!-- <param name="boxbgcolor" value="#000000"> --> Modified: trunk/LWJGL/applet/basic/basicapplet.html =================================================================== --- trunk/LWJGL/applet/basic/basicapplet.html 2011-08-14 10:46:00 UTC (rev 3613) +++ trunk/LWJGL/applet/basic/basicapplet.html 2011-08-14 17:07:23 UTC (rev 3614) @@ -32,12 +32,12 @@ <!-- Tags under here are optional --> - <!-- Version of Applet, important otherwise applet won't be cached, version change will update applet, must be int or float --> - <!-- <param name="al_version" value="0.1"> --> - <!-- whether to use cache - defaults to true --> <!-- <param name="al_cache" value="true"> --> + <!-- Version of Applet (case insensitive String), applet files not redownloaded if same version already in cache --> + <!-- <param name="al_version" value="0.1"> --> + <!-- background color to paint with, defaults to white --> <!-- <param name="boxbgcolor" value="#000000"> --> Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-08-14 10:46:00 UTC (rev 3613) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-08-14 17:07:23 UTC (rev 3614) @@ -144,6 +144,7 @@ * <li>Bobjob</li> * <li>Dashiva</li> * <li>Dr_evil</li> + * <li>Elias Naur</li> * <li>Kevin Glass</li> * <li>Matthias Mann</li> * <li>Mickelukas</li> @@ -808,14 +809,12 @@ // if specified applet version already available don't download anything boolean versionAvailable = false; - // version of applet + // version string of applet String version = getParameter("al_version"); - float latestVersion = 0; - + // if applet version specifed, compare with version in the cache if (version != null) { - latestVersion = Float.parseFloat(version); - versionAvailable = compareVersion(versionFile, latestVersion); + versionAvailable = compareVersion(versionFile, version.toLowerCase()); } // if jars not available or need updating download them @@ -838,7 +837,7 @@ // save version information once jars downloaded successfully if (version != null) { percentage = 90; - writeObjectFile(versionFile, latestVersion); + writeObjectFile(versionFile, version.toLowerCase()); } // save file names with last modified info once downloaded successfully @@ -883,21 +882,23 @@ /** * This method will return true if the version stored in the file - * matches the supplied float version. + * matches the supplied String version. * * @param versionFile - location to file containing version information - * @param version - float version that needs to be compared + * @param version - String version that needs to be compared * @return returns true if the version in file matches specified version */ - protected boolean compareVersion(File versionFile, float version) { + protected boolean compareVersion(File versionFile, String version) { // if version file exists if (versionFile.exists()) { + String s = readStringFile(versionFile); + // compare to version with file - if (version == readFloatFile(versionFile)) { + if (s != null && s.equals(version)) { percentage = 90; // not need to download cache files again if(debugMode) { - System.out.println("Loading Cached Applet Version " + version); + System.out.println("Loading Cached Applet Version: " + version); } debug_sleep(2000); @@ -980,22 +981,21 @@ } /** - * read float from File + * read String object from File * * @param file to be read - * @return the float stored in the file or 0 if it fails + * @return the String stored in the file or null if it fails */ - protected float readFloatFile(File file) { + protected String readStringFile(File file) { try { - Float version = (Float)readObjectFile(file); - return version.floatValue(); + return (String)readObjectFile(file); } catch (Exception e) { // failed to read version file e.printStackTrace(); } - // return 0 if failed to read file - return 0; + // return null if failed to read file + return null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2011-08-15 19:24:45
|
Revision: 3615 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3615&view=rev Author: matzon Date: 2011-08-15 19:24:39 +0000 (Mon, 15 Aug 2011) Log Message: ----------- Updating version to 2.8.0, still some stuff to do tho Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/src/java/org/lwjgl/Sys.java Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2011-08-14 17:07:23 UTC (rev 3614) +++ trunk/LWJGL/platform_build/build-definitions.xml 2011-08-15 19:24:39 UTC (rev 3615) @@ -12,7 +12,7 @@ <property name="lwjgl.docs" location="doc" /> <property name="lwjgl.temp" location="temp" /> <property name="lwjgl.res" location="res" /> - <property name="lwjgl.version" value="2.7.1" /> + <property name="lwjgl.version" value="2.8.0" /> <property name="lwjgl.web" location="www" /> <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2011-08-14 17:07:23 UTC (rev 3614) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2011-08-15 19:24:39 UTC (rev 3615) @@ -54,7 +54,7 @@ private static final String JNI_LIBRARY_NAME = "lwjgl"; /** Current version of library */ - private static final String VERSION = "2.7.1"; + private static final String VERSION = "2.8.0"; private static final String POSTFIX64BIT = "64"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-08-29 13:34:24
|
Revision: 3625 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3625&view=rev Author: kappa1 Date: 2011-08-29 13:34:17 +0000 (Mon, 29 Aug 2011) Log Message: ----------- apply patch to enable applets on OS X using the java plugin2, credits to pjohnson for creating patch. Modified Paths: -------------- trunk/LWJGL/platform_build/macosx_ant/build.xml trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java trunk/LWJGL/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c trunk/LWJGL/src/native/macosx/context.h trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m Modified: trunk/LWJGL/platform_build/macosx_ant/build.xml =================================================================== --- trunk/LWJGL/platform_build/macosx_ant/build.xml 2011-08-29 00:54:54 UTC (rev 3624) +++ trunk/LWJGL/platform_build/macosx_ant/build.xml 2011-08-29 13:34:17 UTC (rev 3625) @@ -7,7 +7,7 @@ <mkdir dir="i386"/> <mkdir dir="x86_64"/> </target> - + <target name="clean"> <delete failonerror="false"> <fileset dir="i386"/> @@ -20,22 +20,19 @@ <target name="compile"> <apply dir="${dstdir}" executable="${compiler}" os="Mac OS X" skipemptyfilesets="true" failonerror="true" dest="${dstdir}"> - <arg line="${cflags} -ObjC -O2 -Wall -Wunused -c -fPIC -I${sdkroot}/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -I${sdkroot}/System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Headers -I${native}/common -I${native}/common/opengl -I${native}/macosx"/> + <arg line="${cflags} -ObjC -O2 -Wall -Wunused -c -fPIC -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -I${native}/common -I${native}/macosx -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/Headers"/> <!-- Map from *.m and *.c to .o --> <mapper type="regexp" from="^(.*)\.(c|m)" to="\1.o"/> <fileset dir="${native}/macosx" includes="*.m"/> <fileset dir="${native}/macosx" includes="*.c"/> <fileset dir="${native}/common" includes="*.c"/> - <fileset dir="${native}/common/opengl" includes="*.c"/> - <fileset dir="${native}/generated/openal" includes="*.c"/> - <fileset dir="${native}/generated/opencl" includes="*.c"/> - <fileset dir="${native}/generated/opengl" includes="*.c"/> + <fileset dir="${native}/generated" includes="*.c"/> </apply> </target> - + <target name="link"> <apply dir="${objdir}" parallel="true" executable="${linker}" os="Mac OS X" failonerror="true" skipemptyfilesets="true"> - <arg line="${linkerflags} -exported_symbols_list ../lwjgl.symbols -dynamiclib -o ${libname} -framework Foundation -framework AppKit -framework JavaVM -framework Carbon -framework OpenGL"/> + <arg line="${linkerflags} -exported_symbols_list ../lwjgl.symbols -dynamiclib -o ${libname} -framework Foundation -framework AppKit -framework JavaVM -framework Carbon -framework OpenGL -framework JavaNativeFoundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks"/> <fileset dir="${objdir}" includes="*.o"/> </apply> <apply dir="${objdir}" executable="strip" os="Mac OS X" failonerror="true"> @@ -43,7 +40,7 @@ <fileset dir="." file="${libname}"/> </apply> </target> - + <target name="nativelibrary" depends="init"> <property name="universal_sdkroot" location="/Developer/SDKs/MacOSX10.6.sdk"/> <property name="ppc_sdkroot" location="/Developer/SDKs/MacOSX10.6.sdk"/> @@ -52,19 +49,19 @@ <property name="ppc_flags" value="-isysroot ${ppc_sdkroot}"/> <antcall target="compile"> <param name="dstdir" location="ppc"/> - <param name="compiler" value="gcc-4.0"/> + <param name="compiler" value="gcc-4.2"/> <param name="sdkroot" location="${ppc_sdkroot}"/> <param name="cflags" value="${universal_flags} -arch ppc -mmacosx-version-min=10.3"/> </antcall> <antcall target="compile"> <param name="dstdir" location="i386"/> - <param name="compiler" value="gcc-4.0"/> + <param name="compiler" value="gcc-4.2"/> <param name="sdkroot" location="${universal_sdkroot}"/> <param name="cflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.4"/> </antcall> <antcall target="compile"> <param name="dstdir" location="x86_64"/> - <param name="compiler" value="gcc-4.0"/> + <param name="compiler" value="gcc-4.2"/> <param name="sdkroot" location="${universal_sdkroot}"/> <param name="cflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> </antcall> @@ -75,19 +72,19 @@ <antcall target="link"> <param name="objdir" location="ppc"/> <param name="libname" value="liblwjgl-ppc.jnilib"/> - <param name="linker" value="gcc-4.0"/> + <param name="linker" value="gcc-4.2"/> <param name="linkerflags" value="${universal_flags} -arch ppc -mmacosx-version-min=10.3"/> </antcall> <antcall target="link"> <param name="objdir" location="i386"/> <param name="libname" value="liblwjgl-i386.jnilib"/> - <param name="linker" value="gcc-4.0"/> + <param name="linker" value="gcc-4.2"/> <param name="linkerflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.4"/> </antcall> <antcall target="link"> <param name="objdir" location="x86_64"/> <param name="libname" value="liblwjgl-i86_64.jnilib"/> - <param name="linker" value="gcc-4.0"/> + <param name="linker" value="gcc-4.2"/> <param name="linkerflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> </antcall> <apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true" > Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java 2011-08-29 00:54:54 UTC (rev 3624) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java 2011-08-29 13:34:17 UTC (rev 3625) @@ -78,14 +78,15 @@ // We need to elevate privileges because of an AWT bug. Please see // http://192.18.37.44/forums/index.php?topic=10572 for a discussion. // It is only needed on first call, so we avoid it on all subsequent calls - // due to performance. + // due to performance.. + final Canvas parent = component instanceof AWTGLCanvas ? component : Display.getParent(); if (firstLockSucceeded) - return lockAndInitHandle(lock_buffer, component); + return lockAndInitHandle(lock_buffer, component, parent); else try { firstLockSucceeded = AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>() { public Boolean run() throws LWJGLException { - return lockAndInitHandle(lock_buffer, component); + return lockAndInitHandle(lock_buffer, component, parent); } }); return firstLockSucceeded; @@ -94,7 +95,7 @@ } } - private static native boolean lockAndInitHandle(ByteBuffer lock_buffer, Canvas component) throws LWJGLException; + private static native boolean lockAndInitHandle(ByteBuffer lock_buffer, Canvas component, Canvas display_parent) throws LWJGLException; void unlock() throws LWJGLException { nUnlock(lock_buffer); Modified: trunk/LWJGL/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c 2011-08-29 00:54:54 UTC (rev 3624) +++ trunk/LWJGL/src/native/common/org_lwjgl_opengl_AWTSurfaceLock.c 2011-08-29 13:34:17 UTC (rev 3625) @@ -49,15 +49,29 @@ } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle - (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas) { + (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas, jobject display_parent) { JAWT awt; JAWT_DrawingSurface* ds; JAWT_DrawingSurfaceInfo *dsi; AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle); - awt.version = JAWT_VERSION_1_4; - if (JAWT_GetAWT(env, &awt) == JNI_FALSE) { - throwException(env, "Could not get the JAWT interface"); - return JNI_FALSE; + + jboolean result = JNI_FALSE; + + #ifdef __MACH__ + if (display_parent) { + //first try CALAYER + awt.version = JAWT_VERSION_1_4 | 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); Modified: trunk/LWJGL/src/native/macosx/context.h =================================================================== --- trunk/LWJGL/src/native/macosx/context.h 2011-08-29 00:54:54 UTC (rev 3624) +++ trunk/LWJGL/src/native/macosx/context.h 2011-08-29 13:34:17 UTC (rev 3625) @@ -50,6 +50,7 @@ typedef struct { NSOpenGLPixelFormat *pixel_format; bool window; + bool canDrawGL; union { NSView *nsview; NSOpenGLPixelBuffer *pbuffer; Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m 2011-08-29 00:54:54 UTC (rev 3624) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m 2011-08-29 13:34:17 UTC (rev 3625) @@ -37,6 +37,9 @@ * @version $Revision$ */ +#import <Cocoa/Cocoa.h> +#import <JavaNativeFoundation.h> + #include <jni.h> #include <jawt_md.h> #include "awt_tools.h" @@ -44,13 +47,147 @@ #include "context.h" #include "common_tools.h" +// forward declaration +@interface PBufferGLLayer : NSOpenGLLayer { + MacOSXPeerInfo *peer_info; + GLuint textureID; + BOOL canDraw; +} + +@property (nonatomic) MacOSXPeerInfo *peer_info; +@property (nonatomic) GLuint textureID; +@end + + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXCanvasPeerInfo_nInitHandle - (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject peer_info_handle) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; +(JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject peer_info_handle) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); AWTSurfaceLock *surface = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle); JAWT_MacOSXDrawingSurfaceInfo *macosx_dsi = (JAWT_MacOSXDrawingSurfaceInfo *)surface->dsi->platformInfo; - peer_info->nsview = macosx_dsi->cocoaViewRef; - peer_info->window = true; + + // check for CALayer support + if(surface->awt.version & JAWT_MACOSX_USE_CALAYER) { + jint width = surface->dsi->bounds.width; + jint height = surface->dsi->bounds.height; + + if(peer_info->pbuffer == NULL || + width != [peer_info->pbuffer pixelsWide] || height != [peer_info->pbuffer pixelsHigh]) { + if(peer_info->pbuffer != NULL) { + [peer_info->pbuffer release]; + } + + // make pbuffer + NSOpenGLPixelBuffer *pbuffer = nil; + NSLog(@"Make pbuffer: %d x %d", width, height); + pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget:GL_TEXTURE_RECTANGLE_EXT + textureInternalFormat:GL_RGBA + textureMaxMipMapLevel:0 + pixelsWide:width + pixelsHigh:height]; + + peer_info->pbuffer = pbuffer; + peer_info->window = false; + peer_info->canDrawGL = true; + } + + if (macosx_dsi != NULL) { + [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ + // attach the "root layer" to the AWT Canvas surface layers + id <JAWT_SurfaceLayers> surfaceLayers = (id <JAWT_SurfaceLayers>)macosx_dsi;//dsi->platformInfo; + if(surfaceLayers.layer == NULL) { + PBufferGLLayer *caGLLayer = [[PBufferGLLayer new] autorelease]; + caGLLayer.peer_info = peer_info; + caGLLayer.asynchronous = YES; + caGLLayer.needsDisplayOnBoundsChange = YES; + caGLLayer.opaque = YES; + surfaceLayers.layer = caGLLayer; + } + }]; + } + } else { + peer_info->nsview = macosx_dsi->cocoaViewRef; + peer_info->window = true; + } + [pool release]; } + +// rotates a red square when asked to draw +@implementation PBufferGLLayer + +@synthesize peer_info; +@synthesize textureID; + +// override to draw custom GL content +-(void)drawInCGLContext:(CGLContextObj)glContext + pixelFormat:(CGLPixelFormatObj)pixelFormat + forLayerTime:(CFTimeInterval)timeInterval + displayTime:(const CVTimeStamp *)timeStamp { + + if(!peer_info || !peer_info->pbuffer) { + return; + } + + peer_info->canDrawGL = false; + + NSOpenGLPixelBuffer *pbuffer = self.peer_info->pbuffer; + + // set the current context + CGLSetCurrentContext(glContext); + + GLsizei width = [pbuffer pixelsWide]; + GLsizei height = [pbuffer pixelsHigh]; + + if(textureID == 0) { + glGenTextures(1, &textureID); + } + glBindTexture(GL_TEXTURE_RECTANGLE_EXT, self.textureID); + CGLTexImagePBuffer(glContext,[pbuffer CGLPBufferObj], GL_FRONT); + + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glEnable(GL_TEXTURE_RECTANGLE_EXT); + + static GLfloat verts[] = { + -1.0, -1.0, + -1.0, 1.0, + 1.0, 1.0, + 1.0, -1.0 + }; + + GLfloat tex[] = { + 0.0, 0.0, + 0.0, height, + width, height, + width, 0.0 + }; + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glVertexPointer(2, GL_FLOAT, 0, verts); + glTexCoordPointer(2, GL_FLOAT, 0, tex); + + glDrawArrays(GL_QUADS, 0, 4); + + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + + glDisable(GL_TEXTURE_RECTANGLE_EXT); + + // call super to finalize the drawing - by default all it does is call glFlush() + [super drawInCGLContext:glContext pixelFormat:pixelFormat forLayerTime:timeInterval displayTime:timeStamp]; +} + +-(BOOL)canDrawInCGLContext:(CGLContextObj)glContext + pixelFormat:(CGLPixelFormatObj)pixelFormat + forLayerTime:(CFTimeInterval)timeInterval + displayTime:(const CVTimeStamp *)timeStamp { + return peer_info->canDrawGL ? YES : NO; +} + +@end \ No newline at end of file Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m 2011-08-29 00:54:54 UTC (rev 3624) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m 2011-08-29 13:34:17 UTC (rev 3625) @@ -45,6 +45,7 @@ typedef struct { NSOpenGLContext *context; + MacOSXPeerInfo *peer_info; } MacOSXContext; JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nCreate @@ -72,6 +73,7 @@ } context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle); context_info->context = context; + context_info->peer_info = peer_info; [pool release]; return context_handle; } @@ -79,8 +81,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nSwapBuffers (JNIEnv *env, jclass clazz, jobject context_handle) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - MacOSXContext *peer_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle); - [peer_info->context flushBuffer]; + MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle); + [context_info->context flushBuffer]; + context_info->peer_info->canDrawGL = true; [pool release]; } @@ -90,6 +93,7 @@ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle); [context_info->context update]; + context_info->peer_info->canDrawGL = true; [pool release]; } @@ -118,6 +122,7 @@ } else { [context_info->context setPixelBuffer:peer_info->pbuffer cubeMapFace:0 mipMapLevel:0 currentVirtualScreen:0]; } + peer_info->canDrawGL = true; [pool release]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-09-03 14:47:17
|
Revision: 3630 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3630&view=rev Author: kappa1 Date: 2011-09-03 14:47:11 +0000 (Sat, 03 Sep 2011) Log Message: ----------- update credits Modified Paths: -------------- trunk/LWJGL/doc/CREDITS trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m trunk/LWJGL/www/credits.php Modified: trunk/LWJGL/doc/CREDITS =================================================================== --- trunk/LWJGL/doc/CREDITS 2011-09-03 11:04:04 UTC (rev 3629) +++ trunk/LWJGL/doc/CREDITS 2011-09-03 14:47:11 UTC (rev 3630) @@ -12,12 +12,13 @@ - Jos Hirth <jh...@ka...> - Kevin Glass <ke...@co...> - Atsuya Takagi - - kappaOne + - kappaOne <one...@gm...> - Simon Felix - Ryan McNally - Ciardhubh <ciardhubh[at]ciardhubh.de> - Jens von Pilgrim - Ruben Garat + - Pelle Johnsen <pel...@gm...> additional credits goes to: - Joseph I. Valenzuela [OpenAL stuff] Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-09-03 11:04:04 UTC (rev 3629) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-09-03 14:47:11 UTC (rev 3630) @@ -151,7 +151,7 @@ * <li>Matthias Mann</li> * <li>Mickelukas</li> * <li>NateS</li> - * <li>pjohnsen</li> + * <li>Pelle Johnsen</li> * <li>Riven</li> * <li>Ruben01</li> * <li>Shannon Smith</li> Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m 2011-09-03 11:04:04 UTC (rev 3629) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m 2011-09-03 14:47:11 UTC (rev 3630) @@ -34,6 +34,7 @@ * $Id$ * * @author elias_naur <eli...@us...> + * @author Pelle Johnsen * @version $Revision$ */ Modified: trunk/LWJGL/www/credits.php =================================================================== --- trunk/LWJGL/www/credits.php 2011-09-03 11:04:04 UTC (rev 3629) +++ trunk/LWJGL/www/credits.php 2011-09-03 14:47:11 UTC (rev 3630) @@ -22,6 +22,7 @@ <li>Simon Felix</li> <li>Ryan McNally</li> <li>Ciardhubh</li> + <li>Pelle Johnsen</li> </ul> <p> <b>Additional credits goes to</b> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2011-09-08 21:36:01
|
Revision: 3637 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3637&view=rev Author: matzon Date: 2011-09-08 21:35:54 +0000 (Thu, 08 Sep 2011) Log Message: ----------- applied maven patch by ruben01 Modified Paths: -------------- trunk/LWJGL/maven/build.xml trunk/LWJGL/maven/lwjgl.pom trunk/LWJGL/platform_build/build-maven.xml Removed Paths: ------------- trunk/LWJGL/maven/jinput-platform.pom trunk/LWJGL/maven/jinput.pom Modified: trunk/LWJGL/maven/build.xml =================================================================== --- trunk/LWJGL/maven/build.xml 2011-09-07 21:28:01 UTC (rev 3636) +++ trunk/LWJGL/maven/build.xml 2011-09-08 21:35:54 UTC (rev 3637) @@ -4,198 +4,240 @@ <property name="mavenrepoId" value="tmprepoid" /> <target name="install"> - <antcall target="execute"> + <antcall target="execute-install"> <param name="mvncommand" value="org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file"/> </antcall> </target> + <target name="deploy"> <antcall target="execute"> - <param name="mvncommand" value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file"/> + <param name="mvncommand" value="org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file"/> </antcall> </target> + <target name="deploy-gpg"> + <antcall target="execute"> + <param name="mvncommand" value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file"/> + </antcall> + </target> + + + <target name="execute"> + + <!-- parent.pom --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl-parent.pom" /> + <arg value="-Dfile=lwjgl-parent.pom" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <!-- lwjgl.jar --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl.pom" /> + <arg value="-Dfile=lwjgl.jar" /> + <arg value="-Dtypes=jar,jar" /> + <arg value="-Dclassifiers=sources,javadoc" /> + <arg value="-Dfiles=lwjgl-sources.jar,lwjgl-javadoc.jar" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + + <!-- lwjgl natives --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl-platform.pom" /> + <arg value="-Dfile=lwjgl-platform-natives-windows.jar" /> + <arg value="-Dclassifier=natives-windows" /> + <arg value="-Dtypes=jar,jar" /> + <arg value="-Dclassifiers=natives-linux,natives-osx" /> + <arg value="-Dfiles=lwjgl-platform-natives-linux.jar,lwjgl-platform-natives-osx.jar" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + + <!-- lwjgl_util.jar --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl_util.pom" /> + <arg value="-Dfile=lwjgl_util.jar" /> + <arg value="-Dtypes=jar,jar" /> + <arg value="-Dclassifiers=sources,javadoc" /> + <arg value="-Dfiles=lwjgl_util-sources.jar,lwjgl_util-javadoc.jar" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <!-- lwjgl_util_applet.jar --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl_util_applet.pom" /> + <arg value="-Dfile=lwjgl_util_applet.jar" /> + <arg value="-Dtypes=jar,jar" /> + <arg value="-Dclassifiers=sources,javadoc" /> + <arg value="-Dfiles=lwjgl_util_applet-sources.jar,lwjgl_util_applet-javadoc.jar" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + </target> + + + <target name="execute-install"> + + <!-- parent.pom --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl-parent.pom" /> + <arg value="-Dfile=lwjgl-parent.pom" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <!-- lwjgl.jar --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl.pom" /> + <arg value="-Dfile=lwjgl.jar" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl.pom" /> + <arg value="-Dfile=lwjgl-sources.jar" /> + <arg value="-Dclassifier=sources" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl.pom" /> + <arg value="-Dfile=lwjgl-javadoc.jar" /> + <arg value="-Dclassifier=javadoc" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <!-- lwjgl natives --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl-platform.pom" /> + <arg value="-Dfile=lwjgl-platform-natives-windows.jar" /> + <arg value="-Dclassifier=natives-windows" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl-platform.pom" /> + <arg value="-Dfile=lwjgl-platform-natives-linux.jar" /> + <arg value="-Dclassifier=natives-linux" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl-platform.pom" /> + <arg value="-Dfile=lwjgl-platform-natives-osx.jar" /> + <arg value="-Dclassifier=natives-osx" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <!-- lwjgl_util.jar --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl_util.pom" /> + <arg value="-Dfile=lwjgl_util.jar" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl_util.pom" /> + <arg value="-Dfile=lwjgl_util-sources.jar" /> + <arg value="-Dclassifier=sources" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl_util.pom" /> + <arg value="-Dfile=lwjgl_util-javadoc.jar" /> + <arg value="-Dclassifier=javadoc" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <!-- lwjgl_util_applet.jar --> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl_util_applet.pom" /> + <arg value="-Dfile=lwjgl_util_applet.jar" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl_util_applet.pom" /> + <arg value="-Dfile=lwjgl_util_applet-sources.jar" /> + <arg value="-Dclassifier=sources" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + + <artifact:mvn> + <arg value="${mvncommand}" /> + <arg value="-Durl=${mavenrepo}" /> + <arg value="-DrepositoryId=${mavenrepoId}" /> + <arg value="-DpomFile=lwjgl_util_applet.pom" /> + <arg value="-Dfile=lwjgl_util_applet-javadoc.jar" /> + <arg value="-Dclassifier=javadoc" /> + <arg value="-Plwjglgpg" /> + </artifact:mvn> + </target> - <!-- parent.pom --> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl-parent.pom" /> - <arg value="-Dfile=lwjgl-parent.pom" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <!-- lwjgl.jar --> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl.pom" /> - <arg value="-Dfile=lwjgl.jar" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl.pom" /> - <arg value="-Dfile=lwjgl-sources.jar" /> - <arg value="-Dclassifier=sources" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl.pom" /> - <arg value="-Dfile=lwjgl-javadoc.jar" /> - <arg value="-Dclassifier=javadoc" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <!-- lwjgl natives --> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl-platform.pom" /> - <arg value="-Dfile=lwjgl-platform-natives-win.jar" /> - <arg value="-Dclassifier=natives-win" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl-platform.pom" /> - <arg value="-Dfile=lwjgl-platform-natives-linux.jar" /> - <arg value="-Dclassifier=natives-linux" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl-platform.pom" /> - <arg value="-Dfile=lwjgl-platform-natives-mac.jar" /> - <arg value="-Dclassifier=natives-mac" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <!-- lwjgl_util.jar --> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl_util.pom" /> - <arg value="-Dfile=lwjgl_util.jar" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl_util.pom" /> - <arg value="-Dfile=lwjgl_util-sources.jar" /> - <arg value="-Dclassifier=sources" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl_util.pom" /> - <arg value="-Dfile=lwjgl_util-javadoc.jar" /> - <arg value="-Dclassifier=javadoc" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <!-- lwjgl_util_applet.jar --> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl_util_applet.pom" /> - <arg value="-Dfile=lwjgl_util_applet.jar" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl_util.pom" /> - <arg value="-Dfile=lwjgl_util_applet-sources.jar" /> - <arg value="-Dclassifier=sources" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=lwjgl_util.pom" /> - <arg value="-Dfile=lwjgl_util_applet-javadoc.jar" /> - <arg value="-Dclassifier=javadoc" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <!-- jinput.jar --> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=jinput.pom" /> - <arg value="-Dfile=jinput.jar" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <!-- jinput natives --> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=jinput-platform.pom" /> - <arg value="-Dfile=jinput-platform-natives-win.jar" /> - <arg value="-Dclassifier=natives-win" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=jinput-platform.pom" /> - <arg value="-Dfile=jinput-platform-natives-linux.jar" /> - <arg value="-Dclassifier=natives-linux" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - <artifact:mvn> - <arg value="${mvncommand}" /> - <arg value="-Durl=${mavenrepo}" /> - <arg value="-DrepositoryId=${mavenrepoId}" /> - <arg value="-DpomFile=jinput-platform.pom" /> - <arg value="-Dfile=jinput-platform-natives-mac.jar" /> - <arg value="-Dclassifier=natives-mac" /> - <arg value="-Plwjglgpg" /> - </artifact:mvn> - - </target> -</project> \ No newline at end of file + +</project> Deleted: trunk/LWJGL/maven/jinput-platform.pom =================================================================== --- trunk/LWJGL/maven/jinput-platform.pom 2011-09-07 21:28:01 UTC (rev 3636) +++ trunk/LWJGL/maven/jinput-platform.pom 2011-09-08 21:35:54 UTC (rev 3637) @@ -1,32 +0,0 @@ -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.lwjgl.lwjgl</groupId> - <artifactId>parent</artifactId> - <version>@VERSION@</version> - </parent> - <groupId>org.lwjgl.lwjgl</groupId> - <artifactId>jinput-platform</artifactId> - <packaging>jar</packaging> - <name>JInput - Java Game Controller API</name> - <version>@VERSION@</version> - <description>JInput - Java Game Controller API</description> - <url>http://java.net/projects/jinput</url> - <licenses> - <license> - <name>BSD</name> - <url>http://www.opensource.org/licenses/bsd-license.php</url> - <distribution>repo</distribution> - </license> - </licenses> - <developers> - <developer> - <id>Members</id> - <url>http://java.net/projects/jinput/members</url> - </developer> - </developers> - <scm> - <url>http://java.net/projects/jinput/sources/svn/show</url> - <connection>https://svn.java.net/svn/jinput~svn </connection> - </scm> -</project> Deleted: trunk/LWJGL/maven/jinput.pom =================================================================== --- trunk/LWJGL/maven/jinput.pom 2011-09-07 21:28:01 UTC (rev 3636) +++ trunk/LWJGL/maven/jinput.pom 2011-09-08 21:35:54 UTC (rev 3637) @@ -1,52 +0,0 @@ -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.lwjgl.lwjgl</groupId> - <artifactId>parent</artifactId> - <version>@VERSION@</version> - </parent> - <groupId>org.lwjgl.lwjgl</groupId> - <artifactId>jinput</artifactId> - <packaging>jar</packaging> - <name>JInput - Java Game Controller API</name> - <version>@VERSION@</version> - <description>JInput - Java Game Controller API</description> - <url>http://java.net/projects/jinput</url> - <licenses> - <license> - <name>BSD</name> - <url>http://www.opensource.org/licenses/bsd-license.php</url> - <distribution>repo</distribution> - </license> - </licenses> - <developers> - <developer> - <id>Members</id> - <url>http://java.net/projects/jinput/members</url> - </developer> - </developers> - <scm> - <url>http://java.net/projects/jinput/sources/svn/show</url> - <connection>https://svn.java.net/svn/jinput~svn </connection> - </scm> - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>jinput-platform</artifactId> - <version>${project.version}</version> - <classifier>natives-win</classifier> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>jinput-platform</artifactId> - <version>${project.version}</version> - <classifier>natives-linux</classifier> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>jinput-platform</artifactId> - <version>${project.version}</version> - <classifier>natives-mac</classifier> - </dependency> - </dependencies> -</project> Modified: trunk/LWJGL/maven/lwjgl.pom =================================================================== --- trunk/LWJGL/maven/lwjgl.pom 2011-09-07 21:28:01 UTC (rev 3636) +++ trunk/LWJGL/maven/lwjgl.pom 2011-09-08 21:35:54 UTC (rev 3637) @@ -22,7 +22,7 @@ <groupId>${project.groupId}</groupId> <artifactId>lwjgl-platform</artifactId> <version>${project.version}</version> - <classifier>natives-win</classifier> + <classifier>natives-windows</classifier> </dependency> <dependency> <groupId>${project.groupId}</groupId> @@ -34,12 +34,12 @@ <groupId>${project.groupId}</groupId> <artifactId>lwjgl-platform</artifactId> <version>${project.version}</version> - <classifier>natives-mac</classifier> + <classifier>natives-osx</classifier> </dependency> <dependency> - <groupId>${project.groupId}</groupId> + <groupId>net.java.jinput</groupId> <artifactId>jinput</artifactId> - <version>${project.version}</version> + <version>@JINPUTVERSION@</version> </dependency> </dependencies> </project> Modified: trunk/LWJGL/platform_build/build-maven.xml =================================================================== --- trunk/LWJGL/platform_build/build-maven.xml 2011-09-07 21:28:01 UTC (rev 3636) +++ trunk/LWJGL/platform_build/build-maven.xml 2011-09-08 21:35:54 UTC (rev 3637) @@ -4,6 +4,7 @@ <property name="lwjgl.maven" location="maven" /> <property name="lwjgl.dstMaven" location="${lwjgl.temp}/maven" /> <property name="lwjgl.src.java" location="${lwjgl.src}/java" /> + <property name="jinput.version" value="2.0.5" /> <fileset id="lwjgl-sources.manual.fileset" dir="${lwjgl.src.java}"> <patternset refid="lwjgl.package.pattern" /> @@ -36,6 +37,32 @@ ]]> </script> </target> + + <target name="-checkjinputversion"> + <script language="javascript" classpath="${lwjgl.lib}/jinput.jar"> + <![CDATA[ + importPackage(java.lang); + var version = net.java.games.input.Version.getVersion() + project.setNewProperty("jinputversion",version); + var declaredJinputVersion = project.getProperty("jinput.version"); + System.out.println("JINPUT Version: " + version + " - DeclaredVersion: " + declaredJinputVersion); + + if(declaredJinputVersion.equals(version)){ + System.out.println("JINPUT Version Matches"); + project.setNewProperty("jinputversionmatches", true); + } else { + System.out.println("JINPUT Version don't match"); + } + ]]> + </script> + <condition property="failjinputcheck"> + <and> + <not><isset property="jinputversionmatches" /></not> + <not><isset property="overridejinput" /></not> + </and> + </condition> + <fail if="failjinputcheck" message="Jinput version in project is different from the declared jinput version for maven add -Doverridejinput=true as a command line option to avoid this check" /> + </target> <target name="maven-full"> <antcall target="clean-java" /> @@ -47,7 +74,7 @@ <antcall target="maven"/> </target> - <target name="maven" depends="-fixmavenversion"> <!-- Added as dependency because using antcall creates a new project scope --> + <target name="maven" depends="-fixmavenversion, -checkjinputversion"> <!-- Added as dependency because using antcall creates a new project scope --> <delete dir="${lwjgl.dstMaven}" quiet="true" failonerror="false" taskname="cleaning maven dist" /> <mkdir dir="${lwjgl.dstMaven}" taskname="initialiazing temp maven folder" /> <antcall target="-copylwjgljars" /> @@ -56,9 +83,14 @@ <antcall target="-createmavennativejars" /> <antcall target="-copymavenpoms"/> <antcall target="-copymavendeploybuild"/> - <antcall target="-addjinput"/> <antcall target="-copymaventdist"/> </target> + + + + + + <target name="-copylwjgljars"> @@ -127,7 +159,7 @@ </target> <target name="-createmavennativejars"> - <jar destfile="${lwjgl.dstMaven}/lwjgl-platform-natives-win.jar" taskname="lwjgl-platform-natives-win.jar"> + <jar destfile="${lwjgl.dstMaven}/lwjgl-platform-natives-windows.jar" taskname="lwjgl-platform-natives-windows.jar"> <fileset dir="${lwjgl.lib}/windows"> <patternset refid="lwjgl-windows-lwjgl.fileset"/> </fileset> @@ -137,7 +169,7 @@ <patternset refid="lwjgl-linux-lwjgl.fileset"/> </fileset> </jar> - <jar destfile="${lwjgl.dstMaven}/lwjgl-platform-natives-mac.jar" taskname="lwjgl-platform-natives-mac.jar"> + <jar destfile="${lwjgl.dstMaven}/lwjgl-platform-natives-osx.jar" taskname="lwjgl-platform-natives-osx.jar"> <fileset dir="${lwjgl.lib}/macosx"> <patternset refid="lwjgl-macosx-lwjgl.fileset"/> </fileset> @@ -151,6 +183,7 @@ </fileset> <filterset> <filter token="VERSION" value="${lwjgl-maven-version}"/> + <filter token="JINPUTVERSION" value="${jinput.version}"/> </filterset> </copy> </target> @@ -163,43 +196,6 @@ </copy> </target> - <!-- JINPUT --> - <target name="-addjinput"> - <antcall target="-copyjinputjar" /> - <antcall target="-createmavennativejinputjars" /> - </target> - - <target name="-copyjinputjar"> - <copy todir="${lwjgl.dstMaven}"> - <fileset dir="${lwjgl.lib}"> - <patternset> - <include name="jinput.jar" /> - </patternset> - </fileset> - </copy> - </target> - - - <target name="-createmavennativejinputjars"> - <jar destfile="${lwjgl.dstMaven}/jinput-platform-natives-win.jar" taskname="jinput-platform-natives-win.jar"> - <fileset dir="${lwjgl.lib}/windows"> - <patternset refid="lwjgl-windows-jinput.fileset"/> - </fileset> - </jar> - <jar destfile="${lwjgl.dstMaven}/jinput-platform-natives-linux.jar" taskname="jinput-platform-natives-linux.jar"> - <fileset dir="${lwjgl.lib}/linux"> - <patternset refid="lwjgl-linux-jinput.fileset"/> - </fileset> - </jar> - <jar destfile="${lwjgl.dstMaven}/jinput-platform-natives-mac.jar" taskname="jinput-platform-natives-mac.jar"> - <fileset dir="${lwjgl.lib}/macosx"> - <patternset refid="lwjgl-macosx-jinput.fileset"/> - </fileset> - </jar> - </target> - - <!-- END JINPUT --> - <target name="-copymaventdist"> <zip destfile="${lwjgl.dist}/lwjgl-maven-${lwjgl.version}.zip" basedir="${lwjgl.temp}" includes="maven/**" /> </target> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-09-29 08:36:42
|
Revision: 3643 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3643&view=rev Author: spasi Date: 2011-09-29 08:36:36 +0000 (Thu, 29 Sep 2011) Log Message: ----------- Added support for INTEL_immediate_execution. Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml Added Paths: ----------- trunk/LWJGL/src/templates/org/lwjgl/opencl/INTEL_immediate_execution.java Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2011-09-27 22:38:32 UTC (rev 3642) +++ trunk/LWJGL/platform_build/build-definitions.xml 2011-09-29 08:36:36 UTC (rev 3643) @@ -17,7 +17,7 @@ <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> <property name="opengles-template-pattern" value="org/lwjgl/opengles/GLES*.java,org/lwjgl/opengles/ARB*.java,org/lwjgl/opengles/EXT*.java,org/lwjgl/opengles/AMD*.java,org/lwjgl/opengles/ANGLE*.java,org/lwjgl/opengles/APPLE*.java,org/lwjgl/opengles/ARM*.java,org/lwjgl/opengles/DMP*.java,org/lwjgl/opengles/IMG*.java,org/lwjgl/opengles/NV*.java,org/lwjgl/opengles/OES*.java,org/lwjgl/opengles/QCOM*.java,org/lwjgl/opengles/VIV*.java"/> - <property name="opencl-template-pattern-extensions" value="org/lwjgl/opencl/KHR*.java,org/lwjgl/opencl/EXT*.java,org/lwjgl/opencl/APPLE*.java,org/lwjgl/opencl/AMD*.java,org/lwjgl/opencl/NV*.java"/> + <property name="opencl-template-pattern-extensions" value="org/lwjgl/opencl/KHR*.java,org/lwjgl/opencl/EXT*.java,org/lwjgl/opencl/APPLE*.java,org/lwjgl/opencl/AMD*.java,org/lwjgl/opencl/INTEL*.java,org/lwjgl/opencl/NV*.java"/> <property name="opencl-template-pattern" value="org/lwjgl/opencl/CL*.java,${opencl-template-pattern-extensions}"/> <!-- ================================================================== --> Added: trunk/LWJGL/src/templates/org/lwjgl/opencl/INTEL_immediate_execution.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/INTEL_immediate_execution.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/INTEL_immediate_execution.java 2011-09-29 08:36:36 UTC (rev 3643) @@ -0,0 +1,47 @@ +/* + * 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. + */ +package org.lwjgl.opencl; + +import org.lwjgl.util.generator.opencl.CLDeviceExtension; + +@CLDeviceExtension +public interface INTEL_immediate_execution { + + // TODO: Update when spec is released publicly. + + /** cl_command_queue_properties - bitfield */ + int CL_QUEUE_IMMEDIATE_EXECUTION_ENABLE_INTEL = (1 << 2); + + /** cl_device_exec_capabilities - bitfield */ + int CL_EXEC_IMMEDIATE_EXECUTION_INTEL = (1 << 2); + +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-10-06 21:11:53
|
Revision: 3651 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3651&view=rev Author: kappa1 Date: 2011-10-06 21:11:46 +0000 (Thu, 06 Oct 2011) Log Message: ----------- update credits Modified Paths: -------------- trunk/LWJGL/doc/CREDITS trunk/LWJGL/www/credits.php Modified: trunk/LWJGL/doc/CREDITS =================================================================== --- trunk/LWJGL/doc/CREDITS 2011-10-06 20:16:37 UTC (rev 3650) +++ trunk/LWJGL/doc/CREDITS 2011-10-06 21:11:46 UTC (rev 3651) @@ -3,7 +3,7 @@ - Brian Matzon <br...@ma...> - Elias Naur <eli...@gm...> - Ioannis Tsakpinis <sp...@us...> - - Niels J\xF8rgensen <nj...@ni...> + - Niels J�rgensen <nj...@ni...> - Tristan Campbell <tr...@ha...> - Gregory Pierce <gre...@ya...> - Luke Holden <lh...@us...> @@ -19,6 +19,7 @@ - Jens von Pilgrim - Ruben Garat - Pelle Johnsen <pel...@gm...> + - Jae Kwon additional credits goes to: - Joseph I. Valenzuela [OpenAL stuff] Modified: trunk/LWJGL/www/credits.php =================================================================== --- trunk/LWJGL/www/credits.php 2011-10-06 20:16:37 UTC (rev 3650) +++ trunk/LWJGL/www/credits.php 2011-10-06 21:11:46 UTC (rev 3651) @@ -23,6 +23,7 @@ <li>Ryan McNally</li> <li>Ciardhubh</li> <li>Pelle Johnsen</li> + <li>Jae Kwon</li> </ul> <p> <b>Additional credits goes to</b> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-10-11 16:06:30
|
Revision: 3656 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3656&view=rev Author: spasi Date: 2011-10-11 16:06:23 +0000 (Tue, 11 Oct 2011) Log Message: ----------- Fixed build to include missing OpenGL ES classes on which Display depends. Excluded desktop OpenGL extensions from the OpenGL ES build. Modified Paths: -------------- trunk/LWJGL/build.xml trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/platform_build/build-maven.xml Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2011-10-10 10:18:03 UTC (rev 3655) +++ trunk/LWJGL/build.xml 2011-10-11 16:06:23 UTC (rev 3656) @@ -132,6 +132,7 @@ <!-- Create lwjgl.jar --> <jar destfile="${lwjgl.temp}/jar/lwjgl-debug.jar" taskname="lwjgl-debug.jar"> <fileset refid="lwjgl.fileset" /> + <fileset refid="lwjgl.fileset.dependencies"/> <manifest> <attribute name="Sealed" value="true"/> </manifest> @@ -143,12 +144,7 @@ <!-- Create lwjgl.jar --> <jar destfile="${lwjgl.temp}/jar/lwjgl.jar" taskname="lwjgl.jar"> <fileset refid="lwjgl.fileset" /> - <fileset dir="${lwjgl.bin}"> <!-- Display has a dependency on these --> - <patternset> - <include name="org/lwjgl/opengles/ContextAttribs.*"/> - <include name="org/lwjgl/opengles/PixelFormat.*"/> - </patternset> - </fileset> + <fileset refid="lwjgl.fileset.dependencies"/> <manifest> <attribute name="Sealed" value="true"/> </manifest> @@ -177,9 +173,40 @@ <!-- Packages the java files for the ES build --> <target name="-createjars_es"> + <!-- ================================================================== --> + <!-- Generate a list of the OpenGL extension classes --> + <!-- ================================================================== --> + <fileset id="opengl-template-fileset" dir="${lwjgl.src}/generated" includes="${opengl-template-pattern}"/> + <property name="opengl-template-files" refid="opengl-template-fileset"/> + + <tempfile property="temp.file"/> + <echo file="${temp.file}" message="${opengl-template-files}" taskname=""/> + + <loadfile srcfile="${temp.file}" property="opengl-template-classes"> + <filterchain> + <tokenfilter delimoutput=","> + <stringtokenizer delims=";"/> + <replaceregex pattern="org\${file.separator}lwjgl\${file.separator}opengl\${file.separator}(.+)[.]java" + replace="org/lwjgl/opengl/\1.class"/> + </tokenfilter> + </filterchain> + </loadfile> + + <delete file="${temp.file}" /> + <!-- Create lwjgl.jar --> <jar destfile="${lwjgl.temp}/jar/lwjgl.jar" taskname="lwjgl.jar"> - <fileset refid="lwjgl_es.fileset"/> + <!-- Files to include in the lwjgl.jar file, for the ES build --> + <fileset dir="${lwjgl.bin}" excludes="${opengl-template-classes}"> + <patternset id="lwjgl_es.package.pattern"> + <include name="org/**/*"/> + <exclude name="org/lwjgl/d3d/**"/> + <exclude name="org/lwjgl/test/**"/> + <exclude name="org/lwjgl/util/**"/> + <exclude name="org/lwjgl/examples/**"/> + </patternset> + </fileset> + <manifest> <attribute name="Sealed" value="true"/> </manifest> Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2011-10-10 10:18:03 UTC (rev 3655) +++ trunk/LWJGL/platform_build/build-definitions.xml 2011-10-11 16:06:23 UTC (rev 3656) @@ -35,15 +35,10 @@ <exclude name="org/lwjgl/examples/**" /> </patternset> </fileset> - - <!-- Files to include in the lwjgl.jar file, for the ES build --> - <fileset id="lwjgl_es.fileset" dir="${lwjgl.bin}"> - <patternset id="lwjgl_es.package.pattern"> - <include name="org/**/*"/> - <exclude name="org/lwjgl/d3d/**"/> - <exclude name="org/lwjgl/test/**"/> - <exclude name="org/lwjgl/util/**"/> - <exclude name="org/lwjgl/examples/**"/> + <fileset id="lwjgl.fileset.dependencies" dir="${lwjgl.bin}"> + <patternset id="lwjgl.package.dependencies.pattern"> + <include name="org/lwjgl/opengles/ContextAttribs*.*"/> + <include name="org/lwjgl/opengles/PixelFormat*.*"/> </patternset> </fileset> Modified: trunk/LWJGL/platform_build/build-maven.xml =================================================================== --- trunk/LWJGL/platform_build/build-maven.xml 2011-10-10 10:18:03 UTC (rev 3655) +++ trunk/LWJGL/platform_build/build-maven.xml 2011-10-11 16:06:23 UTC (rev 3656) @@ -8,6 +8,7 @@ <fileset id="lwjgl-sources.manual.fileset" dir="${lwjgl.src.java}"> <patternset refid="lwjgl.package.pattern" /> + <patternset refid="lwjgl.package.dependencies.pattern"/> </fileset> <fileset id="lwjgl-sources.generated.fileset" dir="${lwjgl.src.generated}"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2011-10-11 17:39:43
|
Revision: 3657 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3657&view=rev Author: matzon Date: 2011-10-11 17:39:37 +0000 (Tue, 11 Oct 2011) Log Message: ----------- bumping version to 2.8.1 Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/src/java/org/lwjgl/Sys.java Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2011-10-11 16:06:23 UTC (rev 3656) +++ trunk/LWJGL/platform_build/build-definitions.xml 2011-10-11 17:39:37 UTC (rev 3657) @@ -12,7 +12,7 @@ <property name="lwjgl.docs" location="doc" /> <property name="lwjgl.temp" location="temp" /> <property name="lwjgl.res" location="res" /> - <property name="lwjgl.version" value="2.8.0" /> + <property name="lwjgl.version" value="2.8.1" /> <property name="lwjgl.web" location="www" /> <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2011-10-11 16:06:23 UTC (rev 3656) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2011-10-11 17:39:37 UTC (rev 3657) @@ -54,7 +54,7 @@ private static final String JNI_LIBRARY_NAME = "lwjgl"; /** Current version of library */ - private static final String VERSION = "2.8.0"; + private static final String VERSION = "2.8.1"; private static final String POSTFIX64BIT = "64"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-10-12 18:54:47
|
Revision: 3664 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3664&view=rev Author: spasi Date: 2011-10-12 18:54:40 +0000 (Wed, 12 Oct 2011) Log Message: ----------- Removed org.lwjgl.opengles.PixelFormat dependency from Display. Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java Removed Paths: ------------- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextType.java Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2011-10-12 18:05:32 UTC (rev 3663) +++ trunk/LWJGL/platform_build/build-definitions.xml 2011-10-12 18:54:40 UTC (rev 3664) @@ -38,7 +38,6 @@ <fileset id="lwjgl.fileset.dependencies" dir="${lwjgl.bin}"> <patternset id="lwjgl.package.dependencies.pattern"> <include name="org/lwjgl/opengles/ContextAttribs*.*"/> - <include name="org/lwjgl/opengles/PixelFormat*.*"/> </patternset> </fileset> Deleted: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextType.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextType.java 2011-10-12 18:05:32 UTC (rev 3663) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextType.java 2011-10-12 18:54:40 UTC (rev 3664) @@ -1,45 +0,0 @@ -/* - * 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. - */ -package org.lwjgl.opengl; - -/** - * This enum can be used in the default Display.create method to specify - * the context type that will be created. - * - * @author Spasi - */ -public enum ContextType { - - GL, - GLES, - -} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2011-10-12 18:05:32 UTC (rev 3663) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2011-10-12 18:54:40 UTC (rev 3664) @@ -750,32 +750,6 @@ } /** - * Create the Display with the specified context type. If isFullscreen() is true or if windowed - * context are not supported on the platform, the display mode will be switched to the mode returned by - * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context - * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be - * created with the given parameters, a LWJGLException will be thrown. - * <p/> - * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. - * - * @param type the context type to create - * - * @throws LWJGLException - */ - public static void create(ContextType type) throws LWJGLException { - synchronized ( GlobalLock.lock ) { - switch ( type ) { - case GL: - create(new PixelFormat()); - break; - case GLES: - create(new org.lwjgl.opengles.PixelFormat()); - break; - } - } - } - - /** * Create the OpenGL context. If isFullscreen() is true or if windowed * context are not supported on the platform, the display mode will be switched to the mode returned by * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context @@ -787,7 +761,7 @@ * @throws LWJGLException */ public static void create() throws LWJGLException { - create(ContextType.GL); + create(new PixelFormat()); } /** @@ -805,7 +779,7 @@ */ public static void create(PixelFormat pixel_format) throws LWJGLException { synchronized ( GlobalLock.lock ) { - create(pixel_format, null, null); + create(pixel_format, null, (ContextAttribs)null); } } @@ -825,7 +799,7 @@ */ public static void create(PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException { synchronized ( GlobalLock.lock ) { - create(pixel_format, shared_drawable, null); + create(pixel_format, shared_drawable, (ContextAttribs)null); } } @@ -930,19 +904,19 @@ * <p/> * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * - * @param pixel_format Describes the minimum specifications the context must fulfill. + * @param pixel_format Describes the minimum specifications the context must fulfill. Must be an instance of org.lwjgl.opengles.PixelFormat. * * @throws LWJGLException */ - public static void create(org.lwjgl.opengles.PixelFormat pixel_format) throws LWJGLException { + public static void create(PixelFormatLWJGL pixel_format) throws LWJGLException { synchronized ( GlobalLock.lock ) { create(pixel_format, null, null); } } /** - * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed + * Create the OpenGL ES context with the given minimum parameters. If isFullscreen() is true or if windowed * context are not supported on the platform, the display mode will be switched to the mode returned by * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be @@ -950,19 +924,19 @@ * <p/> * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * - * @param pixel_format Describes the minimum specifications the context must fulfill. + * @param pixel_format Describes the minimum specifications the context must fulfill. Must be an instance of org.lwjgl.opengles.PixelFormat. * @param shared_drawable The Drawable to share context with. (optional, may be null) * * @throws LWJGLException */ - public static void create(org.lwjgl.opengles.PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException { + public static void create(PixelFormatLWJGL pixel_format, Drawable shared_drawable) throws LWJGLException { synchronized ( GlobalLock.lock ) { create(pixel_format, shared_drawable, null); } } /** - * Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed + * Create the OpenGL ES context with the given minimum parameters. If isFullscreen() is true or if windowed * context are not supported on the platform, the display mode will be switched to the mode returned by * getDisplayMode(), and a fullscreen context will be created. If isFullscreen() is false, a windowed context * will be created with the dimensions given in the mode returned by getDisplayMode(). If a context can't be @@ -970,12 +944,12 @@ * <p/> * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * - * @param pixel_format Describes the minimum specifications the context must fulfill. + * @param pixel_format Describes the minimum specifications the context must fulfill. Must be an instance of org.lwjgl.opengles.PixelFormat. * @param attribs The ContextAttribs to use when creating the context. (optional, may be null) * * @throws LWJGLException */ - public static void create(org.lwjgl.opengles.PixelFormat pixel_format, org.lwjgl.opengles.ContextAttribs attribs) throws LWJGLException { + public static void create(PixelFormatLWJGL pixel_format, org.lwjgl.opengles.ContextAttribs attribs) throws LWJGLException { synchronized ( GlobalLock.lock ) { create(pixel_format, null, attribs); } @@ -990,13 +964,13 @@ * <p/> * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * - * @param pixel_format Describes the minimum specifications the context must fulfill. + * @param pixel_format Describes the minimum specifications the context must fulfill. Must be an instance of org.lwjgl.opengles.PixelFormat. * @param shared_drawable The Drawable to share context with. (optional, may be null) * @param attribs The ContextAttribs to use when creating the context. (optional, may be null) * * @throws LWJGLException */ - public static void create(org.lwjgl.opengles.PixelFormat pixel_format, Drawable shared_drawable, org.lwjgl.opengles.ContextAttribs attribs) throws LWJGLException { + public static void create(PixelFormatLWJGL pixel_format, Drawable shared_drawable, org.lwjgl.opengles.ContextAttribs attribs) throws LWJGLException { synchronized ( GlobalLock.lock ) { if ( isCreated() ) throw new IllegalStateException("Only one LWJGL context may be instantiated at any one time."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2011-10-17 07:45:53
|
Revision: 3680 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3680&view=rev Author: matzon Date: 2011-10-17 07:45:46 +0000 (Mon, 17 Oct 2011) Log Message: ----------- switching to 2.8.2 Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/src/java/org/lwjgl/Sys.java Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2011-10-15 22:11:38 UTC (rev 3679) +++ trunk/LWJGL/platform_build/build-definitions.xml 2011-10-17 07:45:46 UTC (rev 3680) @@ -12,7 +12,7 @@ <property name="lwjgl.docs" location="doc" /> <property name="lwjgl.temp" location="temp" /> <property name="lwjgl.res" location="res" /> - <property name="lwjgl.version" value="2.8.1" /> + <property name="lwjgl.version" value="2.8.2" /> <property name="lwjgl.web" location="www" /> <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2011-10-15 22:11:38 UTC (rev 3679) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2011-10-17 07:45:46 UTC (rev 3680) @@ -54,7 +54,7 @@ private static final String JNI_LIBRARY_NAME = "lwjgl"; /** Current version of library */ - private static final String VERSION = "2.8.1"; + private static final String VERSION = "2.8.2"; private static final String POSTFIX64BIT = "64"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2011-11-13 21:20:49
|
Revision: 3699 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3699&view=rev Author: matzon Date: 2011-11-13 21:20:42 +0000 (Sun, 13 Nov 2011) Log Message: ----------- bumping to 2.8.3 Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/src/java/org/lwjgl/Sys.java Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2011-11-13 20:50:34 UTC (rev 3698) +++ trunk/LWJGL/platform_build/build-definitions.xml 2011-11-13 21:20:42 UTC (rev 3699) @@ -12,7 +12,7 @@ <property name="lwjgl.docs" location="doc" /> <property name="lwjgl.temp" location="temp" /> <property name="lwjgl.res" location="res" /> - <property name="lwjgl.version" value="2.8.2" /> + <property name="lwjgl.version" value="2.8.3" /> <property name="lwjgl.web" location="www" /> <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2011-11-13 20:50:34 UTC (rev 3698) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2011-11-13 21:20:42 UTC (rev 3699) @@ -54,7 +54,7 @@ private static final String JNI_LIBRARY_NAME = "lwjgl"; /** Current version of library */ - private static final String VERSION = "2.8.2"; + private static final String VERSION = "2.8.3"; private static final String POSTFIX64BIT = "64"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-11-16 14:36:41
|
Revision: 3701 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3701&view=rev Author: spasi Date: 2011-11-16 14:36:28 +0000 (Wed, 16 Nov 2011) Log Message: ----------- Added support for OpenCL 1.2 [UNTESTED] Modified Paths: -------------- trunk/LWJGL/platform_build/build-generator.xml trunk/LWJGL/src/java/org/lwjgl/opencl/CLBuildProgramCallback.java trunk/LWJGL/src/java/org/lwjgl/opencl/CLChecks.java trunk/LWJGL/src/java/org/lwjgl/opencl/CLContext.java trunk/LWJGL/src/java/org/lwjgl/opencl/CallbackUtil.java trunk/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java trunk/LWJGL/src/java/org/lwjgl/util/generator/Utils.java trunk/LWJGL/src/java/org/lwjgl/util/generator/opencl/CLPDCapabilitiesGenerator.java trunk/LWJGL/src/native/common/extcl.h trunk/LWJGL/src/native/common/extcl_types.h trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java trunk/LWJGL/src/templates/org/lwjgl/opencl/CL11.java trunk/LWJGL/src/templates/org/lwjgl/opencl/EXT_device_fission.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_separate_shader_objects.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java Added Paths: ----------- trunk/LWJGL/src/java/org/lwjgl/opencl/CLCompileProgramCallback.java trunk/LWJGL/src/java/org/lwjgl/opencl/CLLinkProgramCallback.java trunk/LWJGL/src/java/org/lwjgl/opencl/CLPrintfCallback.java trunk/LWJGL/src/java/org/lwjgl/opencl/CLProgramCallback.java trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12.java trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12GL.java Modified: trunk/LWJGL/platform_build/build-generator.xml =================================================================== --- trunk/LWJGL/platform_build/build-generator.xml 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/platform_build/build-generator.xml 2011-11-16 14:36:28 UTC (rev 3701) @@ -36,13 +36,10 @@ <include name="org/lwjgl/opencl/CLPlatform.java"/> <include name="org/lwjgl/opencl/CLDevice.java"/> <include name="org/lwjgl/opencl/CLContext.java"/> - <include name="org/lwjgl/opencl/CLContextCallback.java"/> <include name="org/lwjgl/opencl/CLCommandQueue.java"/> <include name="org/lwjgl/opencl/CLMem.java"/> - <include name="org/lwjgl/opencl/CLMemObjectDestructorCallback.java"/> - <include name="org/lwjgl/opencl/CLBuildProgramCallback.java"/> + <include name="org/lwjgl/opencl/CL*Callback.java"/> <include name="org/lwjgl/opencl/CLNativeKernel.java"/> - <include name="org/lwjgl/opencl/CLEventCallback.java"/> <include name="org/lwjgl/opencl/CLFunctionAddress.java"/> </javac> </target> Modified: trunk/LWJGL/src/java/org/lwjgl/opencl/CLBuildProgramCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CLBuildProgramCallback.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CLBuildProgramCallback.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2010 LWJGL Project + * Copyright (c) 2002-2011 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,8 +31,6 @@ */ package org.lwjgl.opencl; -import org.lwjgl.PointerWrapperAbstract; - /** * Instances of this class can be used to receive OpenCL program build notifications. * A single CLBuildProgramCallback instance should only be used with programs created @@ -40,37 +38,6 @@ * * @author Spasi */ -public abstract class CLBuildProgramCallback extends PointerWrapperAbstract { +public abstract class CLBuildProgramCallback extends CLProgramCallback { - private CLContext context; - - protected CLBuildProgramCallback() { - super(CallbackUtil.getBuildProgramCallback()); - } - - /** - * Sets the context that contains the CLPrograms to which we're registered. - * - * @param context the CLContext object - */ - void setContext(final CLContext context) { - this.context = context; - } - - /** - * Called from native code. - * - * @param program_address the CLProgram object pointer - */ - private void handleMessage(long program_address) { - handleMessage(context.getCLProgram(program_address)); - } - - /** - * The callback method. - * - * @param program the CLProgram object that was built - */ - protected abstract void handleMessage(CLProgram program); - } \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opencl/CLChecks.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CLChecks.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CLChecks.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -53,23 +53,23 @@ /** * Calculates the number of bytes in the specified cl_mem buffer rectangle region. * - * @param origin the host origin + * @param offset the host offset * @param region the rectangle region * @param row_pitch the host row pitch * @param slice_pitch the host slice pitch * * @return the region size in bytes */ - static int calculateBufferRectSize(final PointerBuffer origin, final PointerBuffer region, long row_pitch, long slice_pitch) { + static int calculateBufferRectSize(final PointerBuffer offset, final PointerBuffer region, long row_pitch, long slice_pitch) { if ( !LWJGLUtil.CHECKS ) return 0; - final long x = origin.get(0); - final long y = origin.get(1); - final long z = origin.get(2); + final long x = offset.get(0); + final long y = offset.get(1); + final long z = offset.get(2); if ( LWJGLUtil.DEBUG && (x < 0 || y < 0 || z < 0) ) - throw new IllegalArgumentException("Invalid cl_mem host origin: " + x + ", " + y + ", " + z); + throw new IllegalArgumentException("Invalid cl_mem host offset: " + x + ", " + y + ", " + z); final long w = region.get(0); final long h = region.get(1); Added: trunk/LWJGL/src/java/org/lwjgl/opencl/CLCompileProgramCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CLCompileProgramCallback.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CLCompileProgramCallback.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -0,0 +1,43 @@ +/* + * 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. + */ +package org.lwjgl.opencl; + +/** + * Instances of this class can be used to receive OpenCL program compilation notifications. + * A single CLCompileProgramCallback instance should only be used with programs created + * in the same CLContext. + * + * @author Spasi + */ +public abstract class CLCompileProgramCallback extends CLProgramCallback { + +} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opencl/CLContext.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CLContext.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CLContext.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -49,11 +49,15 @@ private static final CLContextUtil util = (CLContextUtil)CLPlatform.getInfoUtilInstance(CLContext.class, "CL_CONTEXT_UTIL"); private final CLObjectRegistry<CLCommandQueue> clCommandQueues; - private final CLObjectRegistry<CLMem> clMems; - private final CLObjectRegistry<CLSampler> clSamplers; - private final CLObjectRegistry<CLProgram> clPrograms; - private final CLObjectRegistry<CLEvent> clEvents; + private final CLObjectRegistry<CLMem> clMems; + private final CLObjectRegistry<CLSampler> clSamplers; + private final CLObjectRegistry<CLProgram> clPrograms; + private final CLObjectRegistry<CLEvent> clEvents; + private long + contextCallback, + printfCallback; + CLContext(final long pointer, final CLPlatform platform) { super(pointer, platform); @@ -269,4 +273,50 @@ CLObjectRegistry<CLEvent> getCLEventRegistry() { return clEvents; } + private boolean checkCallback(final long callback, final int result) { + if ( result == 0 && (callback == 0 || isValid()) ) + return true; + + if ( callback != 0 ) + CallbackUtil.deleteGlobalRef(callback); + return false; + } + + /** + * Associates this context with the specified context callback reference. If the context + * is invalid, the callback reference is deleted. NO-OP if user_data is 0. + * + * @param callback the context callback pointer + */ + void setContextCallback(final long callback) { + if ( checkCallback(callback, 0) ) + this.contextCallback = callback; + } + + /** + * Associates this context with the specified printf callback reference. If the context + * is invalid, the callback reference is deleted. NO-OP if user_data is 0. + * + * @param callback the printf callback pointer + */ + void setPrintfCallback(final long callback, final int result) { + if ( checkCallback(callback, result) ) + this.printfCallback = callback; + } + + /** + * Decrements the context's reference count. If the reference + * count hits zero, it also deletes + * any callback objects associated with it. + */ + void releaseImpl() { + if ( release() > 0 ) + return; + + if ( contextCallback != 0 ) + CallbackUtil.deleteGlobalRef(contextCallback); + if ( printfCallback != 0 ) + CallbackUtil.deleteGlobalRef(printfCallback); + } + } \ No newline at end of file Added: trunk/LWJGL/src/java/org/lwjgl/opencl/CLLinkProgramCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CLLinkProgramCallback.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CLLinkProgramCallback.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -0,0 +1,43 @@ +/* + * 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. + */ +package org.lwjgl.opencl; + +/** + * Instances of this class can be used to receive OpenCL program linkage notifications. + * A single CLLinkProgramCallback instance should only be used with programs created + * in the same CLContext. + * + * @author Spasi + */ +public abstract class CLLinkProgramCallback extends CLProgramCallback { + +} \ No newline at end of file Added: trunk/LWJGL/src/java/org/lwjgl/opencl/CLPrintfCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CLPrintfCallback.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CLPrintfCallback.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -0,0 +1,51 @@ +/* + * 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. + */ +package org.lwjgl.opencl; + +import org.lwjgl.PointerWrapperAbstract; + +/** + * Instances of this class can be used to receive OpenCL printf messages. + * Different CLContexts should use different CLPrintfCallback instances. + * + * @author Spasi + */ +public abstract class CLPrintfCallback extends PointerWrapperAbstract { + + protected CLPrintfCallback() { + super(CallbackUtil.getPrintfCallback()); + } + + /** The callback method. */ + protected abstract void handleMessage(String data); + +} \ No newline at end of file Added: trunk/LWJGL/src/java/org/lwjgl/opencl/CLProgramCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CLProgramCallback.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CLProgramCallback.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -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. + */ +package org.lwjgl.opencl; + +import org.lwjgl.PointerWrapperAbstract; + +/** + * Base class for OpenCL program action notifications. + * + * @author Spasi + */ +abstract class CLProgramCallback extends PointerWrapperAbstract { + + private CLContext context; + + protected CLProgramCallback() { + super(CallbackUtil.getProgramCallback()); + } + + /** + * Sets the context that contains the CLPrograms to which we're registered. + * + * @param context the CLContext object + */ + final void setContext(final CLContext context) { + this.context = context; + } + + /** + * Called from native code. + * + * @param program_address the CLProgram object pointer + */ + private void handleMessage(long program_address) { + handleMessage(context.getCLProgram(program_address)); + } + + /** + * The callback method. + * + * @param program the CLProgram object affected + */ + protected abstract void handleMessage(CLProgram program); + +} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opencl/CallbackUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/CallbackUtil.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/CallbackUtil.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -70,7 +70,7 @@ * * @param ref the GlobalRef memory address. */ - private static native void deleteGlobalRef(long ref); + static native void deleteGlobalRef(long ref); /** * Deletes the global reference represented by user_data if an OpenCL error occured. @@ -99,40 +99,6 @@ */ static native long getContextCallback(); - /** - * Associates the specified CLContext with the specified global reference. If the context - * is invalid, the global reference is deleted. NO-OP if user_data is 0. - * - * @param context the CLContext to register - * @param user_data the global reference pointer - */ - static void registerCallback(final CLContext context, final long user_data) { - if ( user_data == 0 ) - return; - - if ( context.isValid() ) - contextUserData.put(context, user_data); - else - deleteGlobalRef(user_data); - } - - /** - * Decrements the specified context's reference count, clears its association - * with a CLContextCallback object if it exists and deletes the corresponding - * global reference. - * - * @param context the CLContext to unregister - */ - static void unregisterCallback(final CLContext context) { - if ( context.release() > 0 ) - return; - - final Long user_data = contextUserData.remove(context); - - if ( user_data != null ) - deleteGlobalRef(user_data); - } - /* [ Other callback functionality ] The other callbacks are simpler. We create the GlobalRef before passing the callback, we delete it when we receive the callback call. @@ -150,7 +116,7 @@ * * @return the callback function address */ - static native long getBuildProgramCallback(); + static native long getProgramCallback(); /** * Returns the memory address of the native function we pass to clEnqueueNativeKernel. @@ -167,6 +133,13 @@ static native long getEventCallback(); /** + * Returns the memory address of the native function we pass to clSetPrintfCallback. + * + * @return the callback function address + */ + static native long getPrintfCallback(); + + /** * Returns the memory address of the native function we pass to clCreateContext(FromType), * when <code>APPLEContextLoggingUtil.SYSTEM_LOG_CALLBACK</code> is used. * Modified: trunk/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -123,7 +123,7 @@ Util.checkCLError(errcode_ret.get(0)); return __result; } finally { - CallbackUtil.registerCallback(__result, user_data); + if ( __result != null ) __result.setContextCallback(user_data); } } Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/Utils.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/Utils.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/Utils.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -373,20 +373,22 @@ if ( param != null && p.getSimpleName().equals(param.getSimpleName()) ) break; + if ( p.getAnnotation(NullTerminated.class) != null ) + continue; + final Class type = Utils.getJavaType(p.getType()); if ( type.equals(CharSequence.class) ) { if ( offset == null ) offset = p.getSimpleName() + ".length()"; else offset += " + " + p.getSimpleName() + ".length()"; - if ( p.getAnnotation(NullTerminated.class) != null ) offset += " + 1"; - + //if ( p.getAnnotation(NullTerminated.class) != null ) offset += " + 1"; } else if ( type.equals(CharSequence[].class) ) { if ( offset == null ) offset = "APIUtil.getTotalLength(" + p.getSimpleName() + ")"; else offset += " + APIUtil.getTotalLength(" + p.getSimpleName() + ")"; - if ( p.getAnnotation(NullTerminated.class) != null ) offset += " + " + p.getSimpleName() + ".length"; + //if ( p.getAnnotation(NullTerminated.class) != null ) offset += " + " + p.getSimpleName() + ".length"; } } Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/opencl/CLPDCapabilitiesGenerator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/opencl/CLPDCapabilitiesGenerator.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/opencl/CLPDCapabilitiesGenerator.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -51,7 +51,7 @@ // TODO: Add future versions here private static final int[][] CL_VERSIONS = { - { 1 }, // OpenCL 1 + { 1, 2 }, // OpenCL 1 }; static void generateClassPrologue(final PrintWriter writer, final String name) { Modified: trunk/LWJGL/src/native/common/extcl.h =================================================================== --- trunk/LWJGL/src/native/common/extcl.h 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/native/common/extcl.h 2011-11-16 14:36:28 UTC (rev 3701) @@ -61,9 +61,10 @@ 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_build_program_callback)(cl_program program, 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 ]----------------- Modified: trunk/LWJGL/src/native/common/extcl_types.h =================================================================== --- trunk/LWJGL/src/native/common/extcl_types.h 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/native/common/extcl_types.h 2011-11-16 14:36:28 UTC (rev 3701) @@ -20,8 +20,10 @@ 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 intptr_t cl_context_properties; typedef cl_uint cl_context_info; typedef cl_uint cl_command_queue_info; typedef cl_uint cl_channel_order; @@ -29,6 +31,7 @@ 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; @@ -37,8 +40,12 @@ 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; @@ -49,6 +56,19 @@ 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; @@ -63,7 +83,7 @@ // -----------------[ Extension typedefs ]----------------- // EXT_device_fission -typedef cl_bitfield cl_device_partition_property_ext; +typedef cl_ulong cl_device_partition_property_ext; // EXT_migrate_memobject typedef cl_bitfield cl_mem_migration_flags_ext; Modified: trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2011-11-16 14:36:28 UTC (rev 3701) @@ -43,9 +43,10 @@ static jmethodID contextCallbackJ; static jmethodID memObjectDestructorCallbackJ; -static jmethodID buildProgramCallbackJ; +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); @@ -113,13 +114,13 @@ return (jlong)(intptr_t)&memObjectDestructorCallback; } -// ----------------- [ MEM OBJECT DESTRUCTOR CALLBACK ] ----------------- +// ----------------- [ PROGRAM CALLBACK ] ----------------- -static void CL_CALLBACK buildProgramCallback(cl_program program, void *user_data) { +static void CL_CALLBACK programCallback(cl_program program, void *user_data) { JNIEnv *env = attachCurrentThread(); - if ( env != NULL && !(*env)->ExceptionOccurred(env) && buildProgramCallbackJ != NULL ) { - (*env)->CallVoidMethod(env, (jobject)user_data, buildProgramCallbackJ, + 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); @@ -128,16 +129,16 @@ detachCurrentThread(); } -JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getBuildProgramCallback(JNIEnv *env, jclass clazz) { +JNIEXPORT jlong JNICALL Java_org_lwjgl_opencl_CallbackUtil_getProgramCallback(JNIEnv *env, jclass clazz) { // Cache the callback methodID jclass callbackClass; - if ( buildProgramCallbackJ == NULL ) { - callbackClass = (*env)->FindClass(env, "org/lwjgl/opencl/CLBuildProgramCallback"); + if ( programCallbackJ == NULL ) { + callbackClass = (*env)->FindClass(env, "org/lwjgl/opencl/CLProgramCallback"); if ( callbackClass != NULL ) - buildProgramCallbackJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(J)V"); + programCallbackJ = (*env)->GetMethodID(env, callbackClass, "handleMessage", "(J)V"); } - return (jlong)(intptr_t)&buildProgramCallback; + return (jlong)(intptr_t)&programCallback; } // ----------------- [ NATIVE KERNEL CALLBACK ] ----------------- @@ -214,6 +215,32 @@ 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) { Modified: trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -399,7 +399,7 @@ // Create a GlobalRef to the callback object. javaBeforeNative = "\t\tlong user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);", // Associate context with the GlobalRef, so we can delete it later. - javaFinally = "\t\t\tCallbackUtil.registerCallback(__result, user_data);" + javaFinally = "\t\t\tif ( __result != null ) __result.setContextCallback(user_data);" ) @Check(value = "errcode_ret", canBeNull = true) @PointerWrapper(value = "cl_context", params = "APIUtil.getCLPlatform(properties)") @@ -417,7 +417,7 @@ // Create a GlobalRef to the callback object. javaBeforeNative = "\t\tlong user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);", // Associate context with the GlobalRef, so we can delete it later. - javaFinally = "\t\t\tCallbackUtil.registerCallback(__result, user_data);" + javaFinally = "\t\t\tif ( __result != null ) __result.setContextCallback(user_data);" ) @Check(value = "errcode_ret", canBeNull = true) @PointerWrapper(value = "cl_context", params = "APIUtil.getCLPlatform(properties)") @@ -434,7 +434,7 @@ // Create a GlobalRef to the callback object. javaBeforeNative = "\t\tlong user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);", // Associate context with the GlobalRef, so we can delete it later. - javaFinally = "\t\t\tCallbackUtil.registerCallback(__result, user_data);" + javaFinally = "\t\t\tif ( __result != null ) __result.setContextCallback(user_data);" ) @Check(value = "errcode_ret", canBeNull = true) @PointerWrapper(value = "cl_context", params = "APIUtil.getCLPlatform(properties)") @@ -450,7 +450,7 @@ @Code( javaBeforeNative = "\t\tAPIUtil.releaseObjects(context);", - javaAfterNative = "\t\tif ( __result == CL_SUCCESS ) CallbackUtil.unregisterCallback(context);" + javaAfterNative = "\t\tif ( __result == CL_SUCCESS ) context.releaseImpl();" ) @cl_int int clReleaseContext(@PointerWrapper("cl_context") CLContext context); @@ -511,7 +511,7 @@ @PointerWrapper("cl_mem") CLMem buffer, @cl_bool int blocking_read, @size_t long offset, - @AutoSize("ptr") @size_t long cb, + @AutoSize("ptr") @size_t long size, @OutParameter @cl_byte @cl_short @@ -529,7 +529,7 @@ @PointerWrapper("cl_mem") CLMem buffer, @cl_bool int blocking_write, @size_t long offset, - @AutoSize("ptr") @size_t long cb, + @AutoSize("ptr") @size_t long size, @Const @cl_byte @cl_short @@ -548,7 +548,7 @@ @PointerWrapper("cl_mem") CLMem dst_buffer, @size_t long src_offset, @size_t long dst_offset, - @size_t long cb, + @size_t long size, @AutoSize(value = "event_wait_list", canBeNull = true) @cl_uint int num_events_in_wait_list, @Check(canBeNull = true) @Const @NativeType("cl_event") PointerBuffer event_wait_list, @OutParameter @Check(value = "1", canBeNull = true) @NativeType("cl_event") PointerBuffer event); @@ -556,13 +556,13 @@ @Code(javaAfterNative = "\t\tif ( __result != null ) command_queue.registerCLEvent(event);") @Check(value = "errcode_ret", canBeNull = true) @cl_void - @AutoSize("cb") + @AutoSize("size") ByteBuffer clEnqueueMapBuffer(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue, @PointerWrapper("cl_mem") CLMem buffer, @cl_bool int blocking_map, @NativeType("cl_map_flags") long map_flags, @size_t long offset, - @size_t long cb, + @size_t long size, @AutoSize(value = "event_wait_list", canBeNull = true) @cl_uint int num_events_in_wait_list, @Check(canBeNull = true) @Const @NativeType("cl_event") PointerBuffer event_wait_list, @OutParameter @Check(value = "1", canBeNull = true) @NativeType("cl_event") PointerBuffer event, @@ -855,7 +855,7 @@ @AutoSize(value = "device_list", canBeNull = true) @cl_uint int num_devices, @Check(canBeNull = true) @Const @NativeType("cl_device_id") PointerBuffer device_list, @Check @NullTerminated @Const @cl_char ByteBuffer options, - @PointerWrapper(value = "cl_build_program_callback", canBeNull = true) CLBuildProgramCallback pfn_notify, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLBuildProgramCallback pfn_notify, @Constant("user_data") @PointerWrapper("void *") long user_data); @Alternate("clBuildProgram") @@ -872,7 +872,7 @@ @AutoSize(value = "device_list", canBeNull = true) @cl_uint int num_devices, @Check(canBeNull = true) @Const @NativeType("cl_device_id") PointerBuffer device_list, @NullTerminated @Const CharSequence options, - @PointerWrapper(value = "cl_build_program_callback", canBeNull = true) CLBuildProgramCallback pfn_notify, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLBuildProgramCallback pfn_notify, @Constant("user_data") @PointerWrapper("void *") long user_data); @Alternate("clBuildProgram") @@ -889,7 +889,7 @@ @Constant("1") @cl_uint int num_devices, @Constant(value = "APIUtil.getPointer(device)", keepParam = true) CLDevice device, @NullTerminated @Const CharSequence options, - @PointerWrapper(value = "cl_build_program_callback", canBeNull = true) CLBuildProgramCallback pfn_notify, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLBuildProgramCallback pfn_notify, @Constant("user_data") @PointerWrapper("void *") long user_data); @cl_int Modified: trunk/LWJGL/src/templates/org/lwjgl/opencl/CL11.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/CL11.java 2011-11-13 21:21:52 UTC (rev 3700) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/CL11.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -121,14 +121,14 @@ int clEnqueueReadBufferRect(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue, @PointerWrapper("cl_mem") CLMem buffer, @cl_bool int blocking_read, - @Const @Check("3") @NativeType("size_t") PointerBuffer buffer_origin, - @Const @Check("3") @NativeType("size_t") PointerBuffer host_origin, + @Const @Check("3") @NativeType("size_t") PointerBuffer buffer_offset, + @Const @Check("3") @NativeType("size_t") PointerBuffer host_offset, @Const @Check("3") @NativeType("size_t") PointerBuffer region, @size_t long buffer_row_pitch, @size_t long buffer_slice_pitch, @size_t long host_row_pitch, @size_t long host_slice_pitch, - @OutParameter @Check("CLChecks.calculateBufferRectSize(host_origin, region, host_row_pitch, host_slice_pitch)") + @OutParameter @Check("CLChecks.calculateBufferRectSize(host_offset, region, host_row_pitch, host_slice_pitch)") @cl_byte @cl_short @cl_int @@ -144,14 +144,14 @@ int clEnqueueWriteBufferRect(@PointerWrapper("cl_command_queue") CLCommandQueue command_queue, @PointerWrapper("cl_mem") CLMem buffer, @cl_bool int blocking_write, - @Const @Check("3") @NativeType("size_t") PointerBuffer buffer_origin, - @Const @Check("3") @NativeType("size_t") PointerBuffer host_origin, + @Const @Check("3") @NativeType("size_t") PointerBuffer buffer_offset, + @Const @Check("3") @NativeType("size_t") PointerBuffer host_offset, @Const @Check("3") @NativeType("size_t") PointerBuffer region, @size_t long buffer_row_pitch, @size_t long buffer_slice_pitch, @size_t long host_row_pitch, @size_t long host_slice_pitch, - @Const @Check("CLChecks.calculateBufferRectSize(host_origin, region, host_row_pitch, host_slice_pitch)") + @Const @Check("CLChecks.calculateBufferRectSize(host_offset, region, host_row_pitch, host_slice_pitch)") @cl_byte @cl_short @cl_int Added: trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opencl/CL12.java 2011-11-16 14:36:28 UTC (rev 3701) @@ -0,0 +1,445 @@ +/* + * 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. + */ +package org.lwjgl.opencl; + +import org.lwjgl.PointerBuffer; +import org.lwjgl.util.generator.*; +import org.lwjgl.util.generator.opencl.*; + +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; + +/** The core OpenCL 1.1 API */ +public interface CL12 { + + /** Error Codes */ + int CL_COMPILE_PROGRAM_FAILURE = -15, + CL_LINKER_NOT_AVAILABLE = -16, + CL_LINK_PROGRAM_FAILURE = -17, + CL_DEVICE_PARTITION_FAILED = -18, + CL_KERNEL_ARG_INFO_NOT_AVAILABLE = -19, + CL_INVALID_IMAGE_DESCRIPTOR = -65, + CL_INVALID_COMPILER_OPTIONS = -66, + CL_INVALID_LINKER_OPTIONS = -67, + CL_INVALID_DEVICE_PARTITION_COUNT = -68; + + /** OpenCL Version */ + int CL_VERSION_1_2 = 1; + + /** cl_bool */ + int CL_BLOCKING = CL10.CL_TRUE, + CL_NON_BLOCKING = CL10.CL_FALSE; + + /** cl_device_type - bitfield */ + int CL_DEVICE_TYPE_CUSTOM = (1 << 4); + + /* cl_device_info */ + int CL_DEVICE_DOUBLE_FP_CONFIG = 0x1032, + CL_DEVICE_LINKER_AVAILABLE = 0x103E, + CL_DEVICE_BUILT_IN_KERNELS = 0x103F, + CL_DEVICE_IMAGE_MAX_BUFFER_SIZE = 0x1040, + CL_DEVICE_IMAGE_MAX_ARRAY_SIZE = 0x1041, + CL_DEVICE_PARENT_DEVICE = 0x1042, + CL_DEVICE_PARTITION_MAX_SUB_DEVICES = 0x1043, + CL_DEVICE_PARTITION_PROPERTIES = 0x1044, + CL_DEVICE_PARTITION_AFFINITY_DOMAIN = 0x1045, + CL_DEVICE_PARTITION_TYPE = 0x1046, + CL_DEVICE_REFERENCE_COUNT = 0x1047, + CL_DEVICE_PREFERRED_INTEROP_USER_SYNC = 0x1048, + CL_DEVICE_PRINTF_BUFFER_SIZE = 0x1049; + + /* cl_device_fp_config - bitfield */ + int CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT = (1 << 7); + + /* cl_context_properties */ + int CL_CONTEXT_INTEROP_USER_SYNC = 0x1085; + + /* cl_device_partition_property */ + int CL_DEVICE_PARTITION_EQUALLY = 0x1086, + CL_DEVICE_PARTITION_BY_COUNTS = 0x1087, + CL_DEVICE_PARTITION_BY_COUNTS_LIST_END = 0x0, + CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN = 0x1088; + + /* cl_device_affinity_domain */ + int CL_DEVICE_AFFINITY_DOMAIN_NUMA = (1 << 0), + CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE = (1 << 1), + CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE = (1 << 2), + CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE = (1 << 3), + CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE = (1 << 4), + CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE = (1 << 5); + + /* cl_mem_flags - bitfield */ + int CL_MEM_HOST_WRITE_ONLY = (1 << 7), + CL_MEM_HOST_READ_ONLY = (1 << 8), + CL_MEM_HOST_NO_ACCESS = (1 << 9); + + /* cl_mem_migration_flags - bitfield */ + int CL_MIGRATE_MEM_OBJECT_HOST = (1 << 0), + CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED = (1 << 1); + + /* cl_mem_object_type */ + int CL_MEM_OBJECT_IMAGE2D_ARRAY = 0x10F3, + CL_MEM_OBJECT_IMAGE1D = 0x10F4, + CL_MEM_OBJECT_IMAGE1D_ARRAY = 0x10F5, + CL_MEM_OBJECT_IMAGE1D_BUFFER = 0x10F6; + + /* cl_image_info */ + int CL_IMAGE_ARRAY_SIZE = 0x1117, + CL_IMAGE_BUFFER = 0x1118, + CL_IMAGE_NUM_MIP_LEVELS = 0x1119, + CL_IMAGE_NUM_SAMPLES = 0x111A; + + /* cl_map_flags - bitfield */ + int CL_MAP_WRITE_INVALIDATE_REGION = (1 << 2); + + /* cl_program_info */ + int CL_PROGRAM_NUM_KERNELS = 0x1167, + CL_PROGRAM_KERNEL_NAMES = 0x1168; + + /* cl_program_build_info */ + int CL_PROGRAM_BINARY_TYPE = 0x1184; + + /* cl_program_binary_type */ + int CL_PROGRAM_BINARY_TYPE_NONE = 0x0, + CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT = 0x1, + CL_PROGRAM_BINARY_TYPE_LIBRARY = 0x2, + CL_PROGRAM_BINARY_TYPE_EXECUTABLE = 0x4; + + /* cl_kernel_info */ + int CL_KERNEL_ATTRIBUTES = 0x1195; + + /* cl_kernel_arg_info */ + int CL_KERNEL_ARG_ADDRESS_QUALIFIER = 0x1196, + CL_KERNEL_ARG_ACCESS_QUALIFIER = 0x1197, + CL_KERNEL_ARG_TYPE_NAME = 0x1198, + CL_KERNEL_ARG_NAME = 0x1199; + + /* cl_kernel_arg_address_qualifier */ + int CL_KERNEL_ARG_ADDRESS_GLOBAL = 0x119A, + CL_KERNEL_ARG_ADDRESS_LOCAL = 0x119B, + CL_KERNEL_ARG_ADDRESS_CONSTANT = 0x119C, + CL_KERNEL_ARG_ADDRESS_PRIVATE = 0x119D; + + /* cl_kernel_arg_access_qualifier */ + int CL_KERNEL_ARG_ACCESS_READ_ONLY = 0x11A0, + CL_KERNEL_ARG_ACCESS_WRITE_ONLY = 0x11A1, + CL_KERNEL_ARG_ACCESS_READ_WRITE = 0x11A2, + CL_KERNEL_ARG_ACCESS_NONE = 0x11A3; + + /* cl_kernel_work_group_info */ + int CL_KERNEL_GLOBAL_WORK_SIZE = 0x11B5; + + /* cl_command_type */ + int CL_COMMAND_BARRIER = 0x1205, + CL_COMMAND_MIGRATE_MEM_OBJECTS = 0x1206, + CL_COMMAND_FILL_BUFFER = 0x1207, + CL_COMMAND_FILL_IMAGE = 0x1208; + + @Code(javaAfterNative = "\t\tif ( __result == CL10.CL_SUCCESS ) device.retain();") + @cl_int + int clRetainDevice(@PointerWrapper("cl_device_id") CLDevice device); + + /** + * Warning: LWJGL will not automatically release any objects associated with sub-devices. + * The user is responsible for tracking and releasing everything prior to calling this method. + * + * @param device the parent CLDevice + * + * @return the error code + */ + @Code( + javaBeforeNative = "\t\tAPIUtil.releaseObjects(device);", + javaAfterNative = "\t\tif ( __result == CL10.CL_SUCCESS ) device.release();" + ) + @cl_int + int clReleaseDevice(@PointerWrapper("cl_device_id") CLDevice device); + + @Code(javaAfterNative = "\t\tif ( __result == CL10.CL_SUCCESS && out_devices != null ) in_device.registerSubCLDevices(out_devices);") + @cl_int + int clCreateSubDevices( + @PointerWrapper("cl_device_id") CLDevice in_device, + @NullTerminated @Const @NativeType("cl_device_partition_property") LongBuffer properties, + @AutoSize(value = "out_devices", canBeNull = true) @cl_uint int num_devices, + @OutParameter @Check(canBeNull = true) @NativeType("cl_device_id") PointerBuffer out_devices, + @OutParameter @Check(value = "1", canBeNull = true) @cl_uint IntBuffer num_devices_ret); + + @Check(value = "errcode_ret", canBeNull = true) + @PointerWrapper(value = "cl_mem", params = "context") + CLMem clCreateImage(@PointerWrapper("cl_context") CLContext context, + @NativeType("cl_mem_flags") long flags, + @Check("2 * 4") @Const @NativeType("cl_image_format") ByteBuffer image_format, + @Check("3 * 4 + 7 * PointerBuffer.getPointerSize()") @Const @NativeType("cl_image_desc") ByteBuffer image_desc, + @Check + @cl_byte + @cl_short + @cl_int + @cl_float Buffer host_ptr, + @OutParameter @Check(value = "1", canBeNull = true) @cl_int IntBuffer errcode_ret); + + @Check(value = "errcode_ret", canBeNull = true) + @PointerWrapper(value = "cl_program", params = "context") + CLProgram clCreateProgramWithBuiltInKernels(@PointerWrapper("cl_context") CLContext context, + @AutoSize("device_list") @cl_uint int num_devices, + @Check("1") @Const @NativeType("cl_device_id") PointerBuffer device_list, + @Check @Const @cl_char ByteBuffer kernel_names, + @OutParameter @Check(value = "1", canBeNull = true) @cl_int IntBuffer errcode_ret); + + @Alternate("clCreateProgramWithBuiltInKernels") + @Check(value = "errcode_ret", canBeNull = true) + @PointerWrapper(value = "cl_program", params = "context") + CLProgram clCreateProgramWithBuiltInKernels(@PointerWrapper("cl_context") CLContext context, + @AutoSize("device_list") @cl_uint int num_devices, + @Check("1") @Const @NativeType("cl_device_id") PointerBuffer device_list, + CharSequence kernel_names, + @OutParameter @Check(value = "1", canBeNull = true) @cl_int IntBuffer errcode_ret); + + /** Single null-terminated header include name. */ + @Code( + tryBlock = true, + // Create a GlobalRef to the callback object. + javaBeforeNative = "\t\tlong user_data = CallbackUtil.createGlobalRef(pfn_notify);\n" + + "\t\tif ( pfn_notify != null ) pfn_notify.setContext(program.getParent());", + // Check if we need to delete the GlobalRef. + javaFinally = "\t\t\tCallbackUtil.checkCallback(__result, user_data);" + ) + @cl_int + int clCompileProgram(@PointerWrapper("cl_program") CLProgram program, + @AutoSize(value = "device_list", canBeNull = true) @cl_uint int num_devices, + @Check(canBeNull = true) @Const @NativeType("cl_device_id") PointerBuffer device_list, + @Check @NullTerminated @Const @cl_char ByteBuffer options, + @Constant("1") @cl_uint int num_input_headers, + @Check("1") @Const @NativeType("cl_program") PointerBuffer input_header, + @NullTerminated @Check @Const @cl_char @Indirect ByteBuffer header_include_name, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLCompileProgramCallback pfn_notify, + @Constant("user_data") @PointerWrapper("void *") long user_data); + + /** Multiple null-terminated header include names, one after the other. */ + @Alternate(value = "clCompileProgram", nativeAlt = true, javaAlt = true) + @Code( + tryBlock = true, + // Create a GlobalRef to the callback object. + javaBeforeNative = "\t\tlong user_data = CallbackUtil.createGlobalRef(pfn_notify);\n" + + "\t\tif ( pfn_notify != null ) pfn_notify.setContext(program.getParent());", + // Check if we need to delete the GlobalRef. + javaFinally = "\t\t\tCallbackUtil.checkCallback(__result, user_data);" + ) + @cl_int + int clCompileProgramMulti(@PointerWrapper("cl_program") CLProgram program, + @AutoSize(value = "device_list", canBeNull = true) @cl_uint int num_devices, + @Check(canBeNull = true) @Const @NativeType("cl_device_id") PointerBuffer device_list, + @Check @NullTerminated @Const @cl_char ByteBuffer options, + @AutoSize("input_headers") @cl_uint int num_input_headers, + @Check("1") @Const @NativeType("cl_program") PointerBuffer input_headers, + @NullTerminated("input_headers.remaining()") @Check @Const @Indirect @cl_char @PointerArray("num_input_headers") ByteBuffer header_include_names, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLCompileProgramCallback pfn_notify, + @Constant("user_data") @PointerWrapper("void *") long user_data); + + @Alternate(value = "clCompileProgram", nativeAlt = true) + @Code( + tryBlock = true, + // Create a GlobalRef to the callback object. + javaBeforeNative = "\t\tlong user_data = CallbackUtil.createGlobalRef(pfn_notify);\n" + + "\t\tif ( pfn_notify != null ) pfn_notify.setContext(program.getParent());", + // Check if we need to delete the GlobalRef. + javaFinally = "\t\t\tCallbackUtil.checkCallback(__result, user_data);" + ) + @cl_int + int clCompileProgram3(@PointerWrapper("cl_program") CLProgram program, + @AutoSize(value = "device_list", canBeNull = true) @cl_uint int num_devices, + @Check(canBeNull = true) @Const @NativeType("cl_device_id") PointerBuffer device_list, + @Check @NullTerminated @Const @cl_char ByteBuffer options, + @Constant("header_include_names.length") @cl_uint int num_input_headers, + @Check("header_include_names.length") @Const @NativeType("cl_program") PointerBuffer input_headers, + @NullTerminated @Check("1") @PointerArray(value = "num_input_headers") @Const @NativeType("cl_char") ByteBuffer[] header_include_names, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLCompileProgramCallback pfn_notify, + @Constant("user_data") @PointerWrapper("void *") long user_data); + + @Alternate("clCompileProgram") + @Code( + tryBlock = true, + // Create a GlobalRef to the callback object. + javaBeforeNative = "\t\tlong user_data = CallbackUtil.createGlobalRef(pfn_notify);\n" + + "\t\tif ( pfn_notify != null ) pfn_notify.setContext(program.getParent());", + // Check if we need to delete the GlobalRef. + javaFinally = "\t\t\tCallbackUtil.checkCallback(__result, user_data);" + ) + @cl_int + int clCompileProgram(@PointerWrapper("cl_program") CLProgram program, + @AutoSize(value = "device_list", canBeNull = true) @cl_uint int num_devices, + @Check(canBeNull = true) @Const @NativeType("cl_device_id") PointerBuffer device_list, + @NullTerminated CharSequence options, + @Constant("1") @cl_uint int num_input_headers, + @Check("1") @Const @NativeType("cl_program") PointerBuffer input_header, + @NullTerminated @Const CharSequence header_include_name, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLCompileProgramCallback pfn_notify, + @Constant("user_data") @PointerWrapper("void *") long user_data); + + @Alternate(value = "clCompileProgram", nativeAlt = true, skipNative = true) + @Code( + tryBlock = true, + // Create a GlobalRef to the callback object. + javaBeforeNative = "\t\tlong user_data = CallbackUtil.createGlobalRef(pfn_notify);\n" + + "\t\tif ( pfn_notify != null ) pfn_notify.setContext(program.getParent());", + // Check if we need to delete the GlobalRef. + javaFinally = "\t\t\tCallbackUtil.checkCallback(__result, user_data);" + ) + @cl_int + int clCompileProgramMulti(@PointerWrapper("cl_program") CLProgram program, + @AutoSize(value = "device_list", canBeNull = true) @cl_uint int num_devices, + @Check(canBeNull = true) @Const @NativeType("cl_device_id") PointerBuffer device_list, + @NullTerminated CharSequence options, + @AutoSize("input_header") @cl_uint int num_input_headers, + @Check("1") @Const @NativeType("cl_program") PointerBuffer input_header, + @NullTerminated @PointerArray(value = "num_input_headers") @Const CharSequence[] header_include_name, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLCompileProgramCallback pfn_notify, + @Constant("user_data") @PointerWrapper("void *") long user_data); + + @Code( + tryBlock = true, + // Create a GlobalRef to the callback object. + javaBeforeNative = "\t\tlong user_data = CallbackUtil.createGlobalRef(pfn_notify);\n" + + "\t\tif ( pfn_notify != null ) pfn_notify.setContext(context);", + // Check if we need to delete the GlobalRef. + javaFinally = "\t\t\tCallbackUtil.checkCallback(errcode_ret.get(errcode_ret.position()), user_data);" + ) + @Check(value = "errcode_ret", canBeNull = true) + @PointerWrapper(value = "cl_program", params = "context") + CLProgram clLinkProgram(@PointerWrapper("cl_context") CLContext context, + @AutoSize(value = "device_list", canBeNull = true) @cl_uint int num_devices, + @Check(canBeNull = true) @Const @NativeType("cl_device_id") PointerBuffer device_list, + @NullTerminated @Check @Const @cl_char ByteBuffer options, + @AutoSize("input_programs") @cl_uint int num_input_programs, + @Check @Const @NativeType("cl_program") PointerBuffer input_programs, + @PointerWrapper(value = "cl_program_callback", canBeNull = true) CLLinkProgramCallback pfn_notify, + @Constant("user_data") @PointerWrapper("void *") long user_data, + @OutParameter @Check("1") @cl_int IntBuffer errcode_ret); + + @Alternate("clLinkProgram") + @Code( + tryBlock = true, + // Create a GlobalRef to the callback object. + javaBeforeNative = "\t\tlong user_data = CallbackUtil.createGlobalRef(pfn_notify);\n" + + "\t\tif ( pfn_notify != null ) pfn_notify.setContext(context);", + // Check if we need to delete the GlobalRef. + javaFinally = "\t\t\tCallbackUtil.checkCallback(errcode_ret.get(errcode_ret.position()), user_data);" + ) + @Check(value = "errcode_ret", canBeNull = true) + @PointerWrapper(value = "cl_program", params = "context") + CLProgram clLinkProgram(@PointerWrapper("cl_context") CLContext context, + @AutoSize(val... [truncated message content] |
From: <ma...@us...> - 2012-01-23 21:30:53
|
Revision: 3731 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3731&view=rev Author: matzon Date: 2012-01-23 21:30:46 +0000 (Mon, 23 Jan 2012) Log Message: ----------- bumping to 2.8.4 and adding changelogs Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/src/java/org/lwjgl/Sys.java trunk/LWJGL/www/changelogs/full-changelog.txt Added Paths: ----------- trunk/LWJGL/www/changelogs/2.8.3-changelog.txt Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2012-01-23 21:05:39 UTC (rev 3730) +++ trunk/LWJGL/platform_build/build-definitions.xml 2012-01-23 21:30:46 UTC (rev 3731) @@ -12,7 +12,7 @@ <property name="lwjgl.docs" location="doc" /> <property name="lwjgl.temp" location="temp" /> <property name="lwjgl.res" location="res" /> - <property name="lwjgl.version" value="2.8.3" /> + <property name="lwjgl.version" value="2.8.4" /> <property name="lwjgl.web" location="www" /> <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2012-01-23 21:05:39 UTC (rev 3730) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2012-01-23 21:30:46 UTC (rev 3731) @@ -54,7 +54,7 @@ private static final String JNI_LIBRARY_NAME = "lwjgl"; /** Current version of library */ - private static final String VERSION = "2.8.3"; + private static final String VERSION = "2.8.4"; private static final String POSTFIX64BIT = "64"; Added: trunk/LWJGL/www/changelogs/2.8.3-changelog.txt =================================================================== --- trunk/LWJGL/www/changelogs/2.8.3-changelog.txt (rev 0) +++ trunk/LWJGL/www/changelogs/2.8.3-changelog.txt 2012-01-23 21:30:46 UTC (rev 3731) @@ -0,0 +1,252 @@ +2012-01-22 20:16 kappa1 + + * src/java/org/lwjgl/opengl/LinuxDisplay.java: Small tweak to the + Linux Display.isActive() fix. + +2012-01-22 18:02 kappa1 + + * src/java/org/lwjgl/opengl/LinuxDisplay.java: fix for + Display.isActive() so that it works as it should on Linux when + using Display.setParent() + +2012-01-18 12:19 spasi + + * src/templates/org/lwjgl/opengl/ARB_buffer_object.java, + src/templates/org/lwjgl/opengl/EXT_direct_state_access.java, + src/templates/org/lwjgl/opengl/GL15.java, + src/templates/org/lwjgl/opengles/GLES20.java: Require at least 1 + element remaining in BO data params. + +2012-01-17 21:05 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: prod nightly + server to rebuild LWJGL. + +2012-01-16 22:18 kappa1 + + * src/java/org/lwjgl/MacOSXSysImplementation.java, + src/java/org/lwjgl/opengl/AWTSurfaceLock.java, + src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java: Add extra + checks so CALayer's only run on OS X 10.6+, Bump OS X native + version + +2012-01-13 00:53 kappa1 + + * platform_build/macosx_ant/build.xml: Weakly link the AppKit + framework in an attempt to allow 10.5 compatibility again. + +2012-01-13 00:40 kappa1 + + * src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m: OS X + slight tweak to MacOSXCanvasPeerInfo in prep to make it + compatible for 10.5 again + +2012-01-11 20:46 matzon + + * src/java/org/lwjgl/WindowsSysImplementation.java, + src/java/org/lwjgl/opengl/WindowsDisplay.java: adding + WS_MAXIMIZEBOX patch for windows and bumping native version + +2012-01-06 11:52 spasi + + * src/templates/org/lwjgl/opencl/INTEL_printf.java: Added + INTEL_printf. + +2012-01-05 11:24 spasi + + * src/templates/org/lwjgl/opengl/AMD_performance_monitor.java, + src/templates/org/lwjgl/opengl/ARB_separate_shader_objects.java, + src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java, + src/templates/org/lwjgl/opengl/ARB_sync.java, + src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java, + src/templates/org/lwjgl/opengles/EXT_color_buffer_half_float.java, + src/templates/org/lwjgl/opengles/EXT_debug_label.java, + src/templates/org/lwjgl/opengles/EXT_debug_marker.java, + src/templates/org/lwjgl/opengles/EXT_multisampled_render_to_texture.java, + src/templates/org/lwjgl/opengles/EXT_occlusion_query_boolean.java, + src/templates/org/lwjgl/opengles/EXT_robustness.java, + src/templates/org/lwjgl/opengles/EXT_sRGB.java, + src/templates/org/lwjgl/opengles/EXT_separate_shader_objects.java, + src/templates/org/lwjgl/opengles/EXT_shadow_samplers.java, + src/templates/org/lwjgl/opengles/EXT_texture_rg.java, + src/templates/org/lwjgl/opengles/EXT_texture_storage.java, + src/templates/org/lwjgl/opengles/NV_EGL_stream_consumer_external.java: + Added new OpenGL ES extensions. + +2012-01-02 22:06 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: Applying + WM_SETCURSOR patch to fix issue with cursor + +2012-01-02 22:03 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: undoing commit of + r3717 + +2012-01-02 21:59 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: Applied + WM_SETCURSOR to fix issue with cursor + +2011-12-21 14:34 jpilgrim + + * eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/StandalonePublisher.java: + Fixed a problem with categories. + + Categories are now extracted from site.xml. A default category is + created if no site.xml is found or if some features are not + mapped to any other category. + +2011-12-20 19:06 spasi + + * src/templates/org/lwjgl/opencl/CL12.java: Added @Optional on + clSetPrintfCallback for the AMD CL 1.2 preview driver. + +2011-12-20 17:16 spasi + + * src/templates/org/lwjgl/opengl/AMD_pinned_memory.java: Updated + AMD_pinned_memory based on official spec. + +2011-12-20 11:04 jpilgrim + + * eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/build-updatesite.xml, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/StandalonePublisher.java: + StandalonePublisher directly creates jars, no need for additional + "jarring". + + - added main method to StandalonePublisher creating + artifact.xml/jar and content.xml/jar from given (old) Eclise + update site. + - when compressed is set to true, artifact.jar and content.jar + are created directly. Removed jar task in build script, as these + are no longer necessary + +2011-12-15 19:00 jpilgrim + + * eclipse-update/org.lwjgl.build/READ.ME, + eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/build-updatesite.xml, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/StandalonePublisher.java: + Fixed problems in update site build. + + Update site is now build including Eclipse p2 metadata + (content.jar and artifact.jar). These files are required by some + tools, such as Tycho (a maven plugin making p2 update sites + available as maven repositories, see http://eclipse.org/tycho). + +2011-12-15 17:40 jpilgrim + + * eclipse-update/org.lwjgl.build/build-updatesite.xml: fixed typo + in update site build script, added publisher task + +2011-12-15 17:32 jpilgrim + + * eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/StandalonePublisher.java: + Added new ant task creating p2 metadata file for update site. + +2011-12-06 22:46 matzon + + * eclipse-update/org.lwjgl.build/build-updatesite.xml: updating + update site build script to use pre-packaged zip file in dist, + updating signjar to not use keypass + +2011-12-06 22:42 matzon + + * build.xml: adding eclipse update site to main build file + +2011-12-05 21:49 jpilgrim + + * eclipse-update/org.lwjgl.build/build-updatesite.xml: signing + information are interactively retrieved similar to applet build + +2011-12-05 12:41 jpilgrim + + * eclipse-update/org.lwjgl.build/READ.ME, + eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/build-updatesite.xml, + eclipse-update/org.lwjgl.build/build.xml, + eclipse-update/org.lwjgl.build/buildEclipseClasses.xml, + eclipse-update/org.lwjgl.build/lwjgl-archives, + eclipse-update/org.lwjgl.build/plugin-classes, + eclipse-update/org.lwjgl.build/plugin-classes/org.lwjgl.info.zip, + eclipse-update/org.lwjgl.build/plugin-classes/org.lwjgl.tools.zip, + eclipse-update/org.lwjgl.build/plugin-classes/org.lwjgl.zip: + Added new Eclipse update site build script to be imported from + main LWJGL build script. + See org.lwjgl.build/README for details. + + Removed old build script depending on pre-build LWJGL archives. + +2011-12-03 11:10 spasi + + * src/templates/org/lwjgl/opengl/NV_transform_feedback.java: Fixed + glTransformFeedbackAttribsNV count argument. + +2011-11-28 16:40 jpilgrim + + * eclipse-update/org.lwjgl.build/build.xml: bug fix in Eclipes + update site build: + native libraries are not copied from skeleton (where they are + required for development purposes) anymore + +2011-11-28 16:23 jpilgrim + + * eclipse-update/org.lwjgl.build/.classpath, + eclipse-update/org.lwjgl.build/META-INF/MANIFEST.MF, + eclipse-update/org.lwjgl.build/build.xml, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/NormalizeVersion.java, + eclipse-update/org.lwjgl.build/test/java/org/lwjgl/ant/NormalizeVersionTest.java: + Fixed a bug in the update site build script. + + Wrong class name of LWJGL plugin activator was specified + (org.lwjgl.eclipse.Activator, but correct + is org.lwjgl.Activator). + + Now, the current date/time string is added as a qualifier to the + LWJGL version, e.g., org.lwjgl_2.8.2.v20111128-1653 instead of + org.lwjgl_2.8.2. This simplifies testing and discouples LWJGL + versions from plugin versions. + +2011-11-17 21:41 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + fix uncaught null pointer exception + +2011-11-16 14:36 spasi + + * platform_build/build-generator.xml, + src/java/org/lwjgl/opencl/CLBuildProgramCallback.java, + src/java/org/lwjgl/opencl/CLChecks.java, + src/java/org/lwjgl/opencl/CLCompileProgramCallback.java, + src/java/org/lwjgl/opencl/CLContext.java, + src/java/org/lwjgl/opencl/CLLinkProgramCallback.java, + src/java/org/lwjgl/opencl/CLPrintfCallback.java, + src/java/org/lwjgl/opencl/CLProgramCallback.java, + src/java/org/lwjgl/opencl/CallbackUtil.java, + src/java/org/lwjgl/opencl/InfoUtilFactory.java, + src/java/org/lwjgl/util/generator/Utils.java, + src/java/org/lwjgl/util/generator/opencl/CLPDCapabilitiesGenerator.java, + src/native/common/extcl.h, src/native/common/extcl_types.h, + src/native/common/org_lwjgl_opencl_CallbackUtil.c, + src/templates/org/lwjgl/opencl/CL10.java, + src/templates/org/lwjgl/opencl/CL11.java, + src/templates/org/lwjgl/opencl/CL12.java, + src/templates/org/lwjgl/opencl/CL12GL.java, + src/templates/org/lwjgl/opencl/EXT_device_fission.java, + src/templates/org/lwjgl/opengl/ARB_separate_shader_objects.java, + src/templates/org/lwjgl/opengl/GL41.java: Added support for + OpenCL 1.2 [UNTESTED] + +2011-11-13 21:21 matzon + + * www/changelogs/2.8.1-changelog.txt, + www/changelogs/2.8.2-changelog.txt, + www/changelogs/full-changelog.txt: adding changelogs + +2011-11-13 21:20 matzon + + * platform_build/build-definitions.xml, + src/java/org/lwjgl/Sys.java: bumping to 2.8.3 \ No newline at end of file Modified: trunk/LWJGL/www/changelogs/full-changelog.txt =================================================================== --- trunk/LWJGL/www/changelogs/full-changelog.txt 2012-01-23 21:05:39 UTC (rev 3730) +++ trunk/LWJGL/www/changelogs/full-changelog.txt 2012-01-23 21:30:46 UTC (rev 3731) @@ -1,3 +1,256 @@ +2012-01-22 20:16 kappa1 + + * src/java/org/lwjgl/opengl/LinuxDisplay.java: Small tweak to the + Linux Display.isActive() fix. + +2012-01-22 18:02 kappa1 + + * src/java/org/lwjgl/opengl/LinuxDisplay.java: fix for + Display.isActive() so that it works as it should on Linux when + using Display.setParent() + +2012-01-18 12:19 spasi + + * src/templates/org/lwjgl/opengl/ARB_buffer_object.java, + src/templates/org/lwjgl/opengl/EXT_direct_state_access.java, + src/templates/org/lwjgl/opengl/GL15.java, + src/templates/org/lwjgl/opengles/GLES20.java: Require at least 1 + element remaining in BO data params. + +2012-01-17 21:05 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: prod nightly + server to rebuild LWJGL. + +2012-01-16 22:18 kappa1 + + * src/java/org/lwjgl/MacOSXSysImplementation.java, + src/java/org/lwjgl/opengl/AWTSurfaceLock.java, + src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java: Add extra + checks so CALayer's only run on OS X 10.6+, Bump OS X native + version + +2012-01-13 00:53 kappa1 + + * platform_build/macosx_ant/build.xml: Weakly link the AppKit + framework in an attempt to allow 10.5 compatibility again. + +2012-01-13 00:40 kappa1 + + * src/native/macosx/org_lwjgl_opengl_MacOSXCanvasPeerInfo.m: OS X + slight tweak to MacOSXCanvasPeerInfo in prep to make it + compatible for 10.5 again + +2012-01-11 20:46 matzon + + * src/java/org/lwjgl/WindowsSysImplementation.java, + src/java/org/lwjgl/opengl/WindowsDisplay.java: adding + WS_MAXIMIZEBOX patch for windows and bumping native version + +2012-01-06 11:52 spasi + + * src/templates/org/lwjgl/opencl/INTEL_printf.java: Added + INTEL_printf. + +2012-01-05 11:24 spasi + + * src/templates/org/lwjgl/opengl/AMD_performance_monitor.java, + src/templates/org/lwjgl/opengl/ARB_separate_shader_objects.java, + src/templates/org/lwjgl/opengl/ARB_shader_subroutine.java, + src/templates/org/lwjgl/opengl/ARB_sync.java, + src/templates/org/lwjgl/opengl/ARB_uniform_buffer_object.java, + src/templates/org/lwjgl/opengles/EXT_color_buffer_half_float.java, + src/templates/org/lwjgl/opengles/EXT_debug_label.java, + src/templates/org/lwjgl/opengles/EXT_debug_marker.java, + src/templates/org/lwjgl/opengles/EXT_multisampled_render_to_texture.java, + src/templates/org/lwjgl/opengles/EXT_occlusion_query_boolean.java, + src/templates/org/lwjgl/opengles/EXT_robustness.java, + src/templates/org/lwjgl/opengles/EXT_sRGB.java, + src/templates/org/lwjgl/opengles/EXT_separate_shader_objects.java, + src/templates/org/lwjgl/opengles/EXT_shadow_samplers.java, + src/templates/org/lwjgl/opengles/EXT_texture_rg.java, + src/templates/org/lwjgl/opengles/EXT_texture_storage.java, + src/templates/org/lwjgl/opengles/NV_EGL_stream_consumer_external.java: + Added new OpenGL ES extensions. + +2012-01-02 22:06 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: Applying + WM_SETCURSOR patch to fix issue with cursor + +2012-01-02 22:03 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: undoing commit of + r3717 + +2012-01-02 21:59 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: Applied + WM_SETCURSOR to fix issue with cursor + +2011-12-21 14:34 jpilgrim + + * eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/StandalonePublisher.java: + Fixed a problem with categories. + + Categories are now extracted from site.xml. A default category is + created if no site.xml is found or if some features are not + mapped to any other category. + +2011-12-20 19:06 spasi + + * src/templates/org/lwjgl/opencl/CL12.java: Added @Optional on + clSetPrintfCallback for the AMD CL 1.2 preview driver. + +2011-12-20 17:16 spasi + + * src/templates/org/lwjgl/opengl/AMD_pinned_memory.java: Updated + AMD_pinned_memory based on official spec. + +2011-12-20 11:04 jpilgrim + + * eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/build-updatesite.xml, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/StandalonePublisher.java: + StandalonePublisher directly creates jars, no need for additional + "jarring". + + - added main method to StandalonePublisher creating + artifact.xml/jar and content.xml/jar from given (old) Eclise + update site. + - when compressed is set to true, artifact.jar and content.jar + are created directly. Removed jar task in build script, as these + are no longer necessary + +2011-12-15 19:00 jpilgrim + + * eclipse-update/org.lwjgl.build/READ.ME, + eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/build-updatesite.xml, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/StandalonePublisher.java: + Fixed problems in update site build. + + Update site is now build including Eclipse p2 metadata + (content.jar and artifact.jar). These files are required by some + tools, such as Tycho (a maven plugin making p2 update sites + available as maven repositories, see http://eclipse.org/tycho). + +2011-12-15 17:40 jpilgrim + + * eclipse-update/org.lwjgl.build/build-updatesite.xml: fixed typo + in update site build script, added publisher task + +2011-12-15 17:32 jpilgrim + + * eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/StandalonePublisher.java: + Added new ant task creating p2 metadata file for update site. + +2011-12-06 22:46 matzon + + * eclipse-update/org.lwjgl.build/build-updatesite.xml: updating + update site build script to use pre-packaged zip file in dist, + updating signjar to not use keypass + +2011-12-06 22:42 matzon + + * build.xml: adding eclipse update site to main build file + +2011-12-05 21:49 jpilgrim + + * eclipse-update/org.lwjgl.build/build-updatesite.xml: signing + information are interactively retrieved similar to applet build + +2011-12-05 12:41 jpilgrim + + * eclipse-update/org.lwjgl.build/READ.ME, + eclipse-update/org.lwjgl.build/anttasks.jar, + eclipse-update/org.lwjgl.build/build-updatesite.xml, + eclipse-update/org.lwjgl.build/build.xml, + eclipse-update/org.lwjgl.build/buildEclipseClasses.xml, + eclipse-update/org.lwjgl.build/lwjgl-archives, + eclipse-update/org.lwjgl.build/plugin-classes, + eclipse-update/org.lwjgl.build/plugin-classes/org.lwjgl.info.zip, + eclipse-update/org.lwjgl.build/plugin-classes/org.lwjgl.tools.zip, + eclipse-update/org.lwjgl.build/plugin-classes/org.lwjgl.zip: + Added new Eclipse update site build script to be imported from + main LWJGL build script. + See org.lwjgl.build/README for details. + + Removed old build script depending on pre-build LWJGL archives. + +2011-12-03 11:10 spasi + + * src/templates/org/lwjgl/opengl/NV_transform_feedback.java: Fixed + glTransformFeedbackAttribsNV count argument. + +2011-11-28 16:40 jpilgrim + + * eclipse-update/org.lwjgl.build/build.xml: bug fix in Eclipes + update site build: + native libraries are not copied from skeleton (where they are + required for development purposes) anymore + +2011-11-28 16:23 jpilgrim + + * eclipse-update/org.lwjgl.build/.classpath, + eclipse-update/org.lwjgl.build/META-INF/MANIFEST.MF, + eclipse-update/org.lwjgl.build/build.xml, + eclipse-update/org.lwjgl.build/src/java/org/lwjgl/ant/NormalizeVersion.java, + eclipse-update/org.lwjgl.build/test/java/org/lwjgl/ant/NormalizeVersionTest.java: + Fixed a bug in the update site build script. + + Wrong class name of LWJGL plugin activator was specified + (org.lwjgl.eclipse.Activator, but correct + is org.lwjgl.Activator). + + Now, the current date/time string is added as a qualifier to the + LWJGL version, e.g., org.lwjgl_2.8.2.v20111128-1653 instead of + org.lwjgl_2.8.2. This simplifies testing and discouples LWJGL + versions from plugin versions. + +2011-11-17 21:41 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + fix uncaught null pointer exception + +2011-11-16 14:36 spasi + + * platform_build/build-generator.xml, + src/java/org/lwjgl/opencl/CLBuildProgramCallback.java, + src/java/org/lwjgl/opencl/CLChecks.java, + src/java/org/lwjgl/opencl/CLCompileProgramCallback.java, + src/java/org/lwjgl/opencl/CLContext.java, + src/java/org/lwjgl/opencl/CLLinkProgramCallback.java, + src/java/org/lwjgl/opencl/CLPrintfCallback.java, + src/java/org/lwjgl/opencl/CLProgramCallback.java, + src/java/org/lwjgl/opencl/CallbackUtil.java, + src/java/org/lwjgl/opencl/InfoUtilFactory.java, + src/java/org/lwjgl/util/generator/Utils.java, + src/java/org/lwjgl/util/generator/opencl/CLPDCapabilitiesGenerator.java, + src/native/common/extcl.h, src/native/common/extcl_types.h, + src/native/common/org_lwjgl_opencl_CallbackUtil.c, + src/templates/org/lwjgl/opencl/CL10.java, + src/templates/org/lwjgl/opencl/CL11.java, + src/templates/org/lwjgl/opencl/CL12.java, + src/templates/org/lwjgl/opencl/CL12GL.java, + src/templates/org/lwjgl/opencl/EXT_device_fission.java, + src/templates/org/lwjgl/opengl/ARB_separate_shader_objects.java, + src/templates/org/lwjgl/opengl/GL41.java: Added support for + OpenCL 1.2 [UNTESTED] + +2011-11-13 21:21 matzon + + * www/changelogs/2.8.1-changelog.txt, + www/changelogs/2.8.2-changelog.txt, + www/changelogs/full-changelog.txt: adding changelogs + +2011-11-13 21:20 matzon + + * platform_build/build-definitions.xml, + src/java/org/lwjgl/Sys.java: bumping to 2.8.3 + 2011-11-12 21:50 kappa1 * src/java/org/lwjgl/MacOSXSysImplementation.java: bump native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-06-03 19:08:05
|
Revision: 3778 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3778&view=rev Author: matzon Date: 2012-06-03 19:07:57 +0000 (Sun, 03 Jun 2012) Log Message: ----------- bumping to 2.8.5, adding changelogs Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/src/java/org/lwjgl/Sys.java trunk/LWJGL/www/changelogs/full-changelog.txt Added Paths: ----------- trunk/LWJGL/www/changelogs/2.8.4-changelog.txt Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2012-06-03 18:54:24 UTC (rev 3777) +++ trunk/LWJGL/platform_build/build-definitions.xml 2012-06-03 19:07:57 UTC (rev 3778) @@ -12,7 +12,7 @@ <property name="lwjgl.docs" location="doc" /> <property name="lwjgl.temp" location="temp" /> <property name="lwjgl.res" location="res" /> - <property name="lwjgl.version" value="2.8.4" /> + <property name="lwjgl.version" value="2.8.5" /> <property name="lwjgl.web" location="www" /> <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2012-06-03 18:54:24 UTC (rev 3777) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2012-06-03 19:07:57 UTC (rev 3778) @@ -54,7 +54,7 @@ private static final String JNI_LIBRARY_NAME = "lwjgl"; /** Current version of library */ - private static final String VERSION = "2.8.4"; + private static final String VERSION = "2.8.5"; private static final String POSTFIX64BIT = "64"; Added: trunk/LWJGL/www/changelogs/2.8.4-changelog.txt =================================================================== --- trunk/LWJGL/www/changelogs/2.8.4-changelog.txt (rev 0) +++ trunk/LWJGL/www/changelogs/2.8.4-changelog.txt 2012-06-03 19:07:57 UTC (rev 3778) @@ -0,0 +1,292 @@ +2012-05-21 20:39 kappa1 + + * libs/macosx/openal.dylib: Add OpenAL-Soft 1.14 for OS X + +2012-05-21 18:30 matzon + + * libs/linux/libopenal.so, libs/linux/libopenal64.so, + libs/solaris/libopenal.so, libs/solaris/libopenal64.so, + libs/windows/OpenAL32.dll, libs/windows/OpenAL64.dll: updating + OpenAL-soft to 1.14+ + +2012-05-13 18:03 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Minor tweak to remove + unused code + +2012-05-13 18:01 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Display.wasResized() + should now work correctly when using Display.setParent() + +2012-05-13 13:50 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + fixed issue with applets on linux with Java 7 where the natives + where LWJGL natives were failing to load. + +2012-05-13 12:11 kappa1 + + * src/java/org/lwjgl/input/Mouse.java: Fix Mouse.getDX() and + Mouse.getDY() values when mouse moves outside Display window & + clipping is on. Thanks to ra4king for patch. + +2012-05-09 12:33 jpilgrim + + * eclipse-update/org.lwjgl.info/plugin.xml: LWJGL info and test + view are now sorted into category "general" (otherwise they are + not visible in Eclipse 4.2) + +2012-05-08 19:38 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + fix to ensure a jar file download is attempted 3 times even if it + throws some download exception. + +2012-05-04 17:23 spasi + + * src/templates/org/lwjgl/opengl/GL11.java, + src/templates/org/lwjgl/opengl/GL13.java, + src/templates/org/lwjgl/opengl/GL14.java, + src/templates/org/lwjgl/opengl/GL31.java, + src/templates/org/lwjgl/opengl/GL40.java, + src/templates/org/lwjgl/opengl/GL41.java: GL spec 20120427 + updates. + +2012-04-26 18:08 jpilgrim + + * eclipse-update/org.lwjgl.info/src/java/org/lwjgl/info/LWJGLInfoView.java: + fixed problem with InfoView, also see + https://bugs.eclipse.org/bugs/show_bug.cgi?id=367718 + +2012-04-26 13:19 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + add further checks to prevent Java default caching + +2012-04-22 23:05 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + set all streams that are open to use try/finally blocks to close + the streams + +2012-04-22 22:51 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + add try/finally block to ensure file is closed on exception in + the downloadJars(), thx to MatthiasM for pointing it out. + +2012-04-22 22:21 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + add extra urlconnections.setUseCaches(false) as an extra + precaution to make sure caching is disabled. + +2012-04-18 16:50 spasi + + * src/templates/org/lwjgl/opencl/INTEL_thread_local_exec.java: + Added INTEL_thread_local_exec OpenCL extension. + +2012-04-14 18:55 kappa1 + + * src/java/org/lwjgl/opengl/MacOSXFrame.java: Fix + Display.getWidth() and Display.getHeight() to return the correct + values on OS X when the window has been resized. + +2012-04-10 13:23 kappa1 + + * src/java/org/lwjgl/input/Controller.java, + src/java/org/lwjgl/input/JInputController.java, + src/java/org/lwjgl/util/input/ControllerAdapter.java: Update + ControllerAdapter in util package to reflect new changes in the + Controller interface class (should fix broken build) + +2012-04-10 11:44 kappa1 + + * src/java/org/lwjgl/input/Controller.java, + src/java/org/lwjgl/input/JInputController.java: Apply patch by + OrangyTang to expose JInput's rumble functionality in LWJGL's + Controller class. + +2012-03-27 13:12 spasi + + * src/templates/org/lwjgl/opengl/AMD_vertex_shader_layer.java, + src/templates/org/lwjgl/opengl/AMD_vertex_shader_viewport_index.java, + src/templates/org/lwjgl/opengl/NV_bindless_texture.java, + src/templates/org/lwjgl/opengl/NV_shader_atomic_float.java: Added + support for: AMD_vertex_shader_viewport_index, + AMD_vertex_shader_layer, NV_bindless_texture, + NV_shader_atomic_float. + +2012-03-24 00:39 kappa1 + + * src/java/org/lwjgl/opengl/Sync.java: remove non-existing import. + +2012-03-24 00:20 kappa1 + + * src/java/org/lwjgl/opengl/Display.java, + src/java/org/lwjgl/opengl/Sync.java: fix minor javadoc typo's + +2012-03-24 00:04 kappa1 + + * src/java/org/lwjgl/opengl/Display.java, + src/java/org/lwjgl/opengl/Sync.java: Replace Display.sync(int + fps) with an even better implementation, special thanks to Riven. + +2012-03-21 19:34 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Display.sync() fix + excessive CPU using on windows + +2012-03-19 22:12 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: applying white + border fix from dr_evil + +2012-03-18 16:25 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Fix the new accurate + Display.sync() method to use less CPU on Mac. + +2012-03-04 13:41 kappa1 + + * src/java/org/lwjgl/opengl/ContextGL.java, + src/java/org/lwjgl/opengl/ContextImplementation.java, + src/java/org/lwjgl/opengl/LinuxContextImplementation.java, + src/java/org/lwjgl/opengl/MacOSXContextImplementation.java, + src/java/org/lwjgl/opengl/WindowsContextImplementation.java: + Refactor so that the peer_info variable in ContextGL does not + need to be static + +2012-03-04 03:50 kappa1 + + * src/native/linux/opengl/extgl_glx.c: add missing + extgl_InitGLXEXTSwapControl() + +2012-03-04 03:45 kappa1 + + * src/native/linux/opengl/extgl_glx.h: add missing + lwjgl_glXSwapIntervalEXT + +2012-03-04 03:40 kappa1 + + * src/java/org/lwjgl/opengl/ContextGL.java, + src/java/org/lwjgl/opengl/ContextImplementation.java, + src/java/org/lwjgl/opengl/LinuxContextImplementation.java, + src/java/org/lwjgl/opengl/MacOSXContextImplementation.java, + src/java/org/lwjgl/opengl/WindowsContextImplementation.java, + src/native/linux/opengl/extgl_glx.c, + src/native/linux/opengl/extgl_glx.h, + src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c: + Implement GLX_EXT_swap_control for Linux + +2012-03-01 22:34 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Tweak Display.sync() + method a little to reduce the Thread.yield() time even further, + now with a minimum of 0 yield time. + +2012-02-29 23:18 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Implement a much more + accurate Display.sync() method that auto adapts to the systems + timer resolution and load. + +2012-02-28 18:18 spasi + + * src/java/org/lwjgl/MemoryUtil.java, + src/native/common/org_lwjgl_opencl_CallbackUtil.c, + src/templates/org/lwjgl/opencl/CL10.java: Fixed + clEnqueueNativeKernel crash. + +2012-02-18 18:38 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: added win32 + display get x/y + +2012-02-18 16:30 kappa1 + + * src/java/org/lwjgl/opengl/Display.java, + src/java/org/lwjgl/opengl/DisplayImplementation.java, + src/java/org/lwjgl/opengl/LinuxDisplay.java, + src/java/org/lwjgl/opengl/MacOSXDisplay.java, + src/java/org/lwjgl/opengl/WindowsDisplay.java: Added the new + public API's Display.getX() and Display.getY(). Currently + implemented for Linux and Mac. Windows implementation pending. + +2012-02-18 01:49 kappa1 + + * src/java/org/lwjgl/opengl/LinuxDisplay.java, + src/java/org/lwjgl/opengl/LinuxEvent.java, + src/native/linux/opengl/org_lwjgl_opengl_Display.c, + src/native/linux/opengles/org_lwjgl_opengl_Display.c: Implement + the ability for the native Display window on Linux to get its x + and y position. In preparation for adding the new Display.getX() + & getY() API's. + +2012-02-06 20:35 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: applied dr_evil's + maximized patch + +2012-02-06 19:26 spasi + + * src/templates/org/lwjgl/opencl/AMD_media_ops2.java: Added support + for AMD_media_ops2. + +2012-02-01 22:50 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: updated fix for + resizable + +2012-02-01 21:33 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: applying suggested + fix for resize issue + +2012-01-31 23:25 kappa1 + + * src/java/org/lwjgl/opengl/LinuxMouse.java: removed a tiny bit of + dead debug code + +2012-01-31 23:24 kappa1 + + * src/java/org/lwjgl/opengl/LinuxMouse.java, + src/native/linux/org_lwjgl_opengl_LinuxMouse.c: Linux Mouse: + added support for using more than 3 buttons on a mouse, supports + mice with upto 256 buttons. + +2012-01-29 20:35 matzon + + * src/java/org/lwjgl/opengl/WindowsMouse.java: limit mouse buttons + to 5, since we can't read more at this time + +2012-01-29 20:26 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: support for 5 + buttons on windows + +2012-01-29 19:06 spasi + + * src/templates/org/lwjgl/opengl/ARB_buffer_object.java, + src/templates/org/lwjgl/opengl/EXT_direct_state_access.java, + src/templates/org/lwjgl/opengl/GL15.java, + src/templates/org/lwjgl/opengles/GLES20.java: Removed @Check("1") + from BufferData functions. + +2012-01-28 19:35 spasi + + * src/templates/org/lwjgl/opengl/AMD_stencil_operation_extended.java, + src/templates/org/lwjgl/opengl/ARB_buffer_object.java, + src/templates/org/lwjgl/opengl/EXT_direct_state_access.java, + src/templates/org/lwjgl/opengl/GL15.java, + src/templates/org/lwjgl/opengles/GLES20.java: Added + AMD_stencil_operation_extended. + Reverted @Check("1") from SubData BO functions. + +2012-01-23 21:30 matzon + + * platform_build/build-definitions.xml, + src/java/org/lwjgl/Sys.java, www/changelogs/2.8.3-changelog.txt, + www/changelogs/full-changelog.txt: bumping to 2.8.4 and adding + changelogs \ No newline at end of file Modified: trunk/LWJGL/www/changelogs/full-changelog.txt =================================================================== --- trunk/LWJGL/www/changelogs/full-changelog.txt 2012-06-03 18:54:24 UTC (rev 3777) +++ trunk/LWJGL/www/changelogs/full-changelog.txt 2012-06-03 19:07:57 UTC (rev 3778) @@ -1,3 +1,296 @@ +2012-05-21 20:39 kappa1 + + * libs/macosx/openal.dylib: Add OpenAL-Soft 1.14 for OS X + +2012-05-21 18:30 matzon + + * libs/linux/libopenal.so, libs/linux/libopenal64.so, + libs/solaris/libopenal.so, libs/solaris/libopenal64.so, + libs/windows/OpenAL32.dll, libs/windows/OpenAL64.dll: updating + OpenAL-soft to 1.14+ + +2012-05-13 18:03 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Minor tweak to remove + unused code + +2012-05-13 18:01 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Display.wasResized() + should now work correctly when using Display.setParent() + +2012-05-13 13:50 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + fixed issue with applets on linux with Java 7 where the natives + where LWJGL natives were failing to load. + +2012-05-13 12:11 kappa1 + + * src/java/org/lwjgl/input/Mouse.java: Fix Mouse.getDX() and + Mouse.getDY() values when mouse moves outside Display window & + clipping is on. Thanks to ra4king for patch. + +2012-05-09 12:33 jpilgrim + + * eclipse-update/org.lwjgl.info/plugin.xml: LWJGL info and test + view are now sorted into category "general" (otherwise they are + not visible in Eclipse 4.2) + +2012-05-08 19:38 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + fix to ensure a jar file download is attempted 3 times even if it + throws some download exception. + +2012-05-04 17:23 spasi + + * src/templates/org/lwjgl/opengl/GL11.java, + src/templates/org/lwjgl/opengl/GL13.java, + src/templates/org/lwjgl/opengl/GL14.java, + src/templates/org/lwjgl/opengl/GL31.java, + src/templates/org/lwjgl/opengl/GL40.java, + src/templates/org/lwjgl/opengl/GL41.java: GL spec 20120427 + updates. + +2012-04-26 18:08 jpilgrim + + * eclipse-update/org.lwjgl.info/src/java/org/lwjgl/info/LWJGLInfoView.java: + fixed problem with InfoView, also see + https://bugs.eclipse.org/bugs/show_bug.cgi?id=367718 + +2012-04-26 13:19 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + add further checks to prevent Java default caching + +2012-04-22 23:05 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + set all streams that are open to use try/finally blocks to close + the streams + +2012-04-22 22:51 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + add try/finally block to ensure file is closed on exception in + the downloadJars(), thx to MatthiasM for pointing it out. + +2012-04-22 22:21 kappa1 + + * src/java/org/lwjgl/util/applet/AppletLoader.java: AppletLoader: + add extra urlconnections.setUseCaches(false) as an extra + precaution to make sure caching is disabled. + +2012-04-18 16:50 spasi + + * src/templates/org/lwjgl/opencl/INTEL_thread_local_exec.java: + Added INTEL_thread_local_exec OpenCL extension. + +2012-04-14 18:55 kappa1 + + * src/java/org/lwjgl/opengl/MacOSXFrame.java: Fix + Display.getWidth() and Display.getHeight() to return the correct + values on OS X when the window has been resized. + +2012-04-10 13:23 kappa1 + + * src/java/org/lwjgl/input/Controller.java, + src/java/org/lwjgl/input/JInputController.java, + src/java/org/lwjgl/util/input/ControllerAdapter.java: Update + ControllerAdapter in util package to reflect new changes in the + Controller interface class (should fix broken build) + +2012-04-10 11:44 kappa1 + + * src/java/org/lwjgl/input/Controller.java, + src/java/org/lwjgl/input/JInputController.java: Apply patch by + OrangyTang to expose JInput's rumble functionality in LWJGL's + Controller class. + +2012-03-27 13:12 spasi + + * src/templates/org/lwjgl/opengl/AMD_vertex_shader_layer.java, + src/templates/org/lwjgl/opengl/AMD_vertex_shader_viewport_index.java, + src/templates/org/lwjgl/opengl/NV_bindless_texture.java, + src/templates/org/lwjgl/opengl/NV_shader_atomic_float.java: Added + support for: AMD_vertex_shader_viewport_index, + AMD_vertex_shader_layer, NV_bindless_texture, + NV_shader_atomic_float. + +2012-03-24 00:39 kappa1 + + * src/java/org/lwjgl/opengl/Sync.java: remove non-existing import. + +2012-03-24 00:20 kappa1 + + * src/java/org/lwjgl/opengl/Display.java, + src/java/org/lwjgl/opengl/Sync.java: fix minor javadoc typo's + +2012-03-24 00:04 kappa1 + + * src/java/org/lwjgl/opengl/Display.java, + src/java/org/lwjgl/opengl/Sync.java: Replace Display.sync(int + fps) with an even better implementation, special thanks to Riven. + +2012-03-21 19:34 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Display.sync() fix + excessive CPU using on windows + +2012-03-19 22:12 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: applying white + border fix from dr_evil + +2012-03-18 16:25 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Fix the new accurate + Display.sync() method to use less CPU on Mac. + +2012-03-04 13:41 kappa1 + + * src/java/org/lwjgl/opengl/ContextGL.java, + src/java/org/lwjgl/opengl/ContextImplementation.java, + src/java/org/lwjgl/opengl/LinuxContextImplementation.java, + src/java/org/lwjgl/opengl/MacOSXContextImplementation.java, + src/java/org/lwjgl/opengl/WindowsContextImplementation.java: + Refactor so that the peer_info variable in ContextGL does not + need to be static + +2012-03-04 03:50 kappa1 + + * src/native/linux/opengl/extgl_glx.c: add missing + extgl_InitGLXEXTSwapControl() + +2012-03-04 03:45 kappa1 + + * src/native/linux/opengl/extgl_glx.h: add missing + lwjgl_glXSwapIntervalEXT + +2012-03-04 03:40 kappa1 + + * src/java/org/lwjgl/opengl/ContextGL.java, + src/java/org/lwjgl/opengl/ContextImplementation.java, + src/java/org/lwjgl/opengl/LinuxContextImplementation.java, + src/java/org/lwjgl/opengl/MacOSXContextImplementation.java, + src/java/org/lwjgl/opengl/WindowsContextImplementation.java, + src/native/linux/opengl/extgl_glx.c, + src/native/linux/opengl/extgl_glx.h, + src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c: + Implement GLX_EXT_swap_control for Linux + +2012-03-01 22:34 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Tweak Display.sync() + method a little to reduce the Thread.yield() time even further, + now with a minimum of 0 yield time. + +2012-02-29 23:18 kappa1 + + * src/java/org/lwjgl/opengl/Display.java: Implement a much more + accurate Display.sync() method that auto adapts to the systems + timer resolution and load. + +2012-02-28 18:18 spasi + + * src/java/org/lwjgl/MemoryUtil.java, + src/native/common/org_lwjgl_opencl_CallbackUtil.c, + src/templates/org/lwjgl/opencl/CL10.java: Fixed + clEnqueueNativeKernel crash. + +2012-02-18 18:38 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: added win32 + display get x/y + +2012-02-18 16:30 kappa1 + + * src/java/org/lwjgl/opengl/Display.java, + src/java/org/lwjgl/opengl/DisplayImplementation.java, + src/java/org/lwjgl/opengl/LinuxDisplay.java, + src/java/org/lwjgl/opengl/MacOSXDisplay.java, + src/java/org/lwjgl/opengl/WindowsDisplay.java: Added the new + public API's Display.getX() and Display.getY(). Currently + implemented for Linux and Mac. Windows implementation pending. + +2012-02-18 01:49 kappa1 + + * src/java/org/lwjgl/opengl/LinuxDisplay.java, + src/java/org/lwjgl/opengl/LinuxEvent.java, + src/native/linux/opengl/org_lwjgl_opengl_Display.c, + src/native/linux/opengles/org_lwjgl_opengl_Display.c: Implement + the ability for the native Display window on Linux to get its x + and y position. In preparation for adding the new Display.getX() + & getY() API's. + +2012-02-06 20:35 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: applied dr_evil's + maximized patch + +2012-02-06 19:26 spasi + + * src/templates/org/lwjgl/opencl/AMD_media_ops2.java: Added support + for AMD_media_ops2. + +2012-02-01 22:50 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: updated fix for + resizable + +2012-02-01 21:33 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: applying suggested + fix for resize issue + +2012-01-31 23:25 kappa1 + + * src/java/org/lwjgl/opengl/LinuxMouse.java: removed a tiny bit of + dead debug code + +2012-01-31 23:24 kappa1 + + * src/java/org/lwjgl/opengl/LinuxMouse.java, + src/native/linux/org_lwjgl_opengl_LinuxMouse.c: Linux Mouse: + added support for using more than 3 buttons on a mouse, supports + mice with upto 256 buttons. + +2012-01-29 20:35 matzon + + * src/java/org/lwjgl/opengl/WindowsMouse.java: limit mouse buttons + to 5, since we can't read more at this time + +2012-01-29 20:26 matzon + + * src/java/org/lwjgl/opengl/WindowsDisplay.java: support for 5 + buttons on windows + +2012-01-29 19:06 spasi + + * src/templates/org/lwjgl/opengl/ARB_buffer_object.java, + src/templates/org/lwjgl/opengl/EXT_direct_state_access.java, + src/templates/org/lwjgl/opengl/GL15.java, + src/templates/org/lwjgl/opengles/GLES20.java: Removed @Check("1") + from BufferData functions. + +2012-01-28 19:35 spasi + + * src/templates/org/lwjgl/opengl/AMD_stencil_operation_extended.java, + src/templates/org/lwjgl/opengl/ARB_buffer_object.java, + src/templates/org/lwjgl/opengl/EXT_direct_state_access.java, + src/templates/org/lwjgl/opengl/GL15.java, + src/templates/org/lwjgl/opengles/GLES20.java: Added + AMD_stencil_operation_extended. + Reverted @Check("1") from SubData BO functions. + +2012-01-23 21:30 matzon + + * platform_build/build-definitions.xml, + src/java/org/lwjgl/Sys.java, www/changelogs/2.8.3-changelog.txt, + www/changelogs/full-changelog.txt: bumping to 2.8.4 and adding + changelogs + 2012-01-22 20:16 kappa1 * src/java/org/lwjgl/opengl/LinuxDisplay.java: Small tweak to the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2012-08-07 15:14:17
|
Revision: 3783 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3783&view=rev Author: spasi Date: 2012-08-07 15:14:03 +0000 (Tue, 07 Aug 2012) Log Message: ----------- Added support for OpenGL 4.3 and OpenGL ES 3.0. Modified the generator process to use relative paths. We were hitting the command line length limit on Windows. Some extension improvements, fixes and spec updates. Modified Paths: -------------- trunk/LWJGL/build.xml trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/platform_build/build-generator.xml trunk/LWJGL/src/java/org/lwjgl/opengl/CallbackUtil.java trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java trunk/LWJGL/src/java/org/lwjgl/opengles/APIUtil.java trunk/LWJGL/src/java/org/lwjgl/opengles/ContextAttribs.java trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java trunk/LWJGL/src/java/org/lwjgl/opengles/GLContext.java trunk/LWJGL/src/java/org/lwjgl/opengles/StateTracker.java trunk/LWJGL/src/java/org/lwjgl/util/generator/GeneratorProcessorFactory.java trunk/LWJGL/src/java/org/lwjgl/util/generator/GeneratorVisitor.java trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeTypeTranslator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/SignatureTranslator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/opengl/GLESGeneratorProcessorFactory.java trunk/LWJGL/src/java/org/lwjgl/util/generator/opengl/GLESTypeMap.java trunk/LWJGL/src/native/common/opengl/extgl.h trunk/LWJGL/src/native/common/opengl/org_lwjgl_opengl_CallbackUtil.c trunk/LWJGL/src/native/common/opengles/extgl.h trunk/LWJGL/src/native/common/opengles/extgl_types.h trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_multi_draw_indirect.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_draw_indirect.java trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL32.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL40.java Added Paths: ----------- trunk/LWJGL/src/java/org/lwjgl/opengl/KHRDebugCallback.java trunk/LWJGL/src/java/org/lwjgl/opengles/CallbackUtil.java trunk/LWJGL/src/java/org/lwjgl/opengles/FastIntMap.java trunk/LWJGL/src/java/org/lwjgl/opengles/GLSync.java trunk/LWJGL/src/java/org/lwjgl/opengles/KHRDebugCallback.java trunk/LWJGL/src/native/common/opengles/org_lwjgl_opengles_CallbackUtil.c trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_ES3_compatibility.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_arrays_of_arrays.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_clear_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_compute_shader.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_copy_image.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_debug_group.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_debug_label.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_debug_output2.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_explicit_uniform_location.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_fragment_layer_viewport.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_framebuffer_no_attachments.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_internalformat_query2.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_invalidate_subdata.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_multi_draw_indirect.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_program_interface_query.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_robust_buffer_access_behavior.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_robustness_isolation.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_image_size.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_shader_storage_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_stencil_texturing.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_buffer_range.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_query_levels.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_storage_multisample.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_texture_view.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_binding.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL43.java trunk/LWJGL/src/templates/org/lwjgl/opengl/KHR_debug.java trunk/LWJGL/src/templates/org/lwjgl/opengl/KHR_texture_compression_astc_ldr.java trunk/LWJGL/src/templates/org/lwjgl/opengles/GLES30.java trunk/LWJGL/src/templates/org/lwjgl/opengles/KHR_debug.java trunk/LWJGL/src/templates/org/lwjgl/opengles/KHR_texture_compression_astc_ldr.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_required_internalformat.java trunk/LWJGL/src/templates/org/lwjgl/opengles/OES_surfaceless_context.java Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/build.xml 2012-08-07 15:14:03 UTC (rev 3783) @@ -177,7 +177,7 @@ <!-- ================================================================== --> <!-- Generate a list of the OpenGL extension classes --> <!-- ================================================================== --> - <fileset id="opengl-template-fileset" dir="${lwjgl.src}/generated" includes="${opengl-template-pattern}"/> + <fileset id="opengl-template-fileset" dir="${lwjgl.src}/generated/org/lwjgl/opengl" includes="${opengl-template-pattern}"/> <property name="opengl-template-files" refid="opengl-template-fileset"/> <tempfile property="temp.file"/> @@ -187,7 +187,7 @@ <filterchain> <tokenfilter delimoutput=","> <stringtokenizer delims=";"/> - <replaceregex pattern="org\${file.separator}lwjgl\${file.separator}opengl\${file.separator}(.+)[.]java" + <replaceregex pattern="(.+)[.]java" replace="org/lwjgl/opengl/\1.class"/> </tokenfilter> </filterchain> @@ -350,6 +350,7 @@ <class name="org.lwjgl.opengles.EGLKHRReusableSync"/> <class name="org.lwjgl.opengles.EGLNVSync"/> <class name="org.lwjgl.opengles.GLContext"/> + <class name="org.lwjgl.opengles.CallbackUtil"/> </javah> </target> @@ -626,7 +627,7 @@ <bottom><![CDATA[<i>Copyright © 2002-2009 lwjgl.org. All Rights Reserved.</i>]]></bottom> </javadoc> </target> - + <!-- get and copy nightly binaries into libs folder --> <target name="copy-nightly-binaries" depends="-initialize" description="Copies latest successful nightly binaries into appropriate libs folder"> <delete file="${lwjgl.temp}/lwjgl-${lwjgl.version}.zip" failonerror="false"/> @@ -635,7 +636,7 @@ <patternset> <include name="**/native/**/*lwjgl*"/> </patternset> - <globmapper from="lwjgl-${lwjgl.version}/native/*" to="*"/> + <globmapper from="lwjgl-${lwjgl.version}/native/*" to="*"/> </unzip> - </target> + </target> </project> Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/platform_build/build-definitions.xml 2012-08-07 15:14:03 UTC (rev 3783) @@ -15,11 +15,17 @@ <property name="lwjgl.version" value="2.8.5" /> <property name="lwjgl.web" location="www" /> - <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/AMD*.java,org/lwjgl/opengl/APPLE*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/NVX*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java,org/lwjgl/opengl/GREMEDY*.java"/> - <property name="opengles-template-pattern" value="org/lwjgl/opengles/GLES*.java,org/lwjgl/opengles/ARB*.java,org/lwjgl/opengles/EXT*.java,org/lwjgl/opengles/AMD*.java,org/lwjgl/opengles/ANGLE*.java,org/lwjgl/opengles/APPLE*.java,org/lwjgl/opengles/ARM*.java,org/lwjgl/opengles/DMP*.java,org/lwjgl/opengles/IMG*.java,org/lwjgl/opengles/NV*.java,org/lwjgl/opengles/OES*.java,org/lwjgl/opengles/QCOM*.java,org/lwjgl/opengles/VIV*.java"/> - <property name="opencl-template-pattern-extensions" value="org/lwjgl/opencl/KHR*.java,org/lwjgl/opencl/EXT*.java,org/lwjgl/opencl/APPLE*.java,org/lwjgl/opencl/AMD*.java,org/lwjgl/opencl/INTEL*.java,org/lwjgl/opencl/NV*.java"/> - <property name="opencl-template-pattern" value="org/lwjgl/opencl/CL*.java,${opencl-template-pattern-extensions}"/> + <property name="lwjgl.src.templates.al" location="${lwjgl.src.templates}/org/lwjgl/openal"/> + <property name="lwjgl.src.templates.gl" location="${lwjgl.src.templates}/org/lwjgl/opengl"/> + <property name="lwjgl.src.templates.gles" location="${lwjgl.src.templates}/org/lwjgl/opengles"/> + <property name="lwjgl.src.templates.cl" location="${lwjgl.src.templates}/org/lwjgl/opencl"/> + <property name="openal-template-pattern" value="AL*.java,EFX*.java"/> + <property name="opengl-template-pattern" value="GL*.java,ARB*.java,EXT*.java,KHR*.java,AMD*.java,APPLE*.java,ATI*.java,NV*.java,NVX*.java,HP*.java,IBM*.java,SUN*.java,SGIS*.java,GREMEDY*.java"/> + <property name="opengles-template-pattern" value="GLES*.java,ARB*.java,EXT*.java,KHR*.java,AMD*.java,ANGLE*.java,APPLE*.java,ARM*.java,DMP*.java,IMG*.java,NV*.java,OES*.java,QCOM*.java,VIV*.java"/> + <property name="opencl-template-pattern-extensions" value="KHR*.java,EXT*.java,APPLE*.java,AMD*.java,INTEL*.java,NV*.java"/> + <property name="opencl-template-pattern" value="CL*.java,${opencl-template-pattern-extensions}"/> + <!-- ================================================================== --> <!-- Filesets used for targets --> <!-- ================================================================== --> Modified: trunk/LWJGL/platform_build/build-generator.xml =================================================================== --- trunk/LWJGL/platform_build/build-generator.xml 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/platform_build/build-generator.xml 2012-08-07 15:14:03 UTC (rev 3783) @@ -30,8 +30,10 @@ <include name="org/lwjgl/opengl/GLSync.java"/> <include name="org/lwjgl/opengl/AMDDebugOutputCallback.java"/> <include name="org/lwjgl/opengl/ARBDebugOutputCallback.java"/> + <include name="org/lwjgl/opengl/KHRDebugCallback.java"/> <!-- OpenGL ES --> <include name="org/lwjgl/opengles/EGLImageOES.java"/> + <include name="org/lwjgl/opengles/KHRDebugCallback.java"/> <!-- OpenCL --> <include name="org/lwjgl/opencl/CLPlatform.java"/> <include name="org/lwjgl/opencl/CLDevice.java"/> @@ -57,7 +59,7 @@ <!-- Generate OpenAL --> <target name="generate-openal" depends="generators" description="Generates java and native source for AL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.al}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> @@ -67,14 +69,15 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> <arg path="${lwjgl.src.native}/generated/openal"/> + <arg value="-Abinpath=${lwjgl.bin}"/> <arg value="-Atypemap=org.lwjgl.util.generator.openal.ALTypeMap"/> - <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java, org/lwjgl/openal/EFX10.java"/> + <fileset dir="${lwjgl.src.templates.al}" includes="${openal-template-pattern}"/> </apply> </target> <!-- Generate OpenAL [DEBUG] --> <target name="generate-openal-debug" depends="generators" description="Generates java and native source for AL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.al}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> @@ -84,9 +87,10 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> <arg path="${lwjgl.src.native}/generated/openal"/> + <arg value="-Abinpath=${lwjgl.bin}"/> <arg value="-Atypemap=org.lwjgl.util.generator.openal.ALTypeMap"/> <arg value="-Ageneratechecks"/> - <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java, org/lwjgl/openal/EFX10.java"/> + <fileset dir="${lwjgl.src.templates.al}" includes="${openal-template-pattern}"/> </apply> </target> @@ -98,7 +102,7 @@ <!-- Generate OpenGL --> <target name="generate-opengl" depends="generators" description="Generates java and native source for GL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> @@ -108,15 +112,16 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> <arg path="${lwjgl.src.native}/generated/opengl"/> + <arg value="-Abinpath=${lwjgl.bin}"/> <arg value="-Acontextspecific"/> <arg value="-Atypemap=org.lwjgl.util.generator.opengl.GLTypeMap"/> - <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gl}" includes="${opengl-template-pattern}"/> </apply> </target> <!-- Generate OpenGL [DEBUG] --> <target name="generate-opengl-debug" depends="generators" description="Generates debug java and native source for GL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> @@ -126,16 +131,17 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> <arg path="${lwjgl.src.native}/generated/opengl"/> + <arg value="-Abinpath=${lwjgl.bin}"/> <arg value="-Ageneratechecks"/> <arg value="-Acontextspecific"/> <arg value="-Atypemap=org.lwjgl.util.generator.opengl.GLTypeMap"/> - <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gl}" includes="${opengl-template-pattern}"/> </apply> </target> <!-- Generate OpenGL references --> <target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.opengl.GLReferencesGeneratorProcessorFactory"/> @@ -143,13 +149,13 @@ <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/> <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> - <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gl}" includes="${opengl-template-pattern}"/> </apply> </target> <!-- Generate OpenGL context capabilities --> <target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessorFactory"/> @@ -158,13 +164,13 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <arg value="-Acontextspecific"/> - <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gl}" includes="${opengl-template-pattern}"/> </apply> </target> <!-- Generate OpenGL context capabilities [DEBUG] --> <target name="generate-opengl-capabilities-debug" depends="generators" description="Generates debug java and native source for GL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessorFactory"/> @@ -174,7 +180,7 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-Ageneratechecks"/> <arg value="-Acontextspecific"/> - <fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gl}" includes="${opengl-template-pattern}"/> </apply> </target> @@ -186,7 +192,7 @@ <!-- Generate OpenGL ES --> <target name="generate-opengles" depends="generators" description="Generates java and native source for GL ES"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gles}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> @@ -196,15 +202,16 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> <arg path="${lwjgl.src.native}/generated/opengles"/> + <arg value="-Abinpath=${lwjgl.bin}"/> <!--<arg value="-Acontextspecific"/>--> <arg value="-Atypemap=org.lwjgl.util.generator.opengl.GLESTypeMap"/> - <fileset dir="${lwjgl.src.templates}" includes="${opengles-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gles}" includes="${opengles-template-pattern}"/> </apply> </target> <!-- Generate OpenGL ES [DEBUG] --> <target name="generate-opengles-debug" depends="generators" description="Generates debug java and native source for GL ES"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gles}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> @@ -214,16 +221,17 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> <arg path="${lwjgl.src.native}/generated/opengles"/> + <arg value="-Abinpath=${lwjgl.bin}"/> <arg value="-Ageneratechecks"/> <!--<arg value="-Acontextspecific"/>--> <arg value="-Atypemap=org.lwjgl.util.generator.opengl.GLESTypeMap"/> - <fileset dir="${lwjgl.src.templates}" includes="${opengles-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gles}" includes="${opengles-template-pattern}"/> </apply> </target> <!-- Generate OpenGL ES context capabilities --> <target name="generate-opengles-capabilities" depends="generators" description="Generates java and native source for GL ES"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gles}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessorFactory"/> @@ -232,13 +240,13 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <!--<arg value="-Acontextspecific"/>--> - <fileset dir="${lwjgl.src.templates}" includes="${opengles-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gles}" includes="${opengles-template-pattern}"/> </apply> </target> <!-- Generate OpenGL ES context capabilities [DEBUG] --> <target name="generate-opengles-capabilities-debug" depends="generators" description="Generates debug java and native source for GL ES"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.gles}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessorFactory"/> @@ -248,7 +256,7 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-Ageneratechecks"/> <!--<arg value="-Acontextspecific"/>--> - <fileset dir="${lwjgl.src.templates}" includes="${opengles-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.gles}" includes="${opengles-template-pattern}"/> </apply> </target> @@ -260,7 +268,7 @@ <!-- Generate OpenCL --> <target name="generate-opencl" depends="generators" description="Generates java and native source for CL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.cl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> @@ -270,15 +278,16 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> <arg path="${lwjgl.src.native}/generated/opencl"/> + <arg value="-Abinpath=${lwjgl.bin}"/> <arg value="-Acontextspecific"/> <arg value="-Atypemap=org.lwjgl.util.generator.opencl.CLTypeMap"/> - <fileset dir="${lwjgl.src.templates}" includes="${opencl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.cl}" includes="${opencl-template-pattern}"/> </apply> </target> <!-- Generate OpenCL [DEBUG] --> <target name="generate-opencl-debug" depends="generators" description="Generates debug java and native source for CL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.cl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/> @@ -288,16 +297,17 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-d"/> <arg path="${lwjgl.src.native}/generated/opencl"/> + <arg value="-Abinpath=${lwjgl.bin}"/> <arg value="-Ageneratechecks"/> <arg value="-Acontextspecific"/> <arg value="-Atypemap=org.lwjgl.util.generator.opencl.CLTypeMap"/> - <fileset dir="${lwjgl.src.templates}" includes="${opencl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.cl}" includes="${opencl-template-pattern}"/> </apply> </target> <!-- Generate OpenCL capabilities --> <target name="generate-opencl-capabilities" depends="generators" description="Generates capabilities for CL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.cl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessorFactory"/> @@ -306,13 +316,13 @@ <arg value="-s"/> <arg path="${lwjgl.src}/generated"/> <arg value="-Acontextspecific"/> - <fileset dir="${lwjgl.src.templates}" includes="${opencl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.cl}" includes="${opencl-template-pattern}"/> </apply> </target> <!-- Generate OpenCL capabilities [DEBUG] --> <target name="generate-opencl-capabilities-debug" depends="generators" description="Generates debug capabilities for CL"> - <apply executable="apt" parallel="true"> + <apply executable="apt" parallel="true" dir="${lwjgl.src.templates.cl}" relative="true"> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessorFactory"/> @@ -322,7 +332,7 @@ <arg path="${lwjgl.src}/generated"/> <arg value="-Ageneratechecks"/> <arg value="-Acontextspecific"/> - <fileset dir="${lwjgl.src.templates}" includes="${opencl-template-pattern}"/> + <fileset dir="${lwjgl.src.templates.cl}" includes="${opencl-template-pattern}"/> </apply> </target> </project> Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/CallbackUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/CallbackUtil.java 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/CallbackUtil.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -45,6 +45,8 @@ private static final Map<ContextCapabilities, Long> contextUserParamsARB = new HashMap<ContextCapabilities, Long>(); /** Context -> Long */ private static final Map<ContextCapabilities, Long> contextUserParamsAMD = new HashMap<ContextCapabilities, Long>(); + /** Context -> Long */ + private static final Map<ContextCapabilities, Long> contextUserParamsKHR = new HashMap<ContextCapabilities, Long>(); private CallbackUtil() {} @@ -115,6 +117,10 @@ userParam = contextUserParamsAMD.remove(caps); if ( userParam != null ) deleteGlobalRef(userParam); + + userParam = contextUserParamsKHR.remove(caps); + if ( userParam != null ) + deleteGlobalRef(userParam); } // --------- [ ARB_debug_output ] --------- @@ -157,4 +163,24 @@ registerContextCallback(userParam, contextUserParamsAMD); } + // --------- [ KHR_debug ] --------- + + /** + * Returns the memory address of the native function we pass to glDebugMessageCallback. + * + * @return the callback function address + */ + static native long getDebugCallbackKHR(); + + /** + * Associates the current OpenGL context with the specified global reference. If there + * is no context current, the global reference is deleted and an exception is thrown. + * Any previous callback registrations will be cleared. + * + * @param userParam the global reference pointer + */ + static void registerContextCallbackKHR(final long userParam) { + registerContextCallback(userParam, contextUserParamsKHR); + } + } \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextAttribs.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -63,12 +63,14 @@ // Same values for GLX & WGL private static final int CONTEXT_ES2_PROFILE_BIT_EXT = 0x00000004; - private static final int CONTEXT_ROBUST_ACCESS_BIT_ARB = 0x00000004; + private static final int CONTEXT_ROBUST_ACCESS_BIT_ARB = 0x00000004; private static final int CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; private static final int - NO_RESET_NOTIFICATION_ARB = 0x8261, - LOSE_CONTEXT_ON_RESET_ARB = 0x8252; + NO_RESET_NOTIFICATION_ARB = 0x8261, + LOSE_CONTEXT_ON_RESET_ARB = 0x8252; + private static final int CONTEXT_RESET_ISOLATION_BIT_ARB = 0x00000008; + private int majorVersion; private int minorVersion; @@ -83,6 +85,7 @@ private boolean profileES; private boolean loseContextOnReset; + private boolean contextResetIsolation; public ContextAttribs() { this(1, 0); @@ -91,7 +94,7 @@ public ContextAttribs(final int majorVersion, final int minorVersion) { if ( majorVersion < 0 || 4 < majorVersion || minorVersion < 0 || - (majorVersion == 4 && 2 < minorVersion) || + (majorVersion == 4 && 3 < minorVersion) || (majorVersion == 3 && 3 < minorVersion) || (majorVersion == 2 && 1 < minorVersion) || (majorVersion == 1 && 5 < minorVersion) ) @@ -241,6 +244,15 @@ return attribs; } + public ContextAttribs withContextResetIsolation(final boolean contextResetIsolation) { + if ( contextResetIsolation == this.contextResetIsolation ) + return this; + + final ContextAttribs attribs = new ContextAttribs(this); + attribs.contextResetIsolation = contextResetIsolation; + return attribs; + } + private static ContextAttribsImplementation getImplementation() { switch ( LWJGLUtil.getPlatform() ) { case LWJGLUtil.PLATFORM_LINUX: @@ -272,6 +284,8 @@ flags |= implementation.getForwardCompatibleBit(); if ( robustAccess ) flags |= CONTEXT_ROBUST_ACCESS_BIT_ARB; + if ( contextResetIsolation ) + flags |= CONTEXT_RESET_ISOLATION_BIT_ARB; if ( 0 < flags ) attribCount++; @@ -285,6 +299,9 @@ if ( 0 < profileMask ) attribCount++; + if ( loseContextOnReset ) + attribCount++; + if ( attribCount == 0 ) return null; Added: trunk/LWJGL/src/java/org/lwjgl/opengl/KHRDebugCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/KHRDebugCallback.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/KHRDebugCallback.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -0,0 +1,205 @@ +/* + * 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. + */ +package org.lwjgl.opengl; + +import org.lwjgl.PointerWrapperAbstract; + +/** + * Instances of this class are needed to use the callback functionality of the KHR_debug extension. + * Users of this class may provide implementations of the {@code Handler} interface to receive notifications. + * The same {@code Handler} instance may be used by different contexts but it is not recommended. + * Handler notifications are synchronized. + * + * @author Spasi + */ +public final class KHRDebugCallback extends PointerWrapperAbstract { + + /** Severity levels. */ + private static final int + GL_DEBUG_SEVERITY_HIGH = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM = 0x9147, + GL_DEBUG_SEVERITY_LOW = 0x9148, + GL_DEBUG_SEVERITY_NOTIFICATION = 0x826B; + + /** Sources. */ + private static final int + GL_DEBUG_SOURCE_API = 0x8246, + GL_DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247, + GL_DEBUG_SOURCE_SHADER_COMPILER = 0x8248, + GL_DEBUG_SOURCE_THIRD_PARTY = 0x8249, + GL_DEBUG_SOURCE_APPLICATION = 0x824A, + GL_DEBUG_SOURCE_OTHER = 0x824B; + + /** Types. */ + private static final int + GL_DEBUG_TYPE_ERROR = 0x824C, + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D, + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E, + GL_DEBUG_TYPE_PORTABILITY = 0x824F, + GL_DEBUG_TYPE_PERFORMANCE = 0x8250, + GL_DEBUG_TYPE_OTHER = 0x8251, + GL_DEBUG_TYPE_MARKER = 0x8268; + + private static final long CALLBACK_POINTER; + + static { + long pointer = 0; + try { + // Call reflectively so that we can compile this class for the Generator. + pointer = (Long)Class.forName("org.lwjgl.opengl.CallbackUtil").getDeclaredMethod("getDebugCallbackKHR").invoke(null); + } catch (Exception e) { + // ignore + } + CALLBACK_POINTER = pointer; + } + + private final Handler handler; + + /** + * Creates an KHRebugCallback with a default callback handler. + * The default handler will simply print the message on System.err. + */ + public KHRDebugCallback() { + this(new Handler() { + public void handleMessage(final int source, final int type, final int id, final int severity, final String message) { + System.err.println("[LWJGL] KHR_debug message"); + System.err.println("\tID: " + id); + + String description; + switch ( source ) { + case GL_DEBUG_SOURCE_API: + description = "API"; + break; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM: + description = "WINDOW SYSTEM"; + break; + case GL_DEBUG_SOURCE_SHADER_COMPILER: + description = "SHADER COMPILER"; + break; + case GL_DEBUG_SOURCE_THIRD_PARTY: + description = "THIRD PARTY"; + break; + case GL_DEBUG_SOURCE_APPLICATION: + description = "APPLICATION"; + break; + case GL_DEBUG_SOURCE_OTHER: + description = "OTHER"; + break; + default: + description = "Unknown (" + Integer.toHexString(source) + ")"; + } + System.err.println("\tSource: " + description); + + switch ( type ) { + case GL_DEBUG_TYPE_ERROR: + description = "ERROR"; + break; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: + description = "DEPRECATED BEHAVIOR"; + break; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: + description = "UNDEFINED BEHAVIOR"; + break; + case GL_DEBUG_TYPE_PORTABILITY: + description = "PORTABILITY"; + break; + case GL_DEBUG_TYPE_PERFORMANCE: + description = "PERFORMANCE"; + break; + case GL_DEBUG_TYPE_OTHER: + description = "OTHER"; + break; + case GL_DEBUG_TYPE_MARKER: + description = "MARKER"; + break; + default: + description = "Unknown (" + Integer.toHexString(source) + ")"; + } + System.err.println("\tType: " + description); + + switch ( severity ) { + case GL_DEBUG_SEVERITY_HIGH: + description = "HIGH"; + break; + case GL_DEBUG_SEVERITY_MEDIUM: + description = "MEDIUM"; + break; + case GL_DEBUG_SEVERITY_LOW: + description = "LOW"; + break; + case GL_DEBUG_SEVERITY_NOTIFICATION: + description = "NOTIFICATION"; + break; + default: + description = "Unknown (" + Integer.toHexString(source) + ")"; + } + System.err.println("\tSeverity: " + description); + + System.err.println("\tMessage: " + message); + } + }); + } + + /** + * Creates an ARBDebugOutputCallback with the specified callback handler. + * The handler's {@code handleMessage} method will be called whenever + * debug output is generated by the GL. + * + * @param handler the callback handler + */ + public KHRDebugCallback(final Handler handler) { + super(CALLBACK_POINTER); + + this.handler = handler; + } + + Handler getHandler() { + return handler; + } + + /** Implementations of this interface can be used to receive ARB_debug_output notifications. */ + public interface Handler { + + /** + * This method will be called when an ARB_debug_output message is generated. + * + * @param id the message ID + * @param source the message source + * @param type the message type + * @param severity the message severity + * @param message the string representation of the message. + */ + void handleMessage(int source, int type, int id, int severity, String message); + + } + +} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opengles/APIUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/APIUtil.java 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/APIUtil.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -39,6 +39,7 @@ import java.nio.ByteBuffer; import java.nio.FloatBuffer; import java.nio.IntBuffer; +import java.nio.LongBuffer; /** * Utility class for OpenGL ES API calls. @@ -143,6 +144,8 @@ static IntBuffer getBufferInt() { return buffersTL.get().ints; } + static LongBuffer getBufferLong() { return buffersTL.get().longs; } + static FloatBuffer getBufferFloat() { return buffersTL.get().floats; } static IntBuffer getLengths() { @@ -312,10 +315,12 @@ private static class Buffers { final IntBuffer ints; + final LongBuffer longs; final FloatBuffer floats; Buffers() { ints = BufferUtils.createIntBuffer(BUFFERS_SIZE); + longs = BufferUtils.createLongBuffer(BUFFERS_SIZE); floats = BufferUtils.createFloatBuffer(BUFFERS_SIZE); } Added: trunk/LWJGL/src/java/org/lwjgl/opengles/CallbackUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/CallbackUtil.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/CallbackUtil.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -0,0 +1,134 @@ +/* + * 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. + */ +package org.lwjgl.opengles; + +import java.util.HashMap; +import java.util.Map; + +/** + * Utility class that handles OpenGL API callbacks. + * + * @author Spasi + */ +final class CallbackUtil { + + /** Context -> Long */ + private static final Map<ContextCapabilities, Long> contextUserParamsKHR = new HashMap<ContextCapabilities, Long>(); + + private CallbackUtil() {} + + /** + * Creates a new global reference to the specified Object. + * + * @param obj the Object + * + * @return the GlobalRef memory address or 0 if the Object is null. + */ + static long createGlobalRef(final Object obj) { + return obj == null ? 0 : ncreateGlobalRef(obj); + } + + /** + * Creates a new global reference to the specified Object. + * + * @param obj the Object + * + * @return the GlobalRef memory address. + */ + private static native long ncreateGlobalRef(Object obj); + + /** + * Deletes a global reference. + * + * @param ref the GlobalRef memory address. + */ + private static native void deleteGlobalRef(long ref); + + // --------- [ XXX_debug_output ] --------- + + /** + * Associates the current OpenGL context with the specified global reference. If there + * is no context current, the global reference is deleted and an exception is thrown. + * Any previous callback registrations will be cleared. + * + * @param userParam the global reference pointer + */ + private static void registerContextCallback(final long userParam, final Map<ContextCapabilities, Long> contextUserData) { + ContextCapabilities caps = GLContext.getCapabilities(); + if ( caps == null ) { + deleteGlobalRef(userParam); + throw new IllegalStateException("No context is current."); + } + + final Long userParam_old = contextUserData.remove(caps); + if ( userParam_old != null ) + deleteGlobalRef(userParam_old); + + if ( userParam != 0 ) + contextUserData.put(caps, userParam); + } + + /** + * Releases references to any callbacks associated with the specified GL context. + * + * @param context the Context to unregister + */ + static void unregisterCallbacks(final Object context) { + // TODO: This is never called for custom contexts. Need to fix for LWJGL 3.0 + final ContextCapabilities caps = GLContext.getCapabilities(); + + Long userParam = contextUserParamsKHR.remove(caps); + if ( userParam != null ) + deleteGlobalRef(userParam); + } + + // --------- [ KHR_debug ] --------- + + /** + * Returns the memory address of the native function we pass to glDebugMessageCallback. + * + * @return the callback function address + */ + static native long getDebugCallbackKHR(); + + /** + * Associates the current OpenGL context with the specified global reference. If there + * is no context current, the global reference is deleted and an exception is thrown. + * Any previous callback registrations will be cleared. + * + * @param userParam the global reference pointer + */ + static void registerContextCallbackKHR(final long userParam) { + registerContextCallback(userParam, contextUserParamsKHR); + } + +} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opengles/ContextAttribs.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/ContextAttribs.java 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/ContextAttribs.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -39,7 +39,7 @@ /** * This class represents the context attributes passed to EGL's eglCreateContext. - * The only attribute allowed is EGL_CONTEXT_CLIENT_VERSION and it must be 2 (LWJGL does not support GLES 1.x). + * The only attribute allowed is EGL_CONTEXT_CLIENT_VERSION and it must be 2 or 3 (LWJGL does not support GLES 1.x). */ public final class ContextAttribs { @@ -50,7 +50,7 @@ } public ContextAttribs(final int version) { - if ( version != 2 ) + if ( 3 < version ) throw new IllegalArgumentException("Invalid OpenGL ES version specified: " + version); this.version = version; Added: trunk/LWJGL/src/java/org/lwjgl/opengles/FastIntMap.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/FastIntMap.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/FastIntMap.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -0,0 +1,238 @@ +/* + * Copyright 2002-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" + * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package org.lwjgl.opengles; + +import java.util.Iterator; + +/** + * A hash map using primitive ints as keys rather than objects. + * + * @author Justin Couch + * @author Alex Chaffee (al...@ap...) + * @author Stephen Colebourne + * @author Nathan Sweet + */ +final class FastIntMap<V> implements Iterable<FastIntMap.Entry<V>> { + + private Entry[] table; + private int size, mask, capacity, threshold; + + /** Same as: FastIntMap(16, 0.75f); */ + FastIntMap() { + this(16, 0.75f); + } + + /** Same as: FastIntMap(initialCapacity, 0.75f); */ + FastIntMap(int initialCapacity) { + this(initialCapacity, 0.75f); + } + + FastIntMap(int initialCapacity, float loadFactor) { + if ( initialCapacity > 1 << 30 ) throw new IllegalArgumentException("initialCapacity is too large."); + if ( initialCapacity < 0 ) throw new IllegalArgumentException("initialCapacity must be greater than zero."); + if ( loadFactor <= 0 ) throw new IllegalArgumentException("initialCapacity must be greater than zero."); + capacity = 1; + while ( capacity < initialCapacity ) + capacity <<= 1; + this.threshold = (int)(capacity * loadFactor); + this.table = new Entry[capacity]; + this.mask = capacity - 1; + } + + private int index(final int key) { + return index(key, mask); + } + + private static int index(final int key, final int mask) { + return key & mask; + } + + public V put(int key, V value) { + final Entry<V>[] table = this.table; + int index = index(key); + + // Check if key already exists. + for ( Entry<V> e = table[index]; e != null; e = e.next ) { + if ( e.key != key ) continue; + V oldValue = e.value; + e.value = value; + return oldValue; + } + + table[index] = new Entry<V>(key, value, table[index]); + + if ( size++ >= threshold ) + rehash(table); + + return null; + } + + private void rehash(final Entry<V>[] table) { + final int newCapacity = 2 * capacity; + final int newMask = newCapacity - 1; + + final Entry<V>[] newTable = new Entry[newCapacity]; + + for ( int i = 0, index; i < table.length; i++ ) { + Entry<V> e = table[i]; + if ( e == null ) continue; + do { + final Entry<V> next = e.next; + index = index(e.key, newMask); + e.next = newTable[index]; + newTable[index] = e; + e = next; + } while ( e != null ); + } + + this.table = newTable; + capacity = newCapacity; + mask = newMask; + threshold *= 2; + } + + public V get(int key) { + final int index = index(key); + for ( Entry<V> e = table[index]; e != null; e = e.next ) + if ( e.key == key ) return e.value; + return null; + } + + public boolean containsValue(Object value) { + final Entry<V>[] table = this.table; + for ( int i = table.length - 1; i >= 0; i-- ) + for ( Entry<V> e = table[i]; e != null; e = e.next ) + if ( e.value.equals(value) ) return true; + return false; + } + + public boolean containsKey(int key) { + final int index = index(key); + for ( Entry<V> e = table[index]; e != null; e = e.next ) + if ( e.key == key ) return true; + return false; + } + + public V remove(int key) { + final int index = index(key); + + Entry<V> prev = table[index]; + Entry<V> e = prev; + while ( e != null ) { + Entry<V> next = e.next; + if ( e.key == key ) { + size--; + if ( prev == e ) + table[index] = next; + else + prev.next = next; + return e.value; + } + prev = e; + e = next; + } + return null; + } + + public int size() { + return size; + } + + public boolean isEmpty() { + return size == 0; + } + + public void clear() { + final Entry<V>[] table = this.table; + for ( int index = table.length - 1; index >= 0; index-- ) + table[index] = null; + size = 0; + } + + public EntryIterator iterator() { + return new EntryIterator(); + } + + public class EntryIterator implements Iterator<Entry<V>> { + + private int nextIndex; + private Entry<V> current; + + EntryIterator() { + reset(); + } + + public void reset() { + current = null; + // Find first bucket. + final Entry<V>[] table = FastIntMap.this.table; + int i; + for ( i = table.length - 1; i >= 0; i-- ) + if ( table[i] != null ) break; + nextIndex = i; + } + + public boolean hasNext() { + if ( nextIndex >= 0 ) return true; + Entry e = current; + return e != null && e.next != null; + } + + public Entry<V> next() { + // Next entry in current bucket. + Entry<V> e = current; + if ( e != null ) { + e = e.next; + if ( e != null ) { + current = e; + return e; + } + } + // Use the bucket at nextIndex and find the next nextIndex. + final Entry<V>[] table = FastIntMap.this.table; + int i = nextIndex; + e = current = table[i]; + while ( --i >= 0 ) + if ( table[i] != null ) break; + nextIndex = i; + return e; + } + + public void remove() { + FastIntMap.this.remove(current.key); + } + } + + static final class Entry<T> { + + final int key; + T value; + Entry<T> next; + + Entry(int key, T value, Entry<T> next) { + this.key = key; + this.value = value; + this.next = next; + } + + public int getKey() { + return key; + } + + public T getValue() { + return value; + } + + } + +} \ No newline at end of file Modified: trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -86,6 +86,30 @@ throw new OpenGLException("Cannot use offsets when Element Array Buffer Object is disabled"); } + /** Helper method to ensure that pixel pack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ + static void ensurePackPBOdisabled() { + if ( LWJGLUtil.CHECKS && StateTracker.getTracker().pixelPackBuffer != 0 ) + throw new OpenGLException("Cannot use Buffers when Pixel Pack Buffer Object is enabled"); + } + + /** Helper method to ensure that pixel pack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */ + static void ensurePackPBOenabled() { + if ( LWJGLUtil.CHECKS && StateTracker.getTracker().pixelPackBuffer == 0 ) + throw new OpenGLException("Cannot use offsets when Pixel Pack Buffer Object is disabled"); + } + + /** Helper method to ensure that pixel unpack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ + static void ensureUnpackPBOdisabled() { + if ( LWJGLUtil.CHECKS && StateTracker.getTracker().pixelUnpackBuffer != 0 ) + throw new OpenGLException("Cannot use Buffers when Pixel Unpack Buffer Object is enabled"); + } + + /** Helper method to ensure that pixel unpack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */ + static void ensureUnpackPBOenabled() { + if ( LWJGLUtil.CHECKS && StateTracker.getTracker().pixelUnpackBuffer == 0 ) + throw new OpenGLException("Cannot use offsets when Pixel Unpack Buffer Object is disabled"); + } + /** * Calculate the storage required for an image in elements * Modified: trunk/LWJGL/src/java/org/lwjgl/opengles/GLContext.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/GLContext.java 2012-07-14 23:29:21 UTC (rev 3782) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/GLContext.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -180,6 +180,8 @@ } // ----------------------[ 2.X ]---------------------- + if ( 3 <= majorVersion ) + supported_extensions.add("OpenGLES30"); if ( 2 <= majorVersion ) supported_extensions.add("OpenGLES20"); Added: trunk/LWJGL/src/java/org/lwjgl/opengles/GLSync.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/GLSync.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/GLSync.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002-2012 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. + */ +package org.lwjgl.opengles; + +import org.lwjgl.PointerWrapperAbstract; + +/** + * This class is a wrapper around a GLsync pointer. + * + * @author spasi <sp...@us...> + */ +public final class GLSync extends PointerWrapperAbstract { + + GLSync(final long sync) { + super(sync); + } + +} \ No newline at end of file Added: trunk/LWJGL/src/java/org/lwjgl/opengles/KHRDebugCallback.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengles/KHRDebugCallback.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opengles/KHRDebugCallback.java 2012-08-07 15:14:03 UTC (rev 3783) @@ -0,0 +1,205 @@ +/* + * 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. + */ +package org.lwjgl.opengles; + +import org.lwjgl.PointerWrapperAbstract; + +/** + * Instances of this class are needed to use the callback functionality of the KHR_debug extension. + * Users of this class may provide implementations of the {@code Handler} interface to receive notifications. + * The same {@code Handler} instance may be used by different contexts but it is not recommended. + * Handler notifications are synchronized. + * + * @author Spasi + */ +public final class KHRDebugCallback extends PointerWrapperAbstract { + + /** Severity levels. */ + private static final int + GL_DEBUG_SEVERITY_HIGH = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM = 0x9147, + GL_DEBUG_SEVERITY_LOW = 0x9148, + GL_DEBUG_SEVERITY_NOTIFICATION = 0x826B; + + /** Sources. */ + private static final int + GL_DEBUG_SOURCE_API = 0x8246, + GL_DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247, + GL_DEBUG_SOURCE_SHADER_COMPILER = 0x8248, + GL_DEBUG_SOURCE_THIRD_PARTY = 0x8249, + GL_DEBUG_SOURCE_APPLICATION = 0x824A, + GL_DEBUG_SOURCE_OTHER = 0x824B; + + /** Types. */ + private static final int + GL_DEBUG_TYPE_ERROR = 0x824C, + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D, + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E, + GL_DEBUG_TYPE_PORTABILITY = 0x824F, + GL_DEBUG_TYPE_PERFORMANCE = 0x8250, + GL_DEBUG_TYPE_OTHER = 0x8251, + GL_DEBUG_TYPE_MARKER = 0x8268; + + private static final long CALLBACK_POINTER; + + static { + long pointer = 0; + try { + // Call reflectively so that we can compile this class for the Generator. + pointer = (Long)Class.forName("org.lwjgl.opengles.CallbackUtil").getDeclaredMethod("getDebugCallbackKHR").invoke(null); + } catch (Exception e) { + // ignore + } + CALLBACK_POINTER = pointer; + } + + private final Handler handler; + + /** + * Creates an KHRebugCallback with a default callback handler. + * The default handler will simply print the message on System.err. + */ + public KHRDebugCallback() { + this(new Handler() { + public void handleMessage(final int source, final int type, final int id, final int severity, final String message) { + System.err.println("[LWJGL] KHR_debug message"); + System.err.println("\tID: " + id); + + String description; + switch ( source ) { + case GL_DEBUG_SOURCE_API: + description = "API"; + break; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM: + description = "WINDOW SYSTEM"; + break; + case GL_DEBUG_SOURCE_SHADER_COMPILER: + description = "SHADER COMPILER"; + break; + case GL_DEBUG_SOURCE_THIRD_PARTY: + description = "THIRD PARTY"; + break; + case GL_DEBUG_SOURCE_APPLICATION: + description = "APPLICATION"; + break; + case GL_DEBUG_SOURCE_OTHER: + description = "OTHER"; + break; + default: + description = "Unknown (" + Integer.toHexString(source) + ")"; + } + System.err.println("\tSource: " + description); + + switch ( type ) { + case GL_DEBUG_TYPE_ERROR: + description = "ERROR"; + break; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: + description = "DEPRECATED BEHAVIOR"; + break; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: + description = "UNDEFINED BEHAVIOR"; + break; + case GL_DEBUG_TYPE_PORTABILITY: + description = "PORTABILITY"; + break; + case GL_DEBUG_TYPE_PERFORMANCE: + description = "PERFORMANCE"; + break; + case GL_DEBUG_TYPE_OTHER: + description = "OTHER"; + break; + case GL_DEBUG_TYPE_MARKER: + description = "MARKER"; + break; + default: + description = "Unknown (" + Integer.toHexString(source) + ")"; + } + System.err.println("\tType: " + description); + + switch ( severity ) { + case GL_DEBUG_SEVERITY_HIGH: + description = "HIGH"; + break; + case GL_DEBUG_SEVERITY_MEDIUM: + description = "MEDIUM"; + break; + case GL_DEBUG_SEVERITY_LOW: + description = "LOW"; + break; + case GL_DEBUG_SEVERITY_NOTIFICATION: + description = "NOTIFICATION"; + break; + default: + description = "Unknown (" + Integer.toHexString(source) + ")"; + } + System.err.println("\tSeverity: " + description); + + System.err.println("\tMessage: " + message); + } + }); + } + + /** + * Creates an ARBDebugOutputCallback with the specified callback handler. + * The handler's {@code handleMessage} method will be called whenever + * debug output is generated by the GL. + * + * @param handler the callback handler + */ + public KHRDebugCallback(final Handler handler) { + super(CALLBACK_POINTER); + + this.handler = handler;... [truncated message content] |
From: <sp...@us...> - 2012-10-16 14:53:31
|
Revision: 3804 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3804&view=rev Author: spasi Date: 2012-10-16 14:53:19 +0000 (Tue, 16 Oct 2012) Log Message: ----------- Added support for AMD_shader_trinary_minmax, INTEL_map_texture and NV_draw_texture. Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml Added Paths: ----------- trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_shader_trinary_minmax.java trunk/LWJGL/src/templates/org/lwjgl/opengl/INTEL_map_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_draw_texture.java trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_draw_texture.java Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2012-09-30 09:48:01 UTC (rev 3803) +++ trunk/LWJGL/platform_build/build-definitions.xml 2012-10-16 14:53:19 UTC (rev 3804) @@ -21,7 +21,7 @@ <property name="lwjgl.src.templates.cl" location="${lwjgl.src.templates}/org/lwjgl/opencl"/> <property name="openal-template-pattern" value="AL*.java,EFX*.java"/> - <property name="opengl-template-pattern" value="GL*.java,ARB*.java,EXT*.java,KHR*.java,AMD*.java,APPLE*.java,ATI*.java,NV*.java,NVX*.java,HP*.java,IBM*.java,SUN*.java,SGIS*.java,GREMEDY*.java"/> + <property name="opengl-template-pattern" value="GL*.java,ARB*.java,EXT*.java,KHR*.java,AMD*.java,APPLE*.java,ATI*.java,NV*.java,NVX*.java,HP*.java,IBM*.java,SUN*.java,SGIS*.java,GREMEDY*.java,INTEL*.java"/> <property name="opengles-template-pattern" value="GLES*.java,ARB*.java,EXT*.java,KHR*.java,AMD*.java,ANGLE*.java,APPLE*.java,ARM*.java,DMP*.java,IMG*.java,NV*.java,OES*.java,QCOM*.java,VIV*.java"/> <property name="opencl-template-pattern-extensions" value="KHR*.java,EXT*.java,APPLE*.java,AMD*.java,INTEL*.java,NV*.java"/> <property name="opencl-template-pattern" value="CL*.java,${opencl-template-pattern-extensions}"/> Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_shader_trinary_minmax.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_shader_trinary_minmax.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_shader_trinary_minmax.java 2012-10-16 14:53:19 UTC (rev 3804) @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002-2012 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. + */ +package org.lwjgl.opengl; + +public interface AMD_shader_trinary_minmax { +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/INTEL_map_texture.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/INTEL_map_texture.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/INTEL_map_texture.java 2012-10-16 14:53:19 UTC (rev 3804) @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2002-2012 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. + */ +package org.lwjgl.opengl; + +import org.lwjgl.util.generator.*; +import org.lwjgl.util.generator.opengl.*; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; + +public interface INTEL_map_texture { + + /** Accepted by the <pname> parameter of TexParameteri, for target TEXTURE_2D */ + int GL_TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; + + /** + * Accepted by the <params> when <pname> is set to + * <TEXTURE_MEMORY_LAYOUT_INTEL>: + */ + int GL_LAYOUT_DEFAULT_INTEL = 0, + GL_LAYOUT_LINEAR_INTEL = 1, + GL_LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; + + /** + * The length parameter does not exist in the native API. It used by LWJGL to return a ByteBuffer + * with a proper capacity. + */ + @CachedResult(isRange = true) + @GLvoid + @AutoSize("length") + ByteBuffer glMapTexture2DINTEL(@GLuint int texture, int level, @Helper(passToNative = true) @GLsizeiptr long length, @GLbitfield int access, + @Check("1") @OutParameter IntBuffer stride, @Check("1") @OutParameter @GLenum IntBuffer layout); + + void glUnmapTexture2DINTEL(@GLuint int texture, int level); + + void glSyncTextureINTEL(@GLuint int texture); + +} Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_draw_texture.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_draw_texture.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_draw_texture.java 2012-10-16 14:53:19 UTC (rev 3804) @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002-2012 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. + */ +package org.lwjgl.opengl; + +import org.lwjgl.util.generator.opengl.GLfloat; +import org.lwjgl.util.generator.opengl.GLuint; + +public interface NV_draw_texture { + + void glDrawTextureNV(@GLuint int texture, @GLuint int sampler, + @GLfloat float x0, @GLfloat float y0, + @GLfloat float x1, @GLfloat float y1, + @GLfloat float z, + @GLfloat float s0, @GLfloat float t0, + @GLfloat float s1, @GLfloat float t1); + +} \ No newline at end of file Added: trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_draw_texture.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_draw_texture.java (rev 0) +++ trunk/LWJGL/src/templates/org/lwjgl/opengles/NV_draw_texture.java 2012-10-16 14:53:19 UTC (rev 3804) @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002-2012 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. + */ +package org.lwjgl.opengles; + +import org.lwjgl.util.generator.opengl.GLfloat; +import org.lwjgl.util.generator.opengl.GLuint; + +public interface NV_draw_texture { + + void glDrawTextureNV(@GLuint int texture, @GLuint int sampler, + @GLfloat float x0, @GLfloat float y0, + @GLfloat float x1, @GLfloat float y1, + @GLfloat float z, + @GLfloat float s0, @GLfloat float t0, + @GLfloat float s1, @GLfloat float t1); + +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-11-04 19:50:34
|
Revision: 3811 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3811&view=rev Author: matzon Date: 2012-11-04 19:50:22 +0000 (Sun, 04 Nov 2012) Log Message: ----------- Bumping version number Modified Paths: -------------- trunk/LWJGL/platform_build/build-definitions.xml trunk/LWJGL/src/java/org/lwjgl/Sys.java Modified: trunk/LWJGL/platform_build/build-definitions.xml =================================================================== --- trunk/LWJGL/platform_build/build-definitions.xml 2012-11-04 18:39:35 UTC (rev 3810) +++ trunk/LWJGL/platform_build/build-definitions.xml 2012-11-04 19:50:22 UTC (rev 3811) @@ -12,7 +12,7 @@ <property name="lwjgl.docs" location="doc" /> <property name="lwjgl.temp" location="temp" /> <property name="lwjgl.res" location="res" /> - <property name="lwjgl.version" value="2.8.5" /> + <property name="lwjgl.version" value="2.9.0" /> <property name="lwjgl.web" location="www" /> <property name="lwjgl.src.templates.al" location="${lwjgl.src.templates}/org/lwjgl/openal"/> Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2012-11-04 18:39:35 UTC (rev 3810) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2012-11-04 19:50:22 UTC (rev 3811) @@ -54,7 +54,7 @@ private static final String JNI_LIBRARY_NAME = "lwjgl"; /** Current version of library */ - private static final String VERSION = "2.8.5"; + private static final String VERSION = "2.9.0"; private static final String POSTFIX64BIT = "64"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2013-01-29 21:03:01
|
Revision: 3839 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3839&view=rev Author: spasi Date: 2013-01-29 21:02:52 +0000 (Tue, 29 Jan 2013) Log Message: ----------- Sync with recent Git changes. Modified Paths: -------------- trunk/LWJGL/platform_build/windows_ant/build.xml trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java trunk/LWJGL/src/native/common/common_tools.c trunk/LWJGL/src/native/common/common_tools.h trunk/LWJGL/src/native/common/extcl.c trunk/LWJGL/src/native/common/extcl.h trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c trunk/LWJGL/src/native/windows/opengl/context.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c Modified: trunk/LWJGL/platform_build/windows_ant/build.xml =================================================================== --- trunk/LWJGL/platform_build/windows_ant/build.xml 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/platform_build/windows_ant/build.xml 2013-01-29 21:02:52 UTC (rev 3839) @@ -6,8 +6,8 @@ <property name="sdkhome" location="${env.MSSDK}"/> <target name="compile_dir"> - <apply dir="." failonerror="true" executable="cl" dest="." skipemptyfilesets="true"> - <arg line="/Ox /W2 /nologo /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c"/> + <apply dir="." failonerror="true" executable="cl" dest="." skipemptyfilesets="true"parallel="true"> + <arg line="/c /W3 /EHsc /Ox /Gy /MT /MP /nologo"/> <arg value="/I${sdkhome}\include"/> <arg value="/I${java.home}\..\include"/> <arg value="/I${java.home}\..\include\win32"/> Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2013-01-29 21:02:52 UTC (rev 3839) @@ -58,6 +58,7 @@ import java.security.PrivilegedAction; import java.util.Arrays; import java.util.HashSet; +import javax.swing.*; public final class Display { @@ -121,6 +122,12 @@ private static float r, g, b; private static final ComponentListener component_listener = new ComponentAdapter() { + public void componentMoved(ComponentEvent e) { + synchronized ( GlobalLock.lock ) { + parent_resized = true; + } + } + public void componentResized(ComponentEvent e) { synchronized ( GlobalLock.lock ) { parent_resized = true; @@ -298,6 +305,7 @@ throw new LWJGLException("Parent.isDisplayable() must be true"); if ( tmp_parent != null ) { tmp_parent.addComponentListener(component_listener); + SwingUtilities.windowForComponent(parent).addComponentListener(component_listener); } DisplayMode mode = getEffectiveMode(); display_impl.createWindow(drawable, mode, tmp_parent, getWindowX(), getWindowY()); @@ -335,6 +343,7 @@ } if ( parent != null ) { parent.removeComponentListener(component_listener); + SwingUtilities.windowForComponent(parent).removeComponentListener(component_listener); } releaseDrawable(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2013-01-29 21:02:52 UTC (rev 3839) @@ -38,8 +38,9 @@ * @author elias_naur */ +import java.awt.*; +import java.lang.reflect.Method; import java.nio.*; -import java.awt.Canvas; import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; @@ -49,6 +50,8 @@ import org.lwjgl.input.Mouse; import org.lwjgl.opengles.EGL; +import javax.swing.*; + final class WindowsDisplay implements DisplayImplementation { private static final int GAMMA_LENGTH = 256; @@ -150,9 +153,9 @@ private static final int WS_THICKFRAME = 0x00040000; private static final int WS_MAXIMIZEBOX = 0x00010000; - + private static final int HTCLIENT = 0x01; - + private static final int MK_XBUTTON1 = 0x0020; private static final int MK_XBUTTON2 = 0x0040; private static final int XBUTTON1 = 0x0001; @@ -199,6 +202,15 @@ private boolean trackingMouse; private boolean mouseInside; + static { + try { + final Method windowProc = WindowsDisplay.class.getDeclaredMethod("handleMessage", long.class, int.class, long.class, long.class, long.class); + setWindowProc(windowProc); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); + } + } + WindowsDisplay() { current_display = this; } @@ -212,7 +224,7 @@ maximized = false; this.parent = parent; hasParent = parent != null; - long parent_hwnd = parent != null ? getHwnd(parent) : 0; + long parent_hwnd = parent != null ? nGetParent(getHwnd(parent)) : 0; this.hwnd = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(), Display.isFullscreen() || isUndecorated(), parent != null, parent_hwnd); this.resizable=false; if (hwnd == 0) { @@ -233,6 +245,8 @@ ((DrawableGLES)drawable).initialize(hwnd, hdc, EGL.EGL_WINDOW_BIT, (org.lwjgl.opengles.PixelFormat)drawable.getPixelFormat()); } peer_info.initDC(getHwnd(), getHdc()); + if ( parent != null ) + reshape(0, 0, mode.getWidth(), mode.getHeight()); showWindow(getHwnd(), SW_SHOWDEFAULT); updateWidthAndHeight(); @@ -275,6 +289,8 @@ } } + private static native long nGetParent(long hWnd); + public void destroyWindow() { nReleaseDC(hwnd, hdc); nDestroyWindow(hwnd); @@ -496,9 +512,6 @@ public void update() { nUpdate(); - if (parent != null && parent.isFocusOwner()) { - setFocus(getHwnd()); - } if (redoMakeContextCurrent) { redoMakeContextCurrent = false; /** @@ -518,6 +531,15 @@ private static native void nUpdate(); public void reshape(int x, int y, int width, int height) { + if ( parent != null ) { + // Translate canvas location to screen coordinates + Point p = new Point(); + + SwingUtilities.convertPointToScreen(p, parent); + + x += p.getX(); + y += p.getY(); + } nReshape(getHwnd(), x, y, width, height, Display.isFullscreen() || isUndecorated(), parent != null); } private static native void nReshape(long hwnd, int x, int y, int width, int height, boolean undecorated, boolean child); @@ -780,10 +802,6 @@ nReleaseCapture(); } } - - if (parent != null && !isFocused) { - setFocus(getHwnd()); - } } private boolean shouldGrab() { @@ -833,14 +851,16 @@ private static native void clientToScreen(long hwnd, IntBuffer point); - private static int handleMessage(long hwnd, int msg, long wParam, long lParam, long millis) { + private static native void setWindowProc(Method windowProc); + + private static long handleMessage(long hwnd, int msg, long wParam, long lParam, long millis) { if (current_display != null) return current_display.doHandleMessage(hwnd, msg, wParam, lParam, millis); else return defWindowProc(hwnd, msg, wParam, lParam); } - private static native int defWindowProc(long hwnd, int msg, long wParam, long lParam); + private static native long defWindowProc(long hwnd, int msg, long wParam, long lParam); private void checkCursorState() { updateClipping(); @@ -863,7 +883,12 @@ checkCursorState(); } - private int doHandleMessage(long hwnd, int msg, long wParam, long lParam, long millis) { + private long doHandleMessage(long hwnd, int msg, long wParam, long lParam, long millis) { + if ( hwnd != getHwnd() ) { + // Can happen at start-up + return defWindowProc(hwnd, msg, wParam, lParam); + } + switch (msg) { // disable screen saver and monitor power down messages which wreak havoc case WM_ACTIVATE: @@ -876,7 +901,7 @@ appActivate(false); break; } - return 0; + return 0L; case WM_SIZE: switch ((int)wParam) { case SIZE_RESTORED: @@ -908,13 +933,13 @@ } else { // let Windows handle cursors outside the client area for resizing, etc. return defWindowProc(hwnd, msg, wParam, lParam); - } + } case WM_KILLFOCUS: appActivate(false); - return 0; + return 0L; case WM_SETFOCUS: appActivate(true); - return 0; + return 0L; case WM_MOUSEMOVE: int xPos = (int)(short)(lParam & 0xFFFF); int yPos = transformY(getHwnd(), (int)(short)((lParam >> 16) & 0xFFFF)); @@ -924,29 +949,29 @@ if(!trackingMouse) { trackingMouse = nTrackMouseEvent(hwnd); } - return 0; + return 0L; case WM_MOUSEWHEEL: int dwheel = (int)(short)((wParam >> 16) & 0xFFFF); handleMouseScrolled(dwheel, millis); - return 0; + return 0L; case WM_LBUTTONDOWN: handleMouseButton(0, 1, millis); - return 0; + return 0L; case WM_LBUTTONUP: handleMouseButton(0, 0, millis); - return 0; + return 0L; case WM_RBUTTONDOWN: handleMouseButton(1, 1, millis); - return 0; + return 0L; case WM_RBUTTONUP: handleMouseButton(1, 0, millis); - return 0; + return 0L; case WM_MBUTTONDOWN: handleMouseButton(2, 1, millis); - return 0; + return 0L; case WM_MBUTTONUP: handleMouseButton(2, 0, millis); - return 0; + return 0L; case WM_XBUTTONUP: if((wParam >> 16) == XBUTTON1) { handleMouseButton(3, 0, millis); @@ -964,7 +989,7 @@ case WM_SYSCHAR: case WM_CHAR: handleChar(wParam, lParam, millis); - return 0; + return 0L; case WM_SYSKEYUP: /* Fall through */ case WM_KEYUP: @@ -985,17 +1010,17 @@ return defWindowProc(hwnd, msg, wParam, lParam); case WM_QUIT: close_requested = true; - return 0; + return 0L; case WM_SYSCOMMAND: switch ((int)(wParam & 0xfff0)) { case SC_KEYMENU: case SC_MOUSEMENU: case SC_SCREENSAVE: case SC_MONITORPOWER: - return 0; + return 0L; case SC_CLOSE: close_requested = true; - return 0; + return 0L; default: break; } @@ -1015,7 +1040,7 @@ handleMouseButton(captureMouse, 0, millis); captureMouse = -1; } - return 0; + return 0L; case WM_WINDOWPOSCHANGED: if(getWindowRect(hwnd, rect_buffer)) { rect.copyFromBuffer(rect_buffer); @@ -1024,12 +1049,12 @@ } else { LWJGLUtil.log("WM_WINDOWPOSCHANGED: Unable to get window rect"); } - return defWindowProc(hwnd, msg, wParam, lParam); + return defWindowProc(hwnd, msg, wParam, lParam); default: return defWindowProc(hwnd, msg, wParam, lParam); } } - + private native boolean getWindowRect(long hwnd, IntBuffer rectBuffer); public int getX() { @@ -1056,8 +1081,8 @@ public void setResizable(boolean resizable) { if(this.resizable != resizable) { - long style = getWindowLongPtr(hwnd, GWL_STYLE); - long styleex = getWindowLongPtr(hwnd, GWL_EXSTYLE); + int style = (int)getWindowLongPtr(hwnd, GWL_STYLE); + int styleex = (int)getWindowLongPtr(hwnd, GWL_EXSTYLE); // update frame style if(resizable && !Display.isFullscreen()) { @@ -1082,7 +1107,7 @@ this.resizable = resizable; } - private native boolean adjustWindowRectEx(IntBuffer rectBuffer, long style, boolean menu, long styleex); + private native boolean adjustWindowRectEx(IntBuffer rectBuffer, int style, boolean menu, int styleex); public boolean wasResized() { if(resized) { Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java 2013-01-29 21:02:52 UTC (rev 3839) @@ -324,7 +324,7 @@ // Declare loop counters and allocate object array if ( !ptrLoopDeclared ) { - writer.println("\tunsigned int " + n + "_i;"); + writer.println("\tint " + n + "_i;"); writer.println("\tjobject " + n + "_object;"); ptrLoopDeclared = true; } @@ -336,7 +336,7 @@ // Declare loop counters and allocate string array if ( !strLoopDeclared ) { - writer.println("\tunsigned int " + n + "_i;"); + writer.println("\tint " + n + "_i;"); writer.println("\t" + arrayType + n + "_address;"); strLoopDeclared = true; } Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/common/common_tools.c 2013-01-29 21:02:52 UTC (rev 3839) @@ -227,11 +227,11 @@ const char *str = (const char *)ustr; if (str == NULL) return NULL; - return NewStringNativeWithLength(env, str, strlen(str)); + return NewStringNativeWithLength(env, str, (jsize)strlen(str)); } // creates locale specific string -jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length) { +jstring NewStringNativeWithLength(JNIEnv *env, const char *str, jsize length) { jclass jcls_str; jmethodID jmethod_str; jstring result; @@ -330,7 +330,7 @@ } bool getBooleanProperty(JNIEnv *env, const char* propertyName) { - jstring property = NewStringNativeWithLength(env, propertyName, strlen(propertyName)); + jstring property = NewStringNativeWithLength(env, propertyName, (jsize)strlen(propertyName)); jclass org_lwjgl_LWJGLUtil_class; jmethodID getBoolean; if (property == NULL) Modified: trunk/LWJGL/src/native/common/common_tools.h =================================================================== --- trunk/LWJGL/src/native/common/common_tools.h 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/common/common_tools.h 2013-01-29 21:02:52 UTC (rev 3839) @@ -75,18 +75,18 @@ return NULL; } -static inline jobject safeNewBuffer(JNIEnv *env, void *p, int size) { +static inline jobject safeNewBuffer(JNIEnv *env, void *p, jlong capacity) { if (p != NULL) { #ifdef __cplusplus - return env->NewDirectByteBuffer(p, size); + return env->NewDirectByteBuffer(p, capacity); #else - return (*env)->NewDirectByteBuffer(env, p, size); + return (*env)->NewDirectByteBuffer(env, p, capacity); #endif } else return NULL; } -static inline jobject safeNewBufferCached(JNIEnv *env, void *p, int size, jobject old_buffer) { +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); @@ -141,7 +141,7 @@ 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, int length); +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); Modified: trunk/LWJGL/src/native/common/extcl.c =================================================================== --- trunk/LWJGL/src/native/common/extcl.c 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/common/extcl.c 2013-01-29 21:02:52 UTC (rev 3839) @@ -59,7 +59,7 @@ ext_InitializeClass(env, clazz, &extcl_GetProcAddress, num_functions, functions); } -int extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch) { +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 Modified: trunk/LWJGL/src/native/common/extcl.h =================================================================== --- trunk/LWJGL/src/native/common/extcl.h 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/common/extcl.h 2013-01-29 21:02:52 UTC (rev 3839) @@ -70,7 +70,7 @@ void* extcl_GetProcAddress(const char* function); void extcl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions); -int extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch); +size_t extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch); // -----------------[ Platform dependent functions ]----------------- Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2013-01-29 21:02:52 UTC (rev 3839) @@ -83,7 +83,7 @@ */ 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); - int length; + size_t length; int i=1; if (alcString == NULL) { Modified: trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2013-01-29 21:02:52 UTC (rev 3839) @@ -67,7 +67,7 @@ private_info_buffer = NewReadOnlyDirectByteBuffer(env, private_info, cb); (*env)->CallVoidMethod(env, (jobject)user_data, contextCallbackJ, - NewStringNativeWithLength(env, errinfo, strlen(errinfo)), + NewStringNativeWithLength(env, errinfo, (jsize)strlen(errinfo)), private_info_buffer ); } Modified: trunk/LWJGL/src/native/windows/opengl/context.c =================================================================== --- trunk/LWJGL/src/native/windows/opengl/context.c 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/windows/opengl/context.c 2013-01-29 21:02:52 UTC (rev 3839) @@ -118,7 +118,7 @@ windowflags = WS_POPUP; } else if (child_window) { exstyle = 0; - windowflags = WS_CHILDWINDOW; + windowflags = WS_POPUP; } else { exstyle = WS_EX_APPWINDOW; windowflags = WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU; Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2013-01-29 21:02:52 UTC (rev 3839) @@ -53,6 +53,9 @@ #define WINDOWCLASSNAME _T("LWJGL") +static jclass windowsDisplayClass; +static jmethodID javaWindowProc; + /* * WindowProc for the GL window. */ @@ -61,10 +64,12 @@ WPARAM wParam, LPARAM lParam) { + /* jclass display_class; jclass display_class_global; jmethodID handleMessage_method; LONG message_time; + */ JNIEnv *env = getThreadEnv(); if (env != NULL && !(*env)->ExceptionOccurred(env)) { /* @@ -80,6 +85,8 @@ * a window is created, where we are sure that the calling class' classloader has * LWJGL classes in it. */ + + /* display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(hWnd, GWLP_USERDATA); if (display_class_global == NULL) { display_class = (*env)->FindClass(env, "org/lwjgl/opengl/WindowsDisplay"); @@ -91,15 +98,27 @@ } if (display_class_global != NULL) { message_time = GetMessageTime(); - handleMessage_method = (*env)->GetStaticMethodID(env, display_class_global, "handleMessage", "(JIJJJ)I"); + handleMessage_method = (*env)->GetStaticMethodID(env, display_class_global, "handleMessage", "(JIJJJ)J"); if (handleMessage_method != NULL) - return (*env)->CallStaticIntMethod(env, display_class_global, handleMessage_method, (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time); + return (*env)->CallStaticLongMethod(env, display_class_global, handleMessage_method, (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time); + } + */ + + return (*env)->CallStaticLongMethod( + env, windowsDisplayClass, javaWindowProc, + (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)GetMessageTime() + ); } return DefWindowProc(hWnd, msg, wParam, lParam); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_defWindowProc(JNIEnv *env, jclass unused, jlong hWnd, jint msg, jlong wParam, jlong lParam) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setWindowProc(JNIEnv *env, jclass clazz, jobject method) { + windowsDisplayClass = clazz; + javaWindowProc = (*env)->FromReflectedMethod(env, method); +} + +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_defWindowProc(JNIEnv *env, jclass unused, jlong hWnd, jint msg, jlong wParam, jlong lParam) { return DefWindowProc((HWND)(INT_PTR)hWnd, msg, wParam, lParam); } @@ -167,6 +186,10 @@ return (INT_PTR)hwnd; } +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nGetParent(JNIEnv *env, jclass clazz, jlong hwnd_ptr) { + return (INT_PTR)GetParent((HWND)(INT_PTR)hwnd_ptr); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReleaseDC(JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hdc_ptr) { HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; HDC hdc = (HDC)(INT_PTR)hdc_ptr; @@ -309,6 +332,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReshape(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint x, jint y, jint width, jint height, jboolean undecorated, jboolean child) { HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; + /* DWORD exstyle, windowflags; RECT clientSize; @@ -329,11 +353,11 @@ ); SetWindowPos(hwnd, HWND_TOP, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, SWP_NOZORDER); + */ + SetWindowPos(hwnd, HWND_TOP, x, y, width, height, SWP_NOZORDER | SWP_NOACTIVATE); } static HICON createWindowIcon(JNIEnv *env, jint *pixels, jint width, jint height) { - unsigned char col; - unsigned char mask; BITMAPV5HEADER bitmapInfo; HBITMAP cursorMask; HBITMAP colorBitmap; @@ -345,8 +369,6 @@ int imageSize; unsigned char *maskPixels; int widthInBytes; - int leftShift; - int maskPixelsOff; int scanlineWidth; HBITMAP colorDIB; @@ -475,7 +497,7 @@ } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_adjustWindowRectEx - (JNIEnv *env, jclass unused, jobject rect_buffer, jlong style, jboolean menu, jlong styleex) { + (JNIEnv *env, jclass unused, jobject rect_buffer, jint style, jboolean menu, jint styleex) { jboolean result; RECT clientRect; copyBufferToRect(env, rect_buffer, &clientRect); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c 2013-01-25 15:39:08 UTC (rev 3838) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c 2013-01-29 21:02:52 UTC (rev 3839) @@ -93,7 +93,7 @@ return NULL; } result[buf_size - 1] = '\0'; - java_result = NewStringNativeWithLength(env, result, strlen(result)); + java_result = NewStringNativeWithLength(env, result, (jsize)strlen(result)); free(result); return java_result; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |