From: <sp...@us...> - 2011-05-17 16:54:09
|
Revision: 3534 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3534&view=rev Author: spasi Date: 2011-05-17 16:53:57 +0000 (Tue, 17 May 2011) Log Message: ----------- Added support for OpenGL ES. Modified Paths: -------------- branches/opengles/LWJGL/build.xml branches/opengles/LWJGL/platform_build/build-definitions.xml branches/opengles/LWJGL/platform_build/build-generator.xml branches/opengles/LWJGL/platform_build/linux_ant/build.xml branches/opengles/LWJGL/platform_build/windows_ant/build.xml branches/opengles/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/CallbackUtil.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/Display.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/DrawableLWJGL.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplayPeerInfo.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/PixelFormat.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/SharedDrawable.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/FieldsGenerator.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/RegisterStubsGenerator.java branches/opengles/LWJGL/src/java/org/lwjgl/util/vector/Matrix4f.java branches/opengles/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c branches/opengles/LWJGL/src/templates/org/lwjgl/opengl/EXT_texture_lod_bias.java Added Paths: ----------- branches/opengles/LWJGL/libs/linux/x64/ branches/opengles/LWJGL/libs/windows/libEGL.dll branches/opengles/LWJGL/libs/windows/libEGL.lib branches/opengles/LWJGL/libs/windows/libGLESv2.dll branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml branches/opengles/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/ContextGLES.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/DrawableGL.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/DrawableGLES.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/PixelFormatLWJGL.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/ branches/opengles/LWJGL/src/java/org/lwjgl/opengles/APIUtil.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/ContextAttribs.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGL.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLConfig.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLContext.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLDisplay.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLImageOES.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLKHRFenceSync.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLKHRReusableSync.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLNVSync.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLSurface.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLSyncKHR.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/EGLSyncNV.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/GLChecks.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/GLContext.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/PeerInfo.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/PixelFormat.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/PowerManagementEventException.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/StateTracker.java branches/opengles/LWJGL/src/java/org/lwjgl/opengles/Util.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/ branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/FullScreenWindowedTest.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/Gears.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/MappedIndexedVBOTest.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/QuadRenderer.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/ branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObject.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObjectArray.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/BufferObjectElement.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/GLLight.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/GLMatrix.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/GLObject.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/Geometry.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/ImmediateModeBuffer.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/Shader.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/ShaderProgram.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengles/util/Sphere.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/opengl/EGLint64NV.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/opengl/EGLuint64NV.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/opengl/GLESCapabilitiesGenerator.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/opengl/GLESGeneratorProcessorFactory.java branches/opengles/LWJGL/src/java/org/lwjgl/util/generator/opengl/GLESTypeMap.java branches/opengles/LWJGL/src/native/common/EGL/ branches/opengles/LWJGL/src/native/common/EGL/egl.h branches/opengles/LWJGL/src/native/common/EGL/eglext.h branches/opengles/LWJGL/src/native/common/EGL/eglplatform.h branches/opengles/LWJGL/src/native/common/GLES2/ branches/opengles/LWJGL/src/native/common/GLES2/gl2.h branches/opengles/LWJGL/src/native/common/GLES2/gl2ext.h branches/opengles/LWJGL/src/native/common/GLES2/gl2extimg.h branches/opengles/LWJGL/src/native/common/GLES2/gl2platform.h branches/opengles/LWJGL/src/native/common/KHR/ branches/opengles/LWJGL/src/native/common/KHR/khrplatform.h branches/opengles/LWJGL/src/native/common/opengl/ branches/opengles/LWJGL/src/native/common/opengl/extgl.c branches/opengles/LWJGL/src/native/common/opengl/extgl.h branches/opengles/LWJGL/src/native/common/opengl/extgl_types.h branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_CallbackUtil.c branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_GLContext.c branches/opengles/LWJGL/src/native/common/opengles/ branches/opengles/LWJGL/src/native/common/opengles/extgl.c branches/opengles/LWJGL/src/native/common/opengles/extgl.h branches/opengles/LWJGL/src/native/common/opengles/extgl_egl.c branches/opengles/LWJGL/src/native/common/opengles/extgl_egl.h branches/opengles/LWJGL/src/native/common/opengles/extgl_types.h branches/opengles/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGL.c branches/opengles/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRFenceSync.c branches/opengles/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLKHRReusableSync.c branches/opengles/LWJGL/src/native/common/opengles/org_lwjgl_opengles_EGLNVSync.c branches/opengles/LWJGL/src/native/common/opengles/org_lwjgl_opengles_GLContext.c branches/opengles/LWJGL/src/native/linux/opengl/ branches/opengles/LWJGL/src/native/linux/opengl/context.c branches/opengles/LWJGL/src/native/linux/opengl/context.h branches/opengles/LWJGL/src/native/linux/opengl/display.c branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.c branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.h branches/opengles/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c branches/opengles/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c branches/opengles/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxCanvasImplementation.c branches/opengles/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c branches/opengles/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Pbuffer.c branches/opengles/LWJGL/src/native/linux/opengles/ branches/opengles/LWJGL/src/native/linux/opengles/context.c branches/opengles/LWJGL/src/native/linux/opengles/context.h branches/opengles/LWJGL/src/native/linux/opengles/display.c branches/opengles/LWJGL/src/native/linux/opengles/extgl_glx.c branches/opengles/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c branches/opengles/LWJGL/src/native/windows/opengl/ branches/opengles/LWJGL/src/native/windows/opengl/context.c branches/opengles/LWJGL/src/native/windows/opengl/context.h branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.c branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.h branches/opengles/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_Pbuffer.c branches/opengles/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_WindowsContextImplementation.c branches/opengles/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_WindowsPeerInfo.c branches/opengles/LWJGL/src/native/windows/opengles/ branches/opengles/LWJGL/src/native/windows/opengles/context.c branches/opengles/LWJGL/src/native/windows/opengles/context.h branches/opengles/LWJGL/src/native/windows/opengles/extgl_wgl.c branches/opengles/LWJGL/src/native/windows/opengles/org_lwjgl_opengl_WindowsPeerInfo.c branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/ branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/AMD_compressed_3DC_texture.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/AMD_compressed_ATC_texture.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/AMD_performance_monitor.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/AMD_program_binary_Z400.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/ANGLE_framebuffer_blit.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/ANGLE_framebuffer_multisample.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/APPLE_framebuffer_multisample.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/APPLE_rgb_422.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/APPLE_texture_format_BGRA8888.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/APPLE_texture_max_level.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/ARB_draw_buffers.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/ARB_half_float_pixel.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/ARB_texture_rectangle.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/ARM_mali_shader_binary.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/ARM_rgba8.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/DMP_shader_binary.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_Cg_shader.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_bgra.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_blend_minmax.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_discard_framebuffer.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_frag_depth.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_multi_draw_arrays.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_packed_float.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_read_format_bgra.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_shader_texture_lod.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_array.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_dxt1.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_latc.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_compression_s3tc.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_filter_anisotropic.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_format_BGRA8888.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_lod_bias.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/EXT_texture_type_2_10_10_10_REV.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/GLES20.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/IMG_multisamples_render_to_texture.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/IMG_program_binary.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/IMG_shader_binary.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/IMG_texture_compression_pvrtc.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_coverage_sample.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_depth_nonlinear.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_draw_path.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_fbo_color_attachments.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_fence.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_framebuffer_vertex_attrib_array.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_get_tex_image.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_read_buffer.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_shader_framebuffer_fetch.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/NV_system_time.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_image.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_image_external.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_EGL_sync.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_equation_separate.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_func_separate.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_blend_subtract.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_compressed_ETC1_RGB8_texture.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_compressed_paletted_texture.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_depth24.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_depth32.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_depth_texture.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_element_index_uint.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_fbo_render_mipmap.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_framebuffer_object.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_get_program_binary.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_mapbuffer.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_packed_depth_stencil.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_rgb8_rgba8.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_standard_derivatives.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil1.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil4.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_stencil8.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_3D.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_float.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_float_linear.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_half_float.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_half_float_linear.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_texture_npot.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_array_object.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_half_float.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/OES_vertex_type_10_10_10_2.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/QCOM_driver_control.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/QCOM_extended_get.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/QCOM_extended_get2.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/QCOM_performance_monitor_global_mode.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/QCOM_tiled_rendering.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/QCOM_writeonly_rendering.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengles/VIV_shader_binary.java Removed Paths: ------------- branches/opengles/LWJGL/src/java/org/lwjgl/opengl/AbstractDrawable.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/Context.java branches/opengles/LWJGL/src/native/common/extgl.c branches/opengles/LWJGL/src/native/common/extgl.h branches/opengles/LWJGL/src/native/common/extgl_types.h branches/opengles/LWJGL/src/native/common/org_lwjgl_opengl_CallbackUtil.c branches/opengles/LWJGL/src/native/common/org_lwjgl_opengl_GLContext.c branches/opengles/LWJGL/src/native/linux/context.c branches/opengles/LWJGL/src/native/linux/context.h branches/opengles/LWJGL/src/native/linux/display.c branches/opengles/LWJGL/src/native/linux/extgl_glx.c branches/opengles/LWJGL/src/native/linux/extgl_glx.h branches/opengles/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c branches/opengles/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c branches/opengles/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxCanvasImplementation.c branches/opengles/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c branches/opengles/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c branches/opengles/LWJGL/src/native/windows/context.c branches/opengles/LWJGL/src/native/windows/context.h branches/opengles/LWJGL/src/native/windows/extgl_wgl.c branches/opengles/LWJGL/src/native/windows/extgl_wgl.h branches/opengles/LWJGL/src/native/windows/org_lwjgl_opengl_Pbuffer.c branches/opengles/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c branches/opengles/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c Property Changed: ---------------- branches/opengles/LWJGL/ branches/opengles/LWJGL/libs/ branches/opengles/LWJGL/libs/windows/ branches/opengles/LWJGL/src/native/common/ branches/opengles/LWJGL/src/native/linux/ Property changes on: branches/opengles/LWJGL ___________________________________________________________________ Modified: svn:ignore - .classpath *.class *.class~ *.java~ .nbattrs .project dist libs temp + *.class *.class~ *.java~ .classpath .nbattrs .project bin dist libs temp Modified: branches/opengles/LWJGL/build.xml =================================================================== --- branches/opengles/LWJGL/build.xml 2011-05-14 15:14:23 UTC (rev 3533) +++ branches/opengles/LWJGL/build.xml 2011-05-17 16:53:57 UTC (rev 3534) @@ -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" /> @@ -111,6 +112,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 +168,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 +250,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 +296,24 @@ <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"/> + </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 +408,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 +475,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: branches/opengles/LWJGL/libs ___________________________________________________________________ Added: svn:ignore + lwjgl-debug.jar lwjgl.jar lwjgl_test.jar lwjgl_util.jar lwjgl_util_applet.jar Property changes on: branches/opengles/LWJGL/libs/windows ___________________________________________________________________ Added: svn:ignore + lwjgl.dll Added: branches/opengles/LWJGL/libs/windows/libEGL.dll =================================================================== (Binary files differ) Property changes on: branches/opengles/LWJGL/libs/windows/libEGL.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/opengles/LWJGL/libs/windows/libEGL.lib =================================================================== (Binary files differ) Property changes on: branches/opengles/LWJGL/libs/windows/libEGL.lib ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/opengles/LWJGL/libs/windows/libGLESv2.dll =================================================================== (Binary files differ) Property changes on: branches/opengles/LWJGL/libs/windows/libGLESv2.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/opengles/LWJGL/platform_build/build-definitions.xml =================================================================== --- branches/opengles/LWJGL/platform_build/build-definitions.xml 2011-05-14 15:14:23 UTC (rev 3533) +++ branches/opengles/LWJGL/platform_build/build-definitions.xml 2011-05-17 16:53:57 UTC (rev 3534) @@ -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: branches/opengles/LWJGL/platform_build/build-generator.xml =================================================================== --- branches/opengles/LWJGL/platform_build/build-generator.xml 2011-05-14 15:14:23 UTC (rev 3533) +++ branches/opengles/LWJGL/platform_build/build-generator.xml 2011-05-17 16:53:57 UTC (rev 3534) @@ -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: branches/opengles/LWJGL/platform_build/linux_ant/build.xml =================================================================== --- branches/opengles/LWJGL/platform_build/linux_ant/build.xml 2011-05-14 15:14:23 UTC (rev 3533) +++ branches/opengles/LWJGL/platform_build/linux_ant/build.xml 2011-05-17 16:53:57 UTC (rev 3534) @@ -73,12 +73,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_flags32}"/> @@ -99,12 +103,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}"/> Added: branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml =================================================================== --- branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml (rev 0) +++ branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml 2011-05-17 16:53:57 UTC (rev 3534) @@ -0,0 +1,125 @@ +<?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> + <condition property="xf86vm_lib" value="-lXxf86vm" else="-Wl,-static,-lXxf86vm,-call_shared"> + <os name="SunOS" /> + </condition> + <condition property="cflags_pthread" value="-pthreads" else="-pthread"> + <os name="SunOS" /> + </condition> + <condition property="version_script_flags32" value="" else="-Wl,--version-script='${native}/linux/lwjgl.map'"> + <os name="SunOS" /> + </condition> + <condition property="version_script_flags64" value="-m64" else="-Wl,--version-script='${native}/linux/lwjgl.map'"> + <and> + <os name="SunOS" /> + </and> + </condition> + <condition property="cflags64" value="-O2 -m64 -Wall -c -fPIC -std=c99 -Wunused" else="-O2 -Wall -c -fPIC -std=c99 -Wunused"> + <os name="SunOS" /> + </condition> + + <property name="linker_flags32" value="${version_script_flags32} -shared -O2 -Wall -o ${libname32} ${libs32} ${xf86vm_lib}"/> + <property name="linker_flags64" value="${version_script_flags64} -shared -O2 -Wall -o ${libname64} ${libs64} ${xf86vm_lib}"/> + + <condition property="build.32bit.only"> + <not> + <or> + <equals arg1="${hwplatform}" arg2="x86_64"/> + <equals arg1="${hwplatform}" arg2="i86pc"/> + </or> + </not> + </condition> + + <!-- On linux, the 64 bit jre doesn't have the 32 bit libs --> + <condition property="build.64bit.only"> + <and> + <os name="Linux"/> + <equals arg1="${hwplatform}" arg2="x86_64"/> + </and> + </condition> + + <antcall target="compile32"/> + <antcall target="compile64"/> + </target> + + <target name="compile32" unless="build.64bit.only"> + <mkdir dir="x32"/> + <apply dir="x32" executable="gcc" skipemptyfilesets="true" failonerror="true"> + <arg line="${cflags32} ${cflags_pthread}"/> + <arg value="-I${java.home}/include"/> + <arg value="-I${java.home}/include/linux"/> + <arg value="-I${java.home}/../include"/> + <arg value="-I${java.home}/../include/linux"/> + <arg value="-I${java.home}/../include/solaris"/> + <arg value="-I${native}/common"/> + <arg value="-I${native}/common/opengles"/> + <arg value="-I${native}/linux"/> + <arg value="-I${native}/linux/opengles"/> + <mapper type="glob" from="*.c" to="*.o"/> + <fileset dir="${native}/common" includes="*.c"/> + <fileset dir="${native}/common/opengles" includes="*.c"/> + <fileset dir="${native}/generated/opengles" includes="*.c"/> + <fileset dir="${native}/linux" includes="*.c"/> + <fileset dir="${native}/linux/opengles" includes="*.c"/> + </apply> + <apply dir="." parallel="true" executable="gcc" failonerror="true"> + <srcfile/> + <arg line="${linker_flags32}"/> + <fileset dir="x32" includes="*.o"/> + </apply> + <apply dir="." parallel="true" executable="strip" failonerror="true"> + <fileset file="${libname32}"/> + </apply> + </target> + + <target name="compile64" unless="build.32bit.only"> + <mkdir dir="x64"/> + <apply dir="x64" executable="gcc" skipemptyfilesets="true" failonerror="true"> + <arg line="${cflags64} ${cflags_pthread}"/> + <arg value="-I${java.home}/include"/> + <arg value="-I${java.home}/include/linux"/> + <arg value="-I${java.home}/../include"/> + <arg value="-I${java.home}/../include/linux"/> + <arg value="-I${java.home}/../include/solaris"/> + <arg value="-I${native}/common"/> + <arg value="-I${native}/common/opengles"/> + <arg value="-I${native}/linux"/> + <arg value="-I${native}/linux/opengles"/> + <mapper type="glob" from="*.c" to="*.o"/> + <fileset dir="${native}/common" includes="*.c"/> + <fileset dir="${native}/common/opengles" includes="*.c"/> + <fileset dir="${native}/generated/opengles" includes="*.c"/> + <fileset dir="${native}/linux" includes="*.c"/> + <fileset dir="${native}/linux/opengles" includes="*.c"/> + </apply> + <apply dir="." parallel="true" executable="gcc" failonerror="true"> + <srcfile/> + <arg line="${linker_flags64}"/> + <fileset dir="x64" includes="*.o"/> + </apply> + <apply dir="." parallel="true" executable="strip" failonerror="true"> + <fileset file="${libname64}"/> + </apply> + </target> +</project> Modified: branches/opengles/LWJGL/platform_build/windows_ant/build.xml =================================================================== --- branches/opengles/LWJGL/platform_build/windows_ant/build.xml 2011-05-14 15:14:23 UTC (rev 3533) +++ branches/opengles/LWJGL/platform_build/windows_ant/build.xml 2011-05-17 16:53:57 UTC (rev 3534) @@ -12,11 +12,15 @@ <arg value="/I${java.home}\..\include"/> <arg value="/I${java.home}\..\include\win32"/> <arg value="/I${native}\common"/> + <arg value="/I${native}\common\opengl"/> <arg value="/I${native}\windows"/> + <arg value="/I${native}\windows\opengl"/> <srcfile/> + <fileset dir="${native}/common" includes="*.c"/> + <fileset dir="${native}/common/opengl" includes="*.c"/> + <fileset dir="${native}/generated/opengl" includes="*.c"/> <fileset dir="${native}/windows" includes="*.c"/> - <fileset dir="${native}/common" includes="*.c"/> - <fileset dir="${native}/generated" includes="*.c"/> + <fileset dir="${native}/windows/opengl" includes="*.c"/> <mapper type="glob" from="*.c" to="*.obj"/> </apply> </target> @@ -43,7 +47,7 @@ <fileset dir="." includes="*.lib"/> </delete> </target> - + <target name="compile"> <condition property="sdkhomelib" value="${sdkhome}\lib" else="${sdkhome}\lib\x64"> <equals arg1="${os.arch}" arg2="x86"/> Added: branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml =================================================================== --- branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml (rev 0) +++ branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml 2011-05-17 16:53:57 UTC (rev 3534) @@ -0,0 +1,65 @@ +<?xml version="1.0"?> + +<project name="lwjgl native code, native code" basedir="../../bin/lwjgles" default="compile"> + <property name="native" location="../../src/native"/> + <property environment="env"/> + <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"/> + <arg value="/I${sdkhome}\include"/> + <arg value="/I${java.home}\..\include"/> + <arg value="/I${java.home}\..\include\win32"/> + <arg value="/I${native}\common"/> + <arg value="/I${native}\common\opengles"/> + <arg value="/I${native}\windows"/> + <arg value="/I${native}\windows\opengles"/> + <srcfile/> + <fileset dir="${native}/common" includes="*.c"/> + <fileset dir="${native}/common/opengles" includes="*.c"/> + <fileset dir="${native}/generated/opengles" includes="*.c"/> + <fileset dir="${native}/windows" includes="*.c"/> + <fileset dir="${native}/windows/opengles" includes="*.c"/> + <mapper type="glob" from="*.c" to="*.obj"/> + </apply> + </target> + + <target name="link"> + <apply dir="." parallel="true" executable="cl" failonerror="true"> + <arg line="/LD /nologo"/> + <srcfile/> + <arg line="/Fe${dllname} /link"/> + <arg value="/LIBPATH:${java.home}\..\lib"/> + <arg value="/LIBPATH:${sdkhomelib}"/> + <arg value="/LIBPATH:..\..\libs\windows"/> + <arg value="/OPT:REF"/> + <arg value="/OPT:ICF"/> + <arg line="/DLL /DELAYLOAD:jawt.dll ${libs}"/> + <fileset dir="." includes="*.obj"/> + </apply> + </target> + + <target name="clean"> + <delete> + <fileset dir="." includes="*.obj"/> + <fileset dir="." includes="*.dll"/> + <fileset dir="." includes="*.exp"/> + <fileset dir="." includes="*.lib"/> + </delete> + </target> + + <target name="compile"> + <condition property="sdkhomelib" value="${sdkhome}\lib" else="${sdkhome}\lib\x64"> + <equals arg1="${os.arch}" arg2="x86"/> + </condition> + <condition property="dllname" value="lwjgl.dll" else="lwjgl64.dll"> + <equals arg1="${os.arch}" arg2="x86"/> + </condition> + <echo message="${sdkhomelib}"/> + <property name="libs" value="Kernel32.lib ole32.lib libEGL.lib Version.lib user32.lib Gdi32.lib Advapi32.lib jawt.lib delayimp.lib winmm.lib Comctl32.lib"/> + <antcall target="compile_dir"/> + <antcall target="link"/> + </target> +</project> + Modified: branches/opengles/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java =================================================================== --- branches/opengles/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java 2011-05-14 15:14:23 UTC (rev 3533) +++ branches/opengles/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java 2011-05-17 16:53:57 UTC (rev 3534) @@ -42,6 +42,8 @@ import java.awt.event.HierarchyEvent; import java.awt.event.HierarchyListener; +import static org.lwjgl.opengl.GL11.*; + /** * <p/> * An AWT rendering context. @@ -56,7 +58,7 @@ private static final long serialVersionUID = 1L; private static final AWTCanvasImplementation implementation; - private boolean update_context; + private boolean update_context; private Object SYNC_LOCK = new Object(); /** The requested pixel format */ @@ -69,8 +71,8 @@ private final ContextAttribs attribs; /** Context handle */ - private PeerInfo peer_info; - private Context context; + private PeerInfo peer_info; + private ContextGL context; /** * re-entry counter for support for re-entrant @@ -105,20 +107,39 @@ } } + public void setPixelFormat(final PixelFormatLWJGL pf) throws LWJGLException { + throw new UnsupportedOperationException(); + } + + public PixelFormatLWJGL getPixelFormat() { + return pixel_format; + } + /** This method should only be called internally. */ - public Context getContext() { + public ContextGL getContext() { return context; } /** This method should only be called internally. */ - public Context createSharedContext() throws LWJGLException { + public ContextGL createSharedContext() throws LWJGLException { synchronized ( SYNC_LOCK ) { if ( context == null ) throw new IllegalStateException("Canvas not yet displayable"); - return new Context(peer_info, context.getContextAttribs(), context); + return new ContextGL(peer_info, context.getContextAttribs(), context); } } + public void checkGLError() { + Util.checkGLError(); + } + + public void initContext(final float r, final float g, final float b) { + // set background clear color + glClearColor(r, g, b, 0.0f); + // Clear window to avoid the desktop "showing through" + glClear(GL_COLOR_BUFFER_BIT); + } + /** Constructor using the default PixelFormat. */ public AWTGLCanvas() throws LWJGLException { this(new PixelFormat()); @@ -195,7 +216,7 @@ synchronized ( SYNC_LOCK ) { if ( context == null ) throw new IllegalStateException("Canvas not yet displayable"); - Context.setSwapInterval(swap_interval); + ContextGL.setSwapInterval(swap_interval); } } @@ -209,7 +230,7 @@ synchronized ( SYNC_LOCK ) { if ( context == null ) throw new IllegalStateException("Canvas not yet displayable"); - Context.swapBuffers(); + ContextGL.swapBuffers(); } } @@ -238,7 +259,7 @@ if ( context == null ) throw new IllegalStateException("Canvas not yet displayable"); if ( context.isCurrent() ) - Context.releaseCurrentContext(); + context.releaseCurrent(); } } @@ -295,7 +316,7 @@ peer_info.lockAndGetHandle(); try { if ( context == null ) { - this.context = new Context(peer_info, attribs, drawable != null ? ((DrawableLWJGL)drawable).getContext() : null); + this.context = new ContextGL(peer_info, attribs, drawable != null ? (ContextGL)((DrawableLWJGL)drawable).getContext() : null); first_run = true; } @@ -315,7 +336,7 @@ } finally { reentry_count--; if ( reentry_count == 0 ) - Context.releaseCurrentContext(); + context.releaseCurrent(); } ... [truncated message content] |
From: <sp...@us...> - 2011-05-21 10:48:14
|
Revision: 3537 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3537&view=rev Author: spasi Date: 2011-05-21 10:48:05 +0000 (Sat, 21 May 2011) Log Message: ----------- Added support for NV_present_video and NV_video_capture. Re-designed WindowsPeerInfo so that we can more easily use WGL extensions in the future. Modified Paths: -------------- branches/opengles/LWJGL/build.xml branches/opengles/LWJGL/src/native/common/opengl/extgl.h branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.c branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.h branches/opengles/LWJGL/src/native/windows/opengl/context.h branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.c branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.h branches/opengles/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_Pbuffer.c branches/opengles/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_WindowsContextImplementation.c branches/opengles/LWJGL/src/native/windows/opengles/context.h Added Paths: ----------- branches/opengles/LWJGL/src/java/org/lwjgl/opengl/NVPresentVideoUtil.java branches/opengles/LWJGL/src/java/org/lwjgl/opengl/NVVideoCaptureUtil.java branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVPresentVideoUtil.c branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVVideoCaptureUtil.c branches/opengles/LWJGL/src/native/linux/opengl/GLX.c branches/opengles/LWJGL/src/native/linux/opengl/GLX.h branches/opengles/LWJGL/src/native/windows/opengl/WGL.c branches/opengles/LWJGL/src/native/windows/opengl/WGL.h branches/opengles/LWJGL/src/templates/org/lwjgl/opengl/NV_present_video.java branches/opengles/LWJGL/src/templates/org/lwjgl/opengl/NV_video_capture.java Modified: branches/opengles/LWJGL/build.xml =================================================================== --- branches/opengles/LWJGL/build.xml 2011-05-17 17:26:33 UTC (rev 3536) +++ branches/opengles/LWJGL/build.xml 2011-05-21 10:48:05 UTC (rev 3537) @@ -49,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 --> @@ -305,6 +306,8 @@ <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"> Added: branches/opengles/LWJGL/src/java/org/lwjgl/opengl/NVPresentVideoUtil.java =================================================================== --- branches/opengles/LWJGL/src/java/org/lwjgl/opengl/NVPresentVideoUtil.java (rev 0) +++ branches/opengles/LWJGL/src/java/org/lwjgl/opengl/NVPresentVideoUtil.java 2011-05-21 10:48:05 UTC (rev 3537) @@ -0,0 +1,122 @@ +/* + * 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.BufferChecks; +import org.lwjgl.LWJGLUtil; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; + +/** + * This class exposes the platform specific functionality present in the + * NV_present_video extension. + * + * @author Spasi + * @since 20/5/2011 + */ +public final class NVPresentVideoUtil { + + private NVPresentVideoUtil() {} + + private static void checkExtension() { + if ( LWJGLUtil.CHECKS && !GLContext.getCapabilities().GL_NV_present_video ) + throw new IllegalStateException("NV_present_video is not supported"); + } + + private static ByteBuffer getPeerInfo() { + return ContextGL.getCurrentContext().getPeerInfo().getHandle(); + } + + /** + * Enumerate the available video output devices. This method is the cross-platform + * equivalent of glXEnumerateVideoDevicesNV and wglEnumerateVideoDevicesNV. Since they are + * not really compatible, this method works like the WGL version. That is, you first + * call it with a null devices buffer, get the number of devices, then call it again + * with an appropriately sized buffer. + * + * @param devices the buffer to store devices in + * + * @return the number of available video output devices + */ + public static int glEnumerateVideoDevicesNV(LongBuffer devices) { + checkExtension(); + + if ( devices != null ) + BufferChecks.checkBuffer(devices, 1); + return nglEnumerateVideoDevicesNV(getPeerInfo(), devices, devices == null ? 0 : devices.position()); + } + + private static native int nglEnumerateVideoDevicesNV(ByteBuffer peer_info, LongBuffer devices, int devices_position); + + /** + * Binds the video output device specified to one of the context's available video output slots. + * This method is the cross-platform equivalent of glXBindVideoDeviceNV and wglBindVideoDeviceNV. + * To release a video device without binding another device to the same slot, call it with + * video_device set to 0 (will use INVALID_HANDLE_VALUE on WGL). + * + * @param video_slot the video slot + * @param video_device the video device + * @param attrib_list the attributes to use + * + * @return true if the binding was successful + */ + public static boolean glBindVideoDeviceNV(int video_slot, long video_device, IntBuffer attrib_list) { + checkExtension(); + + if ( attrib_list != null ) + BufferChecks.checkNullTerminated(attrib_list); + return nglBindVideoDeviceNV(getPeerInfo(), video_slot, video_device, attrib_list, attrib_list == null ? 0 : attrib_list.position()); + } + + private static native boolean nglBindVideoDeviceNV(ByteBuffer peer_info, int video_slot, long video_device, IntBuffer attrib_list, int attrib_list_position); + + /** + * Queries an attribute associated with the current context. This method is the cross-platform + * equivalent of glXQueryContext and wglQueryCurrentContextNV. + * + * @param attrib the attribute to query + * @param value the buffer to store the value in + */ + public static boolean glQueryContextNV(int attrib, IntBuffer value) { + checkExtension(); + + BufferChecks.checkBuffer(value, 1); + ContextGL ctx = ContextGL.getCurrentContext(); + return nglQueryContextNV(ctx.getPeerInfo().getHandle(), ctx.getHandle(), attrib, value, value.position()); + } + + private static native boolean nglQueryContextNV(ByteBuffer peer_info, ByteBuffer context_handle, int attrib, IntBuffer value, int value_position); + +} Added: branches/opengles/LWJGL/src/java/org/lwjgl/opengl/NVVideoCaptureUtil.java =================================================================== --- branches/opengles/LWJGL/src/java/org/lwjgl/opengl/NVVideoCaptureUtil.java (rev 0) +++ branches/opengles/LWJGL/src/java/org/lwjgl/opengl/NVVideoCaptureUtil.java 2011-05-21 10:48:05 UTC (rev 3537) @@ -0,0 +1,153 @@ +/* + * 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.BufferChecks; +import org.lwjgl.LWJGLUtil; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; + +/** + * This class exposes the platform specific functionality present in the + * NV_video_capture extension. + * + * @author Spasi + * @since 20/5/2011 + */ +public final class NVVideoCaptureUtil { + + private NVVideoCaptureUtil() {} + + private static void checkExtension() { + if ( LWJGLUtil.CHECKS && !GLContext.getCapabilities().GL_NV_video_capture ) + throw new IllegalStateException("NV_video_capture is not supported"); + } + + private static ByteBuffer getPeerInfo() { + return ContextGL.getCurrentContext().getPeerInfo().getHandle(); + } + + /** + * After successfully locking a video capture device, use this method to bind it + * to the capture slot specified in the current context. This method is the cross- + * platform equivalent of glXBindVideoCaptureDeviceNV and wglBindVideoCaptureDeviceNV. + * + * @param video_slot the video slot + * @param device the video capture device + * + * @return true if the binding was successful + */ + public static boolean glBindVideoCaptureDeviceNV(int video_slot, long device) { + checkExtension(); + return nglBindVideoCaptureDeviceNV(getPeerInfo(), video_slot, device); + } + + private static native boolean nglBindVideoCaptureDeviceNV(ByteBuffer peer_info, int video_slot, long device); + + /** + * Enumerate the available video capture devices. This method is the cross-platform + * equivalent of glXEnumerateVideoCaptureDevicesNV and wglEnumerateVideoCaptureDevicesNV. + * Since they are not really compatible, this method works like the WGL version. That is, + * you first call it with a null devices buffer, get the number of devices, then call it + * again with an appropriately sized buffer. + * + * @param devices the buffer to store devices in + * + * @return the number of available video capture devices + */ + public static int glEnumerateVideoCaptureDevicesNV(LongBuffer devices) { + checkExtension(); + + if ( devices != null ) + BufferChecks.checkBuffer(devices, 1); + return nglEnumerateVideoCaptureDevicesNV(getPeerInfo(), devices, devices == null ? 0 : devices.position()); + } + + private static native int nglEnumerateVideoCaptureDevicesNV(ByteBuffer peer_info, LongBuffer devices, int devices_position); + + /** + * To lock a video capture device to a display connection, use this method. + * Before using a video capture device, it must be locked. Once a + * video capture device is locked by a process, no other process can + * lock a video capture device with the same unique ID until the lock + * is released or the process ends. + * + * @param device the device to lock + * + * @return true if the lock was successful + */ + public static boolean glLockVideoCaptureDeviceNV(long device) { + checkExtension(); + return nglLockVideoCaptureDeviceNV(getPeerInfo(), device); + } + + private static native boolean nglLockVideoCaptureDeviceNV(ByteBuffer peer_info, long device); + + /** + * Use this method to query the unique ID of the physical device backing a + * video capture device handle. + * + * @param device the device + * @param attribute the attribute to query + * @param value the buffer to store the value in + * + * @return true if the query was successful + */ + public static boolean glQueryVideoCaptureDeviceNV(long device, int attribute, IntBuffer value) { + checkExtension(); + + BufferChecks.checkBuffer(value, 1); + return nglQueryVideoCaptureDeviceNV(getPeerInfo(), device, attribute, value, value.position()); + } + + private static native boolean nglQueryVideoCaptureDeviceNV(ByteBuffer peer_info, long device, int attribute, IntBuffer value, int value_position); + + /** + * Use this method when finished capturing data on a locked video capture device + * to unlock it. + * + * @param device the device + * + * @return true if the device was unlocked successfully + */ + public static boolean glReleaseVideoCaptureDeviceNV(long device) { + checkExtension(); + return nglReleaseVideoCaptureDeviceNV(getPeerInfo(), device); + } + + private static native boolean nglReleaseVideoCaptureDeviceNV(ByteBuffer peer_info, long device); + +} + Modified: branches/opengles/LWJGL/src/native/common/opengl/extgl.h =================================================================== --- branches/opengles/LWJGL/src/native/common/opengl/extgl.h 2011-05-17 17:26:33 UTC (rev 3536) +++ branches/opengles/LWJGL/src/native/common/opengl/extgl.h 2011-05-21 10:48:05 UTC (rev 3537) @@ -103,4 +103,19 @@ extern bool extgl_QueryExtension(const GLubyte*extensions, const char *name); extern void *extgl_GetProcAddress(const char *name); + +#ifndef __APPLE__ + /* NV_present_video functions (GLX & WGL only) */ + extern jint extgl_EnumerateVideoDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position); + extern jboolean extgl_BindVideoDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position); + extern jboolean extgl_QueryContextNV(JNIEnv *env, jobject peer_info_handle, jobject context_handle, jint attrib, jobject value, jint value_position); + + /* NV_video_capture functions (GLX & WGL only) */ + extern jboolean extgl_BindVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong device); + extern jint extgl_EnumerateVideoCaptureDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position); + extern jboolean extgl_LockVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device); + extern jboolean extgl_QueryVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device, jint attribute, jobject value, jint value_position); + extern jboolean extgl_ReleaseVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device); +#endif + #endif /* __EXTGL_H__ */ Added: branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVPresentVideoUtil.c =================================================================== --- branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVPresentVideoUtil.c (rev 0) +++ branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVPresentVideoUtil.c 2011-05-21 10:48:05 UTC (rev 3537) @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2002-2011 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * JNI implementation of the NVPresentVideoUtil class (GLX & WGL only). + * + * @author Spasi + */ + +#include <jni.h> +#include "common_tools.h" +#include "extgl.h" +#include "org_lwjgl_opengl_NVPresentVideoUtil.h" + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglEnumerateVideoDevicesNV( + JNIEnv *env, jclass clazz, jobject peer_info, jobject devices, jint devices_position +) { + #ifdef __APPLE__ + return 0; + #else + return extgl_EnumerateVideoDevicesNV(env, peer_info, devices, devices_position); + #endif +} + +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglBindVideoDeviceNV( + JNIEnv *env, jclass clazz, jobject peer_info, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position +) { + #ifdef __APPLE__ + return false; + #else + return extgl_BindVideoDeviceNV(env, peer_info, video_slot, video_device, attrib_list, attrib_list_position); + #endif +} + +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPresentVideoUtil_nglQueryContextNV(JNIEnv *env, jclass clazz, jobject peer_info, jobject context_handle, jint attrib, jobject value, jint value_position) { + #ifdef __APPLE__ + return false; + #else + return extgl_QueryContextNV(env, peer_info, context_handle, attrib, value, value_position); + #endif +} Added: branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVVideoCaptureUtil.c =================================================================== --- branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVVideoCaptureUtil.c (rev 0) +++ branches/opengles/LWJGL/src/native/common/opengl/org_lwjgl_opengl_NVVideoCaptureUtil.c 2011-05-21 10:48:05 UTC (rev 3537) @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2002-2011 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * JNI implementation of the NVVideoCaptureUtil class (GLX & WGL only). + * + * @author Spasi + */ + +#include <jni.h> +#include "common_tools.h" +#include "extgl.h" +#include "org_lwjgl_opengl_NVVideoCaptureUtil.h" + +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglBindVideoCaptureDeviceNV(JNIEnv *env, jclass clazz, jobject peer_info, jint video_slot, jlong device) { + #ifdef __APPLE__ + return false; + #else + return extgl_BindVideoCaptureDeviceNV(env, peer_info, video_slot, device); + #endif +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglEnumerateVideoCaptureDevicesNV(JNIEnv *env, jclass clazz, jobject peer_info, jobject devices, jint devices_position) { + #ifdef __APPLE__ + return 0; + #else + return extgl_EnumerateVideoCaptureDevicesNV(env, peer_info, devices, devices_position); + #endif +} + +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglLockVideoCaptureDeviceNV(JNIEnv *env, jclass clazz, jobject peer_info, jlong device) { + #ifdef __APPLE__ + return false; + #else + return extgl_LockVideoCaptureDeviceNV(env, peer_info, device); + #endif +} + +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglQueryVideoCaptureDeviceNV(JNIEnv *env, jclass clazz, jobject peer_info, jlong device, jint attribute, jobject value, jint value_position) { + #ifdef __APPLE__ + return false; + #else + return extgl_QueryVideoCaptureDeviceNV(env, peer_info, device, attribute, value, value_position); + #endif +} + +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVVideoCaptureUtil_nglReleaseVideoCaptureDeviceNV(JNIEnv *env, jclass clazz, jobject peer_info, jlong device) { + #ifdef __APPLE__ + return false; + #else + return extgl_ReleaseVideoCaptureDeviceNV(env, peer_info, device); + #endif +} \ No newline at end of file Added: branches/opengles/LWJGL/src/native/linux/opengl/GLX.c =================================================================== --- branches/opengles/LWJGL/src/native/linux/opengl/GLX.c (rev 0) +++ branches/opengles/LWJGL/src/native/linux/opengl/GLX.c 2011-05-21 10:48:05 UTC (rev 3537) @@ -0,0 +1,121 @@ +/* + * 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. + */ + +/** + * GLX extension implementations. + * + * @author Spasi + */ +#include "GLX.h" + +/* NV_present_video functions */ + +typedef struct { + GLXExtensions extension_flags; + GLXContext context; +} X11Context; + +jint extgl_EnumerateVideoDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); + jlong *devices_address = ((jlong *)safeGetBufferAddress(env, devices)) + devices_position; + unsigned int *result; + int i, elements; + + result = lwjgl_glXEnumerateVideoDevicesNV(peer_info->display, peer_info->screen, &elements); + if ( devices_address != NULL ) { + for ( i = 0; i < elements; i++ ) + devices_address[i] = (jlong)result[i]; + } + XFree(result); + + return elements; +} + +jboolean extgl_BindVideoDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); + const int *attrib_list_address = ((const int *)safeGetBufferAddress(env, attrib_list)) + attrib_list_position; + + return lwjgl_glXBindVideoDeviceNV(peer_info->display, video_slot, (unsigned int)video_device, attrib_list_address); +} + +jboolean extgl_QueryContextNV(JNIEnv *env, jobject peer_info_handle, jobject context_handle, jint attrib, jobject value, jint value_position) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); + X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle); + int *value_address = ((int *)(*env)->GetDirectBufferAddress(env, value)) + value_position; + + return lwjgl_glXQueryContext(peer_info->display, context_info->context, attrib, value_address) == GLX_BAD_ATTRIBUTE ? 0 : 1; +} + +/* NV_video_capture functions */ + +jboolean extgl_BindVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong device) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); + + return lwjgl_glXBindVideoCaptureDeviceNV(peer_info->display, video_slot, (GLXVideoCaptureDeviceNV)device); +} + +jint extgl_EnumerateVideoCaptureDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); + jlong *devices_address = ((jlong *)safeGetBufferAddress(env, devices)) + devices_position; + GLXVideoCaptureDeviceNV *result; + int i, elements; + + result = lwjgl_glXEnumerateVideoCaptureDevicesNV(peer_info->display, peer_info->screen, &elements); + if ( devices_address != NULL ) { + for ( i = 0; i < elements; i++ ) + devices_address[i] = (jlong)result[i]; + } + XFree(devices); + + return elements; +} + +jboolean extgl_LockVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); + + lwjgl_glXLockVideoCaptureDeviceNV(peer_info->display, (GLXVideoCaptureDeviceNV)device); + return true; +} + +jboolean extgl_QueryVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device, jint attribute, jobject value, jint value_position) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); + int *value_address = ((int *)(*env)->GetDirectBufferAddress(env, value)) + value_position; + + return lwjgl_glXQueryVideoCaptureDeviceNV(peer_info->display, (GLXVideoCaptureDeviceNV)device, attribute, value_address); +} + +jboolean extgl_ReleaseVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device) { + X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); + + lwjgl_glXReleaseVideoCaptureDeviceNV(peer_info->display, (GLXVideoCaptureDeviceNV)device); + return true; +} Added: branches/opengles/LWJGL/src/native/linux/opengl/GLX.h =================================================================== --- branches/opengles/LWJGL/src/native/linux/opengl/GLX.h (rev 0) +++ branches/opengles/LWJGL/src/native/linux/opengl/GLX.h 2011-05-21 10:48:05 UTC (rev 3537) @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2002-2011 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * GLX extension implementations. + * + * @author Spasi + */ +#ifndef __LWJGL_GLX_H +#define __LWJGL_GLX_H + +#include <jni.h> +#include "common_tools.h" +#include "context.h" + +#include "extgl.h" +#include "extgl_glx.h" + +/* NV_present_video functions */ +extern jint extgl_EnumerateVideoDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position); +extern jboolean extgl_BindVideoDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position); +extern jboolean extgl_QueryContextNV(JNIEnv *env, jobject peer_info_handle, jobject context_handle, jint attrib, jobject value, jint value_position); + +/* NV_video_capture functions */ +extern jboolean extgl_BindVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong device); +extern jint extgl_EnumerateVideoCaptureDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position); +extern jboolean extgl_LockVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device); +extern jboolean extgl_QueryVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device, jint attribute, jobject value, jint value_position); +extern jboolean extgl_ReleaseVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device); + +#endif Modified: branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.c =================================================================== --- branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.c 2011-05-17 17:26:33 UTC (rev 3536) +++ branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.c 2011-05-21 10:48:05 UTC (rev 3537) @@ -77,6 +77,17 @@ /* GLX_ARB_create_context */ glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB = NULL; +/* GLX_NV_present_video */ +glXEnumerateVideoDevicesNVPROC lwjgl_glXEnumerateVideoDevicesNV = NULL; +glXBindVideoDeviceNVPROC lwjgl_glXBindVideoDeviceNV = NULL; + +/* GLX_NV_video_capture */ +glXBindVideoCaptureDeviceNVPROC lwjgl_glXBindVideoCaptureDeviceNV = NULL; +glXEnumerateVideoCaptureDevicesNVPROC lwjgl_glXEnumerateVideoCaptureDevicesNV = NULL; +glXLockVideoCaptureDeviceNVPROC lwjgl_glXLockVideoCaptureDeviceNV = NULL; +glXQueryVideoCaptureDeviceNVPROC lwjgl_glXQueryVideoCaptureDeviceNV = NULL; +glXReleaseVideoCaptureDeviceNVPROC lwjgl_glXReleaseVideoCaptureDeviceNV = NULL; + static void * lib_gl_handle = NULL; typedef void * (APIENTRY * glXGetProcAddressARBPROC) (const GLubyte *procName); @@ -151,6 +162,27 @@ symbols_flags.GLX_ARB_create_context = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } +static void extgl_InitGLXNVPresentVideo() { + ExtFunction functions[] = { + { "glXEnumerateVideoDevicesNV", (void*)&lwjgl_glXEnumerateVideoDevicesNV }, + { "glXBindVideoDeviceNV", (void*)&lwjgl_glXBindVideoDeviceNV } + }; + + symbols_flags.GLX_NV_present_video = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); +} + +static void extgl_InitGLXNVVideoCapture() { + ExtFunction functions[] = { + { "glXBindVideoCaptureDeviceNV", (void*)&lwjgl_glXBindVideoCaptureDeviceNV }, + { "glXEnumerateVideoCaptureDevicesNV", (void*)&lwjgl_glXEnumerateVideoCaptureDevicesNV }, + { "glXLockVideoCaptureDeviceNV", (void*)&lwjgl_glXLockVideoCaptureDeviceNV }, + { "glXQueryVideoCaptureDeviceNV", (void*)&lwjgl_glXQueryVideoCaptureDeviceNV }, + { "glXReleaseVideoCaptureDeviceNV", (void*)&lwjgl_glXReleaseVideoCaptureDeviceNV } + }; + + symbols_flags.GLX_NV_video_capture = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); +} + static void extgl_InitGLXSupportedExtensions(Display *disp, int screen, GLXExtensions *extension_flags) { /* extension_flags.GLX_EXT_visual_info = GLXQueryExtension(disp, screen, "GLX_EXT_visual_info"); extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(disp, screen, "GLX_EXT_visual_rating");*/ @@ -161,6 +193,8 @@ extension_flags->GLX_ARB_framebuffer_sRGB = GLXQueryExtension(disp, screen, "GLX_ARB_framebuffer_sRGB") || GLXQueryExtension(disp, screen, "GLX_EXT_framebuffer_sRGB"); extension_flags->GLX_ARB_create_context = GLXQueryExtension(disp, screen, "GLX_ARB_create_context"); extension_flags->GLX_NV_multisample_coverage = GLXQueryExtension(disp, screen, "GLX_NV_multisample_coverage"); + extension_flags->GLX_NV_present_video = GLXQueryExtension(disp, screen, "GLX_NV_present_video"); + extension_flags->GLX_NV_video_capture = GLXQueryExtension(disp, screen, "GLX_NV_video_capture"); } bool extgl_Open(JNIEnv *env) { @@ -193,6 +227,8 @@ extgl_InitGLX13(); extgl_InitGLXSGISwapControl(); extgl_InitGLXARBCreateContext(); + extgl_InitGLXNVPresentVideo(); + extgl_InitGLXNVVideoCapture(); return true; } Modified: branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.h =================================================================== --- branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.h 2011-05-17 17:26:33 UTC (rev 3536) +++ branches/opengles/LWJGL/src/native/linux/opengl/extgl_glx.h 2011-05-21 10:48:05 UTC (rev 3537) @@ -272,10 +272,17 @@ #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 /* GLX_NV_multisample_coverage */ -#define GLX_COVERAGE_SAMPLES_NV 100001 -#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 +#define GLX_COLOR_SAMPLES_NV 0x20B3 +/* GLX_NV_present_video */ +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 +/* GLX_NV_video_capture */ +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF +#define GLX_UNIQUE_ID_NV 0x20CE + typedef XID GLXContextID; typedef XID GLXPixmap; typedef XID GLXDrawable; @@ -339,6 +346,18 @@ /* GLX_ARB_create_context */ typedef GLXContext (APIENTRY * glXCreateContextAttribsARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); +/* GLX_NV_present_video */ +typedef unsigned int * (APIENTRY * glXEnumerateVideoDevicesNVPROC) (Display *dpy, int screen, int *nelements); +typedef int (APIENTRY * glXBindVideoDeviceNVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); + +/* GLX_NV_video_capture */ +typedef XID GLXVideoCaptureDeviceNV; +typedef int (APIENTRY * glXBindVideoCaptureDeviceNVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * (APIENTRY * glXEnumerateVideoCaptureDevicesNVPROC) (Display *dpy, int screen, int *nelements); +typedef void (APIENTRY * glXLockVideoCaptureDeviceNVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device); +typedef int (APIENTRY * glXQueryVideoCaptureDeviceNVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void (APIENTRY * glXReleaseVideoCaptureDeviceNVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device); + typedef struct { bool GLX12; bool GLX13; @@ -352,6 +371,8 @@ bool GLX_ARB_framebuffer_sRGB; bool GLX_ARB_create_context; bool GLX_NV_multisample_coverage; + bool GLX_NV_present_video; + bool GLX_NV_video_capture; } GLXExtensions; /* Add _ to global symbols to avoid symbol clash with the OpenGL library */ @@ -399,6 +420,17 @@ extern glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB; +/* GLX_NV_present_video */ +extern glXEnumerateVideoDevicesNVPROC lwjgl_glXEnumerateVideoDevicesNV; +extern glXBindVideoDeviceNVPROC lwjgl_glXBindVideoDeviceNV; + +/* GLX_NV_video_capture */ +extern glXBindVideoCaptureDeviceNVPROC lwjgl_glXBindVideoCaptureDeviceNV; +extern glXEnumerateVideoCaptureDevicesNVPROC lwjgl_glXEnumerateVideoCaptureDevicesNV; +extern glXLockVideoCaptureDeviceNVPROC lwjgl_glXLockVideoCaptureDeviceNV; +extern glXQueryVideoCaptureDeviceNVPROC lwjgl_glXQueryVideoCaptureDeviceNV; +extern glXReleaseVideoCaptureDeviceNVPROC lwjgl_glXReleaseVideoCaptureDeviceNV; + extern bool extgl_InitGLX(Display *disp, int screen, GLXExtensions *extension_flags); #endif Added: branches/opengles/LWJGL/src/native/windows/opengl/WGL.c =================================================================== --- branches/opengles/LWJGL/src/native/windows/opengl/WGL.c (rev 0) +++ branches/opengles/LWJGL/src/native/windows/opengl/WGL.c 2011-05-21 10:48:05 UTC (rev 3537) @@ -0,0 +1,95 @@ +/* + * 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. + */ + +/** + * WGL extension implementations. + * + * @author Spasi + */ +#include "WGL.h" + +/* NV_present_video functions */ + +jint extgl_EnumerateVideoDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + HVIDEOOUTPUTDEVICENV *devices_address = ((HVIDEOOUTPUTDEVICENV *)safeGetBufferAddress(env, devices)) + devices_position; + + return peer_info->extensions.wglEnumerateVideoDevicesNV(peer_info->drawable_hdc, devices_address); +} + +jboolean extgl_BindVideoDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + const int *attrib_list_address = ((const int *)safeGetBufferAddress(env, attrib_list)) + attrib_list_position; + + return peer_info->extensions.wglBindVideoDeviceNV(peer_info->drawable_hdc, video_slot, video_device == 0 ? INVALID_HANDLE_VALUE : (HVIDEOOUTPUTDEVICENV)(intptr_t)video_device, attrib_list_address); +} + +jboolean extgl_QueryContextNV(JNIEnv *env, jobject peer_info_handle, jobject context_handle, jint attrib, jobject value, jint value_position) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + int *value_address = ((int *)(*env)->GetDirectBufferAddress(env, value)) + value_position; + + return peer_info->extensions.wglQueryCurrentContextNV(attrib, value_address); +} + +/* NV_video_capture functions */ + +jboolean extgl_BindVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong device) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + + return peer_info->extensions.wglBindVideoCaptureDeviceNV(video_slot, (HVIDEOINPUTDEVICENV)(intptr_t)device); +} + +jint extgl_EnumerateVideoCaptureDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + HVIDEOINPUTDEVICENV *devices_address = ((HVIDEOINPUTDEVICENV *)safeGetBufferAddress(env, devices)) + devices_position; + + return peer_info->extensions.wglEnumerateVideoCaptureDevicesNV(peer_info->drawable_hdc, devices_address); +} + +jboolean extgl_LockVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + + return peer_info->extensions.wglLockVideoCaptureDeviceNV(peer_info->drawable_hdc, (HVIDEOINPUTDEVICENV)(intptr_t)device); +} + +jboolean extgl_QueryVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device, jint attribute, jobject value, jint value_position) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + int *value_address = ((int *)(*env)->GetDirectBufferAddress(env, value)) + value_position; + + return peer_info->extensions.wglQueryVideoCaptureDeviceNV(peer_info->drawable_hdc, (HVIDEOINPUTDEVICENV)(intptr_t)device, attribute, value_address); +} + +jboolean extgl_ReleaseVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + + return peer_info->extensions.wglReleaseVideoCaptureDeviceNV(peer_info->drawable_hdc, (HVIDEOINPUTDEVICENV)(intptr_t)device); +} \ No newline at end of file Added: branches/opengles/LWJGL/src/native/windows/opengl/WGL.h =================================================================== --- branches/opengles/LWJGL/src/native/windows/opengl/WGL.h (rev 0) +++ branches/opengles/LWJGL/src/native/windows/opengl/WGL.h 2011-05-21 10:48:05 UTC (rev 3537) @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2002-2011 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * WGL extension implementations. + * + * @author Spasi + */ +#ifndef __LWJGL_WGL_H +#define __LWJGL_WGL_H + +#include <jni.h> +#include "common_tools.h" +#include "context.h" + +#include "extgl.h" +#include "extgl_wgl.h" + +/* NV_present_video functions */ +extern jint extgl_EnumerateVideoDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position); +extern jboolean extgl_BindVideoDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong video_device, jobject attrib_list, jint attrib_list_position); +extern jboolean extgl_QueryContextNV(JNIEnv *env, jobject peer_info_handle, jobject context_handle, jint attrib, jobject value, jint value_position); + +/* NV_video_capture functions */ +extern jboolean extgl_BindVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jint video_slot, jlong device); +extern jint extgl_EnumerateVideoCaptureDevicesNV(JNIEnv *env, jobject peer_info_handle, jobject devices, jint devices_position); +extern jboolean extgl_LockVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device); +extern jboolean extgl_QueryVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device, jint attribute, jobject value, jint value_position); +extern jboolean extgl_ReleaseVideoCaptureDeviceNV(JNIEnv *env, jobject peer_info_handle, jlong device); + +#endif \ No newline at end of file Modified: branches/opengles/LWJGL/src/native/windows/opengl/context.h =================================================================== --- branches/opengles/LWJGL/src/native/windows/opengl/context.h 2011-05-17 17:26:33 UTC (rev 3536) +++ branches/opengles/LWJGL/src/native/windows/opengl/context.h 2011-05-21 10:48:05 UTC (rev 3537) @@ -1,31 +1,31 @@ -/* +/* * 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 + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * 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 + * * 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 + * 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 + * 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. */ @@ -49,14 +49,10 @@ typedef struct { union { HWND hwnd; - struct { - HPBUFFERARB pbuffer; - // Contains the function pointers that - // created the pbuffer - WGLExtensions extensions; - } pbuffer; + HPBUFFERARB pbuffer; } u; HDC drawable_hdc; + WGLExtensions extensions; } WindowsPeerInfo; /* @@ -86,7 +82,7 @@ * Create a window with the specified position, size, and * fullscreen attribute. The window will have DirectInput associated * with it. - * + * * Returns true for success, or false for failure */ extern HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool undecorated, bool child_window, HWND parent); Modified: branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.c =================================================================== --- branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.c 2011-05-17 17:26:33 UTC (rev 3536) +++ branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.c 2011-05-21 10:48:05 UTC (rev 3537) @@ -84,6 +84,8 @@ return extgl_QueryExtension(extension_string, name); } +/*---------------------------------------------------------------------*/ + static void extgl_InitWGLARBPbuffer(WGLExtensions *extensions) { ExtFunction functions[] = { {"wglCreatePbufferARB", (void *)&extensions->wglCreatePbufferARB}, @@ -137,6 +139,32 @@ extensions->WGL_ARB_create_context = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } +static void extgl_InitWGLNVPresentVideo(WGLExtensions *extensions) { + ExtFunction functions[] = { + {"wglEnumerateVideoDevicesNV", (void *)&extensions->wglEnumerateVideoDevicesNV}, + {"wglBindVideoDeviceNV", (void *)&extensions->wglBindVideoDeviceNV}, + {"wglQueryCurrentContextNV", (void *)&extensions->wglQueryCurrentContextNV} + }; + + if (extensions->WGL_NV_present_video) + extensions->WGL_NV_present_video = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); +} + +static void extgl_InitWGLNVVideoCapture(WGLExtensions *extensions) { + ExtFunction functions[] = { + {"wglBindVideoCaptureDeviceNV", (void *)&extensions->wglBindVideoCaptureDeviceNV}, + {"wglEnumerateVideoCaptureDevicesNV", (void *)&extensions->wglEnumerateVideoCaptureDevicesNV}, + {"wglLockVideoCaptureDeviceNV", (void *)&extensions->wglLockVideoCaptureDeviceNV}, + {"wglQueryVideoCaptureDeviceNV", (void *)&extensions->wglQueryVideoCaptureDeviceNV}, + {"wglReleaseVideoCaptureDeviceNV", (void *)&extensions->wglReleaseVideoCaptureDeviceNV} + }; + + if (extensions->WGL_NV_video_capture) + extensions->WGL_NV_video_capture = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); +} + +/*---------------------------------------------------------------------*/ + static void extgl_InitSupportedWGLExtensions(WGLExtensions *extensions) { extensions->WGL_ARB_buffer_region = WGLQueryExtension(extensions, "WGL_ARB_buffer_region"); extensions->WGL_ARB_make_current_read = WGLQueryExtension(extensions, "WGL_ARB_make_current_read"); @@ -153,6 +181,8 @@ extensions->WGL_EXT_pixel_format_packed_float = WGLQueryExtension(extensions, "WGL_EXT_pixel_format_packed_float"); extensions->WGL_ARB_create_context = WGLQueryExtension(extensions, "WGL_ARB_create_context"); extensions->WGL_NV_multisample_coverage = WGLQueryExtension(extensions, "WGL_NV_multisample_coverage"); + extensions->WGL_NV_present_video = WGLQueryExtension(extensions, "WGL_NV_present_video"); + extensions->WGL_NV_video_capture = WGLQueryExtension(extensions, "WGL_NV_video_capture"); } static void extgl_InitWGLEXTExtensionsString(WGLExtensions *extensions) { @@ -181,4 +211,6 @@ extgl_InitWGLARBPixelFormat(extensions); extgl_InitWGLARBPbuffer(extensions); extgl_InitWGLARBCreateContext(extensions); + extgl_InitWGLNVPresentVideo(extensions); + extgl_InitWGLNVVideoCapture(extensions); } Modified: branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.h =================================================================== --- branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.h 2011-05-17 17:26:33 UTC (rev 3536) +++ branches/opengles/LWJGL/src/native/windows/opengl/extgl_wgl.h 2011-05-21 10:48:05 UTC (rev 3537) @@ -207,6 +207,32 @@ #define WGL_COVERAGE_SAMPLES_NV 0x2042 #define WGL_COLOR_SAMPLES_NV 0x20B9 +/*--------------------------------------------------------------*/ +/*------------ WGL_NV_present_video ----------------------------*/ +/*--------------------------------------------------------------*/ + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef int (APIENTRY * wglEnumerateVideoDevicesNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList); +typedef BOOL (APIENTRY * wglBindVideoDeviceNVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +typedef BOOL (APIENTRY * wglQueryCurrentContextNVPROC) (int iAttribute, int *piValue); + +/*--------------------------------------------------------------*/ +/*------------ WGL_NV_video_capture ----------------------------*/ +/*--------------------------------------------------------------*/ + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef BOOL (APIENTRY * wglBindVideoCaptureDeviceNVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (APIENTRY * wglEnumerateVideoCaptureDevicesNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +typedef BOOL (APIENTRY * wglLockVideoCaptureDeviceNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (APIENTRY * wglQueryVideoCaptureDeviceNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +typedef BOOL (APIENTRY * wglReleaseVideoCaptureDeviceNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + /*---------------------------------------------------------------------*/ typedef struct { @@ -227,6 +253,8 @@ bool WGL_EXT_pixel_format_packed_float; bool WGL_ARB_create_context; bool WGL_NV_multisample_coverage; + bool WGL_NV_present_video; + bool WGL_NV_video_capture; wglGetExtensionsStringEXTPROC wglGetExtensionsStringEXT; @@ -253,6 +281,16 @@ wglGetCurrentReadDCARBPROC wglGetCurrentReadDCARB; wglCreateContextAttribsARBPROC wglCreateContextAttribsARB; + + wglEnumerateVideoDevicesNVPROC wglEnumerateVideoDevicesNV; + wglBindVideoDeviceNVPROC wglBindVideoDeviceNV; + wglQueryCurrentContextNVPROC wglQueryCurrentContextNV; + + wglBindVideoCaptureDeviceNVPROC wglBindVideoCaptureDeviceNV; + wglEnumerateVideoCaptureDevicesNVPROC wglEnumerateVideoCaptureDevicesNV; + wglLockVideoCaptureDeviceNVPROC wglLockVideoCaptureDeviceNV; + wglQueryVideoCaptureDeviceNVPROC wglQueryVideoCaptureDeviceNV; + wglReleaseVideoCaptureDeviceNVPROC wglReleaseVideoCaptureDeviceNV; } WGLExtensions; extern void extgl_InitWGL(WGLExtensions *extensions); Modified: branches/opengles/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_Pbuffer.c =================================================================== --- branches/opengles/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_Pbuffer.c 2011-05-17 17:26:33 UTC (rev 3536) +++ branches/opengles/LWJGL/src/native/windows/opengl/org_lwjgl_opengl_Pbuffer.c 2011-05-21 10:48:05 UTC (rev 3537) @@ -167,23 +167,23 @@ throwException(env, "Could not get Pbuffer DC"); return; } - peer_info->u.pbuffer.extensions = extensions; - peer_info->u.pbuffer.pbuffer = Pbuffer; + peer_info->extensions = extensions; + peer_info->u.pbuffer = Pbuffer; peer_info->drawable_hdc = Pbuffer_dc; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nDestroy (JNIEnv *env, jclass clazz, jobject peer_info_handle) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - peer_info->u.pbuffer.extensions.wglReleasePbufferDCARB(peer_info->u.pbuffer.pbuffer, peer_info->drawable_hdc); - peer_info->u.pbuffer.extensions.wglDestroyPbufferARB(peer_info->u.pbuffer.pbuffer); + peer_info->extensions.wglReleasePbufferDCARB(peer_info->u.pbuffer, peer_info->drawable_hdc); + peer_info->extensions.wglDestroyPbufferARB(peer_info->u.pbuffer); } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nIsBufferLost (JNIEnv *env, jclass clazz, jobject peer_info_handle) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); BOOL buffer_lost; - peer_info->u.pbuffer.extensions.wglQueryPbufferARB(peer_info->u.pbuffer.pbuffer, WGL_PBUFFER_LOST_ARB, &buffer_lost); + peer_info->extensions.wglQueryPbufferARB(peer_info->u.pbuffer, WGL_PBUFFER_LOST_ARB, &buffer_lost); return buffer_lost ? JNI_TRUE : JNI_FALSE; } @@ -196,17 +196,17 @@ attribs[1] = value; attribs[2] = 0; - peer_info->u.pbuffer.extensions.wglSetPbufferAttribARB(peer_info->u.pbuffer.pbuffer, attribs); + peer_info->extensions.wglSetPbufferAttribARB(peer_info->u.pbuffer, attribs); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nBindTexImageToPbuffer (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint buffer) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - peer_info->u.pbuffer.extensions.wglBindTexImageARB(peer_info->u.pbuffer.pbuffer, buffer); + peer_info->extensions.wglBindTexImageARB(peer_info->u.pbuffer, buffer); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPbufferPeerInfo_nReleaseTexImageFromPbuffer (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint buffer) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - peer_info->u.pbuffer.extensions.w... [truncated message content] |
From: <sp...@us...> - 2011-06-04 00:53:11
|
Revision: 3540 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3540&view=rev Author: spasi Date: 2011-06-04 00:53:04 +0000 (Sat, 04 Jun 2011) Log Message: ----------- Added OpenAL & OpenCL generated native paths. Added support for AMD_device_memory_flags, AMD_offline_devices, AMD_popcnt [OpenCL] Minor bugs fixed in high-level OpenCL API. Modified Paths: -------------- branches/opengles/LWJGL/platform_build/linux_ant/build.xml branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml branches/opengles/LWJGL/platform_build/macosx_ant/build.xml branches/opengles/LWJGL/platform_build/mingw_ant/build.xml branches/opengles/LWJGL/platform_build/windows_ant/build.xml branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml branches/opengles/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java branches/opengles/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java branches/opengles/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java Added Paths: ----------- branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java Modified: branches/opengles/LWJGL/platform_build/linux_ant/build.xml =================================================================== --- branches/opengles/LWJGL/platform_build/linux_ant/build.xml 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/platform_build/linux_ant/build.xml 2011-06-04 00:53:04 UTC (rev 3540) @@ -79,6 +79,8 @@ <mapper type="glob" from="*.c" to="*.o"/> <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"/> Modified: branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml =================================================================== --- branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/platform_build/linux_ant/build_es.xml 2011-06-04 00:53:04 UTC (rev 3540) @@ -79,6 +79,8 @@ <mapper type="glob" from="*.c" to="*.o"/> <fileset dir="${native}/common" includes="*.c"/> <fileset dir="${native}/common/opengles" includes="*.c"/> + <fileset dir="${native}/generated/openal" includes="*.c"/> + <fileset dir="${native}/generated/opencl" includes="*.c"/> <fileset dir="${native}/generated/opengles" includes="*.c"/> <fileset dir="${native}/linux" includes="*.c"/> <fileset dir="${native}/linux/opengles" includes="*.c"/> Modified: branches/opengles/LWJGL/platform_build/macosx_ant/build.xml =================================================================== --- branches/opengles/LWJGL/platform_build/macosx_ant/build.xml 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/platform_build/macosx_ant/build.xml 2011-06-04 00:53:04 UTC (rev 3540) @@ -7,7 +7,7 @@ <mkdir dir="i386"/> <mkdir dir="x86_64"/> </target> - + <target name="clean"> <delete failonerror="false"> <fileset dir="i386"/> @@ -26,10 +26,12 @@ <fileset dir="${native}/macosx" includes="*.m"/> <fileset dir="${native}/macosx" includes="*.c"/> <fileset dir="${native}/common" includes="*.c"/> - <fileset dir="${native}/generated" includes="*.c"/> + <fileset dir="${native}/generated/openal" includes="*.c"/> + <fileset dir="${native}/generated/opencl" includes="*.c"/> + <fileset dir="${native}/generated/opengl" 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"/> @@ -40,7 +42,7 @@ <fileset dir="." file="${libname}"/> </apply> </target> - + <target name="nativelibrary" depends="init"> <property name="universal_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/> <property name="ppc_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/> Modified: branches/opengles/LWJGL/platform_build/mingw_ant/build.xml =================================================================== --- branches/opengles/LWJGL/platform_build/mingw_ant/build.xml 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/platform_build/mingw_ant/build.xml 2011-06-04 00:53:04 UTC (rev 3540) @@ -22,7 +22,9 @@ <srcfile/> <fileset dir="${native}/windows" includes="*.c"/> <fileset dir="${native}/common" includes="*.c"/> - <fileset dir="${native}/generated" includes="*.c"/> + <fileset dir="${native}/generated/openal" includes="*.c"/> + <fileset dir="${native}/generated/opencl" includes="*.c"/> + <fileset dir="${native}/generated/opengl" includes="*.c"/> <mapper type="glob" from="*.c" to="*.o"/> </apply> </target> @@ -53,7 +55,7 @@ <fileset dir="." includes="*.dll"/> </delete> </target> - + <target name="compile"> <property name="libs" value="-lkernel32 -lole32 -lopengl32 -lversion -luser32 -lgdi32 -ladvapi32 -lwinmm"/> <antcall target="compile_dir"/> Modified: branches/opengles/LWJGL/platform_build/windows_ant/build.xml =================================================================== --- branches/opengles/LWJGL/platform_build/windows_ant/build.xml 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/platform_build/windows_ant/build.xml 2011-06-04 00:53:04 UTC (rev 3540) @@ -18,6 +18,8 @@ <srcfile/> <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}/windows" includes="*.c"/> <fileset dir="${native}/windows/opengl" includes="*.c"/> Modified: branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml =================================================================== --- branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/platform_build/windows_ant/build_es.xml 2011-06-04 00:53:04 UTC (rev 3540) @@ -18,6 +18,8 @@ <srcfile/> <fileset dir="${native}/common" includes="*.c"/> <fileset dir="${native}/common/opengles" includes="*.c"/> + <fileset dir="${native}/generated/openal" includes="*.c"/> + <fileset dir="${native}/generated/opencl" includes="*.c"/> <fileset dir="${native}/generated/opengles" includes="*.c"/> <fileset dir="${native}/windows" includes="*.c"/> <fileset dir="${native}/windows/opengles" includes="*.c"/> Modified: branches/opengles/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java =================================================================== --- branches/opengles/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/src/java/org/lwjgl/opencl/APIUtil.java 2011-06-04 00:53:04 UTC (rev 3540) @@ -453,7 +453,7 @@ */ static void releaseObjects(final CLDevice device) { // Release objects only if we're about to hit 0. - if ( device.getReferenceCount() > 1 ) + if ( !device.isValid() || device.getReferenceCount() > 1 ) return; releaseObjects(device.getSubCLDeviceRegistry(), DESTRUCTOR_CLSubDevice); @@ -466,7 +466,7 @@ */ static void releaseObjects(final CLContext context) { // Release objects only if we're about to hit 0. - if ( context.getReferenceCount() > 1 ) + if ( !context.isValid() || context.getReferenceCount() > 1 ) return; releaseObjects(context.getCLEventRegistry(), DESTRUCTOR_CLEvent); @@ -483,7 +483,7 @@ */ static void releaseObjects(final CLProgram program) { // Release objects only if we're about to hit 0. - if ( program.getReferenceCount() > 1 ) + if ( !program.isValid() || program.getReferenceCount() > 1 ) return; releaseObjects(program.getCLKernelRegistry(), DESTRUCTOR_CLKernel); @@ -496,7 +496,7 @@ */ static void releaseObjects(final CLCommandQueue queue) { // Release objects only if we're about to hit 0. - if ( queue.getReferenceCount() > 1 ) + if ( !queue.isValid() || queue.getReferenceCount() > 1 ) return; releaseObjects(queue.getCLEventRegistry(), DESTRUCTOR_CLEvent); Modified: branches/opengles/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java =================================================================== --- branches/opengles/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/src/java/org/lwjgl/opencl/InfoUtilFactory.java 2011-06-04 00:53:04 UTC (rev 3540) @@ -118,7 +118,7 @@ final long user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify); CLContext __result = null; try { - __result = new CLContext(nclCreateContext(properties.getBuffer(), 0, devices.size(), properties.getBuffer(), propertyCount * PointerBuffer.getPointerSize(), pfn_notify == null ? 0 : pfn_notify.getPointer(), user_data, errcode_ret, errcode_ret != null ? errcode_ret.position() : 0, function_pointer), platform); + __result = new CLContext(nclCreateContext(properties.getBuffer(), 0, devices.size(), properties.getBuffer(), propertyCount, pfn_notify == null ? 0 : pfn_notify.getPointer(), user_data, errcode_ret, errcode_ret != null ? errcode_ret.position() : 0, function_pointer), platform); if ( LWJGLUtil.DEBUG ) Util.checkCLError(errcode_ret.get(0)); return __result; Modified: branches/opengles/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java =================================================================== --- branches/opengles/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java 2011-05-31 14:40:47 UTC (rev 3539) +++ branches/opengles/LWJGL/src/java/org/lwjgl/test/opengl/sprites/SpriteShootoutCL.java 2011-06-04 00:53:04 UTC (rev 3540) @@ -395,7 +395,8 @@ } private void destroy() { - clReleaseContext(clContext); + if ( clContext != null ) + clReleaseContext(clContext); Display.destroy(); System.exit(0); } @@ -422,7 +423,6 @@ kernel.setArg(0, SCREEN_WIDTH); kernel.setArg(1, SCREEN_HEIGHT); - kernel.setArg(2, ballSize * 0.5f); } protected void createProgram(final int vshID) { Added: branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java =================================================================== --- branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java (rev 0) +++ branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_device_memory_flags.java 2011-06-04 00:53:04 UTC (rev 3540) @@ -0,0 +1,42 @@ +/* + * 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 AMD_device_memory_flags { + + /** Alloc from GPU's CPU visible heap. */ + int CL_MEM_USE_PERSISTENT_MEM_AMD = (1 << 6); + +} \ No newline at end of file Added: branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java =================================================================== --- branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java (rev 0) +++ branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_offline_devices.java 2011-06-04 00:53:04 UTC (rev 3540) @@ -0,0 +1,41 @@ +/* + * 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 AMD_offline_devices { + + int CL_CONTEXT_OFFLINE_DEVICES_AMD = 0x403F; + +} \ No newline at end of file Added: branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java =================================================================== --- branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java (rev 0) +++ branches/opengles/LWJGL/src/templates/org/lwjgl/opencl/AMD_popcnt.java 2011-06-04 00:53:04 UTC (rev 3540) @@ -0,0 +1,39 @@ +/* + * 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 AMD_popcnt { + +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |