SVN revision: 2987
This commit is contained in:
Carsten Haitzler 2000-08-03 23:54:32 +00:00
parent 88cba34eba
commit eccb8b7520
10 changed files with 109 additions and 15 deletions

1
legacy/evas/acconfig.h Normal file
View File

@ -0,0 +1 @@
#undef HAVE_GL

View File

@ -6,16 +6,75 @@ AM_PROG_CC_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
AM_WITH_DMALLOC
if test X"$enable_shared" = Xyes; then
DLLDFLAGS=-export-dynamic
AC_SUBST(DLLDFLAGS)
fi
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CHECK_LIB(Imlib2, imlib_context_set_image, IMLIB2=yes ,[
#### Find out about X
AC_PATH_X
AC_PATH_XTRA
if test "x$x_includes" = "x"; then
x_includes="/usr/include"
fi
x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS"
x_libs="$X_LIBS $X_EXTRA_LIBS"
AC_CHECK_LIB(X11, XOpenDisplay, x_libs="$x_libs",
AC_MSG_ERROR([ERROR: libX11 not found.]); exit,
$X_LDFLAGS $X_EXTRA_LIBS $X_LIBS)
AC_CHECK_LIB(Xext, XShmAttach, x_libs="-lXext $x_libs",
AC_CHECK_LIB(XextSam, XShmAttach,
x_libs="-lXextSam -lXext $x_libs",
AC_MSG_ERROR([ERROR: XShm not found.]); exit,
$x_libs),
$x_libs)
AC_CHECK_LIB(Xext, XShapeCombineMask, x_libs="-lXext $x_libs",
AC_MSG_ERROR([ERROR: XShape not found.]); exit,
$x_libs)
AC_SUBST(x_cflags)
AC_SUBST(x_includes)
AC_SUBST(x_ldflags)
AC_SUBST(x_libs)
#### Find out about E db
AC_CHECK_HEADER(Edb.h,
AC_CHECK_LIB(edb, e_db_open, ,[
echo ""
echo "ERROR: E db needed"
echo ""
AC_MSG_ERROR([Fatal Error: no E db detected.]); exit], -L/usr/local/lib -ldb)
)
#### Find out about Imlib2
AC_CHECK_HEADER(Imlib2.h,
AC_CHECK_LIB(Imlib2, imlib_context_set_image, ,[
echo ""
echo "ERROR: Imlib 2 needed"
echo ""
AC_MSG_ERROR([Fatal Error: no Imlib2 detected.])], -L/usr/X11R6/lib -L/usr/local/lib -lm -ldl -lttf -lX11 -lXext)
AC_MSG_ERROR([Fatal Error: no Imlib2 detected.]); exit], -L/usr/X11R6/lib -L/usr/local/lib -lm -ldl -lttf -lX11 -lXext)
)
gl_includes=""
#### Find out about OpenGL
AC_CHECK_HEADER(GL/gl.h,
gl_includes="-I/usr/include -I/usr/local/include"
AC_CHECK_LIB(GL, glBindTexture, AC_DEFINE(HAVE_GL) ,[
echo "... no GL found"
], -L/usr/local/lib -lGL $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS)
)
AC_CHECK_HEADER($x_includes"/GL/gl.h",
gl_includes="-I/usr/include -I/usr/local/include -I/usr/X11R6/include/"
AC_CHECK_LIB(GL, glBindTexture, AC_DEFINE(HAVE_GL) ,[
echo "... no GL found"
], -L/usr/local/lib -lGL $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS)
)
AC_SUBST(gl_includes)
AC_OUTPUT(Makefile src/Makefile test/Makefile)

View File

