GLES2

Check-in [3f269e25b1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3f269e25b193a2f6892c1945d77ca35fab2b7bcd
User & Date: arnulf 2013-08-20 15:29:37
Context
2013-08-22
21:21
code for diamond bevels check-in: 44bf939a3d user: arnulf tags: trunk
2013-08-20
15:29
fixes check-in: 3f269e25b1 user: arnulf tags: trunk
2013-08-19
14:58
commented out a lot of debug output check-in: 900b282b3b user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
MAKE_STATIC_LIB	= ${STLIB_LD} $@ $(PKG_OBJECTS)
MAKE_STUB_LIB	= ${STLIB_LD} $@ $(PKG_STUB_OBJECTS)
OBJEXT		= o
RANLIB		= :
RANLIB_STUB	= ranlib
SHLIB_CFLAGS	= -fPIC
SHLIB_LD	= ${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}
SHLIB_LD_LIBS	= ${LIBS} -L/home/arnulf/SOURCES/TCL/tclhead/unix -ltclstub8.6
STLIB_LD	= ${AR} cr
TCL_DEFS	= -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.6\" -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DHAVE_ZLIB=1 -DMODULE_SCOPE=extern -DHAVE_CAST_TO_UNION=1 -DTCL_SHLIB_EXT=\".so\" -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_MKSTEMP=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GETADDRINFO=1 -DHAVE_FREEADDRINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_STRUCT_ADDRINFO=1 -DHAVE_STRUCT_IN6_ADDR=1 -DHAVE_STRUCT_SOCKADDR_IN6=1 -DHAVE_STRUCT_SOCKADDR_STORAGE=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_MKSTEMPS=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 -DHAVE_CPUID=1 
TCL_BIN_DIR	= /home/arnulf/SOURCES/TCL/tclhead/unix
TCL_SRC_DIR	= /home/arnulf/SOURCES/TCL/tclhead

# Not used, but retained for reference of what libs Tcl required
TCL_LIBS	= ${DL_LIBS} ${LIBS} ${MATH_LIBS}
................................................................................
		  LD_LIBRARY_PATH="$(EXTRA_PATH):$(LD_LIBRARY_PATH)" \
		  PATH="$(EXTRA_PATH):$(PATH)" \
		  TCLLIBPATH="$(top_builddir)"
TCLSH_PROG	= /home/arnulf/SOURCES/TCL/tclhead/unix/tclsh
TCLSH		= $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG)
SHARED_BUILD	= 1

INCLUDES	=  -I. -I/usr/include/freetype2 -I"./generic" -I"/home/arnulf/SOURCES/TCL/tclhead/generic" -I"/home/arnulf/SOURCES/TCL/tclhead/unix"

PKG_CFLAGS	=  -DGLES2_DEBUG

DEFS		= -DPACKAGE_NAME=\"gles2\" -DPACKAGE_TARNAME=\"gles2\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"gles2\ 0.0.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DBUILD_gles2=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DTCL_THREADS=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_INTPTR_T=1 -DUSE_TCL_STUBS=1 $(PKG_CFLAGS) \
		  -DGLES2_LIBRARY=\"$(pkglibdir)\"

CONFIG_CLEAN_FILES =  Makefile gles2Config.sh pkgIndex.tcl

CPPFLAGS	= 
LIBS		=  -lSDL -lm -ldl -lEGL -lGLESv2 -lfreetype -lX11 
AR		= ar
CFLAGS		=  -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} 
COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)

#========================================================================
# Start of user-definable TARGETS section
#========================================================================







|







 







|









|







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
MAKE_STATIC_LIB	= ${STLIB_LD} $@ $(PKG_OBJECTS)
MAKE_STUB_LIB	= ${STLIB_LD} $@ $(PKG_STUB_OBJECTS)
OBJEXT		= o
RANLIB		= :
RANLIB_STUB	= ranlib
SHLIB_CFLAGS	= -fPIC
SHLIB_LD	= ${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}
SHLIB_LD_LIBS	= ${LIBS} -L/home/arnulf/SOURCES/TCL/tclhead/unix -ltclstub8.6 -L/home/arnulf/SOURCES/TCL/tkhead/unix -ltkstub8.6
STLIB_LD	= ${AR} cr
TCL_DEFS	= -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.6\" -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DHAVE_ZLIB=1 -DMODULE_SCOPE=extern -DHAVE_CAST_TO_UNION=1 -DTCL_SHLIB_EXT=\".so\" -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_MKSTEMP=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GETADDRINFO=1 -DHAVE_FREEADDRINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_STRUCT_ADDRINFO=1 -DHAVE_STRUCT_IN6_ADDR=1 -DHAVE_STRUCT_SOCKADDR_IN6=1 -DHAVE_STRUCT_SOCKADDR_STORAGE=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_MKSTEMPS=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 -DHAVE_CPUID=1 
TCL_BIN_DIR	= /home/arnulf/SOURCES/TCL/tclhead/unix
TCL_SRC_DIR	= /home/arnulf/SOURCES/TCL/tclhead

# Not used, but retained for reference of what libs Tcl required
TCL_LIBS	= ${DL_LIBS} ${LIBS} ${MATH_LIBS}
................................................................................
		  LD_LIBRARY_PATH="$(EXTRA_PATH):$(LD_LIBRARY_PATH)" \
		  PATH="$(EXTRA_PATH):$(PATH)" \
		  TCLLIBPATH="$(top_builddir)"
TCLSH_PROG	= /home/arnulf/SOURCES/TCL/tclhead/unix/tclsh
TCLSH		= $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG)
SHARED_BUILD	= 1

INCLUDES	=  -I. -I/usr/include/freetype2 -I"./generic" -I"/home/arnulf/SOURCES/TCL/tclhead/generic" -I"/home/arnulf/SOURCES/TCL/tclhead/unix" -I"/home/arnulf/SOURCES/TCL/tkhead/generic" -I"/home/arnulf/SOURCES/TCL/tkhead/unix" -I"/home/arnulf/SOURCES/TCL/tkhead/generic/ttk"

PKG_CFLAGS	=  -DGLES2_DEBUG

DEFS		= -DPACKAGE_NAME=\"gles2\" -DPACKAGE_TARNAME=\"gles2\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"gles2\ 0.0.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DBUILD_gles2=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DTCL_THREADS=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_INTPTR_T=1 -DUSE_TCL_STUBS=1 $(PKG_CFLAGS) \
		  -DGLES2_LIBRARY=\"$(pkglibdir)\"

