Build for arm64 macOS

This commit is contained in:
Shadowfacts 2022-01-17 11:54:19 -05:00
parent 2df01dd762
commit 08c5bb1927
27 changed files with 345 additions and 320 deletions

276
build.xml
View file

@ -88,8 +88,8 @@
<antcall target="-createjars" /> <antcall target="-createjars" />
<antcall target="-jars_NoDEP" /> <antcall target="-jars_NoDEP" />
<antcall target="javadoc" /> <!-- <antcall target="javadoc" /> -->
<antcall target="applet-release" /> <!-- <antcall target="applet-release" /> -->
<!-- copy resources to res folder --> <!-- copy resources to res folder -->
<copy todir="${lwjgl.temp}/res"> <copy todir="${lwjgl.temp}/res">
@ -97,15 +97,15 @@
</copy> </copy>
<!-- copy docs --> <!-- copy docs -->
<copy todir="${lwjgl.temp}/doc"> <!-- <copy todir="${lwjgl.temp}/doc"> -->
<fileset dir="${lwjgl.docs}"> <!-- <fileset dir="${lwjgl.docs}"> -->
<patternset refid="lwjgl-docs.fileset" /> <!-- <patternset refid="lwjgl-docs.fileset" /> -->
</fileset> <!-- </fileset> -->
</copy> <!-- </copy> -->
<!-- create distribution from files in libs/ and temp/ --> <!-- create distribution from files in libs/ and temp/ -->
<antcall target="-distribution_javadoc" /> <!-- <antcall target="-distribution_javadoc" /> -->
<antcall target="-distribution_source" /> <!-- <antcall target="-distribution_source" /> -->
<antcall target="-distribute" /> <antcall target="-distribute" />
</target> </target>
@ -295,82 +295,88 @@
<!-- Generates the native headers from source files --> <!-- Generates the native headers from source files -->
<target name="headers" description="invokes javah on java classes" depends="compile"> <target name="headers" description="invokes javah on java classes" depends="compile">
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux"> <!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux"> -->
<class name="org.lwjgl.LinuxSysImplementation" /> <!-- <class name="org.lwjgl.LinuxSysImplementation" /> -->
<class name="org.lwjgl.opengl.LinuxEvent" /> <!-- <class name="org.lwjgl.opengl.LinuxEvent" /> -->
<class name="org.lwjgl.opengl.LinuxMouse" /> <!-- <class name="org.lwjgl.opengl.LinuxMouse" /> -->
<class name="org.lwjgl.opengl.LinuxKeyboard" /> <!-- <class name="org.lwjgl.opengl.LinuxKeyboard" /> -->
<class name="org.lwjgl.opengl.LinuxDisplay" /> <!-- <class name="org.lwjgl.opengl.LinuxDisplay" /> -->
<class name="org.lwjgl.opengl.LinuxPeerInfo" /> <!-- <class name="org.lwjgl.opengl.LinuxPeerInfo" /> -->
</javah> <!-- </javah> -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux/opengl"> <!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux/opengl"> -->
<class name="org.lwjgl.opengl.LinuxPbufferPeerInfo"/> <!-- <class name="org.lwjgl.opengl.LinuxPbufferPeerInfo"/> -->
<class name="org.lwjgl.opengl.LinuxDisplayPeerInfo"/> <!-- <class name="org.lwjgl.opengl.LinuxDisplayPeerInfo"/> -->
<class name="org.lwjgl.opengl.LinuxAWTGLCanvasPeerInfo"/> <!-- <class name="org.lwjgl.opengl.LinuxAWTGLCanvasPeerInfo"/> -->
<class name="org.lwjgl.opengl.LinuxContextImplementation"/> <!-- <class name="org.lwjgl.opengl.LinuxContextImplementation"/> -->
<class name="org.lwjgl.opengl.LinuxCanvasImplementation"/> <!-- <class name="org.lwjgl.opengl.LinuxCanvasImplementation"/> -->
</javah> <!-- </javah> -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows"> <!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows"> -->
<class name="org.lwjgl.WindowsSysImplementation"/> <!-- <class name="org.lwjgl.WindowsSysImplementation"/> -->
<class name="org.lwjgl.opengl.WindowsKeyboard" /> <!-- <class name="org.lwjgl.opengl.WindowsKeyboard" /> -->
<class name="org.lwjgl.opengl.WindowsRegistry" /> <!-- <class name="org.lwjgl.opengl.WindowsRegistry" /> -->
<class name="org.lwjgl.opengl.WindowsDisplay"/> <!-- <class name="org.lwjgl.opengl.WindowsDisplay"/> -->
<class name="org.lwjgl.opengl.WindowsDisplayPeerInfo"/> <!-- <class name="org.lwjgl.opengl.WindowsDisplayPeerInfo"/> -->
<class name="org.lwjgl.opengl.WindowsAWTGLCanvasPeerInfo"/> <!-- <class name="org.lwjgl.opengl.WindowsAWTGLCanvasPeerInfo"/> -->
</javah> <!-- </javah> -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows/opengl"> <!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows/opengl"> -->
<class name="org.lwjgl.opengl.WindowsPbufferPeerInfo"/> <!-- <class name="org.lwjgl.opengl.WindowsPbufferPeerInfo"/> -->
<class name="org.lwjgl.opengl.WindowsPeerInfo"/> <!-- <class name="org.lwjgl.opengl.WindowsPeerInfo"/> -->
<class name="org.lwjgl.opengl.WindowsContextImplementation"/> <!-- <class name="org.lwjgl.opengl.WindowsContextImplementation"/> -->
</javah> <!-- </javah> -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows/opengles"> <!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows/opengles"> -->
<class name="org.lwjgl.opengl.WindowsPeerInfo"/> <!-- <class name="org.lwjgl.opengl.WindowsPeerInfo"/> -->
</javah> <!-- </javah> -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx"> <echo>lwjgl.src.headers = ${lwjgl.src.headers}</echo>
<class name="org.lwjgl.MacOSXSysImplementation" />
<class name="org.lwjgl.opengl.MacOSXCanvasPeerInfo" />
<class name="org.lwjgl.opengl.MacOSXPeerInfo" />
<class name="org.lwjgl.opengl.MacOSXPbufferPeerInfo" />
<class name="org.lwjgl.opengl.MacOSXDisplay" />
<class name="org.lwjgl.opengl.MacOSXContextImplementation" />
<class name="org.lwjgl.opengl.MacOSXNativeKeyboard" />
<class name="org.lwjgl.opengl.MacOSXNativeMouse" />
<class name="org.lwjgl.opengl.MacOSXMouseEventQueue" />
</javah>
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}"> <javac classpath="${lwjgl.bin}" srcdir="${lwjgl.src}" nativeheaderdir="${lwjgl.src.native}/macosx">
<class name="org.lwjgl.opengl.AWTSurfaceLock" /> <compilerarg line="-h ${lwjgl.src.native}/macosx" />
<class name="org.lwjgl.DefaultSysImplementation" /> <include name="java/org/lwjgl/MacOSXSysImplementation.java" />
<class name="org.lwjgl.input.Cursor" /> <include name="java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java" />
<class name="org.lwjgl.input.Keyboard" /> <include name="java/org/lwjgl/opengl/MacOSXPeerInfo.java" />
<class name="org.lwjgl.input.Mouse" /> <include name="java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java" />
<class name="org.lwjgl.openal.AL" /> <include name="java/org/lwjgl/opengl/MacOSXDisplay.java" />
<class name="org.lwjgl.opencl.CL" /> <include name="java/org/lwjgl/opengl/MacOSXContextImplementation.java" />
<class name="org.lwjgl.opencl.CallbackUtil" /> <include name="java/org/lwjgl/opengl/MacOSXNativeKeyboard.java" />
<class name="org.lwjgl.BufferUtils" /> <include name="java/org/lwjgl/opengl/MacOSXNativeMouse.java" />
</javah> <include name="java/org/lwjgl/opengl/MacOSXMouseEventQueue.java" />
</javac>
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}/opengl"> <javac classpath="${lwjgl.bin}" srcdir="${lwjgl.src}" nativeheaderdir="${lwjgl.src.headers}">
<class name="org.lwjgl.opengl.GLContext"/> <compilerarg line="-h ${lwjgl.src.headers}" />
<class name="org.lwjgl.opengl.Pbuffer"/> <include name="java/org/lwjgl/opengl/AWTSurfaceLock.java" />
<class name="org.lwjgl.opengl.CallbackUtil"/> <include name="java/org/lwjgl/DefaultSysImplementation.java" />
<class name="org.lwjgl.opengl.NVPresentVideoUtil"/> <include name="java/org/lwjgl/input/Cursor.java" />
<class name="org.lwjgl.opengl.NVVideoCaptureUtil"/> <include name="java/org/lwjgl/input/Keyboard.java" />
</javah> <include name="java/org/lwjgl/input/Mouse.java" />
<include name="java/org/lwjgl/openal/AL.java" />
<include name="java/org/lwjgl/opencl/CL.java" />
<include name="java/org/lwjgl/opencl/CallbackUtil.java" />
<include name="java/org/lwjgl/BufferUtils.java" />
</javac>
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}/opengles"> <javac classpath="${lwjgl.bin}" srcdir="${lwjgl.src}" nativeheaderdir="${lwjgl.src.headers}/opengl">
<class name="org.lwjgl.opengles.EGL"/> <compilerarg line="-h ${lwjgl.src.headers}/opengl" />
<class name="org.lwjgl.opengles.EGLKHRFenceSync"/> <include name="java/org/lwjgl/opengl/GLContext.java"/>
<class name="org.lwjgl.opengles.EGLKHRReusableSync"/> <include name="java/org/lwjgl/opengl/Pbuffer.java"/>
<class name="org.lwjgl.opengles.EGLNVSync"/> <include name="java/org/lwjgl/opengl/CallbackUtil.java"/>
<class name="org.lwjgl.opengles.GLContext"/> <include name="java/org/lwjgl/opengl/NVPresentVideoUtil.java"/>
<class name="org.lwjgl.opengles.CallbackUtil"/> <include name="java/org/lwjgl/opengl/NVVideoCaptureUtil.java"/>
</javah> </javac>
<javac classpath="${lwjgl.bin}" srcdir="${lwjgl.src}" nativeheaderdir="${lwjgl.src.headers}/opengles">
<compilerarg line="-h ${lwjgl.src.headers}/opengles" />
<include name="java/org/lwjgl/opengles/EGL.java"/>
<include name="java/org/lwjgl/opengles/EGLKHRFenceSync.java"/>
<include name="java/org/lwjgl/opengles/EGLKHRReusableSync.java"/>
<include name="java/org/lwjgl/opengles/EGLNVSync.java"/>
<include name="java/org/lwjgl/opengles/GLContext.java"/>
<include name="java/org/lwjgl/opengles/CallbackUtil.java"/>
</javac>
</target> </target>
<target name="touch-version"> <target name="touch-version">
@ -380,60 +386,60 @@
</target> </target>
<target name="version-mismatch"> <target name="version-mismatch">
<loadfile srcfile="${lwjgl.src}/java/org/lwjgl/WindowsSysImplementation.java" property="lwjgl.java.windows.version"> <!-- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/WindowsSysImplementation.java" property="lwjgl.java.windows.version"> -->
<filterchain> <!-- <filterchain> -->
<tokenfilter> <!-- <tokenfilter> -->
<containsstring contains="JNI_VERSION ="/> <!-- <containsstring contains="JNI_VERSION ="/> -->
</tokenfilter> <!-- </tokenfilter> -->
</filterchain> <!-- </filterchain> -->
</loadfile> <!-- </loadfile> -->
<loadfile srcfile="${lwjgl.src}/java/org/lwjgl/LinuxSysImplementation.java" property="lwjgl.java.linux.version"> <!-- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/LinuxSysImplementation.java" property="lwjgl.java.linux.version"> -->
<filterchain> <!-- <filterchain> -->
<tokenfilter> <!-- <tokenfilter> -->
<containsstring contains="JNI_VERSION ="/> <!-- <containsstring contains="JNI_VERSION ="/> -->
</tokenfilter> <!-- </tokenfilter> -->
</filterchain> <!-- </filterchain> -->
</loadfile> <!-- </loadfile> -->
<loadfile srcfile="${lwjgl.src}/java/org/lwjgl/MacOSXSysImplementation.java" property="lwjgl.java.macosx.version"> <!-- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/MacOSXSysImplementation.java" property="lwjgl.java.macosx.version"> -->
<filterchain> <!-- <filterchain> -->
<tokenfilter> <!-- <tokenfilter> -->
<containsstring contains="JNI_VERSION ="/> <!-- <containsstring contains="JNI_VERSION ="/> -->
</tokenfilter> <!-- </tokenfilter> -->
</filterchain> <!-- </filterchain> -->
</loadfile> <!-- </loadfile> -->
<loadfile srcfile="${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version"> <!-- <loadfile srcfile="${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version"> -->
<filterchain> <!-- <filterchain> -->
<tokenfilter> <!-- <tokenfilter> -->
<containsstring contains="#define org_lwjgl_WindowsSysImplementation_JNI_VERSION"/> <!-- <containsstring contains="#define org_lwjgl_WindowsSysImplementation_JNI_VERSION"/> -->
</tokenfilter> <!-- </tokenfilter> -->
</filterchain> <!-- </filterchain> -->
</loadfile> <!-- </loadfile> -->
<loadfile srcfile="${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version"> <!-- <loadfile srcfile="${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version"> -->
<filterchain> <!-- <filterchain> -->
<tokenfilter> <!-- <tokenfilter> -->
<containsstring contains="#define org_lwjgl_LinuxSysImplementation_JNI_VERSION"/> <!-- <containsstring contains="#define org_lwjgl_LinuxSysImplementation_JNI_VERSION"/> -->
</tokenfilter> <!-- </tokenfilter> -->
</filterchain> <!-- </filterchain> -->
</loadfile> <!-- </loadfile> -->
<loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version"> <!-- <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version"> -->
<filterchain> <!-- <filterchain> -->
<tokenfilter> <!-- <tokenfilter> -->
<containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/> <!-- <containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/> -->
</tokenfilter> <!-- </tokenfilter> -->
</filterchain> <!-- </filterchain> -->
</loadfile> <!-- </loadfile> -->
<echo> <!-- <echo> -->
lwjgl.java.windows.version = ${lwjgl.java.windows.version} <!-- lwjgl.java.windows.version = ${lwjgl.java.windows.version} -->
lwjgl.native.windows.version = ${lwjgl.native.windows.version} <!-- lwjgl.native.windows.version = ${lwjgl.native.windows.version} -->
lwjgl.java.linux.version = ${lwjgl.java.linux.version} <!-- lwjgl.java.linux.version = ${lwjgl.java.linux.version} -->
lwjgl.native.linux.version = ${lwjgl.native.linux.version} <!-- lwjgl.native.linux.version = ${lwjgl.native.linux.version} -->
lwjgl.java.freebsd.version = ${lwjgl.java.linux.version} <!-- lwjgl.java.freebsd.version = ${lwjgl.java.linux.version} -->
lwjgl.native.freebsd.version = ${lwjgl.native.linux.version} <!-- lwjgl.native.freebsd.version = ${lwjgl.native.linux.version} -->
lwjgl.java.openbsd.version = ${lwjgl.java.linux.version} <!-- lwjgl.java.openbsd.version = ${lwjgl.java.linux.version} -->
lwjgl.native.openbsd.version = ${lwjgl.native.linux.version} <!-- lwjgl.native.openbsd.version = ${lwjgl.native.linux.version} -->
lwjgl.java.macosx.version = ${lwjgl.java.macosx.version} <!-- lwjgl.java.macosx.version = ${lwjgl.java.macosx.version} -->
lwjgl.native.macosx.version = ${lwjgl.native.macosx.version} <!-- lwjgl.native.macosx.version = ${lwjgl.native.macosx.version} -->
</echo> <!-- </echo> -->
</target> </target>
<macrodef name="version-check"> <macrodef name="version-check">
@ -462,7 +468,7 @@
<!-- Compiles the Java source code --> <!-- Compiles the Java source code -->
<target name="compile" description="Compiles the java source code" depends="-initialize"> <target name="compile" description="Compiles the java source code" depends="-initialize">
<javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core"> <javac debug="yes" destdir="${lwjgl.bin}" source="1.7" target="1.7" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core">
<!--<compilerarg value="-Xlint:unchecked"/>--> <!--<compilerarg value="-Xlint:unchecked"/>-->
<src path="${lwjgl.src}/java/"/> <src path="${lwjgl.src}/java/"/>
<src path="${lwjgl.src}/generated/"/> <src path="${lwjgl.src}/generated/"/>
@ -475,8 +481,8 @@
<include name="org/lwjgl/util/**"/> <include name="org/lwjgl/util/**"/>
<exclude name="org/lwjgl/util/generator/**"/> <exclude name="org/lwjgl/util/generator/**"/>
</javac> </javac>
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.5" target="1.5" taskname="test" /> <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.7" target="1.7" taskname="test" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.5" target="1.5" taskname="examples" /> <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.7" target="1.7" taskname="examples" />
</target> </target>
<target name="compile_native" depends="-initialize, headers, touch-version, version-mismatch" description="Compiles the native files"> <target name="compile_native" depends="-initialize, headers, touch-version, version-mismatch" description="Compiles the native files">
@ -560,7 +566,7 @@
<target name="-compile_native_macosx" if="lwjgl.platform.macosx"> <target name="-compile_native_macosx" if="lwjgl.platform.macosx">
<ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/> <ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/>
<copy file="${lwjgl.bin}/lwjgl/liblwjgl.dylib" todir="${lwjgl.lib}/macosx"/> <copy file="${lwjgl.bin}/lwjgl/liblwjgl.dylib" todir="${lwjgl.lib}/macosx"/>
<version-check platform="macosx"/> <!-- <version-check platform="macosx"/> -->
</target> </target>
<target name="compile_native_es" depends="-initialize, headers, touch-version, version-mismatch" description="Compiles the native files"> <target name="compile_native_es" depends="-initialize, headers, touch-version, version-mismatch" description="Compiles the native files">