@ -5,12 +5,25 @@ AUTOMAKE_OPTIONS = 1.4 foreign
# A list of all the files in the current directory which can be regenerated
MAINTAINERCLEANFILES = Makefile.in
LDFLAGS = -L/usr/X11R6/lib -L/usr/local/lib
INCLUDES = -I/usr/X11R6/include -I/usr/local/include \
$(X_CFLAGS) -I$(includedir) \
-DLIBDIR=\"$(libdir)\" \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\"
LIBS_X = @x_ldflags@ @x_libs@
LIBS_IMLIB2 = -lImlib2 -lttf -ldl -lm
LIBS_DB = -ledb
LIBS_GL = -lGL
LIBS_EXTRA = -L/usr/local/lib
CFLAGS_X = @x_cflags@
CFLAGS_IMLIB2 =
CFLAGS_DB =
CFLAGS_GL = @gl_includes@
CFLAGS_EXTRA = -I$(includedir) -I$(top_srcdir) -I/usr/local/include
LIBS_ALL = $(LIBS_X) $(LIBS_IMLIB2) $(LIBS_DB) $(LIBS_GL) $(LIBS_EXTRA)
CFLGAS_ALL = $(CFLAGS_X) $(CFLAGS_IMLIB2) $(CFLAGS_DB) $(CFLAGS_GL) $(CFLAGS_EXTRA)
INCLUDES = $(CFLGAS_ALL) \
-DLIBDIR=\"$(libdir)\" \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\"
lib_LTLIBRARIES = libevas.la
include_HEADERS = \
@ -34,6 +47,6 @@ evas_text.c \
evas_gl_routines.h \
Evas.h
libevas_la_LIBADD = -lX11 -lXext -lttf -ldl -lm -lImlib2 -ldb -lGL $(LDFLAGS)
libevas_la_LIBADD = $(LIBS_ALL)
libevas_la_DEPENDENCIES = $(top_builddir)/config.h
libevas_la_LDFLAGS = -version-info 0:1:0

View File

@ -139,6 +139,7 @@ void __evas_calc_tex_and_poly(Evas_GL_Image *im, int x, double *x1, double *x2,
*txx = im->texture.max_size - 2;
*dtx = (double)*tx / (im->texture.max_size);
*dtxx = (double)*txx / (im->texture.max_size);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
}
else if (x < (tw - 1))
{
@ -181,6 +182,7 @@ void __evas_gl_set_conect_for_dest(Evas_GL_Image *im, Display *disp, Window w,
im->buffer.dest = w;
glXMakeCurrent(disp, w, im->context);
glEnable(GL_BLEND);
glEnable(GL_DITHER);
glShadeModel(GL_FLAT);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
@ -242,7 +244,7 @@ void __evas_gl_render_to_window(Evas_GL_Image *im,
x2 = dx + ((x2 * dw) / (double)im->w);
y2 = dy + ((y2 * dh) / (double)im->h);
glBindTexture(GL_TEXTURE_2D, im->texture.textures[i]);
glBegin(GL_POLYGON);
glBegin(GL_QUADS);
glTexCoord2d(dtx, dty); glVertex2d(x1, y1);
glTexCoord2d(dtxx, dty); glVertex2d(x2, y1);
glTexCoord2d(dtxx, dtyy); glVertex2d(x2, y2);

View File

@ -1,5 +1,19 @@
INCLUDES = \
-I$(top_srcdir)/src -I/usr/local/include
LIBS_X = @x_ldflags@ @x_libs@
LIBS_IMLIB2 = -lImlib2 -lttf -ldl -lm
LIBS_DB = -ledb
LIBS_GL = -lGL
LIBS_EXTRA = -L/usr/local/lib
CFLAGS_X = @x_cflags@
CFLAGS_IMLIB2 =
CFLAGS_DB =
CFLAGS_GL = @gl_includes@
CFLAGS_EXTRA = -I$(includedir) -I$(top_srcdir) -I$(top_srcdir)/src -I/usr/local/include
LIBS_ALL = $(LIBS_X) $(LIBS_IMLIB2) $(LIBS_DB) $(LIBS_GL) $(LIBS_EXTRA)
CFLGAS_ALL = $(CFLAGS_X) $(CFLAGS_IMLIB2) $(CFLAGS_DB) $(CFLAGS_GL) $(CFLAGS_EXTRA)
INCLUDES = $(CFLGAS_ALL)
noinst_PROGRAMS = evas_test
@ -9,4 +23,4 @@ evas_test_SOURCES = evas_test.c
evas_test_LDFLAGS = -static
evas_test_LDADD = $(top_builddir)/src/libevas.la -lImlib2 -lttf -lX11 -lXext -ldl -ldb -lGL -lm
evas_test_LDADD = $(top_builddir)/src/libevas.la

View File

@ -43,6 +43,7 @@ main(int argc, char **argv)
&att);
XMapWindow(d, win);
}
if (__evas_gl_capable(d))
{
int a = 0;
double t1, t2;
@ -72,7 +73,7 @@ main(int argc, char **argv)
{
int xx, yy;
j = k % 4;
j = 3 - (k % 4);
xx = (((k + 1) * a) / 2) % win_w;
yy = 0;
if (k == 2)
@ -102,4 +103,8 @@ main(int argc, char **argv)
}
}
}
else
{
printf("Your X server is unable to do GLX - no go buddy.\n");
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 457 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 624 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 642 KiB