CONFIG_CLEAN_FILES =  Makefile gles2Config.sh pkgIndex.tcl

CPPFLAGS	= 
LIBS		=  /home/arnulf/lib/libtk8.6.so -lSDL -lm -ldl -lEGL -lGLESv2 -lfreetype -lX11 
AR		= ar
CFLAGS		=  -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} 
COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)

#========================================================================
# Start of user-definable TARGETS section
#========================================================================

Changes to Makefile.in.

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
		  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
		  PATH="$(EXTRA_PATH):$(PATH)" \
		  TCLLIBPATH="$(top_builddir)"
TCLSH_PROG	= @TCLSH_PROG@
TCLSH		= $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG)
SHARED_BUILD	= @SHARED_BUILD@

INCLUDES	= @PKG_INCLUDES@ @TCL_INCLUDES@

PKG_CFLAGS	= @PKG_CFLAGS@

DEFS		= @DEFS@ $(PKG_CFLAGS) \
		  -DGLES2_LIBRARY=\"$(pkglibdir)\"

CONFIG_CLEAN_FILES = @CONFIG_CLEAN_FILES@ Makefile gles2Config.sh pkgIndex.tcl







|







128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
		  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
		  PATH="$(EXTRA_PATH):$(PATH)" \
		  TCLLIBPATH="$(top_builddir)"
TCLSH_PROG	= @TCLSH_PROG@
TCLSH		= $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG)
SHARED_BUILD	= @SHARED_BUILD@

INCLUDES	= @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@

PKG_CFLAGS	= @PKG_CFLAGS@

DEFS		= @DEFS@ $(PKG_CFLAGS) \
		  -DGLES2_LIBRARY=\"$(pkglibdir)\"

CONFIG_CLEAN_FILES = @CONFIG_CLEAN_FILES@ Makefile gles2Config.sh pkgIndex.tcl

Changes to configure.

652
653
654
655
656
657
658



659
660
661
662
663
664
665
...
668
669
670
671
672
673
674











675
676
677
678
679
680
681
...
739
740
741
742
743
744
745

746

747
748
749
750
751
752
753
....
1378
1379
1380
1381
1382
1383
1384

1385

1386
1387
1388
1389
1390
1391
1392
....
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670




















































































































































































































































2671
2672
2673
2674
2675
2676
2677
....
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
....
5085
5086
5087
5088
5089
5090
5091










































































































































































5092
5093
5094
5095
5096
5097
5098
....
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
....
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
CFLAGS_WARNING
CFLAGS_OPTIMIZE
CFLAGS_DEBUG
RC
CELIB_DIR
AR
SHARED_BUILD



TCL_TOP_DIR_NATIVE
TCL_INCLUDES
PKG_OBJECTS
PKG_SOURCES
MATH_LIBS
EGREP
GREP
................................................................................
CPP
OBJEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC











TCL_SHLIB_LD_LIBS
TCL_LD_FLAGS
TCL_EXTRA_CFLAGS
TCL_DEFS
TCL_LIBS
CLEANFILES
TCL_STUB_LIB_SPEC
................................................................................
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
with_tcl

with_tclinclude

enable_shared
enable_64bit
enable_64bit_vis
enable_rpath
enable_wince
with_celib
enable_symbols
................................................................................
  --enable-symbols        build with debugging symbols (default: off)

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-tcl              directory containing tcl configuration
                          (tclConfig.sh)

  --with-tclinclude       directory containing the public Tcl header files

  --with-celib=DIR        use Windows/CE support library from DIR

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
................................................................................





if test "${TCL_VERSION}" != "8.6"; then
    as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
Itcl ${PACKAGE_VERSION} needs Tcl 8.6.
Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6." "$LINENO" 5
fi





















































































































































































































































#-----------------------------------------------------------------------
# Handle the --prefix=... option by defaulting to what Tcl gave.
# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
#-----------------------------------------------------------------------


................................................................................
# contain private data structures and are subject to change without
# notice.
# This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
# so that we can extract TCL_SRC_DIR from the config file (in the case
# of private headers
#--------------------------------------------------------------------

#TEA_PUBLIC_TCL_HEADERS

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5
$as_echo_n "checking for Tcl public headers... " >&6; }


# Check whether --with-tclinclude was given.
if test "${with_tclinclude+set}" = set; then :
................................................................................
	else
	    if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
		as_fn_error $? "Cannot find private header tclInt.h in ${TCL_SRC_DIR}" "$LINENO" 5
	    fi
	    result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}"
	fi
    fi














































































































































































    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${result}" >&5
$as_echo "${result}" >&6; }

................................................................................
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TCLSH_PROG}" >&5
$as_echo "${TCLSH_PROG}" >&6; }



#--------------------------------------------------------------------
# These are for itclConfig.sh
#--------------------------------------------------------------------


    #--------------------------------------------------------------------
    # These are for gles2Config.sh
    #--------------------------------------------------------------------

................................................................................





# itcl_SRC_DIR must be a fully qualified path
eval gles2_SRC_DIR="$srcdir"
gles2_SRC_DIR=`cd "${itcl_SRC_DIR}"; pwd`


eval gles2_INCLUDE_SPEC="${gles2_SRC_DIR}/generic"


#--------------------------------------------------------------------
# Finally, substitute all of the various values into the Makefile.







>
>
>







 







>
>
>
>
>
>
>
>
>
>
>







 







>

>







 







>

>







 







|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







 







|







652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
...
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
...
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
....
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
....
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
....
5211
5212
5213
5214
5215
5216
5217

5218
5219
5220
5221
5222
5223
5224
....
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
....
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
....
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
CFLAGS_WARNING
CFLAGS_OPTIMIZE
CFLAGS_DEBUG
RC
CELIB_DIR
AR
SHARED_BUILD
TK_XLIB_DIR_NATIVE
TK_TOP_DIR_NATIVE
TK_INCLUDES
TCL_TOP_DIR_NATIVE
TCL_INCLUDES
PKG_OBJECTS
PKG_SOURCES
MATH_LIBS
EGREP
GREP
................................................................................
CPP
OBJEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
TK_XINCLUDES
TK_LIBS
TK_STUB_LIB_SPEC
TK_STUB_LIB_FLAG
TK_STUB_LIB_FILE
TK_LIB_SPEC
TK_LIB_FLAG
TK_LIB_FILE
TK_SRC_DIR
TK_BIN_DIR
TK_VERSION
TCL_SHLIB_LD_LIBS
TCL_LD_FLAGS
TCL_EXTRA_CFLAGS
TCL_DEFS
TCL_LIBS
CLEANFILES
TCL_STUB_LIB_SPEC
................................................................................
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
with_tcl
with_tk
with_tclinclude
with_tkinclude
enable_shared
enable_64bit
enable_64bit_vis
enable_rpath
enable_wince
with_celib
enable_symbols
................................................................................
  --enable-symbols        build with debugging symbols (default: off)

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-tcl              directory containing tcl configuration
                          (tclConfig.sh)
  --with-tk               directory containing tk configuration (tkConfig.sh)
  --with-tclinclude       directory containing the public Tcl header files
  --with-tkinclude        directory containing the public Tk header files
  --with-celib=DIR        use Windows/CE support library from DIR

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
................................................................................





