diff --git a/Makefile.am b/Makefile.am index c8006fe..7b032a5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -168,7 +168,9 @@ libshl_la_SOURCES = \ src/shl_hook.h \ src/shl_misc.h \ src/shl_register.h \ - src/shl_flagset.h + src/shl_flagset.h \ + src/shl_gl.h \ + src/shl_gl_math.c libshl_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(XKBCOMMON_CFLAGS) \ @@ -180,6 +182,12 @@ libshl_la_LIBADD = \ $(AM_LIBADD) \ $(XKBCOMMON_LIBS) +if BUILD_HAVE_GLES2 +libshl_la_SOURCES += src/shl_gl_shader.c +libshl_la_CPPFLAGS += $(GLES2_CFLAGS) +libshl_la_LIBADD += $(GLES2_LIBS) +endif + # # libeloop # This library contains the whole event-loop implementation of kmscon. It is @@ -261,10 +269,7 @@ noinst_PROGRAMS += genshader libuterm_la_SOURCES += \ src/uterm_drm3d_internal.h \ src/uterm_drm3d_video.c \ - src/uterm_drm3d_render.c \ - src/static_gl.h \ - src/static_gl_math.c \ - src/static_gl_shader.c + src/uterm_drm3d_render.c nodist_libuterm_la_SOURCES += src/static_shaders.c libuterm_la_CPPFLAGS += \ $(DRM_CFLAGS) \ @@ -408,9 +413,6 @@ endif mod_gltex_la_SOURCES = \ src/kmscon_module_interface.h \ src/text_gltex.c \ - src/static_gl.h \ - src/static_gl_math.c \ - src/static_gl_shader.c \ src/kmscon_mod_gltex.c nodist_mod_gltex_la_SOURCES = \ src/static_shaders.c diff --git a/configure.ac b/configure.ac index 2d94c22..743957d 100644 --- a/configure.ac +++ b/configure.ac @@ -773,6 +773,9 @@ else AC_MSG_RESULT([no]) fi +# gles2 helpers +AM_CONDITIONAL([BUILD_HAVE_GLES2], [test "x$have_gles2" = "xyes"]) + # # Makefile vars # After everything is configured, we correctly substitute the values for the diff --git a/src/static_gl.h b/src/shl_gl.h similarity index 93% rename from src/static_gl.h rename to src/shl_gl.h index 8709adc..ccff76b 100644 --- a/src/static_gl.h +++ b/src/shl_gl.h @@ -1,8 +1,7 @@ /* - * kmscon - OpenGL Helpers + * shl - OpenGL Helpers * - * Copyright (c) 2011-2012 David Herrmann - * Copyright (c) 2011 University of Tuebingen + * Copyright (c) 2011-2013 David Herrmann * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files @@ -28,10 +27,11 @@ * OpenGL Helpers * This file provides several helper functions that are commonly used when * working with OpenGL. + * TODO: Rename to shl_gl_* prefix. */ -#ifndef GL_H_INCLUDED -#define GL_H_INCLUDED +#ifndef SHL_GL_H +#define SHL_GL_H #include #include @@ -88,4 +88,4 @@ void gl_clear_error(); bool gl_has_error(struct gl_shader *shader); const char *gl_err_to_str(GLenum err); -#endif /* GL_H_INCLUDED */ +#endif /* SHL_GL_H */ diff --git a/src/static_gl_math.c b/src/shl_gl_math.c similarity index 97% rename from src/static_gl_math.c rename to src/shl_gl_math.c index 5d6ae26..a3a3a1d 100644 --- a/src/static_gl_math.c +++ b/src/shl_gl_math.c @@ -1,8 +1,7 @@ /* - * kmscon - GL Math Helpers + * shl - OpenGL Helpers * - * Copyright (c) 2011 David Herrmann - * Copyright (c) 2011 University of Tuebingen + * Copyright (c) 2011-2013 David Herrmann * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files @@ -32,7 +31,7 @@ #include #include #include -#include "static_gl.h" +#include "shl_gl.h" struct gl_m4_entry { struct gl_m4_entry *next; diff --git a/src/static_gl_shader.c b/src/shl_gl_shader.c similarity index 97% rename from src/static_gl_shader.c rename to src/shl_gl_shader.c index ce9b462..093d786 100644 --- a/src/static_gl_shader.c +++ b/src/shl_gl_shader.c @@ -1,8 +1,7 @@ /* - * GL - Graphics Layer + * shl - OpenGL Helpers * - * Copyright (c) 2011-2012 David Herrmann - * Copyright (c) 2011 University of Tuebingen + * Copyright (c) 2011-2013 David Herrmann * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files @@ -38,8 +37,8 @@ #include #include #include +#include "shl_gl.h" #include "shl_llog.h" -#include "static_gl.h" #define LLOG_SUBSYSTEM "gl_shader" diff --git a/src/text_gltex.c b/src/text_gltex.c index 9c0b06b..b0abcbd 100644 --- a/src/text_gltex.c +++ b/src/text_gltex.c @@ -46,10 +46,10 @@ #include #include #include "shl_dlist.h" +#include "shl_gl.h" #include "shl_hashtable.h" #include "shl_log.h" #include "shl_misc.h" -#include "static_gl.h" #include "text.h" #include "uterm_video.h" diff --git a/src/uterm_drm3d_render.c b/src/uterm_drm3d_render.c index 6080d2c..c7a213d 100644 --- a/src/uterm_drm3d_render.c +++ b/src/uterm_drm3d_render.c @@ -45,8 +45,8 @@ #include #include #include "eloop.h" +#include "shl_gl.h" #include "shl_log.h" -#include "static_gl.h" #include "uterm_drm_shared_internal.h" #include "uterm_drm3d_internal.h" #include "uterm_video.h" diff --git a/src/uterm_drm3d_video.c b/src/uterm_drm3d_video.c index 2184e71..4c7f877 100644 --- a/src/uterm_drm3d_video.c +++ b/src/uterm_drm3d_video.c @@ -47,7 +47,6 @@ #include "eloop.h" #include "shl_log.h" #include "shl_misc.h" -#include "static_gl.h" #include "uterm_drm_shared_internal.h" #include "uterm_drm3d_internal.h" #include "uterm_video.h"