parent
45e9c1186d
commit
efa657cc06
|
@ -4,12 +4,22 @@ if BUILD_SNPRINTF
|
|||
SRCS_SNPRINTF = snprintf.c
|
||||
endif
|
||||
|
||||
lib_LTLIBRARIES = libepplet.la
|
||||
if BUILD_GLX
|
||||
EPPLET_LIB_GLX = libepplet_glx.la
|
||||
endif
|
||||
|
||||
lib_LTLIBRARIES = libepplet.la $(EPPLET_LIB_GLX)
|
||||
|
||||
include_HEADERS = epplet.h
|
||||
|
||||
libepplet_la_SOURCES = epplet.c $(SRCS_SNPRINTF)
|
||||
libepplet_la_CPPFLAGS = -I$(top_srcdir) $(IMLIB2_CFLAGS) $(X_CFLAGS) -D ENLIGHTENMENT_ROOT=\"$(datadir)/e16\"
|
||||
libepplet_la_LIBADD = $(IMLIB2_LIBS) $(GLX_LIBS) $(X_LIBS) -lXext -lX11
|
||||
libepplet_la_LDFLAGS = -version-info 2:0:0
|
||||
libepplet_la_LIBADD = $(IMLIB2_LIBS) $(X_LIBS) -lXext -lX11
|
||||
libepplet_la_LDFLAGS = -version-info 3:0:0
|
||||
|
||||
EXTRA_DIST = epplet.h.in snprintf.c
|
||||
libepplet_glx_la_SOURCES = epplet_glx.c
|
||||
libepplet_glx_la_CPPFLAGS = -I$(top_srcdir) $(X_CFLAGS)
|
||||
libepplet_glx_la_LIBADD = libepplet.la $(GLX_LIBS)
|
||||
libepplet_glx_la_LDFLAGS = -version-info 3:0:0
|
||||
|
||||
EXTRA_DIST = epplet.h.in snprintf.c epplet_glx.c
|
||||
|
|
74
api/epplet.c
74
api/epplet.c
|
@ -31,7 +31,7 @@ typedef struct epplet_window
|
|||
EppWindow;
|
||||
typedef EppWindow *Epplet_window;
|
||||
|
||||
static Display *disp = NULL;
|
||||
Display *disp = NULL;
|
||||
|
||||
static int window_num = 0; /* For window list */
|
||||
static Epplet_window *windows = NULL; /* List of windows to loop though */
|
||||
|
@ -5436,78 +5436,6 @@ Epplet_free_rgb_buf(RGB_buf buf)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_GLX
|
||||
GLXContext
|
||||
Epplet_bind_double_GL(Epplet_gadget da, int red, int green, int blue,
|
||||
int aux_buffers, int alpha, int depth, int stencil,
|
||||
int accum_red, int accum_green, int accum_blue,
|
||||
int accum_alpha)
|
||||
{
|
||||
XVisualInfo *vi;
|
||||
GLXContext cx;
|
||||
Window win;
|
||||
|
||||
/* This sets up our MINIMUM request list for glx values. If all
|
||||
* the following minimums are not available, then a NULL is
|
||||
* returned for cx. You also might get a LARGER value then you
|
||||
* specify. */
|
||||
|
||||
int attributeListDbl[] = { GLX_RGBA, GLX_DOUBLEBUFFER,
|
||||
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
|
||||
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
|
||||
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil,
|
||||
GLX_ACCUM_RED_SIZE, accum_red, GLX_ACCUM_GREEN_SIZE, accum_green,
|
||||
GLX_ACCUM_BLUE_SIZE, accum_blue, GLX_ACCUM_ALPHA_SIZE, accum_alpha,
|
||||
None
|
||||
};
|
||||
|
||||
win = Epplet_get_drawingarea_window(da);
|
||||
vi = glXChooseVisual(disp, DefaultScreen(disp), attributeListDbl);
|
||||
cx = glXCreateContext(disp, vi, 0, GL_TRUE);
|
||||
glXMakeCurrent(disp, win, cx);
|
||||
|
||||
return cx;
|
||||
}
|
||||
|
||||
GLXContext
|
||||
Epplet_bind_single_GL(Epplet_gadget da, int red, int green, int blue,
|
||||
int aux_buffers, int alpha, int depth, int stencil,
|
||||
int accum_red, int accum_green, int accum_blue,
|
||||
int accum_alpha)
|
||||
{
|
||||
XVisualInfo *vi;
|
||||
GLXContext cx;
|
||||
Window win;
|
||||
int attributeListSgl[] = { GLX_RGBA,
|
||||
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
|
||||
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
|
||||
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil,
|
||||
GLX_ACCUM_RED_SIZE, accum_red, GLX_ACCUM_GREEN_SIZE, accum_green,
|
||||
GLX_ACCUM_BLUE_SIZE, accum_blue, GLX_ACCUM_ALPHA_SIZE, accum_alpha,
|
||||
None
|
||||
};
|
||||
|
||||
win = Epplet_get_drawingarea_window(da);
|
||||
vi = glXChooseVisual(disp, DefaultScreen(disp), attributeListSgl);
|
||||
cx = glXCreateContext(disp, vi, 0, GL_TRUE);
|
||||
glXMakeCurrent(disp, win, cx);
|
||||
|
||||
return cx;
|
||||
}
|
||||
|
||||
GLXContext
|
||||
Epplet_default_bind_GL(Epplet_gadget da)
|
||||
{
|
||||
return Epplet_bind_double_GL(da, 1, 1, 1, 0, 0, 8, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
Epplet_unbind_GL(GLXContext cx)
|
||||
{
|
||||
glXDestroyContext(disp, cx);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
Epplet_handle_child(int num)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
#include "config.h"
|
||||
#include "epplet.h"
|
||||
|
||||
extern Display *disp;
|
||||
|
||||
GLXContext
|
||||
Epplet_bind_double_GL(Epplet_gadget da, int red, int green, int blue,
|
||||
int aux_buffers, int alpha, int depth, int stencil,
|
||||
int accum_red, int accum_green, int accum_blue,
|
||||
int accum_alpha)
|
||||
{
|
||||
XVisualInfo *vi;
|
||||
GLXContext cx;
|
||||
Window win;
|
||||
|
||||
/* This sets up our MINIMUM request list for glx values. If all
|
||||
* the following minimums are not available, then a NULL is
|
||||
* returned for cx. You also might get a LARGER value then you
|
||||
* specify. */
|
||||
|
||||
int attributeListDbl[] = { GLX_RGBA, GLX_DOUBLEBUFFER,
|
||||
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
|
||||
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
|
||||
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil,
|
||||
GLX_ACCUM_RED_SIZE, accum_red, GLX_ACCUM_GREEN_SIZE, accum_green,
|
||||
GLX_ACCUM_BLUE_SIZE, accum_blue, GLX_ACCUM_ALPHA_SIZE, accum_alpha,
|
||||
None
|
||||
};
|
||||
|
||||
win = Epplet_get_drawingarea_window(da);
|
||||
vi = glXChooseVisual(disp, DefaultScreen(disp), attributeListDbl);
|
||||
cx = glXCreateContext(disp, vi, 0, GL_TRUE);
|
||||
glXMakeCurrent(disp, win, cx);
|
||||
|
||||
return cx;
|
||||
}
|
||||
|
||||
GLXContext
|
||||
Epplet_bind_single_GL(Epplet_gadget da, int red, int green, int blue,
|
||||
int aux_buffers, int alpha, int depth, int stencil,
|
||||
int accum_red, int accum_green, int accum_blue,
|
||||
int accum_alpha)
|
||||
{
|
||||
XVisualInfo *vi;
|
||||
GLXContext cx;
|
||||
Window win;
|
||||
int attributeListSgl[] = { GLX_RGBA,
|
||||
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
|
||||
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
|
||||
GLX_DEPTH_SIZE, depth, GLX_STENCIL_SIZE, stencil,
|
||||
GLX_ACCUM_RED_SIZE, accum_red, GLX_ACCUM_GREEN_SIZE, accum_green,
|
||||
GLX_ACCUM_BLUE_SIZE, accum_blue, GLX_ACCUM_ALPHA_SIZE, accum_alpha,
|
||||
None
|
||||
};
|
||||
|
||||
win = Epplet_get_drawingarea_window(da);
|
||||
vi = glXChooseVisual(disp, DefaultScreen(disp), attributeListSgl);
|
||||
cx = glXCreateContext(disp, vi, 0, GL_TRUE);
|
||||
glXMakeCurrent(disp, win, cx);
|
||||
|
||||
return cx;
|
||||
}
|
||||
|
||||
GLXContext
|
||||
Epplet_default_bind_GL(Epplet_gadget da)
|
||||
{
|
||||
return Epplet_bind_double_GL(da, 1, 1, 1, 0, 0, 8, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
Epplet_unbind_GL(GLXContext cx)
|
||||
{
|
||||
glXDestroyContext(disp, cx);
|
||||
}
|
|
@ -85,7 +85,7 @@ AC_ARG_ENABLE(glx,
|
|||
enable_glx=yes)
|
||||
if test "x$enable_glx" = "xyes"; then
|
||||
AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glx.h,, enable_glx=no)
|
||||
AC_CHECK_LIB(GL, glXChooseVisual,, enable_glx=no)
|
||||
AC_CHECK_LIB(GL, glXChooseVisual, enable_glx=yes, enable_glx=no)
|
||||
dnl# AC_CHECK_LIB(GLU, main, , GLX_LIBS="", $X_LIBS)
|
||||
fi
|
||||
if test "x$enable_glx" = "xyes"; then
|
||||
|
@ -97,6 +97,7 @@ else
|
|||
fi
|
||||
AC_SUBST(GLX_LIBS)
|
||||
AC_SUBST(GLX_PROGS)
|
||||
AM_CONDITIONAL(BUILD_GLX, test "x$enable_glx" = "xyes")
|
||||
|
||||
PKG_CHECK_MODULES(IMLIB2, imlib2 >= 1.2.0)
|
||||
|
||||
|
|
|
@ -44,8 +44,10 @@ EppletConfigTest_epplet_DEPENDENCIES = $(top_builddir)/api/libepplet.la
|
|||
EppletConfigTest_epplet_LDFLAGS = -rpath $(libdir)
|
||||
|
||||
E_OpenGL_Demo_epplet_SOURCES = E-OpenGL-Demo.c
|
||||
E_OpenGL_Demo_epplet_DEPENDENCIES = $(top_builddir)/api/libepplet.la
|
||||
E_OpenGL_Demo_epplet_DEPENDENCIES = \
|
||||
$(top_builddir)/api/libepplet.la $(top_builddir)/api/libepplet_glx.la
|
||||
E_OpenGL_Demo_epplet_LDFLAGS = -rpath $(libdir)
|
||||
E_OpenGL_Demo_epplet_LDADD = $(top_builddir)/api/libepplet_glx.la $(LDADD)
|
||||
####################################################
|
||||
|
||||
E_Exec_epplet_SOURCES = E-Exec.c
|
||||
|
|
Loading…
Reference in New Issue