if test "${TCL_VERSION}" != "8.6"; then
    as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
gles2 ${PACKAGE_VERSION} needs Tcl 8.6.
Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6." "$LINENO" 5
fi

#--------------------------------------------------------------------
# Load the tkConfig.sh file
#--------------------------------------------------------------------


    #
    # Ok, lets find the tk configuration
    # First, look for one uninstalled.
    # the alternative search directory is invoked by --with-tk
    #

    if test x"${no_tk}" = x ; then
	# we reset no_tk in case something fails here
	no_tk=true

# Check whether --with-tk was given.
if test "${with_tk+set}" = set; then :
  withval=$with_tk; with_tkconfig="${withval}"
fi

	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk configuration" >&5
$as_echo_n "checking for Tk configuration... " >&6; }
	if ${ac_cv_c_tkconfig+:} false; then :
  $as_echo_n "(cached) " >&6
else


	    # First check to see if --with-tkconfig was specified.
	    if test x"${with_tkconfig}" != x ; then
		case "${with_tkconfig}" in
		    */tkConfig.sh )
			if test -f "${with_tkconfig}"; then
			    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5
$as_echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;}
			    with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
			fi ;;
		esac
		if test -f "${with_tkconfig}/tkConfig.sh" ; then
		    ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
		else
		    as_fn_error $? "${with_tkconfig} directory doesn't contain tkConfig.sh" "$LINENO" 5
		fi
	    fi

	    # then check for a private Tk library
	    if test x"${ac_cv_c_tkconfig}" = x ; then
		for i in \
			../tk \
			`ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
			`ls -dr ../tk[8-9].[0-9] 2>/dev/null` \
			`ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \
			../../tk \
			`ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
			`ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \
			`ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \
			../../../tk \
			`ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
			`ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \
			`ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do
		    if test "${TEA_PLATFORM}" = "windows" \
			    -a -f "$i/win/tkConfig.sh" ; then
			ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
			break
		    fi
		    if test -f "$i/unix/tkConfig.sh" ; then
			ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
			break
		    fi
		done
	    fi

	    # on Darwin, check in Framework installation locations
	    if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
		for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
			`ls -d /Library/Frameworks 2>/dev/null` \
			`ls -d /Network/Library/Frameworks 2>/dev/null` \
			`ls -d /System/Library/Frameworks 2>/dev/null` \
			; do
		    if test -f "$i/Tk.framework/tkConfig.sh" ; then
			ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
			break
		    fi
		done
	    fi

	    # check in a few common install locations
	    if test x"${ac_cv_c_tkconfig}" = x ; then
		for i in `ls -d ${libdir} 2>/dev/null` \
			`ls -d ${exec_prefix}/lib 2>/dev/null` \
			`ls -d ${prefix}/lib 2>/dev/null` \
			`ls -d /usr/local/lib 2>/dev/null` \
			`ls -d /usr/contrib/lib 2>/dev/null` \
			`ls -d /usr/lib 2>/dev/null` \
			`ls -d /usr/lib64 2>/dev/null` \
			; do
		    if test -f "$i/tkConfig.sh" ; then
			ac_cv_c_tkconfig="`(cd $i; pwd)`"
			break
		    fi
		done
	    fi

	    # TEA specific: on Windows, check in common installation locations
	    if test "${TEA_PLATFORM}" = "windows" \
		-a x"${ac_cv_c_tkconfig}" = x ; then
		for i in `ls -d C:/Tcl/lib 2>/dev/null` \
			`ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
			; do
		    if test -f "$i/tkConfig.sh" ; then
			ac_cv_c_tkconfig="`(cd $i; pwd)`"
			break
		    fi
		done
	    fi

	    # check in a few other private locations
	    if test x"${ac_cv_c_tkconfig}" = x ; then
		for i in \
			${srcdir}/../tk \
			`ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
			`ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \
			`ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do
		    if test "${TEA_PLATFORM}" = "windows" \
			    -a -f "$i/win/tkConfig.sh" ; then
			ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
			break
		    fi
		    if test -f "$i/unix/tkConfig.sh" ; then
			ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
			break
		    fi
		done
	    fi

fi


	if test x"${ac_cv_c_tkconfig}" = x ; then
	    TK_BIN_DIR="# no Tk configs found"
	    as_fn_error $? "Can't find Tk configuration definitions" "$LINENO" 5
	else
	    no_tk=
	    TK_BIN_DIR="${ac_cv_c_tkconfig}"
	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5
$as_echo "found ${TK_BIN_DIR}/tkConfig.sh" >&6; }
	fi
    fi


    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5
$as_echo_n "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... " >&6; }

    if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5
$as_echo "loading" >&6; }
	. "${TK_BIN_DIR}/tkConfig.sh"
    else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5
$as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; }
    fi

    # eval is required to do the TK_DBGX substitution
    eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
    eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""

    # If the TK_BIN_DIR is the build directory (not the install directory),
    # then set the common variable name to the value of the build variables.
    # For example, the variable TK_LIB_SPEC will be set to the value
    # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
    # instead of TK_BUILD_LIB_SPEC since it will work with both an
    # installed and uninstalled version of Tcl.
    if test -f "${TK_BIN_DIR}/Makefile" ; then
        TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
        TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
        TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
    elif test "`uname -s`" = "Darwin"; then
	# If Tk was built as a framework, attempt to use the libraries
	# from the framework at the given location so that linking works
	# against Tk.framework installed in an arbitrary location.
	case ${TK_DEFS} in
	    *TK_FRAMEWORK*)
		if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
		    for i in "`cd "${TK_BIN_DIR}"; pwd`" \
			     "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
			if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
			    TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
			    break
			fi
		    done
		fi
		if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
		    TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}"  | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
		    TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
		fi
		;;
	esac
    fi

    # eval is required to do the TK_DBGX substitution
    eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
    eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
    eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
    eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""

    # TEA specific: Ensure windowingsystem is defined
    if test "${TEA_PLATFORM}" = "unix" ; then
	case ${TK_DEFS} in
	    *MAC_OSX_TK*)