View file

@ -24,7 +24,7 @@
<mkdir dir="${lwjgl.src.native}/generated/opencl"/> <mkdir dir="${lwjgl.src.native}/generated/opencl"/>
<mkdir dir="${lwjgl.bin}"/> <mkdir dir="${lwjgl.bin}"/>
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.6" target="1.6" includes="org/lwjgl/util/generator/**.java" taskname="generator"> <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.7" target="1.7" includes="org/lwjgl/util/generator/**.java" taskname="generator">
<include name="org/lwjgl/util/generator/openal/**.java"/> <include name="org/lwjgl/util/generator/openal/**.java"/>
<include name="org/lwjgl/util/generator/opengl/**.java"/> <include name="org/lwjgl/util/generator/opengl/**.java"/>
<include name="org/lwjgl/util/generator/opengles/**.java"/> <include name="org/lwjgl/util/generator/opengles/**.java"/>
@ -33,7 +33,7 @@
</javac> </javac>
<!-- Compile helper classes used by the templates --> <!-- Compile helper classes used by the templates -->
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.5" target="1.5" taskname="generator"> <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.7" target="1.7" taskname="generator">
<include name="org/lwjgl/PointerWrapper.java"/> <include name="org/lwjgl/PointerWrapper.java"/>
<include name="org/lwjgl/PointerBuffer.java"/> <include name="org/lwjgl/PointerBuffer.java"/>
<!-- OpenGL --> <!-- OpenGL -->
@ -69,7 +69,7 @@
<!-- Generate OpenAL --> <!-- Generate OpenAL -->
<target name="generate-openal" depends="generators" description="Generates java and native source for AL"> <target name="generate-openal" depends="generators" description="Generates java and native source for AL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.al}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.al}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -91,7 +91,7 @@
<!-- Generate OpenAL [DEBUG] --> <!-- Generate OpenAL [DEBUG] -->
<target name="generate-openal-debug" depends="generators" description="Generates java and native source for AL"> <target name="generate-openal-debug" depends="generators" description="Generates java and native source for AL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.al}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.al}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -120,7 +120,7 @@
<!-- Generate OpenGL --> <!-- Generate OpenGL -->
<target name="generate-opengl" depends="generators" description="Generates java and native source for GL"> <target name="generate-opengl" depends="generators" description="Generates java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processorGL"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processorGL">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -143,7 +143,7 @@
<!-- Generate OpenGL [DEBUG] --> <!-- Generate OpenGL [DEBUG] -->
<target name="generate-opengl-debug" depends="generators" description="Generates debug java and native source for GL"> <target name="generate-opengl-debug" depends="generators" description="Generates debug java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -167,7 +167,7 @@
<!-- Generate OpenGL references --> <!-- Generate OpenGL references -->
<target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL"> <target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLReferencesGeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.opengl.GLReferencesGeneratorProcessor"/>
@ -185,7 +185,7 @@
<!-- Generate OpenGL context capabilities --> <!-- Generate OpenGL context capabilities -->
<target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL"> <target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessor"/>
@ -204,7 +204,7 @@
<!-- Generate OpenGL context capabilities [DEBUG] --> <!-- Generate OpenGL context capabilities [DEBUG] -->
<target name="generate-opengl-capabilities-debug" depends="generators" description="Generates debug java and native source for GL"> <target name="generate-opengl-capabilities-debug" depends="generators" description="Generates debug java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessor"/>
@ -230,7 +230,7 @@
<!-- Generate OpenGL ES --> <!-- Generate OpenGL ES -->
<target name="generate-opengles" depends="generators" description="Generates java and native source for GL ES"> <target name="generate-opengles" depends="generators" description="Generates java and native source for GL ES">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -253,7 +253,7 @@
<!-- Generate OpenGL ES [DEBUG] --> <!-- Generate OpenGL ES [DEBUG] -->
<target name="generate-opengles-debug" depends="generators" description="Generates debug java and native source for GL ES"> <target name="generate-opengles-debug" depends="generators" description="Generates debug java and native source for GL ES">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -277,7 +277,7 @@
<!-- Generate OpenGL ES context capabilities --> <!-- Generate OpenGL ES context capabilities -->
<target name="generate-opengles-capabilities" depends="generators" description="Generates java and native source for GL ES"> <target name="generate-opengles-capabilities" depends="generators" description="Generates java and native source for GL ES">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessor"/>
@ -296,7 +296,7 @@
<!-- Generate OpenGL ES context capabilities [DEBUG] --> <!-- Generate OpenGL ES context capabilities [DEBUG] -->
<target name="generate-opengles-capabilities-debug" depends="generators" description="Generates debug java and native source for GL ES"> <target name="generate-opengles-capabilities-debug" depends="generators" description="Generates debug java and native source for GL ES">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessor"/>
@ -322,7 +322,7 @@
<!-- Generate OpenCL --> <!-- Generate OpenCL -->
<target name="generate-opencl" depends="generators" description="Generates java and native source for CL"> <target name="generate-opencl" depends="generators" description="Generates java and native source for CL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -345,7 +345,7 @@
<!-- Generate OpenCL [DEBUG] --> <!-- Generate OpenCL [DEBUG] -->
<target name="generate-opencl-debug" depends="generators" description="Generates debug java and native source for CL"> <target name="generate-opencl-debug" depends="generators" description="Generates debug java and native source for CL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -369,7 +369,7 @@
<!-- Generate OpenCL capabilities --> <!-- Generate OpenCL capabilities -->
<target name="generate-opencl-capabilities" depends="generators" description="Generates capabilities for CL"> <target name="generate-opencl-capabilities" depends="generators" description="Generates capabilities for CL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessor"/>
@ -388,7 +388,7 @@
<!-- Generate OpenCL capabilities [DEBUG] --> <!-- Generate OpenCL capabilities [DEBUG] -->
<target name="generate-opencl-capabilities-debug" depends="generators" description="Generates debug capabilities for CL"> <target name="generate-opencl-capabilities-debug" depends="generators" description="Generates debug capabilities for CL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor"> <javac destdir="${lwjgl.bin}" source="1.7" target="1.7" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/> <compilerarg value="-proc:only"/>
<compilerarg value="-processor"/> <compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessor"/> <compilerarg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessor"/>

View file

@ -2,7 +2,7 @@
<property name="native" location="../../src/native"/> <property name="native" location="../../src/native"/>
<target name="init"> <target name="init">
<mkdir dir="x86_64"/> <mkdir dir="arm64"/>
<property environment="env" /> <property environment="env" />
<!-- Ask Xcode for correct path to XCode tools --> <!-- Ask Xcode for correct path to XCode tools -->
<!-- Will fail if XCode Command Line Tools are not installed on 10.7+ (Lion) --> <!-- Will fail if XCode Command Line Tools are not installed on 10.7+ (Lion) -->
@ -15,7 +15,8 @@
</condition> </condition>
<property name="sdk_path" value="Platforms/MacOSX.platform/Developer/SDKs"/> <property name="sdk_path" value="Platforms/MacOSX.platform/Developer/SDKs"/>
<property name="jvm_headers_path" value="System/Library/Frameworks/JavaVM.framework/Versions/A/Headers"/> <property name="jvm_headers_path" value="/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/include/"/>
<property name="sdkroot" value="${developer_path}/${sdk_path}/MacOSX.sdk"/>
<!-- Choose a JavaVM.framework --> <!-- Choose a JavaVM.framework -->
<condition property="javavmroot" value="${developer_path}/${sdk_path}/MacOSX10.9.sdk"> <condition property="javavmroot" value="${developer_path}/${sdk_path}/MacOSX10.9.sdk">
@ -102,8 +103,7 @@
<target name="clean"> <target name="clean">
<delete failonerror="false"> <delete failonerror="false">
<fileset dir="i386"/> <fileset dir="arm64"/>
<fileset dir="x86_64"/>
<fileset dir="." includes="liblwjgl.dylib"/> <fileset dir="." includes="liblwjgl.dylib"/>
<fileset dir="." includes="lwjgl.symbols"/> <fileset dir="." includes="lwjgl.symbols"/>
</delete> </delete>
@ -111,7 +111,7 @@
<target name="compile" depends="init"> <target name="compile" depends="init">
<apply dir="${dstdir}" executable="${compiler}" os="Mac OS X" skipemptyfilesets="true" failonerror="true" dest="${dstdir}"> <apply dir="${dstdir}" executable="${compiler}" os="Mac OS X" skipemptyfilesets="true" failonerror="true" dest="${dstdir}">
<arg line="${cflags} -ObjC -O2 -Wall -Wunused -c -fPIC -I${javavmroot}/${jvm_headers_path} -I${native}/common -I${native}/common/opengl -I${native}/macosx"/> <arg line="${cflags} -ObjC -O2 -Wall -Wunused -c -fPIC -I${jvm_headers_path} -I${jvm_headers_path}/darwin -I${native}/common -I${native}/common/opengl -I${native}/macosx"/>
<!-- Map from *.m and *.c to .o --> <!-- Map from *.m and *.c to .o -->
<mapper type="regexp" from="^(.*)\.(c|m)" to="\1.o"/> <mapper type="regexp" from="^(.*)\.(c|m)" to="\1.o"/>
<fileset dir="${native}/macosx" includes="*.m"/> <fileset dir="${native}/macosx" includes="*.m"/>
@ -136,10 +136,10 @@
<arg line="${linkerflags} -exported_symbols_list ../lwjgl.symbols -dynamiclib -o ${libname} -framework Foundation -weak_framework AppKit -framework Carbon -framework OpenGL -framework QuartzCore -L${jdk_lib} -ljawt"/> <arg line="${linkerflags} -exported_symbols_list ../lwjgl.symbols -dynamiclib -o ${libname} -framework Foundation -weak_framework AppKit -framework Carbon -framework OpenGL -framework QuartzCore -L${jdk_lib} -ljawt"/>
<fileset dir="${objdir}" includes="*.o"/> <fileset dir="${objdir}" includes="*.o"/>
</apply> </apply>
<apply dir="${objdir}" executable="strip" os="Mac OS X" failonerror="true"> <!-- <apply dir="${objdir}" executable="strip" os="Mac OS X" failonerror="true"> -->
<arg line="-S -X"/> <!-- <arg line="-S -X"/> -->
<fileset dir="." file="${libname}"/> <!-- <fileset file="${libname}"/> -->
</apply> <!-- </apply> -->
</target> </target>
<target name="nativelibrary" depends="init"> <target name="nativelibrary" depends="init">
@ -147,76 +147,74 @@
<echo message=" Mac OS SDK: ${sdkroot}"/> <echo message=" Mac OS SDK: ${sdkroot}"/>
<echo message="JavaVM.framework: ${javavmroot}"/> <echo message="JavaVM.framework: ${javavmroot}"/>
<condition property="build_x86_64" value="1"> <property name="build_arm64" value="1" />
<equals arg1="${compiler}" arg2="clang"/>
</condition>
<antcall target="-build"/> <antcall target="-build"/>
</target> </target>
<target name="-build" depends="-build_universal,-build_x86_x64"/> <target name="-build" depends="-build_arm64"/>
<target name="-build_universal" unless="build_x86_64"> <!-- <target name="-build_universal" unless="build_x86_64"> -->
<mkdir dir="i386"/> <!-- <mkdir dir="i386"/> -->
<property name="universal_sdkroot" location="${sdkroot}"/> <!-- <property name="universal_sdkroot" location="${sdkroot}"/> -->
<property name="x86_64_sdkroot" location="${sdkroot}"/> <!-- <property name="x86_64_sdkroot" location="${sdkroot}"/> -->
<property name="universal_flags" value="-isysroot ${universal_sdkroot}"/> <!-- <property name="universal_flags" value="-isysroot ${universal_sdkroot}"/> -->
<antcall target="compile"> <!-- <antcall target="compile"> -->
<param name="dstdir" location="i386"/> <!-- <param name="dstdir" location="i386"/> -->
<param name="sdkroot" location="${universal_sdkroot}"/> <!-- <param name="sdkroot" location="${universal_sdkroot}"/> -->
<param name="cflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.5"/> <!-- <param name="cflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.5"/> -->
</antcall> <!-- </antcall> -->
<antcall target="compile"> <!-- <antcall target="compile"> -->
<param name="dstdir" location="x86_64"/> <!-- <param name="dstdir" location="x86_64"/> -->
<param name="sdkroot" location="${universal_sdkroot}"/> <!-- <param name="sdkroot" location="${universal_sdkroot}"/> -->
<param name="cflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> <!-- <param name="cflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> -->
</antcall> <!-- </antcall> -->
<exec vmlauncher="true" executable="sh" output="lwjgl.symbols" failonerror="true"> <!-- <exec vmlauncher="true" executable="sh" output="lwjgl.symbols" failonerror="true"> -->
<arg path="../../platform_build/macosx_ant/build-symbol-list"/> <!-- <arg path="../../platform_build/macosx_ant/build-symbol-list"/> -->
<arg path="i386"/> <!-- <arg path="i386"/> -->
</exec> <!-- </exec> -->
<antcall target="link"> <!-- <antcall target="link"> -->
<param name="objdir" location="i386"/> <!-- <param name="objdir" location="i386"/> -->
<param name="libname" value="liblwjgl-i386.dylib"/> <!-- <param name="libname" value="liblwjgl-i386.dylib"/> -->
<param name="linkerflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.5"/> <!-- <param name="linkerflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.5"/> -->
</antcall> <!-- </antcall> -->
<antcall target="link"> <!-- <antcall target="link"> -->
<param name="objdir" location="x86_64"/> <!-- <param name="objdir" location="x86_64"/> -->
<param name="libname" value="liblwjgl-i86_64.dylib"/> <!-- <param name="libname" value="liblwjgl-i86_64.dylib"/> -->
<param name="linkerflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> <!-- <param name="linkerflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> -->
</antcall> <!-- </antcall> -->
<apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true"> <!-- <apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true"> -->
<arg value="-create"/> <!-- <arg value="-create"/> -->
<srcfile/> <!-- <srcfile/> -->
<arg value="-output"/> <!-- <arg value="-output"/> -->
<arg path="liblwjgl.dylib"/> <!-- <arg path="liblwjgl.dylib"/> -->
<fileset file="i386/liblwjgl-i386.dylib"/> <!-- <fileset file="i386/liblwjgl-i386.dylib"/> -->
<fileset file="x86_64/liblwjgl-i86_64.dylib"/> <!-- <fileset file="x86_64/liblwjgl-i86_64.dylib"/> -->
</apply> <!-- </apply> -->
</target> <!-- </target> -->
<target name="-build_x86_x64" if="build_x86_64"> <target name="-build_arm64" if="build_arm64">
<antcall target="compile"> <antcall target="compile">
<param name="dstdir" location="x86_64"/> <param name="dstdir" location="arm64"/>
<param name="sdkroot" location="${sdkroot}"/> <param name="sdkroot" location="${sdkroot}"/>
<param name="cflags" value="-isysroot ${sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> <param name="cflags" value="-isysroot ${sdkroot} -arch arm64 -mmacosx-version-min=10.5"/>
</antcall> </antcall>
<exec vmlauncher="true" executable="sh" output="lwjgl.symbols" failonerror="true"> <exec vmlauncher="true" executable="sh" output="lwjgl.symbols" failonerror="true">
<arg path="../../platform_build/macosx_ant/build-symbol-list"/> <arg path="../../platform_build/macosx_ant/build-symbol-list"/>
<arg path="x86_64"/> <arg path="arm64"/>
</exec> </exec>
<antcall target="link"> <antcall target="link">
<param name="objdir" location="x86_64"/> <param name="objdir" location="arm64"/>
<param name="libname" value="liblwjgl-i86_64.dylib"/> <param name="libname" value="liblwjgl-arm64.dylib"/>
<param name="linkerflags" value="-isysroot ${sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> <param name="linkerflags" value="-isysroot ${sdkroot} -arch arm64 -mmacosx-version-min=10.5"/>
</antcall> </antcall>
<apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true"> <apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true">
<arg value="-create"/> <arg value="-create"/>
<srcfile/> <srcfile/>
<arg value="-output"/> <arg value="-output"/>
<arg path="liblwjgl.dylib"/> <arg path="liblwjgl.dylib"/>
<fileset file="x86_64/liblwjgl-i86_64.dylib"/> <fileset file="arm64/liblwjgl-arm64.dylib"/>
</apply> </apply>
</target> </target>
</project> </project>

View file

@ -31,7 +31,6 @@
*/ */
package org.lwjgl; package org.lwjgl;
import com.apple.eio.FileManager;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction; import java.security.PrivilegedExceptionAction;
@ -55,13 +54,5 @@ final class MacOSXSysImplementation extends J2SESysImplementation {
return JNI_VERSION; return JNI_VERSION;
} }
public boolean openURL(String url) { public native boolean openURL(String url);
try {
FileManager.openURL(url);
return true;
} catch (Exception e) {
LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e);
return false;
}
}
} }

