mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2025-12-06 08:01:59 +01:00
Build for arm64 macOS
This commit is contained in:
parent
2df01dd762
commit
08c5bb1927
276
build.xml
276
build.xml
|
|
@ -88,8 +88,8 @@
|
|||
<antcall target="-createjars" />
|
||||
|
||||
<antcall target="-jars_NoDEP" />
|
||||
<antcall target="javadoc" />
|
||||
<antcall target="applet-release" />
|
||||
<!-- <antcall target="javadoc" /> -->
|
||||
<!-- <antcall target="applet-release" /> -->
|
||||
|
||||
<!-- copy resources to res folder -->
|
||||
<copy todir="${lwjgl.temp}/res">
|
||||
|
|
@ -97,15 +97,15 @@
|
|||
</copy>
|
||||
|
||||
<!-- copy docs -->
|
||||
<copy todir="${lwjgl.temp}/doc">
|
||||
<fileset dir="${lwjgl.docs}">
|
||||
<patternset refid="lwjgl-docs.fileset" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- <copy todir="${lwjgl.temp}/doc"> -->
|
||||
<!-- <fileset dir="${lwjgl.docs}"> -->
|
||||
<!-- <patternset refid="lwjgl-docs.fileset" /> -->
|
||||
<!-- </fileset> -->
|
||||
<!-- </copy> -->
|
||||
|
||||
<!-- create distribution from files in libs/ and temp/ -->
|
||||
<antcall target="-distribution_javadoc" />
|
||||
<antcall target="-distribution_source" />
|
||||
<!-- <antcall target="-distribution_javadoc" /> -->
|
||||
<!-- <antcall target="-distribution_source" /> -->
|
||||
<antcall target="-distribute" />
|
||||
</target>
|
||||
|
||||
|
|
@ -295,82 +295,88 @@
|
|||
|
||||
<!-- Generates the native headers from source files -->
|
||||
<target name="headers" description="invokes javah on java classes" depends="compile">
|
||||
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux">
|
||||
<class name="org.lwjgl.LinuxSysImplementation" />
|
||||
<class name="org.lwjgl.opengl.LinuxEvent" />
|
||||
<class name="org.lwjgl.opengl.LinuxMouse" />
|
||||
<class name="org.lwjgl.opengl.LinuxKeyboard" />
|
||||
<class name="org.lwjgl.opengl.LinuxDisplay" />
|
||||
<class name="org.lwjgl.opengl.LinuxPeerInfo" />
|
||||
</javah>
|
||||
<!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux"> -->
|
||||
<!-- <class name="org.lwjgl.LinuxSysImplementation" /> -->
|
||||
<!-- <class name="org.lwjgl.opengl.LinuxEvent" /> -->
|
||||
<!-- <class name="org.lwjgl.opengl.LinuxMouse" /> -->
|
||||
<!-- <class name="org.lwjgl.opengl.LinuxKeyboard" /> -->
|
||||
<!-- <class name="org.lwjgl.opengl.LinuxDisplay" /> -->
|
||||
<!-- <class name="org.lwjgl.opengl.LinuxPeerInfo" /> -->
|
||||
<!-- </javah> -->
|
||||
|
||||
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux/opengl">
|
||||
<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"> -->
|
||||
<!-- <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">
|
||||
<class name="org.lwjgl.WindowsSysImplementation"/>
|
||||
<class name="org.lwjgl.opengl.WindowsKeyboard" />
|
||||
<class name="org.lwjgl.opengl.WindowsRegistry" />
|
||||
<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"> -->
|
||||
<!-- <class name="org.lwjgl.WindowsSysImplementation"/> -->
|
||||
<!-- <class name="org.lwjgl.opengl.WindowsKeyboard" /> -->
|
||||
<!-- <class name="org.lwjgl.opengl.WindowsRegistry" /> -->
|
||||
<!-- <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">
|
||||
<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/opengl"> -->
|
||||
<!-- <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">
|
||||
<class name="org.lwjgl.opengl.WindowsPeerInfo"/>
|
||||
</javah>
|
||||
<!-- <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows/opengles"> -->
|
||||
<!-- <class name="org.lwjgl.opengl.WindowsPeerInfo"/> -->
|
||||
<!-- </javah> -->
|
||||
|
||||
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx">
|
||||
<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>
|
||||
<echo>lwjgl.src.headers = ${lwjgl.src.headers}</echo>
|
||||
|
||||
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}">
|
||||
<class name="org.lwjgl.opengl.AWTSurfaceLock" />
|
||||
<class name="org.lwjgl.DefaultSysImplementation" />
|
||||
<class name="org.lwjgl.input.Cursor" />
|
||||
<class name="org.lwjgl.input.Keyboard" />
|
||||
<class name="org.lwjgl.input.Mouse" />
|
||||
<class name="org.lwjgl.openal.AL" />
|
||||
<class name="org.lwjgl.opencl.CL" />
|
||||
<class name="org.lwjgl.opencl.CallbackUtil" />
|
||||
<class name="org.lwjgl.BufferUtils" />
|
||||
</javah>
|
||||
<javac classpath="${lwjgl.bin}" srcdir="${lwjgl.src}" nativeheaderdir="${lwjgl.src.native}/macosx">
|
||||
<compilerarg line="-h ${lwjgl.src.native}/macosx" />
|
||||
<include name="java/org/lwjgl/MacOSXSysImplementation.java" />
|
||||
<include name="java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java" />
|
||||
<include name="java/org/lwjgl/opengl/MacOSXPeerInfo.java" />
|
||||
<include name="java/org/lwjgl/opengl/MacOSXPbufferPeerInfo.java" />
|
||||
<include name="java/org/lwjgl/opengl/MacOSXDisplay.java" />
|
||||
<include name="java/org/lwjgl/opengl/MacOSXContextImplementation.java" />
|
||||
<include name="java/org/lwjgl/opengl/MacOSXNativeKeyboard.java" />
|
||||
<include name="java/org/lwjgl/opengl/MacOSXNativeMouse.java" />
|
||||
<include name="java/org/lwjgl/opengl/MacOSXMouseEventQueue.java" />
|
||||
</javac>
|
||||
|
||||
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}/opengl">
|
||||
<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>
|
||||
<javac classpath="${lwjgl.bin}" srcdir="${lwjgl.src}" nativeheaderdir="${lwjgl.src.headers}">
|
||||
<compilerarg line="-h ${lwjgl.src.headers}" />
|
||||
<include name="java/org/lwjgl/opengl/AWTSurfaceLock.java" />
|
||||
<include name="java/org/lwjgl/DefaultSysImplementation.java" />
|
||||
<include name="java/org/lwjgl/input/Cursor.java" />
|
||||
<include name="java/org/lwjgl/input/Keyboard.java" />
|
||||
<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">
|
||||
<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"/>
|
||||
<class name="org.lwjgl.opengles.CallbackUtil"/>
|
||||
</javah>
|
||||
<javac classpath="${lwjgl.bin}" srcdir="${lwjgl.src}" nativeheaderdir="${lwjgl.src.headers}/opengl">
|
||||
<compilerarg line="-h ${lwjgl.src.headers}/opengl" />
|
||||
<include name="java/org/lwjgl/opengl/GLContext.java"/>
|
||||
<include name="java/org/lwjgl/opengl/Pbuffer.java"/>
|
||||
<include name="java/org/lwjgl/opengl/CallbackUtil.java"/>
|
||||
<include name="java/org/lwjgl/opengl/NVPresentVideoUtil.java"/>
|
||||
<include name="java/org/lwjgl/opengl/NVVideoCaptureUtil.java"/>
|
||||
</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 name="touch-version">
|
||||
|
|
@ -380,60 +386,60 @@
|
|||
</target>
|
||||
|
||||
<target name="version-mismatch">
|
||||
<loadfile srcfile="${lwjgl.src}/java/org/lwjgl/WindowsSysImplementation.java" property="lwjgl.java.windows.version">
|
||||
<filterchain>
|
||||
<tokenfilter>
|
||||
<containsstring contains="JNI_VERSION ="/>
|
||||
</tokenfilter>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
<loadfile srcfile="${lwjgl.src}/java/org/lwjgl/LinuxSysImplementation.java" property="lwjgl.java.linux.version">
|
||||
<filterchain>
|
||||
<tokenfilter>
|
||||
<containsstring contains="JNI_VERSION ="/>
|
||||
</tokenfilter>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
<loadfile srcfile="${lwjgl.src}/java/org/lwjgl/MacOSXSysImplementation.java" property="lwjgl.java.macosx.version">
|
||||
<filterchain>
|
||||
<tokenfilter>
|
||||
<containsstring contains="JNI_VERSION ="/>
|
||||
</tokenfilter>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
<loadfile srcfile="${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version">
|
||||
<filterchain>
|
||||
<tokenfilter>
|
||||
<containsstring contains="#define org_lwjgl_WindowsSysImplementation_JNI_VERSION"/>
|
||||
</tokenfilter>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
<loadfile srcfile="${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version">
|
||||
<filterchain>
|
||||
<tokenfilter>
|
||||
<containsstring contains="#define org_lwjgl_LinuxSysImplementation_JNI_VERSION"/>
|
||||
</tokenfilter>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
<loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
|
||||
<filterchain>
|
||||
<tokenfilter>
|
||||
<containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/>
|
||||
</tokenfilter>
|
||||
</filterchain>
|
||||
</loadfile>
|
||||
<echo>
|
||||
lwjgl.java.windows.version = ${lwjgl.java.windows.version}
|
||||
lwjgl.native.windows.version = ${lwjgl.native.windows.version}
|
||||
lwjgl.java.linux.version = ${lwjgl.java.linux.version}
|
||||
lwjgl.native.linux.version = ${lwjgl.native.linux.version}
|
||||
lwjgl.java.freebsd.version = ${lwjgl.java.linux.version}
|
||||
lwjgl.native.freebsd.version = ${lwjgl.native.linux.version}
|
||||
lwjgl.java.openbsd.version = ${lwjgl.java.linux.version}
|
||||
lwjgl.native.openbsd.version = ${lwjgl.native.linux.version}
|
||||
lwjgl.java.macosx.version = ${lwjgl.java.macosx.version}
|
||||
lwjgl.native.macosx.version = ${lwjgl.native.macosx.version}
|
||||
</echo>
|
||||
<!-- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/WindowsSysImplementation.java" property="lwjgl.java.windows.version"> -->
|
||||
<!-- <filterchain> -->
|
||||
<!-- <tokenfilter> -->
|
||||
<!-- <containsstring contains="JNI_VERSION ="/> -->
|
||||
<!-- </tokenfilter> -->
|
||||
<!-- </filterchain> -->
|
||||
<!-- </loadfile> -->
|
||||
<!-- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/LinuxSysImplementation.java" property="lwjgl.java.linux.version"> -->
|
||||
<!-- <filterchain> -->
|
||||
<!-- <tokenfilter> -->
|
||||
<!-- <containsstring contains="JNI_VERSION ="/> -->
|
||||
<!-- </tokenfilter> -->
|
||||
<!-- </filterchain> -->
|
||||
<!-- </loadfile> -->
|
||||
<!-- <loadfile srcfile="${lwjgl.src}/java/org/lwjgl/MacOSXSysImplementation.java" property="lwjgl.java.macosx.version"> -->
|
||||
<!-- <filterchain> -->
|
||||
<!-- <tokenfilter> -->
|
||||
<!-- <containsstring contains="JNI_VERSION ="/> -->
|
||||
<!-- </tokenfilter> -->
|
||||
<!-- </filterchain> -->
|
||||
<!-- </loadfile> -->
|
||||
<!-- <loadfile srcfile="${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version"> -->
|
||||
<!-- <filterchain> -->
|
||||
<!-- <tokenfilter> -->
|
||||
<!-- <containsstring contains="#define org_lwjgl_WindowsSysImplementation_JNI_VERSION"/> -->
|
||||
<!-- </tokenfilter> -->
|
||||
<!-- </filterchain> -->
|
||||
<!-- </loadfile> -->
|
||||
<!-- <loadfile srcfile="${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version"> -->
|
||||
<!-- <filterchain> -->
|
||||
<!-- <tokenfilter> -->
|
||||
<!-- <containsstring contains="#define org_lwjgl_LinuxSysImplementation_JNI_VERSION"/> -->
|
||||
<!-- </tokenfilter> -->
|
||||
<!-- </filterchain> -->
|
||||
<!-- </loadfile> -->
|
||||
<!-- <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version"> -->
|
||||
<!-- <filterchain> -->
|
||||
<!-- <tokenfilter> -->
|
||||
<!-- <containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/> -->
|
||||
<!-- </tokenfilter> -->
|
||||
<!-- </filterchain> -->
|
||||
<!-- </loadfile> -->
|
||||
<!-- <echo> -->
|
||||
<!-- lwjgl.java.windows.version = ${lwjgl.java.windows.version} -->
|
||||
<!-- lwjgl.native.windows.version = ${lwjgl.native.windows.version} -->
|
||||
<!-- lwjgl.java.linux.version = ${lwjgl.java.linux.version} -->
|
||||
<!-- lwjgl.native.linux.version = ${lwjgl.native.linux.version} -->
|
||||
<!-- lwjgl.java.freebsd.version = ${lwjgl.java.linux.version} -->
|
||||
<!-- lwjgl.native.freebsd.version = ${lwjgl.native.linux.version} -->
|
||||
<!-- lwjgl.java.openbsd.version = ${lwjgl.java.linux.version} -->
|
||||
<!-- lwjgl.native.openbsd.version = ${lwjgl.native.linux.version} -->
|
||||
<!-- lwjgl.java.macosx.version = ${lwjgl.java.macosx.version} -->
|
||||
<!-- lwjgl.native.macosx.version = ${lwjgl.native.macosx.version} -->
|
||||
<!-- </echo> -->
|
||||
</target>
|
||||
|
||||
<macrodef name="version-check">
|
||||
|
|
@ -462,7 +468,7 @@
|
|||
|
||||
<!-- Compiles the Java source code -->
|
||||
<target name="compile" description="Compiles the java source code" depends="-initialize">
|
||||
<javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-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"/>-->
|
||||
<src path="${lwjgl.src}/java/"/>
|
||||
<src path="${lwjgl.src}/generated/"/>
|
||||
|
|
@ -475,8 +481,8 @@
|
|||
<include name="org/lwjgl/util/**"/>
|
||||
<exclude name="org/lwjgl/util/generator/**"/>
|
||||
</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/examples/**" source="1.5" target="1.5" taskname="examples" />
|
||||
<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.7" target="1.7" taskname="examples" />
|
||||
</target>
|
||||
|
||||
<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">
|
||||
<ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/>
|
||||
<copy file="${lwjgl.bin}/lwjgl/liblwjgl.dylib" todir="${lwjgl.lib}/macosx"/>
|
||||
<version-check platform="macosx"/>
|
||||
<!-- <version-check platform="macosx"/> -->
|
||||
</target>
|
||||
|
||||
<target name="compile_native_es" depends="-initialize, headers, touch-version, version-mismatch" description="Compiles the native files">
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<mkdir dir="${lwjgl.src.native}/generated/opencl"/>
|
||||
<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/opengl/**.java"/>
|
||||
<include name="org/lwjgl/util/generator/opengles/**.java"/>
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
</javac>
|
||||
|
||||
<!-- 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/PointerBuffer.java"/>
|
||||
<!-- OpenGL -->
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
|
||||
<!-- Generate OpenAL -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
|
||||
<!-- Generate OpenAL [DEBUG] -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
|
||||
<!-- Generate OpenGL -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
|
||||
<!-- Generate OpenGL [DEBUG] -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
|
||||
|
|
@ -167,7 +167,7 @@
|
|||
|
||||
<!-- Generate OpenGL references -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.opengl.GLReferencesGeneratorProcessor"/>
|
||||
|
|
@ -185,7 +185,7 @@
|
|||
|
||||
<!-- Generate OpenGL context capabilities -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessor"/>
|
||||
|
|
@ -204,7 +204,7 @@
|
|||
|
||||
<!-- Generate OpenGL context capabilities [DEBUG] -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessor"/>
|
||||
|
|
@ -230,7 +230,7 @@
|
|||
|
||||
<!-- Generate OpenGL 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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
|
||||
|
|
@ -253,7 +253,7 @@
|
|||
|
||||
<!-- Generate OpenGL ES [DEBUG] -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
|
||||
|
|
@ -277,7 +277,7 @@
|
|||
|
||||
<!-- Generate OpenGL ES context capabilities -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessor"/>
|
||||
|
|
@ -296,7 +296,7 @@
|
|||
|
||||
<!-- Generate OpenGL ES context capabilities [DEBUG] -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessor"/>
|
||||
|
|
@ -322,7 +322,7 @@
|
|||
|
||||
<!-- Generate OpenCL -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
|
||||
|
|
@ -345,7 +345,7 @@
|
|||
|
||||
<!-- Generate OpenCL [DEBUG] -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
|
||||
|
|
@ -369,7 +369,7 @@
|
|||
|
||||
<!-- Generate OpenCL capabilities -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessor"/>
|
||||
|
|
@ -388,7 +388,7 @@
|
|||
|
||||
<!-- Generate OpenCL capabilities [DEBUG] -->
|
||||
<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="-processor"/>
|
||||
<compilerarg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessor"/>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<property name="native" location="../../src/native"/>
|
||||
|
||||
<target name="init">
|
||||
<mkdir dir="x86_64"/>
|
||||
<mkdir dir="arm64"/>
|
||||
<property environment="env" />
|
||||
<!-- Ask Xcode for correct path to XCode tools -->
|
||||
<!-- Will fail if XCode Command Line Tools are not installed on 10.7+ (Lion) -->
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
</condition>
|
||||
|
||||
<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 -->
|
||||
<condition property="javavmroot" value="${developer_path}/${sdk_path}/MacOSX10.9.sdk">
|
||||
|
|
@ -102,8 +103,7 @@
|
|||
|
||||
<target name="clean">
|
||||
<delete failonerror="false">
|
||||
<fileset dir="i386"/>
|
||||
<fileset dir="x86_64"/>
|
||||
<fileset dir="arm64"/>
|
||||
<fileset dir="." includes="liblwjgl.dylib"/>
|
||||
<fileset dir="." includes="lwjgl.symbols"/>
|
||||
</delete>
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
|
||||
<target name="compile" depends="init">
|
||||
<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 -->
|
||||
<mapper type="regexp" from="^(.*)\.(c|m)" to="\1.o"/>
|
||||
<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"/>
|
||||
<fileset dir="${objdir}" includes="*.o"/>
|
||||
</apply>
|
||||
<apply dir="${objdir}" executable="strip" os="Mac OS X" failonerror="true">
|
||||
<arg line="-S -X"/>
|
||||
<fileset dir="." file="${libname}"/>
|
||||
</apply>
|
||||
<!-- <apply dir="${objdir}" executable="strip" os="Mac OS X" failonerror="true"> -->
|
||||
<!-- <arg line="-S -X"/> -->
|
||||
<!-- <fileset file="${libname}"/> -->
|
||||
<!-- </apply> -->
|
||||
</target>
|
||||
|
||||
<target name="nativelibrary" depends="init">
|
||||
|
|
@ -147,76 +147,74 @@
|
|||
<echo message=" Mac OS SDK: ${sdkroot}"/>
|
||||
<echo message="JavaVM.framework: ${javavmroot}"/>
|
||||
|
||||
<condition property="build_x86_64" value="1">
|
||||
<equals arg1="${compiler}" arg2="clang"/>
|
||||
</condition>
|
||||
<property name="build_arm64" value="1" />
|
||||
|
||||
<antcall target="-build"/>
|
||||
</target>
|
||||
|
||||
<target name="-build" depends="-build_universal,-build_x86_x64"/>
|
||||
<target name="-build" depends="-build_arm64"/>
|
||||
|
||||
<target name="-build_universal" unless="build_x86_64">
|
||||
<mkdir dir="i386"/>
|
||||
<!-- <target name="-build_universal" unless="build_x86_64"> -->
|
||||
<!-- <mkdir dir="i386"/> -->
|
||||
|
||||
<property name="universal_sdkroot" location="${sdkroot}"/>
|
||||
<property name="x86_64_sdkroot" location="${sdkroot}"/>
|
||||
<property name="universal_flags" value="-isysroot ${universal_sdkroot}"/>
|
||||
<antcall target="compile">
|
||||
<param name="dstdir" location="i386"/>
|
||||
<param name="sdkroot" location="${universal_sdkroot}"/>
|
||||
<param name="cflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.5"/>
|
||||
</antcall>
|
||||
<antcall target="compile">
|
||||
<param name="dstdir" location="x86_64"/>
|
||||
<param name="sdkroot" location="${universal_sdkroot}"/>
|
||||
<param name="cflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/>
|
||||
</antcall>
|
||||
<exec vmlauncher="true" executable="sh" output="lwjgl.symbols" failonerror="true">
|
||||
<arg path="../../platform_build/macosx_ant/build-symbol-list"/>
|
||||
<arg path="i386"/>
|
||||
</exec>
|
||||
<antcall target="link">
|
||||
<param name="objdir" location="i386"/>
|
||||
<param name="libname" value="liblwjgl-i386.dylib"/>
|
||||
<param name="linkerflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.5"/>
|
||||
</antcall>
|
||||
<antcall target="link">
|
||||
<param name="objdir" location="x86_64"/>
|
||||
<param name="libname" value="liblwjgl-i86_64.dylib"/>
|
||||
<param name="linkerflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/>
|
||||
</antcall>
|
||||
<apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true">
|
||||
<arg value="-create"/>
|
||||
<srcfile/>
|
||||
<arg value="-output"/>
|
||||
<arg path="liblwjgl.dylib"/>
|
||||
<fileset file="i386/liblwjgl-i386.dylib"/>
|
||||
<fileset file="x86_64/liblwjgl-i86_64.dylib"/>
|
||||
</apply>
|
||||
</target>
|
||||
<!-- <property name="universal_sdkroot" location="${sdkroot}"/> -->
|
||||
<!-- <property name="x86_64_sdkroot" location="${sdkroot}"/> -->
|
||||
<!-- <property name="universal_flags" value="-isysroot ${universal_sdkroot}"/> -->
|
||||
<!-- <antcall target="compile"> -->
|
||||
<!-- <param name="dstdir" location="i386"/> -->
|
||||
<!-- <param name="sdkroot" location="${universal_sdkroot}"/> -->
|
||||
<!-- <param name="cflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.5"/> -->
|
||||
<!-- </antcall> -->
|
||||
<!-- <antcall target="compile"> -->
|
||||
<!-- <param name="dstdir" location="x86_64"/> -->
|
||||
<!-- <param name="sdkroot" location="${universal_sdkroot}"/> -->
|
||||
<!-- <param name="cflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> -->
|
||||
<!-- </antcall> -->
|
||||
<!-- <exec vmlauncher="true" executable="sh" output="lwjgl.symbols" failonerror="true"> -->
|
||||
<!-- <arg path="../../platform_build/macosx_ant/build-symbol-list"/> -->
|
||||
<!-- <arg path="i386"/> -->
|
||||
<!-- </exec> -->
|
||||
<!-- <antcall target="link"> -->
|
||||
<!-- <param name="objdir" location="i386"/> -->
|
||||
<!-- <param name="libname" value="liblwjgl-i386.dylib"/> -->
|
||||
<!-- <param name="linkerflags" value="${universal_flags} -arch i386 -mmacosx-version-min=10.5"/> -->
|
||||
<!-- </antcall> -->
|
||||
<!-- <antcall target="link"> -->
|
||||
<!-- <param name="objdir" location="x86_64"/> -->
|
||||
<!-- <param name="libname" value="liblwjgl-i86_64.dylib"/> -->
|
||||
<!-- <param name="linkerflags" value="-isysroot ${x86_64_sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/> -->
|
||||
<!-- </antcall> -->
|
||||
<!-- <apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true"> -->
|
||||
<!-- <arg value="-create"/> -->
|
||||
<!-- <srcfile/> -->
|
||||
<!-- <arg value="-output"/> -->
|
||||
<!-- <arg path="liblwjgl.dylib"/> -->
|
||||
<!-- <fileset file="i386/liblwjgl-i386.dylib"/> -->
|
||||
<!-- <fileset file="x86_64/liblwjgl-i86_64.dylib"/> -->
|
||||
<!-- </apply> -->
|
||||
<!-- </target> -->
|
||||
|
||||
<target name="-build_x86_x64" if="build_x86_64">
|
||||
<target name="-build_arm64" if="build_arm64">
|
||||
<antcall target="compile">
|
||||
<param name="dstdir" location="x86_64"/>
|
||||
<param name="dstdir" location="arm64"/>
|
||||
<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>
|
||||
<exec vmlauncher="true" executable="sh" output="lwjgl.symbols" failonerror="true">
|
||||
<arg path="../../platform_build/macosx_ant/build-symbol-list"/>
|
||||
<arg path="x86_64"/>
|
||||
<arg path="arm64"/>
|
||||
</exec>
|
||||
<antcall target="link">
|
||||
<param name="objdir" location="x86_64"/>
|
||||
<param name="libname" value="liblwjgl-i86_64.dylib"/>
|
||||
<param name="linkerflags" value="-isysroot ${sdkroot} -arch x86_64 -mmacosx-version-min=10.5"/>
|
||||
<param name="objdir" location="arm64"/>
|
||||
<param name="libname" value="liblwjgl-arm64.dylib"/>
|
||||
<param name="linkerflags" value="-isysroot ${sdkroot} -arch arm64 -mmacosx-version-min=10.5"/>
|
||||
</antcall>
|
||||
<apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true">
|
||||
<arg value="-create"/>
|
||||
<srcfile/>
|
||||
<arg value="-output"/>
|
||||
<arg path="liblwjgl.dylib"/>
|
||||
<fileset file="x86_64/liblwjgl-i86_64.dylib"/>
|
||||
<fileset file="arm64/liblwjgl-arm64.dylib"/>
|
||||
</apply>
|
||||
</target>
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
*/
|
||||
package org.lwjgl;
|
||||
|
||||
import com.apple.eio.FileManager;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
|
|
@ -55,13 +54,5 @@ final class MacOSXSysImplementation extends J2SESysImplementation {
|
|||
return JNI_VERSION;
|
||||
}
|
||||
|
||||
public 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;
|
||||
}
|
||||
}
|
||||
public native boolean openURL(String url);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ public final class MemoryUtil {
|
|||
// Depends on java.nio.Buffer#address and sun.misc.Unsafe
|
||||
util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorUnsafe");
|
||||
} catch (Exception e0) {
|
||||
try {
|
||||
// Depends on java.nio.Buffer#address and sun.reflect.FieldAccessor
|
||||
util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorReflectFast");
|
||||
} catch (Exception e1) {
|
||||
// try {
|
||||
// // Depends on java.nio.Buffer#address and sun.reflect.FieldAccessor
|
||||
// util = loadAccessor("org.lwjgl.MemoryUtilSun$AccessorReflectFast");
|
||||
// } catch (Exception e1) {
|
||||
try {
|
||||
// Depends on java.nio.Buffer#address
|
||||
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.");
|
||||
util = new AccessorJNI();
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
LWJGLUtil.log("MemoryUtil Accessor: " + util.getClass().getSimpleName());
|
||||
|
|
@ -282,7 +282,8 @@ public final class MemoryUtil {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import java.lang.reflect.Modifier;
|
|||
import java.nio.Buffer;
|
||||
|
||||
import sun.misc.Unsafe;
|
||||
import sun.reflect.FieldAccessor;
|
||||
// import sun.reflect.FieldAccessor;
|
||||
|
||||
/**
|
||||
* MemoryUtil.Accessor implementations that depend on sun.misc.
|
||||
|
|
@ -104,32 +104,32 @@ final class MemoryUtilSun {
|
|||
}
|
||||
|
||||
/** 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() {
|
||||
Field address;
|
||||
try {
|
||||
address = MemoryUtil.getAddressField();
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
address.setAccessible(true);
|
||||
// AccessorReflectFast() {
|
||||
// Field address;
|
||||
// try {
|
||||
// address = MemoryUtil.getAddressField();
|
||||
// } catch (NoSuchFieldException e) {
|
||||
// throw new UnsupportedOperationException(e);
|
||||
// }
|
||||
// address.setAccessible(true);
|
||||
|
||||
try {
|
||||
Method m = Field.class.getDeclaredMethod("acquireFieldAccessor", boolean.class);
|
||||
m.setAccessible(true);
|
||||
addressAccessor = (FieldAccessor)m.invoke(address, true);
|
||||
} catch (Exception e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
}
|
||||
// try {
|
||||
// Method m = Field.class.getDeclaredMethod("acquireFieldAccessor", boolean.class);
|
||||
// m.setAccessible(true);
|
||||
// addressAccessor = (FieldAccessor)m.invoke(address, true);
|
||||
// } catch (Exception e) {
|
||||
// throw new UnsupportedOperationException(e);
|
||||
// }
|
||||
// }
|
||||
|
||||
public long getAddress(final Buffer buffer) {
|
||||
return addressAccessor.getLong(buffer);
|
||||
}
|
||||
// public long getAddress(final Buffer buffer) {
|
||||
// return addressAccessor.getLong(buffer);
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ package org.lwjgl.input;
|
|||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -331,7 +332,7 @@ public class Keyboard {
|
|||
}
|
||||
|
||||
private static void reset() {
|
||||
readBuffer.limit(0);
|
||||
((Buffer)readBuffer).limit(0);
|
||||
for (int i = 0; i < keyDownBuffer.remaining(); i++)
|
||||
keyDownBuffer.put(i, (byte)0);
|
||||
current_event.reset();
|
||||
|
|
@ -392,7 +393,7 @@ public class Keyboard {
|
|||
private static void read() {
|
||||
readBuffer.compact();
|
||||
implementation.readKeyboard(readBuffer);
|
||||
readBuffer.flip();
|
||||
((Buffer)readBuffer).flip();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -453,7 +454,7 @@ public class Keyboard {
|
|||
int num_events = 0;
|
||||
while (readNext(tmp_event) && (!tmp_event.repeat || repeat_enabled))
|
||||
num_events++;
|
||||
readBuffer.position(old_position);
|
||||
((Buffer)readBuffer).position(old_position);
|
||||
return num_events;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
*/
|
||||
package org.lwjgl.input;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.security.AccessController;
|
||||
|
|
@ -249,7 +250,7 @@ public class Mouse {
|
|||
|
||||
private static void resetMouse() {
|
||||
dx = dy = dwheel = 0;
|
||||
readBuffer.position(readBuffer.limit());
|
||||
((Buffer)readBuffer).position(readBuffer.limit());
|
||||
}
|
||||
|
||||
static InputImplementation getImplementation() {
|
||||
|
|
@ -279,7 +280,7 @@ public class Mouse {
|
|||
if (currentCursor != null && implementation.getNativeCursorCapabilities() != 0)
|
||||
setNativeCursor(currentCursor);
|
||||
readBuffer = ByteBuffer.allocate(EVENT_SIZE * BUFFER_SIZE);
|
||||
readBuffer.limit(0);
|
||||
((Buffer)readBuffer).limit(0);
|
||||
setGrabbed(isGrabbed);
|
||||
}
|
||||
|
||||
|
|
@ -383,7 +384,7 @@ public class Mouse {
|
|||
private static void read() {
|
||||
readBuffer.compact();
|
||||
implementation.readMouse(readBuffer);
|
||||
readBuffer.flip();
|
||||
((Buffer)readBuffer).flip();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
*/
|
||||
package org.lwjgl.openal;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
|
|
@ -177,7 +178,7 @@ public final class ALC11 {
|
|||
try {
|
||||
IntBuffer ib = BufferUtils.createIntBuffer(2);
|
||||
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);
|
||||
|
||||
int major = ib.get(0);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ final class APIUtil {
|
|||
buffer = BufferUtils.createByteBuffer(size);
|
||||
caps.util.buffer = buffer;
|
||||
} else
|
||||
buffer.clear();
|
||||
((Buffer)buffer).clear();
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
|
@ -114,8 +114,8 @@ final class APIUtil {
|
|||
bufferNew.put(buffer);
|
||||
caps.util.buffer = (buffer = bufferNew);
|
||||
} else {
|
||||
buffer.position(buffer.limit());
|
||||
buffer.limit(buffer.capacity());
|
||||
((Buffer)buffer).position(buffer.limit());
|
||||
((Buffer)buffer).limit(buffer.capacity());
|
||||
}
|
||||
|
||||
return buffer;
|
||||
|
|
@ -193,7 +193,7 @@ final class APIUtil {
|
|||
*/
|
||||
static long getBuffer(final ContextCapabilities caps, final CharSequence string) {
|
||||
final ByteBuffer buffer = encode(getBufferByte(caps, string.length()), string);
|
||||
buffer.flip();
|
||||
((Buffer)buffer).flip();
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ final class APIUtil {
|
|||
*/
|
||||
static long getBuffer(final ContextCapabilities caps, final CharSequence string, final int offset) {
|
||||
final ByteBuffer buffer = encode(getBufferByteOffset(caps, offset + string.length()), string);
|
||||
buffer.flip();
|
||||
((Buffer)buffer).flip();
|
||||
return MemoryUtil.getAddress(buffer);
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ final class APIUtil {
|
|||
static long getBufferNT(final ContextCapabilities caps, final CharSequence string) {
|
||||
final ByteBuffer buffer = encode(getBufferByte(caps, string.length() + 1), string);
|
||||
buffer.put((byte)0);
|
||||
buffer.flip();
|
||||
((Buffer)buffer).flip();
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ final class APIUtil {
|
|||
for ( CharSequence string : strings )
|
||||
encode(buffer, string);
|
||||
|
||||
buffer.flip();
|
||||
((Buffer)buffer).flip();
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ final class APIUtil {
|
|||
buffer.put((byte)0);
|
||||
}
|
||||
|
||||
buffer.flip();
|
||||
((Buffer)buffer).flip();
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ final class APIUtil {
|
|||
for ( CharSequence string : strings )
|
||||
buffer.put(string.length());
|
||||
|
||||
buffer.flip();
|
||||
((Buffer)buffer).flip();
|
||||
return MemoryUtil.getAddress0(buffer);
|
||||
}
|
||||
|
||||
|
|
@ -293,4 +293,4 @@ final class APIUtil {
|
|||
return MemoryUtil.getAddress0(getBufferByte(caps, 0));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ import java.awt.*;
|
|||
import java.awt.event.ComponentAdapter;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.security.AccessController;
|
||||
|
|
@ -1222,8 +1223,8 @@ public final class Display {
|
|||
cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity());
|
||||
int old_position = icons[i].position();
|
||||
cached_icons[i].put(icons[i]);
|
||||
icons[i].position(old_position);
|
||||
cached_icons[i].flip();
|
||||
((Buffer)icons[i]).position(old_position);
|
||||
((Buffer)cached_icons[i]).flip();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ package org.lwjgl.opengl;
|
|||
* @author elias_naur
|
||||
*/
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
class EventQueue {
|
||||
|
|
@ -58,12 +59,12 @@ class EventQueue {
|
|||
* Copy available events into the specified buffer.
|
||||
*/
|
||||
public synchronized void copyEvents(ByteBuffer dest) {
|
||||
queue.flip();
|
||||
((Buffer)queue).flip();
|
||||
int old_limit = queue.limit();
|
||||
if (dest.remaining() < queue.remaining())
|
||||
queue.limit(dest.remaining() + queue.position());
|
||||
((Buffer)queue).limit(dest.remaining() + queue.position());
|
||||
dest.put(queue);
|
||||
queue.limit(old_limit);
|
||||
((Buffer)queue).limit(old_limit);
|
||||
queue.compact();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ package org.lwjgl.opengl;
|
|||
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.HashMap;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
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) {
|
||||
event.clear();
|
||||
((Buffer)event).clear();
|
||||
event.putInt(key_code).put(state).putInt(character).putLong(nanos).put(repeat ? (byte)1 : (byte)0);
|
||||
event.flip();
|
||||
((Buffer)event).flip();
|
||||
putEvent(event);
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +220,7 @@ final class MacOSXNativeKeyboard extends EventQueue {
|
|||
flushDeferredEvent();
|
||||
int old_position = key_down_buffer.position();
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ package org.lwjgl.opengl;
|
|||
* @author kappaOne <one.kappa@gmail.com>
|
||||
*/
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
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) {
|
||||
event.clear();
|
||||
((Buffer)event).clear();
|
||||
event.put(button).put(state).putInt(coord1).putInt(coord2).putInt(dz).putLong(nanos);
|
||||
event.flip();
|
||||
((Buffer)event).flip();
|
||||
putEvent(event);
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +175,7 @@ final class MacOSXNativeMouse extends EventQueue {
|
|||
accum_dx = accum_dy = accum_dz = 0;
|
||||
int old_position = buttons_buffer.position();
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ import java.util.concurrent.Future;
|
|||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.jar.JarOutputStream;
|
||||
import java.util.jar.Pack200;
|
||||
import java.util.zip.CRC32;
|
||||
import java.util.zip.CheckedInputStream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
|
@ -376,12 +375,12 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
|
|||
}
|
||||
|
||||
// check pack200 support
|
||||
try {
|
||||
java.util.jar.Pack200.class.getSimpleName();
|
||||
pack200Supported = true;
|
||||
} catch (Throwable e) {
|
||||
/* no pack200 support */
|
||||
}
|
||||
// try {
|
||||
// java.util.jar.Pack200.class.getSimpleName();
|
||||
// pack200Supported = true;
|
||||
// } catch (Throwable e) {
|
||||
// /* no pack200 support */
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1680,20 +1679,21 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
|
|||
* @throws Exception if any errors occur
|
||||
*/
|
||||
protected void extractPack(String in, String out) throws Exception {
|
||||
File f = new File(in);
|
||||
FileOutputStream fostream = new FileOutputStream(out);
|
||||
JarOutputStream jostream = new JarOutputStream(fostream);
|
||||
throw new UnsupportedOperationException();
|
||||
// File f = new File(in);
|
||||
// FileOutputStream fostream = new FileOutputStream(out);
|
||||
// JarOutputStream jostream = new JarOutputStream(fostream);
|
||||
|
||||
try {
|
||||
Pack200.Unpacker unpacker = Pack200.newUnpacker();
|
||||
unpacker.unpack(f, jostream);
|
||||
} finally {
|
||||
jostream.close();
|
||||
fostream.close();
|
||||
}
|
||||
// try {
|
||||
// Pack200.Unpacker unpacker = Pack200.newUnpacker();
|
||||
// unpacker.unpack(f, jostream);
|
||||
// } finally {
|
||||
// jostream.close();
|
||||
// fostream.close();
|
||||
// }
|
||||
|
||||
// delete pack file as its no longer needed
|
||||
f.delete();
|
||||
// // delete pack file as its no longer needed
|
||||
// f.delete();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import javax.tools.Diagnostic;
|
|||
* @version $Revision$ $Id$
|
||||
*/
|
||||
@SupportedAnnotationTypes({ "*" })
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_7)
|
||||
@SupportedOptions({ "binpath", "typemap", "generatechecks", "contextspecific" })
|
||||
public class GeneratorProcessor extends AbstractProcessor {
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
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);
|
||||
|
||||
if ( methods.size() > 0 ) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
|
|||
* @author Spasi
|
||||
*/
|
||||
@SupportedAnnotationTypes({ "*" })
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_7)
|
||||
@SupportedOptions({ "generatechecks", "contextspecific" })
|
||||
public class CLGeneratorProcessor extends AbstractProcessor {
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
|
|||
* 2010-04-09 23:57:40Z spasi $
|
||||
*/
|
||||
@SupportedAnnotationTypes({ "*" })
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_7)
|
||||
@SupportedOptions({ "contextspecific", "generatechecks" })
|
||||
public class GLESGeneratorProcessor extends AbstractProcessor {
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
|
|||
* 2010-04-09 23:57:40Z spasi $
|
||||
*/
|
||||
@SupportedAnnotationTypes({ "*" })
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_7)
|
||||
@SupportedOptions({ "generatechecks", "contextspecific" })
|
||||
public class GLGeneratorProcessor extends AbstractProcessor {
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ import javax.lang.model.util.ElementFilter;
|
|||
* 2009-09-08 15:07:15Z spasi $
|
||||
*/
|
||||
@SupportedAnnotationTypes({ "*" })
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_7)
|
||||
@SupportedOptions({ "generatechecks", "contextspecific" })
|
||||
public class GLReferencesGeneratorProcessor extends AbstractProcessor {
|
||||
|
||||
|
|
|
|||
|
|
@ -39,11 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <jni.h>
|
||||
#ifdef __MACH__
|
||||
#include <JavaVM/jawt_md.h>
|
||||
#else
|
||||
#include <jawt_md.h>
|
||||
#endif
|
||||
#include "org_lwjgl_opengl_AWTSurfaceLock.h"
|
||||
#include "awt_tools.h"
|
||||
#include "common_tools.h"
|
||||
|
|
|
|||
|
|
@ -50,6 +50,11 @@
|
|||
#include "common_tools.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 {
|
||||
NSControlLeftKeyMask = 0x0001,
|
||||
NSControlRightKeyMask = 0x2000,
|
||||
|
|
|
|||
|
|
@ -101,10 +101,11 @@ NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool g
|
|||
bpp = 16;
|
||||
else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
bpp = 8;
|
||||
else
|
||||
bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
|
||||
else {
|
||||
throwException(env, "unknown pixel encoding");
|
||||
}
|
||||
} else {
|
||||
bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
|
||||
throwException(env, "unreachable");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
12
src/native/macosx/org_lwjgl_MacOSXSysImplementation.m
Normal file
12
src/native/macosx/org_lwjgl_MacOSXSysImplementation.m
Normal 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -77,10 +77,7 @@ static NSUInteger lastModifierFlags = 0;
|
|||
// Inform the view of its parent window info;
|
||||
[window_info->view setParent:window_info];
|
||||
|
||||
if (window_info->enableHighDPI) {
|
||||
// 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];
|
||||
}
|
||||
[window_info->view setWantsBestResolutionOpenGLSurface:NO];
|
||||
|
||||
// set nsapp delegate for catching app quit events
|
||||
[NSApp setDelegate:window_info->view];
|
||||
|
|
@ -261,7 +258,9 @@ static NSUInteger lastModifierFlags = 0;
|
|||
if (context == nil) return;
|
||||
|
||||
if ([context view] != self) {
|
||||
[context setView:self];
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[context setView:self];
|
||||
});
|
||||
}
|
||||
|
||||
[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);
|
||||
window_info->display_rect = NSMakeRect(x, y, width, height);
|
||||
[window_info->window setFrame:window_info->display_rect display:false];
|
||||
[window_info->view update];
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[window_info->view update];
|
||||
});
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nWasResized(JNIEnv *env, jobject this, jobject window_handle) {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nUpdate
|
|||
(JNIEnv *env, jclass clazz, jobject context_handle) {
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
|
||||
[context_info->context update];
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[context_info->context update];
|
||||
});
|
||||
[pool release];
|
||||
}
|
||||
|
||||
|
|
@ -163,7 +165,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_setView
|
|||
peer_info->glLayer->setViewport = YES;
|
||||
}
|
||||
|
||||
[context_info->context setView: peer_info->window_info->view];
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[context_info->context setView: peer_info->window_info->view];
|
||||
});
|
||||
}
|
||||
else {
|
||||
[context_info->context setPixelBuffer:peer_info->pbuffer cubeMapFace:0 mipMapLevel:0 currentVirtualScreen:0];
|
||||
|
|
|
|||
Loading…
Reference in a new issue