$as_echo "#define MAC_OSX_TK 1" >>confdefs.h

		TEA_WINDOWINGSYSTEM="aqua"
		;;
	    *)
		TEA_WINDOWINGSYSTEM="x11"
		;;
	esac
    elif test "${TEA_PLATFORM}" = "windows" ; then
	TEA_WINDOWINGSYSTEM="win32"
    fi













    # TEA specific:




if test "${TK_VERSION}" != "8.6"; then
    as_fn_error $? "${TK_BIN_DIR}/tkConfig.sh is for Tk ${TK_VERSION}.
gles2 ${PACKAGE_VERSION} needs Tk 8.6.
Use --with-tk= option to indicate location of tkConfig.sh file for Tk 8.6." "$LINENO" 5
fi

#-----------------------------------------------------------------------
# Handle the --prefix=... option by defaulting to what Tcl gave.
# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
#-----------------------------------------------------------------------


................................................................................
# contain private data structures and are subject to change without
# notice.
# This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
# so that we can extract TCL_SRC_DIR from the config file (in the case
# of private headers
#--------------------------------------------------------------------



    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5
$as_echo_n "checking for Tcl public headers... " >&6; }


# Check whether --with-tclinclude was given.
if test "${with_tclinclude+set}" = set; then :
................................................................................
	else
	    if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
		as_fn_error $? "Cannot find private header tclInt.h in ${TCL_SRC_DIR}" "$LINENO" 5
	    fi
	    result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}"
	fi
    fi




    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${result}" >&5
$as_echo "${result}" >&6; }


    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk public headers" >&5
$as_echo_n "checking for Tk public headers... " >&6; }


# Check whether --with-tkinclude was given.
if test "${with_tkinclude+set}" = set; then :
  withval=$with_tkinclude; with_tkinclude=${withval}
fi


    if ${ac_cv_c_tkh+:} false; then :
  $as_echo_n "(cached) " >&6
else

	# Use the value from --with-tkinclude, if it was given

	if test x"${with_tkinclude}" != x ; then
	    if test -f "${with_tkinclude}/tk.h" ; then
		ac_cv_c_tkh=${with_tkinclude}
	    else
		as_fn_error $? "${with_tkinclude} directory does not contain tk.h" "$LINENO" 5
	    fi
	else
	    list=""
	    if test "`uname -s`" = "Darwin"; then
		# If Tk was built as a framework, attempt to use
		# the framework's Headers directory.
		case ${TK_DEFS} in
		    *TK_FRAMEWORK*)
			list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
			;;
		esac
	    fi

	    # Look in the source dir only if Tk is not installed,
	    # and in that situation, look there before installed locations.
	    if test -f "${TK_BIN_DIR}/Makefile" ; then
		list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
	    fi

	    # Check order: pkg --prefix location, Tk's --prefix location,
	    # relative to directory of tkConfig.sh, Tcl's --prefix location,
	    # relative to directory of tclConfig.sh.

	    eval "temp_includedir=${includedir}"
	    list="$list \
		`ls -d ${temp_includedir}        2>/dev/null` \
		`ls -d ${TK_PREFIX}/include      2>/dev/null` \
		`ls -d ${TK_BIN_DIR}/../include  2>/dev/null` \
		`ls -d ${TCL_PREFIX}/include     2>/dev/null` \
		`ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
	    if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
		list="$list /usr/local/include /usr/include"
		if test x"${TK_INCLUDE_SPEC}" != x ; then
		    d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
		    list="$list `ls -d ${d} 2>/dev/null`"
		fi
	    fi
	    for i in $list ; do
		if test -f "$i/tk.h" ; then
		    ac_cv_c_tkh=$i
		    break
		fi
	    done
	fi

fi


    # Print a message based on how we determined the include path

    if test x"${ac_cv_c_tkh}" = x ; then
	as_fn_error $? "tk.h not found.  Please specify its location with --with-tkinclude" "$LINENO" 5
    else
	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tkh}" >&5