View file

@ -62,10 +62,10 @@ public final class MemoryUtil {
// Depends on java.nio.Buffer#address and sun.misc.Unsafe // Depends on java.nio.Buffer#address and sun.misc.Unsafe
util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorUnsafe"); util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorUnsafe");
} catch (Exception e0) { } catch (Exception e0) {
try { // try {
// Depends on java.nio.Buffer#address and sun.reflect.FieldAccessor // // Depends on java.nio.Buffer#address and sun.reflect.FieldAccessor
util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorReflectFast"); // util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorReflectFast");
} catch (Exception e1) { // } catch (Exception e1) {
try { try {
// Depends on java.nio.Buffer#address // Depends on java.nio.Buffer#address
util = new AccessorReflect(); util = new AccessorReflect();
@ -73,7 +73,7 @@ public final class MemoryUtil {
LWJGLUtil.log("Unsupported JVM detected, this will likely result in low performance. Please inform LWJGL developers."); LWJGLUtil.log("Unsupported JVM detected, this will likely result in low performance. Please inform LWJGL developers.");
util = new AccessorJNI(); util = new AccessorJNI();
} }
} // }
} }
LWJGLUtil.log("MemoryUtil Accessor: " + util.getClass().getSimpleName()); LWJGLUtil.log("MemoryUtil Accessor: " + util.getClass().getSimpleName());
@ -282,7 +282,8 @@ public final class MemoryUtil {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
out.flip(); // cast to use Buffer's implementation of flip even when compiling against versions of java that have ByteBuffer::flip
((Buffer)out).flip();
return out; return out;
} }

