summaryrefslogtreecommitdiff
path: root/Makethird
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-08-21 15:22:21 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-10-06 11:21:23 +0200
commit83a00b0a38558e3e64f38d8a584808e323f4d706 (patch)
treeca246c1dccaa1973240f317f3a66d2104089c74e /Makethird
parent74e2286574a4ba6fd5a644c99033d2b1bf33d46b (diff)
downloadmupdf-83a00b0a38558e3e64f38d8a584808e323f4d706.tar.xz
gl: Use GLFW instead of GLUT.
Add OpenGL text rendering using textured quads, instead of using glut bitmap fonts.
Diffstat (limited to 'Makethird')
-rw-r--r--Makethird55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makethird b/Makethird
index ac4b2857..79f4dc07 100644
--- a/Makethird
+++ b/Makethird
@@ -14,6 +14,7 @@ OPENJPEG_DIR := thirdparty/openjpeg/libopenjpeg
OPENSSL_DIR := thirdparty/openssl
ZLIB_DIR := thirdparty/zlib
CURL_DIR := thirdparty/curl
+GLFW_DIR := thirdparty/glfw
# --- V8 ---
#
@@ -460,6 +461,60 @@ CURL_CFLAGS := $(SYS_CURL_CFLAGS)
CURL_LIBS := $(SYS_CURL_LIBS)
endif
+# --- GLFW ---
+
+ifneq "$(wildcard $(GLFW_DIR)/README.md)" ""
+
+GLFW_LIB := $(OUT)/libglfw.a
+GLFW_OUT := $(OUT)/glfw
+GLFW_SRC := \
+ context.c \
+ glx_context.c \
+ init.c \
+ input.c \
+ linux_joystick.c \
+ monitor.c \
+ posix_time.c \
+ posix_tls.c \
+ window.c \
+ x11_init.c \
+ x11_monitor.c \
+ x11_window.c \
+ xkb_unicode.c \
+
+GLFW_SRC_UNUSED := \
+ egl_context.c \
+ mach_time.c \
+ mir_init.c \
+ mir_monitor.c \
+ mir_window.c \
+ win32_init.c \
+ win32_monitor.c \
+ win32_time.c \
+ win32_tls.c \
+ win32_window.c \
+ winmm_joystick.c \
+ wgl_context.c \
+ wl_init.c \
+ wl_monitor.c \
+ wl_window.c \
+
+$(GLFW_LIB): $(addprefix $(GLFW_OUT)/, $(GLFW_SRC:%.c=%.o))
+$(GLFW_OUT):
+ $(MKDIR_CMD)
+$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT)
+ $(CC_CMD) -D_GLFW_X11 -D_GLFW_GLX -D_GLFW_USE_OPENGL -D_GLFW_HAS_GLXGETPROCADDRESS
+
+GLFW_CFLAGS := -I$(GLFW_DIR)/include
+GLFW_LIBS := -lGL -lX11 -lXcursor -lXrandr -lXinerama -lpthread
+
+HAVE_GLFW := yes
+
+else ifeq "$(HAVE_GLFW)" "yes"
+GLFW_CFLAGS := $(SYS_GLFW_CFLAGS)
+GLFW_LIBS := $(SYS_GLFW_LIBS)
+endif
+
# --- X11 ---
ifeq "$(HAVE_X11)" "yes"