$as_echo "${ac_cv_c_tkh}" >&6; }
    fi

    # Convert to a native path and substitute into the output files.

    INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`

    TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"



    if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
	# On Windows and Aqua, we need the X compat headers
	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5
$as_echo_n "checking for X11 header files... " >&6; }
	if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
	    INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
	    TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"

	fi
	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${INCLUDE_DIR_NATIVE}" >&5
$as_echo "${INCLUDE_DIR_NATIVE}" >&6; }
    fi


    # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh}

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk private include files" >&5
$as_echo_n "checking for Tk private include files... " >&6; }

    TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
    TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"

    # Check to see if tk<Plat>Port.h isn't already with the public headers
    # Don't look for tkInt.h because that resides with tk.h in the core
    # sources, but the <plat>Port headers are in a different directory
    if test "${TEA_PLATFORM}" = "windows" -a \
	-f "${ac_cv_c_tkh}/tkWinPort.h"; then
	result="private headers found with public headers"
    elif test "${TEA_PLATFORM}" = "unix" -a \
	-f "${ac_cv_c_tkh}/tkUnixPort.h"; then
	result="private headers found with public headers"
    else
	TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
	TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
	if test "${TEA_PLATFORM}" = "windows"; then
	    TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
	else
	    TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
	fi
	# Overwrite the previous TK_INCLUDES as this should capture both
	# public and private headers in the same set.
	# We want to ensure these are substituted so as not to require
	# any *_NATIVE vars be defined in the Makefile
	TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
	# Detect and add ttk subdir
	if test -d "${TK_SRC_DIR}/generic/ttk"; then
	   TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\""
	fi
	if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
	   TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\""
	fi
	if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
	   TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\""
	fi
	if test "`uname -s`" = "Darwin"; then
	    # If Tk was built as a framework, attempt to use
	    # the framework's Headers and PrivateHeaders directories
	    case ${TK_DEFS} in
		*TK_FRAMEWORK*)
			if test -d "${TK_BIN_DIR}/Headers" -a \
				-d "${TK_BIN_DIR}/PrivateHeaders"; then
			    TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"
			else
			    TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
			fi
			;;
	    esac
	    result="Using ${TK_INCLUDES}"
	else
	    if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then
	       as_fn_error $? "Cannot find private header tkInt.h in ${TK_SRC_DIR}" "$LINENO" 5
	    fi
	    result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}"
	fi
    fi





    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${result}" >&5
$as_echo "${result}" >&6; }

................................................................................
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TCLSH_PROG}" >&5
$as_echo "${TCLSH_PROG}" >&6; }



#--------------------------------------------------------------------
# These are for gles2Config.sh
#--------------------------------------------------------------------


    #--------------------------------------------------------------------
    # These are for gles2Config.sh
    #--------------------------------------------------------------------

................................................................................





# itcl_SRC_DIR must be a fully qualified path
eval gles2_SRC_DIR="$srcdir"
gles2_SRC_DIR=`cd "${gles2_SRC_DIR}"; pwd`


eval gles2_INCLUDE_SPEC="${gles2_SRC_DIR}/generic"


#--------------------------------------------------------------------
# Finally, substitute all of the various values into the Makefile.

Changes to configure.in.

37
38
39
40
41
42
43
44
45
46













47
48
49
50
51
52
53
...
120
121
122
123
124
125
126
127
128


129
130
131
132
133
134
135
...
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#--------------------------------------------------------------------

TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG

if test "${TCL_VERSION}" != "8.6"; then
    AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
Itcl ${PACKAGE_VERSION} needs Tcl 8.6.
Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6.])
fi














#-----------------------------------------------------------------------
# Handle the --prefix=... option by defaulting to what Tcl gave.
# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
#-----------------------------------------------------------------------

TEA_PREFIX
................................................................................
# contain private data structures and are subject to change without
# notice.
# This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
# so that we can extract TCL_SRC_DIR from the config file (in the case
# of private headers
#--------------------------------------------------------------------

#TEA_PUBLIC_TCL_HEADERS
TEA_PRIVATE_TCL_HEADERS



#--------------------------------------------------------------------
# We need to enable the threading macros found in tcl.h and tclInt.h.
# The use of the threading features is determined by the core the
# extension is loaded into, but we need to compile with these macros
# turned on.
#--------------------------------------------------------------------
................................................................................
# Require that we use a tclsh shell version 8.2 or later since earlier
# versions have bugs in the pkg_mkIndex routine.
#--------------------------------------------------------------------

TEA_PROG_TCLSH

#--------------------------------------------------------------------
# These are for itclConfig.sh
#--------------------------------------------------------------------

TEA_EXPORT_CONFIG([gles2])

# itcl_SRC_DIR must be a fully qualified path
eval gles2_SRC_DIR="$srcdir"
gles2_SRC_DIR=`cd "${itcl_SRC_DIR}"; pwd`
AC_SUBST(gles2_SRC_DIR)

eval gles2_INCLUDE_SPEC="${gles2_SRC_DIR}/generic"
AC_SUBST(gles2_INCLUDE_SPEC)

#--------------------------------------------------------------------
# Finally, substitute all of the various values into the Makefile.
#--------------------------------------------------------------------

AC_OUTPUT([Makefile pkgIndex.tcl gles2Config.sh])







|


>
>
>
>
>
>
>
>
>
>
>
>
>







 







|

>
>







 







|






|










37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
...
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
...
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
#--------------------------------------------------------------------

TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG

if test "${TCL_VERSION}" != "8.6"; then
    AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
gles2 ${PACKAGE_VERSION} needs Tcl 8.6.
Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6.])
fi

#--------------------------------------------------------------------
# Load the tkConfig.sh file
#--------------------------------------------------------------------

TEA_PATH_TKCONFIG
TEA_LOAD_TKCONFIG

if test "${TK_VERSION}" != "8.6"; then
    AC_MSG_ERROR([${TK_BIN_DIR}/tkConfig.sh is for Tk ${TK_VERSION}.
gles2 ${PACKAGE_VERSION} needs Tk 8.6.
Use --with-tk= option to indicate location of tkConfig.sh file for Tk 8.6.])
fi

#-----------------------------------------------------------------------
# Handle the --prefix=... option by defaulting to what Tcl gave.
# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
#-----------------------------------------------------------------------

TEA_PREFIX
................................................................................
# contain private data structures and are subject to change without
# notice.
# This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
# so that we can extract TCL_SRC_DIR from the config file (in the case
# of private headers
#--------------------------------------------------------------------

TEA_PUBLIC_TCL_HEADERS
TEA_PRIVATE_TCL_HEADERS
TEA_PUBLIC_TK_HEADERS
TEA_PRIVATE_TK_HEADERS

#--------------------------------------------------------------------
# We need to enable the threading macros found in tcl.h and tclInt.h.
# The use of the threading features is determined by the core the
# extension is loaded into, but we need to compile with these macros
# turned on.
#--------------------------------------------------------------------
................................................................................
# Require that we use a tclsh shell version 8.2 or later since earlier
# versions have bugs in the pkg_mkIndex routine.
#--------------------------------------------------------------------

TEA_PROG_TCLSH

#--------------------------------------------------------------------
# These are for gles2Config.sh
#--------------------------------------------------------------------

TEA_EXPORT_CONFIG([gles2])

# itcl_SRC_DIR must be a fully qualified path
eval gles2_SRC_DIR="$srcdir"
gles2_SRC_DIR=`cd "${gles2_SRC_DIR}"; pwd`
AC_SUBST(gles2_SRC_DIR)

eval gles2_INCLUDE_SPEC="${gles2_SRC_DIR}/generic"
AC_SUBST(gles2_INCLUDE_SPEC)

#--------------------------------------------------------------------
# Finally, substitute all of the various values into the Makefile.
#--------------------------------------------------------------------

AC_OUTPUT([Makefile pkgIndex.tcl gles2Config.sh])

Changes to generic/gles2Base.c.

8
9
10
11
12
13
14


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
..
52
53
54
55
56
57
58

59

60
61
62
63
64

65

66







67
68
69
70
71
72
73
74
75



76
77
78
79
80
81
82
..
83
84
85
86
87
88
89

90
91
92
93
94
95
96
...
104
105
106
107
108
109
110








111
112
113
114
115
116
117
118
119
120
121

122
123
124
125
126
127
128
129
130
...
164
165
166
167
168
169
170
171
172
173
174






























175
176
177
178
179
180
181
...
190
191
192
193
194
195
196



197
198
199
200
201
202
203
...
206
207
208
209
210
211
212


213
214
215
216
217
218
219
220
221
222
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include <stdlib.h>
#include <tcl.h>


#include "gles2.h"
#include "gles2Int.h"
#include <stdio.h>
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <SDL/SDL_syswm.h>
#include "cube.h"
#include "window.h"
#include "matrix.h"

static EGLDisplay g_eglDisplay = 0;
static EGLConfig g_eglConfigs[1];
static EGLContext g_eglContext = 0;
static EGLSurface g_eglSurface = 0;
static Display *g_x11Display = NULL;
static Window g_Window;

// consts
#define COLOURDEPTH_RED_SIZE  		8
#define COLOURDEPTH_GREEN_SIZE 		8
#define COLOURDEPTH_BLUE_SIZE 		8
#define COLOURDEPTH_DEPTH_SIZE		16

................................................................................
  EGL_CONTEXT_CLIENT_VERSION, 2,
  EGL_NONE
};


unsigned int uiWidth;
unsigned int uiHeight;



static int Initialize(Tcl_Interp *interp);
int Gles2_BiInit(Tcl_Interp *interp      /* current interpreter */
       );
static int InitOpenGL();
static void TerminateOpenGL();

void SDL_SetVideoMode(int w, int h, int depth, int flags);










/*===========================================================
 * Initialise opengl settings. Call straight after SDL_SetVideoMode()
 * ===========================================================*/
 
static int InitOpenGL()
{
    Colormap colormap;
    XVisualInfo *pVisual;



    
    uiWidth = 640;
    uiHeight = 480;

    // use EGL to initialise GLES
    g_x11Display = XOpenDisplay(NULL);

................................................................................
    if (!g_x11Display)
    {
        fprintf(stderr, "ERROR: unable to get display!n");
        return 0;
    }
 
    g_eglDisplay = eglGetDisplay((EGLNativeDisplayType)g_x11Display);

    if (g_eglDisplay == EGL_NO_DISPLAY)
    {
        printf("Unable to initialise EGL display.");
 	return 0;
    }

    // Initialise egl
................................................................................
    EGLint numConfigsOut = 0;
    if (eglChooseConfig(g_eglDisplay, g_configAttribs, g_eglConfigs, 1, &numConfigsOut) != EGL_TRUE || numConfigsOut == 0)
    {
        fprintf(stderr, "Unable to find appropriate EGL config.");
        return 0;
    }
		 








    g_Window = create_window("OpenGL ES 2.0 Example on a Linux Desktop", uiWidth, uiHeight, g_x11Display, g_eglDisplay, g_eglConfigs[0], &colormap, &pVisual);
    
    // Get the SDL window handle
    SDL_SysWMinfo sysInfo; //Will hold our Window information
    SDL_VERSION(&sysInfo.version); //Set SDL version
    if(SDL_GetWMInfo(&sysInfo) <= 0) 
    {
        printf("Unable to get window handle");
        return 0;
    }


//    g_eglSurface = eglCreateWindowSurface(g_eglDisplay, g_eglConfigs[0], (EGLNativeWindowType)sysInfo.info.x11.window, 0);
    g_eglSurface = eglCreateWindowSurface(g_eglDisplay, g_eglConfigs[0], (EGLNativeWindowType)g_Window, 0);
    if ( g_eglSurface == EGL_NO_SURFACE)
    {
        printf("Unable to create EGL surface!");
        return 0;
    }
						 
    // Bind GLES and create the context
................................................................................
 
int SwapBuffers(
    ClientData clientData,   /* unused */
    Tcl_Interp *interp,      /* current interpreter */
    int objc,                /* number of arguments */
    Tcl_Obj *const objv[])   /* argument objects */
{
fprintf(stderr, "SwapBuffers!%d!\n", objc);
    eglSwapBuffers(g_eglDisplay, g_eglSurface);
    return 0;
}































 
/*
 * ------------------------------------------------------------------------
 *  Initialize()
 *
 *      that is the starting point when loading the library
................................................................................
{
    Tcl_Namespace *nsPtr;
    int ret;

    if (Tcl_InitStubs(interp, "8.6", 0) == NULL) {
        return TCL_ERROR;
    }




    nsPtr = Tcl_CreateNamespace(interp, GLES2_NAMESPACE, NULL, NULL);
    if (nsPtr == NULL) {
        Tcl_Panic("Gles2: cannot create namespace: \"%s\" \n", GLES2_NAMESPACE);
    }

fprintf(stderr, "call Gles2_BiInit:\n");
................................................................................
    }
    if (Gles2_InitFreeType(interp, NULL) != TCL_OK) {
        Tcl_Panic("Gles2: cannot call Gles2_InitFreeType: %s \n", "");
    }

    Tcl_CreateObjCommand(interp, GLES2_NAMESPACE"::swapbuffers", SwapBuffers,
		                NULL, NULL);



    SDL_SetVideoMode(800, 480, 16, 0);
    ret = InitOpenGL();
    fprintf(stderr, "ret!%d!\n", ret);
    /* reset the gl* error !! */
    glGetError();

    /*
     *  Set up the variables containing version info.
     */







>
>



<
<










|







 







>

>



|
|
>

>

>
>
>
>
>
>
>





|

|
|
>
>
>







 







>







 







>
>
>
>
>
>
>
>
|










>
|
|







 







|



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>







 







>
>


|







8
9
10
11
12
13
14
15
16
17
18
19


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
..
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
...
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
...
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
...
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include <stdlib.h>
#include <tcl.h>
#include <tk.h>
#include <tkInt.h>
#include "gles2.h"
#include "gles2Int.h"
#include <stdio.h>


#include <SDL/SDL_syswm.h>
#include "cube.h"
#include "window.h"
#include "matrix.h"

static EGLDisplay g_eglDisplay = 0;
static EGLConfig g_eglConfigs[1];
static EGLContext g_eglContext = 0;
static EGLSurface g_eglSurface = 0;
static Display *g_x11Display = NULL;
//static Window g_Window;

// consts
#define COLOURDEPTH_RED_SIZE  		8
#define COLOURDEPTH_GREEN_SIZE 		8
#define COLOURDEPTH_BLUE_SIZE 		8
#define COLOURDEPTH_DEPTH_SIZE		16

................................................................................
  EGL_CONTEXT_CLIENT_VERSION, 2,
  EGL_NONE
};


unsigned int uiWidth;
unsigned int uiHeight;
extern void *lastTkpMakeWindow;

void * GetLastTkpMakeWindow();
static int Initialize(Tcl_Interp *interp);
int Gles2_BiInit(Tcl_Interp *interp      /* current interpreter */
       );
static int InitOpenGL(Tcl_Interp *interp);
void TerminateOpenGL();

void SDL_SetVideoMode(int w, int h, int depth, int flags);
SDL_SysWMinfo sysInfo; //Will hold our Window information

int GetX11Window() {
 return sysInfo.info.x11.window;
}

Display * GetX11Display() {
 return g_x11Display;
}

/*===========================================================
 * Initialise opengl settings. Call straight after SDL_SetVideoMode()
 * ===========================================================*/
 
static int InitOpenGL(Tcl_Interp *interp)
{
//    Colormap colormap;
//    XVisualInfo *pVisual;
//    Tk_Window mainWindow;
//    TkWindow *winPtr;
//    Tcl_Obj * obj0;
    
    uiWidth = 640;
    uiHeight = 480;

    // use EGL to initialise GLES
    g_x11Display = XOpenDisplay(NULL);

................................................................................
    if (!g_x11Display)
    {
        fprintf(stderr, "ERROR: unable to get display!n");
        return 0;
    }
 
    g_eglDisplay = eglGetDisplay((EGLNativeDisplayType)g_x11Display);
//    g_eglDisplay = eglGetDisplay((EGLNativeDisplayType)GetLastXDisplay());
    if (g_eglDisplay == EGL_NO_DISPLAY)
    {
        printf("Unable to initialise EGL display.");
 	return 0;
    }

    // Initialise egl
................................................................................
    EGLint numConfigsOut = 0;
    if (eglChooseConfig(g_eglDisplay, g_configAttribs, g_eglConfigs, 1, &numConfigsOut) != EGL_TRUE || numConfigsOut == 0)
    {
        fprintf(stderr, "Unable to find appropriate EGL config.");
        return 0;
    }
		 
//    obj0 = Tcl_NewStringObj("toplevel .gles2", -1);
//    if (Tcl_EvalObjEx(interp, obj0, 0) != TCL_OK) {
//fprintf(stderr, "cannot create frame .gles2\n");
//        return TCL_ERROR;
//    }
//    mainWindow = Tk_MainWindow(interp);
//    winPtr = (TkWindow *)mainWindow;
//fprintf(stderr, "mainWindow!%p!%p!%p!\n", mainWindow, (void *)winPtr->window, GetLastTkpMakeWindow());
//    g_Window = create_window("OpenGL ES 2.0 Example on a Linux Desktop", uiWidth, uiHeight, g_x11Display, g_eglDisplay, g_eglConfigs[0], &colormap, &pVisual);
    
    // Get the SDL window handle
    SDL_SysWMinfo sysInfo; //Will hold our Window information
    SDL_VERSION(&sysInfo.version); //Set SDL version
    if(SDL_GetWMInfo(&sysInfo) <= 0) 
    {
        printf("Unable to get window handle");
        return 0;
    }

//    g_eglSurface = eglCreateWindowSurface(g_eglDisplay, g_eglConfigs[0], (EGLNativeWindowType)GetLastTkpMakeWindow(), 0);
    g_eglSurface = eglCreateWindowSurface(g_eglDisplay, g_eglConfigs[0], (EGLNativeWindowType)sysInfo.info.x11.window, 0);
//    g_eglSurface = eglCreateWindowSurface(g_eglDisplay, g_eglConfigs[0], (EGLNativeWindowType)g_Window, 0);
    if ( g_eglSurface == EGL_NO_SURFACE)
    {
        printf("Unable to create EGL surface!");
        return 0;
    }
						 
    // Bind GLES and create the context
................................................................................
 
int SwapBuffers(
    ClientData clientData,   /* unused */
    Tcl_Interp *interp,      /* current interpreter */
    int objc,                /* number of arguments */
    Tcl_Obj *const objv[])   /* argument objects */
{
//fprintf(stderr, "SwapBuffers!%d!\n", objc);
    eglSwapBuffers(g_eglDisplay, g_eglSurface);
    return 0;
}

int X11EventLoop (
    ClientData clientData,   /* unused */
    Tcl_Interp *interp,      /* current interpreter */
    int objc,                /* number of arguments */
    Tcl_Obj *const objv[])   /* argument objects */
{
    XEvent event;

    do{ 
        XNextEvent(GetX11Display(),&event); 
fprintf(stderr, "event.type!0x%08x!\n", event.type);
#ifdef NOTDEF
        switch(event.type){
        case ButtonPress:
            sprintf(str, "x=%d, y=%d", event.xbutton.x, event.xbutton.y);
            XDrawImageString(display,win1,gr_context1,event.xbutton.x, 
            event.xbutton.y, str, strlen(str));
            break;
        case KeyPress:
            deal_with_keys(&event);
            break;
        case Expose:
            XClearWindow(display,win1);
            XDrawImageString(display,win1,gr_context1,0,20,
                "Press a key or Button. Use Break to exit", 40);
        }
#endif
    }while  (1);
}

 
/*
 * ------------------------------------------------------------------------
 *  Initialize()
 *
 *      that is the starting point when loading the library
................................................................................
{
    Tcl_Namespace *nsPtr;
    int ret;

    if (Tcl_InitStubs(interp, "8.6", 0) == NULL) {
        return TCL_ERROR;
    }
    if (Tcl_PkgRequire(interp, "Tk", "8.6", 0) == NULL) {
        return TCL_ERROR;
    }

    nsPtr = Tcl_CreateNamespace(interp, GLES2_NAMESPACE, NULL, NULL);
    if (nsPtr == NULL) {
        Tcl_Panic("Gles2: cannot create namespace: \"%s\" \n", GLES2_NAMESPACE);
    }

fprintf(stderr, "call Gles2_BiInit:\n");
................................................................................
    }
    if (Gles2_InitFreeType(interp, NULL) != TCL_OK) {
        Tcl_Panic("Gles2: cannot call Gles2_InitFreeType: %s \n", "");
    }

    Tcl_CreateObjCommand(interp, GLES2_NAMESPACE"::swapbuffers", SwapBuffers,
		                NULL, NULL);
    Tcl_CreateObjCommand(interp, GLES2_NAMESPACE"::x11eventloop", X11EventLoop,
		                NULL, NULL);

    SDL_SetVideoMode(800, 480, 16, 0);
    ret = InitOpenGL(interp);
    fprintf(stderr, "ret!%d!\n", ret);
    /* reset the gl* error !! */
    glGetError();

    /*
     *  Set up the variables containing version info.
     */

Changes to generic/gles2Int.h.

1

2
3
4
5
6
7
8
..
67
68
69
70
71
72
73
74

#include <string.h>

#include <GLES2/gl2.h>

#ifdef GLES2_DEBUG
MODULE_SCOPE int _gles2_debug_level;
MODULE_SCOPE void Gles2ShowArgs(int level, const char *str, int objc,
		        Tcl_Obj * const* objv);
#else
................................................................................
        Gles2WidgetImage *wgtPtr, Tcl_Obj *listPtr);
MODULE_SCOPE GLfloat Pixel2Coord(Tcl_Interp *interp, int pixels, int useWidth);
MODULE_SCOPE int Value2Pixel(Tcl_Interp *interp, Tcl_Obj *obj);
MODULE_SCOPE Tcl_Obj * ColorValue2RGBA(Tcl_Interp *interp, Tcl_Obj *obj);
MODULE_SCOPE Tcl_Obj * GetElementPositions(Tcl_Interp *interp, Tcl_Obj *obj);
MODULE_SCOPE Tcl_Obj * GetDiamondPositions(Tcl_Interp *interp, Tcl_Obj *obj, int diameter);
MODULE_SCOPE Tcl_Obj * GetShadows(Tcl_Interp *interp, Tcl_Obj *backgroundColorObj);



>







 







|
>
1
2
3
4
5
6
7
8
9
..
68
69
70
71
72
73
74
75
76
#include <string.h>
#include <EGL/egl.h>
#include <GLES2/gl2.h>

#ifdef GLES2_DEBUG
MODULE_SCOPE int _gles2_debug_level;
MODULE_SCOPE void Gles2ShowArgs(int level, const char *str, int objc,
		        Tcl_Obj * const* objv);
#else
................................................................................
        Gles2WidgetImage *wgtPtr, Tcl_Obj *listPtr);
MODULE_SCOPE GLfloat Pixel2Coord(Tcl_Interp *interp, int pixels, int useWidth);
MODULE_SCOPE int Value2Pixel(Tcl_Interp *interp, Tcl_Obj *obj);
MODULE_SCOPE Tcl_Obj * ColorValue2RGBA(Tcl_Interp *interp, Tcl_Obj *obj);
MODULE_SCOPE Tcl_Obj * GetElementPositions(Tcl_Interp *interp, Tcl_Obj *obj);
MODULE_SCOPE Tcl_Obj * GetDiamondPositions(Tcl_Interp *interp, Tcl_Obj *obj, int diameter);
MODULE_SCOPE Tcl_Obj * GetShadows(Tcl_Interp *interp, Tcl_Obj *backgroundColorObj);
MODULE_SCOPE int GetX11Window();
MODULE_SCOPE Display * GetX11Display();

Changes to generic/window.c.

120
121
122
123
124
125
126




127
128
129
130
131
132
133

134
135
136
137
138
139

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
    colormap = XCreateColormap(display, RootWindow(display, screen), visual->visual, AllocNone);

    wa.colormap = colormap;
    wa.background_pixel = 0xFFFFFFFF;
    wa.border_pixel = 0;

    wa.event_mask = StructureNotifyMask | ExposureMask;




    wa.event_mask |= KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask;
    wa.event_mask |= EnterWindowMask | LeaveWindowMask;
    wa.event_mask |= PointerMotionMask | PointerMotionHintMask;
    wa.event_mask |= Button1MotionMask | Button2MotionMask | Button3MotionMask;
    wa.event_mask |= Button4MotionMask | Button5MotionMask | ButtonMotionMask;
    wa.event_mask |= KeymapStateMask | ExposureMask | VisibilityChangeMask;
    wa.event_mask |= StructureNotifyMask | ResizeRedirectMask;


fprintf(stderr, "event_mask!0x%08x!\n", wa.event_mask);
    mask = CWBackPixel | CWBorderPixel | CWEventMask | CWColormap;

    window = XCreateWindow(display, RootWindow(display, screen), 0, 0, width, height, 
		0, visual->depth, InputOutput, visual->visual, mask, &wa);


    sh.flags = USPosition;
    sh.x = 10;
    sh.y = 10;

    XSetStandardProperties(display, window, title, title, None, 0, 0, &sh);
    XMapWindow(display, window);
    XIfEvent(display, &e, wait_for_map, (char*)&window);
    XSetWMColormapWindows(display, window, &window, 1);
    XFlush(display);

    *pColormap = colormap;
    *ppVisual = visual;

    return window;
}

#endif /* _WIN32 */








>
>
>
>







>






>







|











120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
    colormap = XCreateColormap(display, RootWindow(display, screen), visual->visual, AllocNone);

    wa.colormap = colormap;
    wa.background_pixel = 0xFFFFFFFF;
    wa.border_pixel = 0;

    wa.event_mask = StructureNotifyMask | ExposureMask;
    wa.event_mask += KeyPressMask | ButtonPressMask;
    wa.event_mask += Button1MotionMask | Button2MotionMask | Button3MotionMask;
    wa.event_mask += EnterWindowMask | LeaveWindowMask;
#ifdef NOTDEF
    wa.event_mask |= KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask;
    wa.event_mask |= EnterWindowMask | LeaveWindowMask;
    wa.event_mask |= PointerMotionMask | PointerMotionHintMask;
    wa.event_mask |= Button1MotionMask | Button2MotionMask | Button3MotionMask;
    wa.event_mask |= Button4MotionMask | Button5MotionMask | ButtonMotionMask;
    wa.event_mask |= KeymapStateMask | ExposureMask | VisibilityChangeMask;
    wa.event_mask |= StructureNotifyMask | ResizeRedirectMask;
#endif

fprintf(stderr, "event_mask!0x%08x!\n", wa.event_mask);
    mask = CWBackPixel | CWBorderPixel | CWEventMask | CWColormap;

    window = XCreateWindow(display, RootWindow(display, screen), 0, 0, width, height, 
		0, visual->depth, InputOutput, visual->visual, mask, &wa);
//    XSelectInput(display, window, wa.event_mask);

    sh.flags = USPosition;
    sh.x = 10;
    sh.y = 10;

    XSetStandardProperties(display, window, title, title, None, 0, 0, &sh);
    XMapWindow(display, window);
//    XIfEvent(display, &e, wait_for_map, (char*)&window);
    XSetWMColormapWindows(display, window, &window, 1);
    XFlush(display);

    *pColormap = colormap;
    *ppVisual = visual;

    return window;
}

#endif /* _WIN32 */

Changes to pkgIndex.tcl.in.

1
2
3

4
5
6
# Tcl package index file, version 1.0

if {![package vsatisfies [package provide Tcl] 8.6]} {return}


package ifneeded gles2 @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] gles2]
package ifneeded gles2 @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] gles2]



>



1
2
3
4
5
6
7
# Tcl package index file, version 1.0

if {![package vsatisfies [package provide Tcl] 8.6]} {return}
package require Tk 8.6

package ifneeded gles2 @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] gles2]
package ifneeded gles2 @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] gles2]