View file

@ -37,7 +37,7 @@ import java.lang.reflect.Modifier;
import java.nio.Buffer; import java.nio.Buffer;
import sun.misc.Unsafe; import sun.misc.Unsafe;
import sun.reflect.FieldAccessor; // import sun.reflect.FieldAccessor;
/** /**
* MemoryUtil.Accessor implementations that depend on sun.misc. * MemoryUtil.Accessor implementations that depend on sun.misc.
@ -104,32 +104,32 @@ final class MemoryUtilSun {
} }
/** Implementation using reflection on ByteBuffer, FieldAccessor is used directly. */ /** Implementation using reflection on ByteBuffer, FieldAccessor is used directly. */
private static class AccessorReflectFast implements MemoryUtil.Accessor { // private static class AccessorReflectFast implements MemoryUtil.Accessor {
private final FieldAccessor addressAccessor; // private final FieldAccessor addressAccessor;
AccessorReflectFast() { // AccessorReflectFast() {
Field address; // Field address;
try { // try {
address = MemoryUtil.getAddressField(); // address = MemoryUtil.getAddressField();
} catch (NoSuchFieldException e) { // } catch (NoSuchFieldException e) {
throw new UnsupportedOperationException(e); // throw new UnsupportedOperationException(e);
} // }
address.setAccessible(true); // address.setAccessible(true);
try { // try {
Method m = Field.class.getDeclaredMethod("acquireFieldAccessor", boolean.class); // Method m = Field.class.getDeclaredMethod("acquireFieldAccessor", boolean.class);
m.setAccessible(true); // m.setAccessible(true);
addressAccessor = (FieldAccessor)m.invoke(address, true); // addressAccessor = (FieldAccessor)m.invoke(address, true);
} catch (Exception e) { // } catch (Exception e) {
throw new UnsupportedOperationException(e); // throw new UnsupportedOperationException(e);
} // }
} // }
public long getAddress(final Buffer buffer) { // public long getAddress(final Buffer buffer) {
return addressAccessor.getLong(buffer); // return addressAccessor.getLong(buffer);
} // }
} // }
} }

