diff --git a/src/java/org/lwjgl/opengl/GLCaps.java b/src/java/org/lwjgl/opengl/GLCaps.java index 6094dea8..e7954e68 100644 --- a/src/java/org/lwjgl/opengl/GLCaps.java +++ b/src/java/org/lwjgl/opengl/GLCaps.java @@ -70,6 +70,7 @@ public abstract class GLCaps { public static boolean GL_ARB_transpose_matrix; public static boolean GL_ARB_vertex_blend; public static boolean GL_ARB_vertex_program; + public static boolean GL_ARB_fragment_program; public static boolean GL_ARB_vertex_buffer_object; public static boolean GL_ARB_window_pos; public static boolean GL_EXT_abgr; diff --git a/src/java/org/lwjgl/opengl/GLConstants.java b/src/java/org/lwjgl/opengl/GLConstants.java index adff4ef8..005b89f2 100644 --- a/src/java/org/lwjgl/opengl/GLConstants.java +++ b/src/java/org/lwjgl/opengl/GLConstants.java @@ -76,6 +76,7 @@ public interface GLConstants ARBVertexBlend, ARBVertexBufferObject, ARBVertexProgram, + ARBFragmentProgram, ATIElementArray, ATIEnvmapBumpmap, ATIFragmentShader, diff --git a/src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java b/src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java new file mode 100644 index 00000000..2c3d4d68 --- /dev/null +++ b/src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Light Weight Java Game Library' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * Created by IntelliJ IDEA. + * User: nj + * Date: 12-08-2002 + * Time: 16:02:30 + * To change template for new interface use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package org.lwjgl.opengl.arb; + +public interface ARBFragmentProgram +{ + public static final int GL_PROGRAM_LENGTH_ARB = 0x8627; + public static final int GL_PROGRAM_FORMAT_ARB = 0x8876; + public static final int GL_PROGRAM_BINDING_ARB = 0x8677; + public static final int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0; + public static final int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; + public static final int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; + public static final int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; + public static final int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4; + public static final int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; + public static final int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; + public static final int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; + public static final int GL_PROGRAM_PARAMETERS_ARB = 0x88A8; + public static final int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; + public static final int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; + public static final int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; + public static final int GL_PROGRAM_ATTRIBS_ARB = 0x88AC; + public static final int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; + public static final int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; + public static final int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; + public static final int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; + public static final int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; + public static final int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; + public static final int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; + public static final int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; + public static final int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; + public static final int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; + public static final int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; + public static final int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; + public static final int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; + public static final int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; + public static final int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; + public static final int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; + public static final int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; + public static final int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; + public static final int GL_PROGRAM_STRING_ARB = 0x8628; + public static final int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B; + public static final int GL_CURRENT_MATRIX_ARB = 0x8641; + public static final int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; + public static final int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; + public static final int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F; + public static final int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; + public static final int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; + public static final int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; + public static final int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; + public static final int GL_MATRIX0_ARB = 0x88C0; + public static final int GL_MATRIX1_ARB = 0x88C1; + public static final int GL_MATRIX2_ARB = 0x88C2; + public static final int GL_MATRIX3_ARB = 0x88C3; + public static final int GL_MATRIX4_ARB = 0x88C4; + public static final int GL_MATRIX5_ARB = 0x88C5; + public static final int GL_MATRIX6_ARB = 0x88C6; + public static final int GL_MATRIX7_ARB = 0x88C7; + public static final int GL_MATRIX8_ARB = 0x88C8; + public static final int GL_MATRIX9_ARB = 0x88C9; + public static final int GL_MATRIX10_ARB = 0x88CA; + public static final int GL_MATRIX11_ARB = 0x88CB; + public static final int GL_MATRIX12_ARB = 0x88CC; + public static final int GL_MATRIX13_ARB = 0x88CD; + public static final int GL_MATRIX14_ARB = 0x88CE; + public static final int GL_MATRIX15_ARB = 0x88CF; + public static final int GL_MATRIX16_ARB = 0x88D0; + public static final int GL_MATRIX17_ARB = 0x88D1; + public static final int GL_MATRIX18_ARB = 0x88D2; + public static final int GL_MATRIX19_ARB = 0x88D3; + public static final int GL_MATRIX20_ARB = 0x88D4; + public static final int GL_MATRIX21_ARB = 0x88D5; + public static final int GL_MATRIX22_ARB = 0x88D6; + public static final int GL_MATRIX23_ARB = 0x88D7; + public static final int GL_MATRIX24_ARB = 0x88D8; + public static final int GL_MATRIX25_ARB = 0x88D9; + public static final int GL_MATRIX26_ARB = 0x88DA; + public static final int GL_MATRIX27_ARB = 0x88DB; + public static final int GL_MATRIX28_ARB = 0x88DC; + public static final int GL_MATRIX29_ARB = 0x88DD; + public static final int GL_MATRIX30_ARB = 0x88DE; + public static final int GL_MATRIX31_ARB = 0x88DF; +} diff --git a/src/native/ltmain.sh b/src/native/ltmain.sh index dd490ba9..7883e23e 100644 --- a/src/native/ltmain.sh +++ b/src/native/ltmain.sh @@ -48,9 +48,6 @@ EOF exit 0 fi -# define SED for historic ltconfig's generated by Libtool 1.3 -test -z "$SED" && SED=sed - # The name of this program. progname=`$echo "$0" | ${SED} 's%^.*/%%'` modename="$progname" @@ -771,7 +768,6 @@ compiler." linker_flags= dllsearchpath= lib_search_path=`pwd` - inst_prefix_dir= avoid_version=no dlfiles= @@ -902,11 +898,6 @@ compiler." prev= continue ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; release) release="-$arg" prev= @@ -1008,11 +999,6 @@ compiler." continue ;; - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) @@ -1328,11 +1314,11 @@ compiler." output_objdir="$output_objdir/$objdir" fi # Create the object directory. - if test ! -d $output_objdir; then + if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" - $run $mkdir $output_objdir + $run $mkdir "$output_objdir" status=$? - if test $status -ne 0 && test ! -d $output_objdir; then + if test $status -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi @@ -1564,7 +1550,7 @@ compiler." if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || - { test $linkmode = oldlib && test $linkmode = obj; }; then + { test $linkmode != lib && test $linkmode != prog; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" @@ -1907,16 +1893,7 @@ compiler." if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then - # Try looking first in the location we're being installed to. - add_dir= - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="-L$inst_prefix_dir$libdir" - ;; - esac - fi - add_dir="$add_dir -L$libdir" + add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in @@ -1926,16 +1903,11 @@ compiler." add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. - # Try looking first in the location we're being installed to. - add_dir= - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="-L$inst_prefix_dir$libdir" - ;; - esac + if test "X$installed" = Xyes; then + add_dir="-L$libdir" + else + add_dir="-L$DESTDIR$libdir" fi - add_dir="$add_dir -L$libdir" add="-l$name" fi @@ -2268,7 +2240,7 @@ compiler." # Check that each of the things are valid numbers. case $current in - [0-9]*) ;; + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 @@ -2277,7 +2249,7 @@ compiler." esac case $revision in - [0-9]*) ;; + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 @@ -2286,7 +2258,7 @@ compiler." esac case $age in - [0-9]*) ;; + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 @@ -2643,6 +2615,13 @@ EOF *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done + # It is ok to link against an archive when + # building a shared library. + if $AR -t $potlib > /dev/null 2>&1; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | egrep "$file_magic_regex" > /dev/null; then @@ -3960,7 +3939,7 @@ fi\ fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. @@ -4243,12 +4222,21 @@ relink_command=\"$relink_command\"" esac # Add the libdir to current_libdirs if it is the destination. + DESTDIR= if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else + case "$destdir" in + *"$libdir") + DESTDIR=`$echo "$destdir" | sed -e 's!'"$libdir"'$!!'` + if test "X$destdir" != "X$DESTDIR$libdir"; then + DESTDIR= + fi + ;; + esac # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; @@ -4261,32 +4249,16 @@ relink_command=\"$relink_command\"" dir="$dir$objdir" if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit 1 - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` - fi - $echo "$modename: warning: relinking \`$file'" 1>&2 + export DESTDIR $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit 1 + continue fi fi + unset DESTDIR # See the names of the shared library. set dummy $library_names @@ -4447,13 +4419,11 @@ relink_command=\"$relink_command\"" if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir_mktemp=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` - if test $? = 0 ; then - tmpdir="$tmpdir_mktemp" - unset tmpdir_mktemp - else - tmpdir="$tmpdir/libtool-$$" - fi + tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` + if test $? = 0 ; then : + else + tmpdir="$tmpdir/libtool-$$" + fi if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 @@ -4867,9 +4837,23 @@ relink_command=\"$relink_command\"" ;; *.lo) - if test "$build_old_libs" = yes; then - oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` - rmfiles="$rmfiles $dir/$oldobj" + # Possibly a libtool object, so verify it. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi fi ;;