View file

@ -33,6 +33,7 @@ package org.lwjgl.input;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -331,7 +332,7 @@ public class Keyboard {
} }
private static void reset() { private static void reset() {
readBuffer.limit(0); ((Buffer)readBuffer).limit(0);
for (int i = 0; i < keyDownBuffer.remaining(); i++) for (int i = 0; i < keyDownBuffer.remaining(); i++)
keyDownBuffer.put(i, (byte)0); keyDownBuffer.put(i, (byte)0);
current_event.reset(); current_event.reset();
@ -392,7 +393,7 @@ public class Keyboard {
private static void read() { private static void read() {
readBuffer.compact(); readBuffer.compact();
implementation.readKeyboard(readBuffer); implementation.readKeyboard(readBuffer);
readBuffer.flip(); ((Buffer)readBuffer).flip();
} }
/** /**
@ -453,7 +454,7 @@ public class Keyboard {
int num_events = 0; int num_events = 0;
while (readNext(tmp_event) && (!tmp_event.repeat || repeat_enabled)) while (readNext(tmp_event) && (!tmp_event.repeat || repeat_enabled))
num_events++; num_events++;
readBuffer.position(old_position); ((Buffer)readBuffer).position(old_position);
return num_events; return num_events;
} }
} }

View file

@ -31,6 +31,7 @@
*/ */
package org.lwjgl.input; package org.lwjgl.input;
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.security.AccessController; import java.security.AccessController;
@ -249,7 +250,7 @@ public class Mouse {
private static void resetMouse() { private static void resetMouse() {
dx = dy = dwheel = 0; dx = dy = dwheel = 0;
readBuffer.position(readBuffer.limit()); ((Buffer)readBuffer).position(readBuffer.limit());
} }
static InputImplementation getImplementation() { static InputImplementation getImplementation() {
@ -279,7 +280,7 @@ public class Mouse {
if (currentCursor != null && implementation.getNativeCursorCapabilities() != 0) if (currentCursor != null && implementation.getNativeCursorCapabilities() != 0)
setNativeCursor(currentCursor); setNativeCursor(currentCursor);
readBuffer = ByteBuffer.allocate(EVENT_SIZE * BUFFER_SIZE); readBuffer = ByteBuffer.allocate(EVENT_SIZE * BUFFER_SIZE);
readBuffer.limit(0); ((Buffer)readBuffer).limit(0);
setGrabbed(isGrabbed); setGrabbed(isGrabbed);
} }
@ -383,7 +384,7 @@ public class Mouse {
private static void read() { private static void read() {
readBuffer.compact(); readBuffer.compact();
implementation.readMouse(readBuffer); implementation.readMouse(readBuffer);
readBuffer.flip(); ((Buffer)readBuffer).flip();
} }
/** /**

View file

@ -31,6 +31,7 @@
*/ */
package org.lwjgl.openal; package org.lwjgl.openal;
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
@ -177,7 +178,7 @@ public final class ALC11 {
try { try {
IntBuffer ib = BufferUtils.createIntBuffer(2); IntBuffer ib = BufferUtils.createIntBuffer(2);
ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, ib); ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, ib);
ib.position(1); ((Buffer)ib).position(1);
ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, ib); ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, ib);
int major = ib.get(0); int major = ib.get(0);

View file

@ -97,7 +97,7 @@ final class APIUtil {
buffer = BufferUtils.createByteBuffer(size); buffer = BufferUtils.createByteBuffer(size);
caps.util.buffer = buffer; caps.util.buffer = buffer;
} else } else
buffer.clear(); ((Buffer)buffer).clear();
return buffer; return buffer;
} }
@ -114,8 +114,8 @@ final class APIUtil {
bufferNew.put(buffer); bufferNew.put(buffer);
caps.util.buffer = (buffer = bufferNew); caps.util.buffer = (buffer = bufferNew);
} else { } else {
buffer.position(buffer.limit()); ((Buffer)buffer).position(buffer.limit());
buffer.limit(buffer.capacity()); ((Buffer)buffer).limit(buffer.capacity());
} }
return buffer; return buffer;
@ -193,7 +193,7 @@ final class APIUtil {
*/ */
static long getBuffer(final ContextCapabilities caps, final CharSequence string) { static long getBuffer(final ContextCapabilities caps, final CharSequence string) {
final ByteBuffer buffer = encode(getBufferByte(caps, string.length()), string); final ByteBuffer buffer = encode(getBufferByte(caps, string.length()), string);
buffer.flip(); ((Buffer)buffer).flip();
return MemoryUtil.getAddress0(buffer); return MemoryUtil.getAddress0(buffer);
} }
@ -206,7 +206,7 @@ final class APIUtil {
*/ */
static long getBuffer(final ContextCapabilities caps, final CharSequence string, final int offset) { static long getBuffer(final ContextCapabilities caps, final CharSequence string, final int offset) {
final ByteBuffer buffer = encode(getBufferByteOffset(caps, offset + string.length()), string); final ByteBuffer buffer = encode(getBufferByteOffset(caps, offset + string.length()), string);
buffer.flip(); ((Buffer)buffer).flip();
return MemoryUtil.getAddress(buffer); return MemoryUtil.getAddress(buffer);
} }
@ -220,7 +220,7 @@ final class APIUtil {
static long getBufferNT(final ContextCapabilities caps, final CharSequence string) { static long getBufferNT(final ContextCapabilities caps, final CharSequence string) {
final ByteBuffer buffer = encode(getBufferByte(caps, string.length() + 1), string); final ByteBuffer buffer = encode(getBufferByte(caps, string.length() + 1), string);
buffer.put((byte)0); buffer.put((byte)0);
buffer.flip(); ((Buffer)buffer).flip();
return MemoryUtil.getAddress0(buffer); return MemoryUtil.getAddress0(buffer);
} }
@ -245,7 +245,7 @@ final class APIUtil {
for ( CharSequence string : strings ) for ( CharSequence string : strings )
encode(buffer, string); encode(buffer, string);
buffer.flip(); ((Buffer)buffer).flip();
return MemoryUtil.getAddress0(buffer); return MemoryUtil.getAddress0(buffer);
} }
@ -264,7 +264,7 @@ final class APIUtil {
buffer.put((byte)0); buffer.put((byte)0);
} }
buffer.flip(); ((Buffer)buffer).flip();
return MemoryUtil.getAddress0(buffer); return MemoryUtil.getAddress0(buffer);
} }
@ -281,7 +281,7 @@ final class APIUtil {
for ( CharSequence string : strings ) for ( CharSequence string : strings )
buffer.put(string.length()); buffer.put(string.length());
buffer.flip(); ((Buffer)buffer).flip();
return MemoryUtil.getAddress0(buffer); return MemoryUtil.getAddress0(buffer);
} }

View file

@ -55,6 +55,7 @@ import java.awt.*;
import java.awt.event.ComponentAdapter; import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent; import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener; import java.awt.event.ComponentListener;
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.security.AccessController; import java.security.AccessController;
@ -1222,8 +1223,8 @@ public final class Display {
cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity()); cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity());
int old_position = icons[i].position(); int old_position = icons[i].position();
cached_icons[i].put(icons[i]); cached_icons[i].put(icons[i]);
icons[i].position(old_position); ((Buffer)icons[i]).position(old_position);
cached_icons[i].flip(); ((Buffer)cached_icons[i]).flip();
} }
} }

View file

@ -36,6 +36,7 @@ package org.lwjgl.opengl;
* @author elias_naur * @author elias_naur
*/ */
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
class EventQueue { class EventQueue {
@ -58,12 +59,12 @@ class EventQueue {
* Copy available events into the specified buffer. * Copy available events into the specified buffer.
*/ */
public synchronized void copyEvents(ByteBuffer dest) { public synchronized void copyEvents(ByteBuffer dest) {
queue.flip(); ((Buffer)queue).flip();
int old_limit = queue.limit(); int old_limit = queue.limit();
if (dest.remaining() < queue.remaining()) if (dest.remaining() < queue.remaining())
queue.limit(dest.remaining() + queue.position()); ((Buffer)queue).limit(dest.remaining() + queue.position());
dest.put(queue); dest.put(queue);
queue.limit(old_limit); ((Buffer)queue).limit(old_limit);
queue.compact(); queue.compact();
} }

View file

@ -39,6 +39,7 @@ package org.lwjgl.opengl;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.util.HashMap; import java.util.HashMap;
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@ -209,9 +210,9 @@ final class MacOSXNativeKeyboard extends EventQueue {
} }
public void putKeyboardEvent(int key_code, byte state, int character, long nanos, boolean repeat) { public void putKeyboardEvent(int key_code, byte state, int character, long nanos, boolean repeat) {
event.clear(); ((Buffer)event).clear();
event.putInt(key_code).put(state).putInt(character).putLong(nanos).put(repeat ? (byte)1 : (byte)0); event.putInt(key_code).put(state).putInt(character).putLong(nanos).put(repeat ? (byte)1 : (byte)0);
event.flip(); ((Buffer)event).flip();
putEvent(event); putEvent(event);
} }
@ -219,7 +220,7 @@ final class MacOSXNativeKeyboard extends EventQueue {
flushDeferredEvent(); flushDeferredEvent();
int old_position = key_down_buffer.position(); int old_position = key_down_buffer.position();
key_down_buffer.put(key_states); key_down_buffer.put(key_states);
key_down_buffer.position(old_position); ((Buffer)key_down_buffer).position(old_position);
} }
public synchronized void copyEvents(ByteBuffer dest) { public synchronized void copyEvents(ByteBuffer dest) {

View file

@ -37,6 +37,7 @@ package org.lwjgl.opengl;
* @author kappaOne <one.kappa@gmail.com> * @author kappaOne <one.kappa@gmail.com>
*/ */
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
@ -156,9 +157,9 @@ final class MacOSXNativeMouse extends EventQueue {
} }
protected void putMouseEventWithCoords(byte button, byte state, int coord1, int coord2, int dz, long nanos) { protected void putMouseEventWithCoords(byte button, byte state, int coord1, int coord2, int dz, long nanos) {
event.clear(); ((Buffer)event).clear();
event.put(button).put(state).putInt(coord1).putInt(coord2).putInt(dz).putLong(nanos); event.put(button).put(state).putInt(coord1).putInt(coord2).putInt(dz).putLong(nanos);
event.flip(); ((Buffer)event).flip();
putEvent(event); putEvent(event);
} }
@ -174,7 +175,7 @@ final class MacOSXNativeMouse extends EventQueue {
accum_dx = accum_dy = accum_dz = 0; accum_dx = accum_dy = accum_dz = 0;
int old_position = buttons_buffer.position(); int old_position = buttons_buffer.position();
buttons_buffer.put(buttons, 0, buttons.length); buttons_buffer.put(buttons, 0, buttons.length);
buttons_buffer.position(old_position); ((Buffer)buttons_buffer).position(old_position);
} }
private void setCursorPos(float x, float y, long nanos) { private void setCursorPos(float x, float y, long nanos) {

View file

@ -85,7 +85,6 @@ import java.util.concurrent.Future;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.jar.JarFile; import java.util.jar.JarFile;
import java.util.jar.JarOutputStream; import java.util.jar.JarOutputStream;
import java.util.jar.Pack200;
import java.util.zip.CRC32; import java.util.zip.CRC32;
import java.util.zip.CheckedInputStream; import java.util.zip.CheckedInputStream;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
@ -376,12 +375,12 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
} }
// check pack200 support // check pack200 support
try { // try {
java.util.jar.Pack200.class.getSimpleName(); // java.util.jar.Pack200.class.getSimpleName();
pack200Supported = true; // pack200Supported = true;
} catch (Throwable e) { // } catch (Throwable e) {
/* no pack200 support */ // /* no pack200 support */
} // }
} }
/** /**
@ -1680,20 +1679,21 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
* @throws Exception if any errors occur * @throws Exception if any errors occur
*/ */
protected void extractPack(String in, String out) throws Exception { protected void extractPack(String in, String out) throws Exception {
File f = new File(in); throw new UnsupportedOperationException();
FileOutputStream fostream = new FileOutputStream(out); // File f = new File(in);
JarOutputStream jostream = new JarOutputStream(fostream); // FileOutputStream fostream = new FileOutputStream(out);
// JarOutputStream jostream = new JarOutputStream(fostream);
try { // try {
Pack200.Unpacker unpacker = Pack200.newUnpacker(); // Pack200.Unpacker unpacker = Pack200.newUnpacker();
unpacker.unpack(f, jostream); // unpacker.unpack(f, jostream);
} finally { // } finally {
jostream.close(); // jostream.close();
fostream.close(); // fostream.close();
} // }
// delete pack file as its no longer needed // // delete pack file as its no longer needed
f.delete(); // f.delete();
} }
/** /**

View file

@ -51,7 +51,7 @@ import javax.tools.Diagnostic;
* @version $Revision$ $Id$ * @version $Revision$ $Id$
*/ */
@SupportedAnnotationTypes({ "*" }) @SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedSourceVersion(SourceVersion.RELEASE_7)
@SupportedOptions({ "binpath", "typemap", "generatechecks", "contextspecific" }) @SupportedOptions({ "binpath", "typemap", "generatechecks", "contextspecific" })
public class GeneratorProcessor extends AbstractProcessor { public class GeneratorProcessor extends AbstractProcessor {

View file

@ -300,7 +300,10 @@ public class GeneratorVisitor extends ElementKindVisitor6<Void, Void> {
} }
// TODO: Back-port LWJGL 3's generation file handling (generate in-memory and avoid touching files if nothing has changed) // TODO: Back-port LWJGL 3's generation file handling (generate in-memory and avoid touching files if nothing has changed)
java_writer = new PrintWriter(env.getFiler().createSourceFile(Utils.getQualifiedClassName(e), env.getElementUtils().getPackageOf(e)).openWriter()); // java_writer = new PrintWriter(env.getFiler().createSourceFile(Utils.getQualifiedClassName(e), env.getElementUtils().getPackageOf(e)).openWriter());
outputJava.getParentFile().mkdirs();
outputJava.createNewFile();
java_writer = new PrintWriter(outputJava);
generateJavaSource(e, java_writer); generateJavaSource(e, java_writer);
if ( methods.size() > 0 ) { if ( methods.size() > 0 ) {

View file

@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
* @author Spasi * @author Spasi
*/ */
@SupportedAnnotationTypes({ "*" }) @SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedSourceVersion(SourceVersion.RELEASE_7)
@SupportedOptions({ "generatechecks", "contextspecific" }) @SupportedOptions({ "generatechecks", "contextspecific" })
public class CLGeneratorProcessor extends AbstractProcessor { public class CLGeneratorProcessor extends AbstractProcessor {

View file

@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
* 2010-04-09 23:57:40Z spasi $ * 2010-04-09 23:57:40Z spasi $
*/ */
@SupportedAnnotationTypes({ "*" }) @SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedSourceVersion(SourceVersion.RELEASE_7)
@SupportedOptions({ "contextspecific", "generatechecks" }) @SupportedOptions({ "contextspecific", "generatechecks" })
public class GLESGeneratorProcessor extends AbstractProcessor { public class GLESGeneratorProcessor extends AbstractProcessor {

View file

@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
* 2010-04-09 23:57:40Z spasi $ * 2010-04-09 23:57:40Z spasi $
*/ */
@SupportedAnnotationTypes({ "*" }) @SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedSourceVersion(SourceVersion.RELEASE_7)
@SupportedOptions({ "generatechecks", "contextspecific" }) @SupportedOptions({ "generatechecks", "contextspecific" })
public class GLGeneratorProcessor extends AbstractProcessor { public class GLGeneratorProcessor extends AbstractProcessor {

View file

@ -53,7 +53,7 @@ import javax.lang.model.util.ElementFilter;
* 2009-09-08 15:07:15Z spasi $ * 2009-09-08 15:07:15Z spasi $
*/ */
@SupportedAnnotationTypes({ "*" }) @SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedSourceVersion(SourceVersion.RELEASE_7)
@SupportedOptions({ "generatechecks", "contextspecific" }) @SupportedOptions({ "generatechecks", "contextspecific" })
public class GLReferencesGeneratorProcessor extends AbstractProcessor { public class GLReferencesGeneratorProcessor extends AbstractProcessor {

View file

@ -39,11 +39,7 @@
*/ */
#include <jni.h> #include <jni.h>
#ifdef __MACH__
#include <JavaVM/jawt_md.h>
#else
#include <jawt_md.h> #include <jawt_md.h>
#endif
#include "org_lwjgl_opengl_AWTSurfaceLock.h" #include "org_lwjgl_opengl_AWTSurfaceLock.h"
#include "awt_tools.h" #include "awt_tools.h"
#include "common_tools.h" #include "common_tools.h"

View file

@ -50,6 +50,11 @@
#include "common_tools.h" #include "common_tools.h"
#include <jawt_md.h> #include <jawt_md.h>
typedef struct JAWT_MacOSXDrawingSurfaceInfo {
NSView *cocoaViewRef; // the view is guaranteed to be valid only for the duration of Component.paint method
}
JAWT_MacOSXDrawingSurfaceInfo;
enum { enum {
NSControlLeftKeyMask = 0x0001, NSControlLeftKeyMask = 0x0001,
NSControlRightKeyMask = 0x2000, NSControlRightKeyMask = 0x2000,

View file

@ -101,10 +101,11 @@ NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool g
bpp = 16; bpp = 16;
else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
bpp = 8; bpp = 8;
else else {
bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay); throwException(env, "unknown pixel encoding");
}
} else { } else {
bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay); throwException(env, "unreachable");
} }
} }
else else

View file

@ -0,0 +1,12 @@
#import <jni.h>
#import <AppKit/NSWorkspace.h>
#import "org_lwjgl_MacOSXSysImplementation.h"
JNIEXPORT jboolean JNICALL Java_org_lwjgl_MacOSXSysImplementation_openURL(JNIEnv * env, jobject this, jstring url) {
@autoreleasepool {
const jchar *chars = (*env)->GetStringChars(env, url, NULL);
NSString *s = [NSString stringWithCharacters:chars length:(*env)->GetStringLength(env, url)];
[[NSWorkspace shared] openURL: [NSURL URLWithString:s]];
(*env)->ReleaseStringChars(env, url, chars);
}
}

View file

@ -77,10 +77,7 @@ static NSUInteger lastModifierFlags = 0;
// Inform the view of its parent window info; // Inform the view of its parent window info;
[window_info->view setParent:window_info]; [window_info->view setParent:window_info];
if (window_info->enableHighDPI) { [window_info->view setWantsBestResolutionOpenGLSurface:NO];
// call method using runtime selector as its a 10.7+ api and allows compiling on older SDK's
[window_info->view performSelector:NSSelectorFromString(@"setWantsBestResolutionOpenGLSurface:") withObject:YES];
}
// set nsapp delegate for catching app quit events // set nsapp delegate for catching app quit events
[NSApp setDelegate:window_info->view]; [NSApp setDelegate:window_info->view];
@ -261,7 +258,9 @@ static NSUInteger lastModifierFlags = 0;
if (context == nil) return; if (context == nil) return;
if ([context view] != self) { if ([context view] != self) {
dispatch_sync(dispatch_get_main_queue(), ^{
[context setView:self]; [context setView:self];
});
} }
[context makeCurrentContext]; [context makeCurrentContext];
@ -594,7 +593,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nResizeWindow(JNIEnv
MacOSXWindowInfo *window_info = (MacOSXWindowInfo *)(*env)->GetDirectBufferAddress(env, window_handle); MacOSXWindowInfo *window_info = (MacOSXWindowInfo *)(*env)->GetDirectBufferAddress(env, window_handle);
window_info->display_rect = NSMakeRect(x, y, width, height); window_info->display_rect = NSMakeRect(x, y, width, height);
[window_info->window setFrame:window_info->display_rect display:false]; [window_info->window setFrame:window_info->display_rect display:false];
dispatch_sync(dispatch_get_main_queue(), ^{
[window_info->view update]; [window_info->view update];
});
} }
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nWasResized(JNIEnv *env, jobject this, jobject window_handle) { JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nWasResized(JNIEnv *env, jobject this, jobject window_handle) {

View file

@ -132,7 +132,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nUpdate
(JNIEnv *env, jclass clazz, jobject context_handle) { (JNIEnv *env, jclass clazz, jobject context_handle) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle); MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
dispatch_sync(dispatch_get_main_queue(), ^{
[context_info->context update]; [context_info->context update];
});
[pool release]; [pool release];
} }
@ -163,7 +165,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_setView
peer_info->glLayer->setViewport = YES; peer_info->glLayer->setViewport = YES;
} }
dispatch_sync(dispatch_get_main_queue(), ^{
[context_info->context setView: peer_info->window_info->view]; [context_info->context setView: peer_info->window_info->view];
});
} }
else { else {
[context_info->context setPixelBuffer:peer_info->pbuffer cubeMapFace:0 mipMapLevel:0 currentVirtualScreen:0]; [context_info->context setPixelBuffer:peer_info->pbuffer cubeMapFace:0 mipMapLevel:0 currentVirtualScreen:0];