Unstable changes: Update SDL to 2.0.10
Bug: Martin's hack of restarting SDL no longer works in this SDL version so more matches to LOVE central repository will be come soon.
@@ -33,7 +33,7 @@ android {
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs('src/main/java', 'src/jni/SDL2-2.0.9/android-project/app/src/main/java')
|
||||
srcDirs('src/main/java', 'src/jni/SDL2/android-project/app/src/main/java')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,674 +0,0 @@
|
||||
# Makefile to build and install the SDL library
|
||||
|
||||
top_builddir = .
|
||||
srcdir = /home/martin/temp/SDL2
|
||||
objects = build
|
||||
gen = gen
|
||||
prefix = /usr/local/stow/SDL2-configure
|
||||
exec_prefix = ${prefix}
|
||||
bindir = ${exec_prefix}/bin
|
||||
libdir = ${exec_prefix}/lib
|
||||
includedir = ${prefix}/include
|
||||
datarootdir = ${prefix}/share
|
||||
datadir = ${datarootdir}
|
||||
auxdir = build-scripts
|
||||
distpath = $(srcdir)/..
|
||||
distdir = SDL2-2.0.5
|
||||
distfile = $(distdir).tar.gz
|
||||
|
||||
|
||||
SHELL = /bin/bash
|
||||
CC = gcc
|
||||
INCLUDE = -Iinclude -I/home/martin/temp/SDL2/include
|
||||
CFLAGS = -g -O3 -DUSING_GENERATED_CONFIG_H
|
||||
EXTRA_CFLAGS = -Iinclude -I/home/martin/temp/SDL2/include -mmmx -m3dnow -msse -msse2 -msse3 -Wall -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -D_REENTRANT -DHAVE_LINUX_VERSION_H
|
||||
LDFLAGS =
|
||||
EXTRA_LDFLAGS = -Wl,--no-undefined -lm -ldl -lpthread -lrt
|
||||
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
||||
INSTALL = /usr/bin/install -c
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
WINDRES = :
|
||||
|
||||
TARGET = libSDL2.la
|
||||
OBJECTS = $(objects)/SDL.lo $(objects)/SDL_assert.lo $(objects)/SDL_dataqueue.lo $(objects)/SDL_error.lo $(objects)/SDL_hints.lo $(objects)/SDL_log.lo $(objects)/SDL_atomic.lo $(objects)/SDL_spinlock.lo $(objects)/SDL_audio.lo $(objects)/SDL_audiocvt.lo $(objects)/SDL_audiodev.lo $(objects)/SDL_audiotypecvt.lo $(objects)/SDL_mixer.lo $(objects)/SDL_wave.lo $(objects)/SDL_cpuinfo.lo $(objects)/SDL_dynapi.lo $(objects)/SDL_clipboardevents.lo $(objects)/SDL_dropevents.lo $(objects)/SDL_events.lo $(objects)/SDL_gesture.lo $(objects)/SDL_keyboard.lo $(objects)/SDL_mouse.lo $(objects)/SDL_quit.lo $(objects)/SDL_touch.lo $(objects)/SDL_windowevents.lo $(objects)/SDL_rwops.lo $(objects)/SDL_haptic.lo $(objects)/SDL_gamecontroller.lo $(objects)/SDL_joystick.lo $(objects)/e_atan2.lo $(objects)/e_log.lo $(objects)/e_pow.lo $(objects)/e_rem_pio2.lo $(objects)/e_sqrt.lo $(objects)/k_cos.lo $(objects)/k_rem_pio2.lo $(objects)/k_sin.lo $(objects)/k_tan.lo $(objects)/s_atan.lo $(objects)/s_copysign.lo $(objects)/s_cos.lo $(objects)/s_fabs.lo $(objects)/s_floor.lo $(objects)/s_scalbn.lo $(objects)/s_sin.lo $(objects)/s_tan.lo $(objects)/SDL_power.lo $(objects)/SDL_d3dmath.lo $(objects)/SDL_render.lo $(objects)/SDL_yuv_mmx.lo $(objects)/SDL_yuv_sw.lo $(objects)/SDL_render_d3d.lo $(objects)/SDL_render_d3d11.lo $(objects)/SDL_render_gl.lo $(objects)/SDL_shaders_gl.lo $(objects)/SDL_render_gles.lo $(objects)/SDL_render_gles2.lo $(objects)/SDL_shaders_gles2.lo $(objects)/SDL_render_psp.lo $(objects)/SDL_blendfillrect.lo $(objects)/SDL_blendline.lo $(objects)/SDL_blendpoint.lo $(objects)/SDL_drawline.lo $(objects)/SDL_drawpoint.lo $(objects)/SDL_render_sw.lo $(objects)/SDL_rotate.lo $(objects)/SDL_getenv.lo $(objects)/SDL_iconv.lo $(objects)/SDL_malloc.lo $(objects)/SDL_qsort.lo $(objects)/SDL_stdlib.lo $(objects)/SDL_string.lo $(objects)/SDL_thread.lo $(objects)/SDL_timer.lo $(objects)/SDL_RLEaccel.lo $(objects)/SDL_blit.lo $(objects)/SDL_blit_0.lo $(objects)/SDL_blit_1.lo $(objects)/SDL_blit_A.lo $(objects)/SDL_blit_N.lo $(objects)/SDL_blit_auto.lo $(objects)/SDL_blit_copy.lo $(objects)/SDL_blit_slow.lo $(objects)/SDL_bmp.lo $(objects)/SDL_clipboard.lo $(objects)/SDL_egl.lo $(objects)/SDL_fillrect.lo $(objects)/SDL_pixels.lo $(objects)/SDL_rect.lo $(objects)/SDL_shape.lo $(objects)/SDL_stretch.lo $(objects)/SDL_surface.lo $(objects)/SDL_video.lo $(objects)/SDL_nullevents.lo $(objects)/SDL_nullframebuffer.lo $(objects)/SDL_nullvideo.lo $(objects)/SDL_diskaudio.lo $(objects)/SDL_dummyaudio.lo $(objects)/SDL_sysloadso.lo $(objects)/SDL_dspaudio.lo $(objects)/SDL_x11clipboard.lo $(objects)/SDL_x11dyn.lo $(objects)/SDL_x11events.lo $(objects)/SDL_x11framebuffer.lo $(objects)/SDL_x11keyboard.lo $(objects)/SDL_x11messagebox.lo $(objects)/SDL_x11modes.lo $(objects)/SDL_x11mouse.lo $(objects)/SDL_x11opengl.lo $(objects)/SDL_x11opengles.lo $(objects)/SDL_x11shape.lo $(objects)/SDL_x11touch.lo $(objects)/SDL_x11video.lo $(objects)/SDL_x11window.lo $(objects)/SDL_x11xinput2.lo $(objects)/edid-parse.lo $(objects)/imKStoUCS.lo $(objects)/SDL_ime.lo $(objects)/SDL_systhread.lo $(objects)/SDL_syssem.lo $(objects)/SDL_sysmutex.lo $(objects)/SDL_syscond.lo $(objects)/SDL_systls.lo $(objects)/SDL_sysjoystick.lo $(objects)/SDL_syshaptic.lo $(objects)/SDL_syspower.lo $(objects)/SDL_sysfilesystem.lo $(objects)/SDL_systimer.lo $(objects)/SDL_evdev.lo $(objects)/SDL_evdev_kbd.lo
|
||||
GEN_HEADERS =
|
||||
GEN_OBJECTS =
|
||||
VERSION_OBJECTS =
|
||||
|
||||
SDLMAIN_TARGET = libSDL2main.a
|
||||
SDLMAIN_OBJECTS = $(objects)/SDL_dummy_main.o
|
||||
|
||||
SDLTEST_TARGET = libSDL2_test.a
|
||||
SDLTEST_OBJECTS = $(objects)/SDL_test_assert.o $(objects)/SDL_test_common.o $(objects)/SDL_test_compare.o $(objects)/SDL_test_crc32.o $(objects)/SDL_test_font.o $(objects)/SDL_test_fuzzer.o $(objects)/SDL_test_harness.o $(objects)/SDL_test_imageBlit.o $(objects)/SDL_test_imageBlitBlend.o $(objects)/SDL_test_imageFace.o $(objects)/SDL_test_imagePrimitives.o $(objects)/SDL_test_imagePrimitivesBlend.o $(objects)/SDL_test_log.o $(objects)/SDL_test_md5.o $(objects)/SDL_test_random.o
|
||||
|
||||
WAYLAND_SCANNER =
|
||||
|
||||
SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS
|
||||
GEN_DIST = SDL2.spec
|
||||
|
||||
ifneq ($V,1)
|
||||
RUN_CMD_AR = @echo " AR " $@;
|
||||
RUN_CMD_CC = @echo " CC " $@;
|
||||
RUN_CMD_CXX = @echo " CXX " $@;
|
||||
RUN_CMD_LTLINK = @echo " LTLINK" $@;
|
||||
RUN_CMD_RANLIB = @echo " RANLIB" $@;
|
||||
RUN_CMD_GEN = @echo " GEN " $@;
|
||||
LIBTOOL += --quiet
|
||||
endif
|
||||
|
||||
HDRS = \
|
||||
SDL.h \
|
||||
SDL_assert.h \
|
||||
SDL_atomic.h \
|
||||
SDL_audio.h \
|
||||
SDL_bits.h \
|
||||
SDL_blendmode.h \
|
||||
SDL_clipboard.h \
|
||||
SDL_cpuinfo.h \
|
||||
SDL_egl.h \
|
||||
SDL_endian.h \
|
||||
SDL_error.h \
|
||||
SDL_events.h \
|
||||
SDL_filesystem.h \
|
||||
SDL_gamecontroller.h \
|
||||
SDL_gesture.h \
|
||||
SDL_haptic.h \
|
||||
SDL_hints.h \
|
||||
SDL_joystick.h \
|
||||
SDL_keyboard.h \
|
||||
SDL_keycode.h \
|
||||
SDL_loadso.h \
|
||||
SDL_log.h \
|
||||
SDL_main.h \
|
||||
SDL_messagebox.h \
|
||||
SDL_mouse.h \
|
||||
SDL_mutex.h \
|
||||
SDL_name.h \
|
||||
SDL_opengl.h \
|
||||
SDL_opengl_glext.h \
|
||||
SDL_opengles.h \
|
||||
SDL_opengles2_gl2ext.h \
|
||||
SDL_opengles2_gl2.h \
|
||||
SDL_opengles2_gl2platform.h \
|
||||
SDL_opengles2.h \
|
||||
SDL_opengles2_khrplatform.h \
|
||||
SDL_pixels.h \
|
||||
SDL_platform.h \
|
||||
SDL_power.h \
|
||||
SDL_quit.h \
|
||||
SDL_rect.h \
|
||||
SDL_render.h \
|
||||
SDL_rwops.h \
|
||||
SDL_scancode.h \
|
||||
SDL_shape.h \
|
||||
SDL_stdinc.h \
|
||||
SDL_surface.h \
|
||||
SDL_system.h \
|
||||
SDL_syswm.h \
|
||||
SDL_thread.h \
|
||||
SDL_timer.h \
|
||||
SDL_touch.h \
|
||||
SDL_types.h \
|
||||
SDL_version.h \
|
||||
SDL_video.h \
|
||||
begin_code.h \
|
||||
close_code.h
|
||||
|
||||
SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
|
||||
|
||||
LT_AGE = 5
|
||||
LT_CURRENT = 5
|
||||
LT_RELEASE = 2.0
|
||||
LT_REVISION = 0
|
||||
LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
|
||||
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
|
||||
|
||||
$(srcdir)/configure: $(srcdir)/configure.in
|
||||
@echo "Warning, configure is out of date, please re-run autogen.sh"
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in
|
||||
$(SHELL) config.status $@
|
||||
|
||||
Makefile.in:;
|
||||
|
||||
$(objects):
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $@
|
||||
|
||||
update-revision:
|
||||
$(SHELL) $(auxdir)/updaterev.sh
|
||||
|
||||
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
|
||||
|
||||
$(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
|
||||
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
|
||||
|
||||
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
|
||||
$(RUN_CMD_AR)$(AR) cru $@ $(SDLMAIN_OBJECTS)
|
||||
$(RUN_CMD_RANLIB)$(RANLIB) $@
|
||||
|
||||
$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
|
||||
$(RUN_CMD_AR)$(AR) cru $@ $(SDLTEST_OBJECTS)
|
||||
$(RUN_CMD_RANLIB)$(RANLIB) $@
|
||||
|
||||
install: all install-bin install-hdrs install-lib install-data
|
||||
install-bin:
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
|
||||
$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
|
||||
install-hdrs: update-revision
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
|
||||
for file in $(HDRS) $(SDLTEST_HDRS); do \
|
||||
$(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
|
||||
done
|
||||
$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
|
||||
if test -f include/SDL_revision.h; then \
|
||||
$(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
|
||||
else \
|
||||
$(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
|
||||
fi
|
||||
|
||||
install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
|
||||
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
|
||||
$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
$(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
|
||||
$(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
|
||||
install-data:
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
|
||||
$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
|
||||
$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
|
||||
$(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
|
||||
|
||||
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
|
||||
uninstall-bin:
|
||||
rm -f $(DESTDIR)$(bindir)/sdl2-config
|
||||
uninstall-hdrs:
|
||||
for file in $(HDRS) $(SDLTEST_HDRS); do \
|
||||
rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
|
||||
done
|
||||
rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
|
||||
rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
|
||||
-rmdir $(DESTDIR)$(includedir)/SDL2
|
||||
uninstall-lib:
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
|
||||
rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
|
||||
uninstall-data:
|
||||
rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
|
||||
rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
|
||||
rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake
|
||||
|
||||
clean:
|
||||
rm -rf $(objects)
|
||||
rm -rf $(gen)
|
||||
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.rules sdl2-config
|
||||
rm -f config.status config.cache config.log libtool
|
||||
rm -rf $(srcdir)/autom4te*
|
||||
find $(srcdir) \( \
|
||||
-name '*~' -o \
|
||||
-name '*.bak' -o \
|
||||
-name '*.old' -o \
|
||||
-name '*.rej' -o \
|
||||
-name '*.orig' -o \
|
||||
-name '.#*' \) \
|
||||
-exec rm -f {} \;
|
||||
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
|
||||
|
||||
dist $(distfile):
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
|
||||
(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
|
||||
tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
|
||||
find $(distdir) \( \
|
||||
-name '*~' -o \
|
||||
-name '*.bak' -o \
|
||||
-name '*.old' -o \
|
||||
-name '*.rej' -o \
|
||||
-name '*.orig' -o \
|
||||
-name '.#*' \) \
|
||||
-exec rm -f {} \;
|
||||
if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
|
||||
(cd $(distdir); build-scripts/updaterev.sh)
|
||||
tar cvf - $(distdir) | gzip --best >$(distfile)
|
||||
rm -rf $(distdir)
|
||||
|
||||
rpm: $(distfile)
|
||||
rpmbuild -ta $?
|
||||
|
||||
# Build rules for objects
|
||||
-include $(OBJECTS:.lo=.d)
|
||||
|
||||
# Special dependency for SDL.c, since it depends on SDL_revision.h
|
||||
/home/martin/temp/SDL2/src/SDL.c: update-revision
|
||||
|
||||
$(objects)/SDL.lo: /home/martin/temp/SDL2/src/SDL.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_assert.lo: /home/martin/temp/SDL2/src/SDL_assert.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dataqueue.lo: /home/martin/temp/SDL2/src/SDL_dataqueue.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_error.lo: /home/martin/temp/SDL2/src/SDL_error.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_hints.lo: /home/martin/temp/SDL2/src/SDL_hints.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_log.lo: /home/martin/temp/SDL2/src/SDL_log.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_atomic.lo: /home/martin/temp/SDL2/src/atomic/SDL_atomic.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_spinlock.lo: /home/martin/temp/SDL2/src/atomic/SDL_spinlock.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_audio.lo: /home/martin/temp/SDL2/src/audio/SDL_audio.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_audiocvt.lo: /home/martin/temp/SDL2/src/audio/SDL_audiocvt.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_audiodev.lo: /home/martin/temp/SDL2/src/audio/SDL_audiodev.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_audiotypecvt.lo: /home/martin/temp/SDL2/src/audio/SDL_audiotypecvt.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_mixer.lo: /home/martin/temp/SDL2/src/audio/SDL_mixer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_wave.lo: /home/martin/temp/SDL2/src/audio/SDL_wave.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_cpuinfo.lo: /home/martin/temp/SDL2/src/cpuinfo/SDL_cpuinfo.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dynapi.lo: /home/martin/temp/SDL2/src/dynapi/SDL_dynapi.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_clipboardevents.lo: /home/martin/temp/SDL2/src/events/SDL_clipboardevents.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dropevents.lo: /home/martin/temp/SDL2/src/events/SDL_dropevents.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_events.lo: /home/martin/temp/SDL2/src/events/SDL_events.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_gesture.lo: /home/martin/temp/SDL2/src/events/SDL_gesture.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_keyboard.lo: /home/martin/temp/SDL2/src/events/SDL_keyboard.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_mouse.lo: /home/martin/temp/SDL2/src/events/SDL_mouse.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_quit.lo: /home/martin/temp/SDL2/src/events/SDL_quit.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_touch.lo: /home/martin/temp/SDL2/src/events/SDL_touch.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_windowevents.lo: /home/martin/temp/SDL2/src/events/SDL_windowevents.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_rwops.lo: /home/martin/temp/SDL2/src/file/SDL_rwops.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_haptic.lo: /home/martin/temp/SDL2/src/haptic/SDL_haptic.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_gamecontroller.lo: /home/martin/temp/SDL2/src/joystick/SDL_gamecontroller.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_joystick.lo: /home/martin/temp/SDL2/src/joystick/SDL_joystick.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_atan2.lo: /home/martin/temp/SDL2/src/libm/e_atan2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_log.lo: /home/martin/temp/SDL2/src/libm/e_log.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_pow.lo: /home/martin/temp/SDL2/src/libm/e_pow.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_rem_pio2.lo: /home/martin/temp/SDL2/src/libm/e_rem_pio2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_sqrt.lo: /home/martin/temp/SDL2/src/libm/e_sqrt.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/k_cos.lo: /home/martin/temp/SDL2/src/libm/k_cos.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/k_rem_pio2.lo: /home/martin/temp/SDL2/src/libm/k_rem_pio2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/k_sin.lo: /home/martin/temp/SDL2/src/libm/k_sin.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/k_tan.lo: /home/martin/temp/SDL2/src/libm/k_tan.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_atan.lo: /home/martin/temp/SDL2/src/libm/s_atan.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_copysign.lo: /home/martin/temp/SDL2/src/libm/s_copysign.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_cos.lo: /home/martin/temp/SDL2/src/libm/s_cos.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_fabs.lo: /home/martin/temp/SDL2/src/libm/s_fabs.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_floor.lo: /home/martin/temp/SDL2/src/libm/s_floor.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_scalbn.lo: /home/martin/temp/SDL2/src/libm/s_scalbn.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_sin.lo: /home/martin/temp/SDL2/src/libm/s_sin.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_tan.lo: /home/martin/temp/SDL2/src/libm/s_tan.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_power.lo: /home/martin/temp/SDL2/src/power/SDL_power.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_d3dmath.lo: /home/martin/temp/SDL2/src/render/SDL_d3dmath.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render.lo: /home/martin/temp/SDL2/src/render/SDL_render.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_yuv_mmx.lo: /home/martin/temp/SDL2/src/render/SDL_yuv_mmx.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_yuv_sw.lo: /home/martin/temp/SDL2/src/render/SDL_yuv_sw.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_d3d.lo: /home/martin/temp/SDL2/src/render/direct3d/SDL_render_d3d.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_d3d11.lo: /home/martin/temp/SDL2/src/render/direct3d11/SDL_render_d3d11.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_gl.lo: /home/martin/temp/SDL2/src/render/opengl/SDL_render_gl.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_shaders_gl.lo: /home/martin/temp/SDL2/src/render/opengl/SDL_shaders_gl.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_gles.lo: /home/martin/temp/SDL2/src/render/opengles/SDL_render_gles.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_gles2.lo: /home/martin/temp/SDL2/src/render/opengles2/SDL_render_gles2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_shaders_gles2.lo: /home/martin/temp/SDL2/src/render/opengles2/SDL_shaders_gles2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_psp.lo: /home/martin/temp/SDL2/src/render/psp/SDL_render_psp.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blendfillrect.lo: /home/martin/temp/SDL2/src/render/software/SDL_blendfillrect.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blendline.lo: /home/martin/temp/SDL2/src/render/software/SDL_blendline.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blendpoint.lo: /home/martin/temp/SDL2/src/render/software/SDL_blendpoint.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_drawline.lo: /home/martin/temp/SDL2/src/render/software/SDL_drawline.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_drawpoint.lo: /home/martin/temp/SDL2/src/render/software/SDL_drawpoint.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_sw.lo: /home/martin/temp/SDL2/src/render/software/SDL_render_sw.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_rotate.lo: /home/martin/temp/SDL2/src/render/software/SDL_rotate.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_getenv.lo: /home/martin/temp/SDL2/src/stdlib/SDL_getenv.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_iconv.lo: /home/martin/temp/SDL2/src/stdlib/SDL_iconv.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_malloc.lo: /home/martin/temp/SDL2/src/stdlib/SDL_malloc.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_qsort.lo: /home/martin/temp/SDL2/src/stdlib/SDL_qsort.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_stdlib.lo: /home/martin/temp/SDL2/src/stdlib/SDL_stdlib.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_string.lo: /home/martin/temp/SDL2/src/stdlib/SDL_string.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_thread.lo: /home/martin/temp/SDL2/src/thread/SDL_thread.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_timer.lo: /home/martin/temp/SDL2/src/timer/SDL_timer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_RLEaccel.lo: /home/martin/temp/SDL2/src/video/SDL_RLEaccel.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit.lo: /home/martin/temp/SDL2/src/video/SDL_blit.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_0.lo: /home/martin/temp/SDL2/src/video/SDL_blit_0.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_1.lo: /home/martin/temp/SDL2/src/video/SDL_blit_1.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_A.lo: /home/martin/temp/SDL2/src/video/SDL_blit_A.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_N.lo: /home/martin/temp/SDL2/src/video/SDL_blit_N.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_auto.lo: /home/martin/temp/SDL2/src/video/SDL_blit_auto.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_copy.lo: /home/martin/temp/SDL2/src/video/SDL_blit_copy.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_slow.lo: /home/martin/temp/SDL2/src/video/SDL_blit_slow.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_bmp.lo: /home/martin/temp/SDL2/src/video/SDL_bmp.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_clipboard.lo: /home/martin/temp/SDL2/src/video/SDL_clipboard.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_egl.lo: /home/martin/temp/SDL2/src/video/SDL_egl.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_fillrect.lo: /home/martin/temp/SDL2/src/video/SDL_fillrect.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_pixels.lo: /home/martin/temp/SDL2/src/video/SDL_pixels.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_rect.lo: /home/martin/temp/SDL2/src/video/SDL_rect.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_shape.lo: /home/martin/temp/SDL2/src/video/SDL_shape.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_stretch.lo: /home/martin/temp/SDL2/src/video/SDL_stretch.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_surface.lo: /home/martin/temp/SDL2/src/video/SDL_surface.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_video.lo: /home/martin/temp/SDL2/src/video/SDL_video.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_nullevents.lo: /home/martin/temp/SDL2/src/video/dummy/SDL_nullevents.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_nullframebuffer.lo: /home/martin/temp/SDL2/src/video/dummy/SDL_nullframebuffer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_nullvideo.lo: /home/martin/temp/SDL2/src/video/dummy/SDL_nullvideo.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_diskaudio.lo: /home/martin/temp/SDL2/src/audio/disk/SDL_diskaudio.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dummyaudio.lo: /home/martin/temp/SDL2/src/audio/dummy/SDL_dummyaudio.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_sysloadso.lo: /home/martin/temp/SDL2/src/loadso/dlopen/SDL_sysloadso.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dspaudio.lo: /home/martin/temp/SDL2/src/audio/dsp/SDL_dspaudio.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11clipboard.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11clipboard.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11dyn.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11dyn.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11events.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11events.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11framebuffer.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11framebuffer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11keyboard.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11keyboard.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11messagebox.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11messagebox.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11modes.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11modes.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11mouse.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11mouse.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11opengl.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11opengl.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11opengles.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11opengles.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11shape.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11shape.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11touch.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11touch.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11video.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11video.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11window.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11window.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11xinput2.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11xinput2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/edid-parse.lo: /home/martin/temp/SDL2/src/video/x11/edid-parse.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/imKStoUCS.lo: /home/martin/temp/SDL2/src/video/x11/imKStoUCS.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_ime.lo: /home/martin/temp/SDL2/src/core/linux/SDL_ime.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_systhread.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_systhread.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_syssem.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_syssem.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_sysmutex.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_sysmutex.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_syscond.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_syscond.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_systls.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_systls.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_sysjoystick.lo: /home/martin/temp/SDL2/src/joystick/linux/SDL_sysjoystick.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_syshaptic.lo: /home/martin/temp/SDL2/src/haptic/linux/SDL_syshaptic.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_syspower.lo: /home/martin/temp/SDL2/src/power/linux/SDL_syspower.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_sysfilesystem.lo: /home/martin/temp/SDL2/src/filesystem/unix/SDL_sysfilesystem.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_systimer.lo: /home/martin/temp/SDL2/src/timer/unix/SDL_systimer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_evdev.lo: /home/martin/temp/SDL2/src/core/linux/SDL_evdev.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_evdev_kbd.lo: /home/martin/temp/SDL2/src/core/linux/SDL_evdev_kbd.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
|
||||
$(objects)/SDL_dummy_main.o: /home/martin/temp/SDL2/src/main/dummy/SDL_dummy_main.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_test_assert.o: /home/martin/temp/SDL2/src/test/SDL_test_assert.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_common.o: /home/martin/temp/SDL2/src/test/SDL_test_common.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_compare.o: /home/martin/temp/SDL2/src/test/SDL_test_compare.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_crc32.o: /home/martin/temp/SDL2/src/test/SDL_test_crc32.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_font.o: /home/martin/temp/SDL2/src/test/SDL_test_font.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_fuzzer.o: /home/martin/temp/SDL2/src/test/SDL_test_fuzzer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_harness.o: /home/martin/temp/SDL2/src/test/SDL_test_harness.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imageBlit.o: /home/martin/temp/SDL2/src/test/SDL_test_imageBlit.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imageBlitBlend.o: /home/martin/temp/SDL2/src/test/SDL_test_imageBlitBlend.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imageFace.o: /home/martin/temp/SDL2/src/test/SDL_test_imageFace.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imagePrimitives.o: /home/martin/temp/SDL2/src/test/SDL_test_imagePrimitives.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imagePrimitivesBlend.o: /home/martin/temp/SDL2/src/test/SDL_test_imagePrimitivesBlend.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_log.o: /home/martin/temp/SDL2/src/test/SDL_test_log.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_md5.o: /home/martin/temp/SDL2/src/test/SDL_test_md5.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_random.o: /home/martin/temp/SDL2/src/test/SDL_test_random.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
@@ -1,432 +0,0 @@
|
||||
|
||||
# Build rules for objects
|
||||
-include $(OBJECTS:.lo=.d)
|
||||
|
||||
# Special dependency for SDL.c, since it depends on SDL_revision.h
|
||||
/home/martin/temp/SDL2/src/SDL.c: update-revision
|
||||
|
||||
$(objects)/SDL.lo: /home/martin/temp/SDL2/src/SDL.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_assert.lo: /home/martin/temp/SDL2/src/SDL_assert.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dataqueue.lo: /home/martin/temp/SDL2/src/SDL_dataqueue.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_error.lo: /home/martin/temp/SDL2/src/SDL_error.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_hints.lo: /home/martin/temp/SDL2/src/SDL_hints.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_log.lo: /home/martin/temp/SDL2/src/SDL_log.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_atomic.lo: /home/martin/temp/SDL2/src/atomic/SDL_atomic.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_spinlock.lo: /home/martin/temp/SDL2/src/atomic/SDL_spinlock.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_audio.lo: /home/martin/temp/SDL2/src/audio/SDL_audio.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_audiocvt.lo: /home/martin/temp/SDL2/src/audio/SDL_audiocvt.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_audiodev.lo: /home/martin/temp/SDL2/src/audio/SDL_audiodev.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_audiotypecvt.lo: /home/martin/temp/SDL2/src/audio/SDL_audiotypecvt.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_mixer.lo: /home/martin/temp/SDL2/src/audio/SDL_mixer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_wave.lo: /home/martin/temp/SDL2/src/audio/SDL_wave.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_cpuinfo.lo: /home/martin/temp/SDL2/src/cpuinfo/SDL_cpuinfo.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dynapi.lo: /home/martin/temp/SDL2/src/dynapi/SDL_dynapi.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_clipboardevents.lo: /home/martin/temp/SDL2/src/events/SDL_clipboardevents.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dropevents.lo: /home/martin/temp/SDL2/src/events/SDL_dropevents.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_events.lo: /home/martin/temp/SDL2/src/events/SDL_events.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_gesture.lo: /home/martin/temp/SDL2/src/events/SDL_gesture.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_keyboard.lo: /home/martin/temp/SDL2/src/events/SDL_keyboard.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_mouse.lo: /home/martin/temp/SDL2/src/events/SDL_mouse.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_quit.lo: /home/martin/temp/SDL2/src/events/SDL_quit.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_touch.lo: /home/martin/temp/SDL2/src/events/SDL_touch.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_windowevents.lo: /home/martin/temp/SDL2/src/events/SDL_windowevents.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_rwops.lo: /home/martin/temp/SDL2/src/file/SDL_rwops.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_haptic.lo: /home/martin/temp/SDL2/src/haptic/SDL_haptic.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_gamecontroller.lo: /home/martin/temp/SDL2/src/joystick/SDL_gamecontroller.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_joystick.lo: /home/martin/temp/SDL2/src/joystick/SDL_joystick.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_atan2.lo: /home/martin/temp/SDL2/src/libm/e_atan2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_log.lo: /home/martin/temp/SDL2/src/libm/e_log.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_pow.lo: /home/martin/temp/SDL2/src/libm/e_pow.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_rem_pio2.lo: /home/martin/temp/SDL2/src/libm/e_rem_pio2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/e_sqrt.lo: /home/martin/temp/SDL2/src/libm/e_sqrt.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/k_cos.lo: /home/martin/temp/SDL2/src/libm/k_cos.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/k_rem_pio2.lo: /home/martin/temp/SDL2/src/libm/k_rem_pio2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/k_sin.lo: /home/martin/temp/SDL2/src/libm/k_sin.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/k_tan.lo: /home/martin/temp/SDL2/src/libm/k_tan.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_atan.lo: /home/martin/temp/SDL2/src/libm/s_atan.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_copysign.lo: /home/martin/temp/SDL2/src/libm/s_copysign.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_cos.lo: /home/martin/temp/SDL2/src/libm/s_cos.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_fabs.lo: /home/martin/temp/SDL2/src/libm/s_fabs.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_floor.lo: /home/martin/temp/SDL2/src/libm/s_floor.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_scalbn.lo: /home/martin/temp/SDL2/src/libm/s_scalbn.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_sin.lo: /home/martin/temp/SDL2/src/libm/s_sin.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/s_tan.lo: /home/martin/temp/SDL2/src/libm/s_tan.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_power.lo: /home/martin/temp/SDL2/src/power/SDL_power.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_d3dmath.lo: /home/martin/temp/SDL2/src/render/SDL_d3dmath.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render.lo: /home/martin/temp/SDL2/src/render/SDL_render.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_yuv_mmx.lo: /home/martin/temp/SDL2/src/render/SDL_yuv_mmx.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_yuv_sw.lo: /home/martin/temp/SDL2/src/render/SDL_yuv_sw.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_d3d.lo: /home/martin/temp/SDL2/src/render/direct3d/SDL_render_d3d.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_d3d11.lo: /home/martin/temp/SDL2/src/render/direct3d11/SDL_render_d3d11.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_gl.lo: /home/martin/temp/SDL2/src/render/opengl/SDL_render_gl.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_shaders_gl.lo: /home/martin/temp/SDL2/src/render/opengl/SDL_shaders_gl.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_gles.lo: /home/martin/temp/SDL2/src/render/opengles/SDL_render_gles.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_gles2.lo: /home/martin/temp/SDL2/src/render/opengles2/SDL_render_gles2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_shaders_gles2.lo: /home/martin/temp/SDL2/src/render/opengles2/SDL_shaders_gles2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_psp.lo: /home/martin/temp/SDL2/src/render/psp/SDL_render_psp.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blendfillrect.lo: /home/martin/temp/SDL2/src/render/software/SDL_blendfillrect.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blendline.lo: /home/martin/temp/SDL2/src/render/software/SDL_blendline.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blendpoint.lo: /home/martin/temp/SDL2/src/render/software/SDL_blendpoint.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_drawline.lo: /home/martin/temp/SDL2/src/render/software/SDL_drawline.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_drawpoint.lo: /home/martin/temp/SDL2/src/render/software/SDL_drawpoint.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_render_sw.lo: /home/martin/temp/SDL2/src/render/software/SDL_render_sw.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_rotate.lo: /home/martin/temp/SDL2/src/render/software/SDL_rotate.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_getenv.lo: /home/martin/temp/SDL2/src/stdlib/SDL_getenv.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_iconv.lo: /home/martin/temp/SDL2/src/stdlib/SDL_iconv.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_malloc.lo: /home/martin/temp/SDL2/src/stdlib/SDL_malloc.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_qsort.lo: /home/martin/temp/SDL2/src/stdlib/SDL_qsort.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_stdlib.lo: /home/martin/temp/SDL2/src/stdlib/SDL_stdlib.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_string.lo: /home/martin/temp/SDL2/src/stdlib/SDL_string.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_thread.lo: /home/martin/temp/SDL2/src/thread/SDL_thread.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_timer.lo: /home/martin/temp/SDL2/src/timer/SDL_timer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_RLEaccel.lo: /home/martin/temp/SDL2/src/video/SDL_RLEaccel.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit.lo: /home/martin/temp/SDL2/src/video/SDL_blit.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_0.lo: /home/martin/temp/SDL2/src/video/SDL_blit_0.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_1.lo: /home/martin/temp/SDL2/src/video/SDL_blit_1.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_A.lo: /home/martin/temp/SDL2/src/video/SDL_blit_A.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_N.lo: /home/martin/temp/SDL2/src/video/SDL_blit_N.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_auto.lo: /home/martin/temp/SDL2/src/video/SDL_blit_auto.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_copy.lo: /home/martin/temp/SDL2/src/video/SDL_blit_copy.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_blit_slow.lo: /home/martin/temp/SDL2/src/video/SDL_blit_slow.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_bmp.lo: /home/martin/temp/SDL2/src/video/SDL_bmp.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_clipboard.lo: /home/martin/temp/SDL2/src/video/SDL_clipboard.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_egl.lo: /home/martin/temp/SDL2/src/video/SDL_egl.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_fillrect.lo: /home/martin/temp/SDL2/src/video/SDL_fillrect.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_pixels.lo: /home/martin/temp/SDL2/src/video/SDL_pixels.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_rect.lo: /home/martin/temp/SDL2/src/video/SDL_rect.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_shape.lo: /home/martin/temp/SDL2/src/video/SDL_shape.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_stretch.lo: /home/martin/temp/SDL2/src/video/SDL_stretch.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_surface.lo: /home/martin/temp/SDL2/src/video/SDL_surface.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_video.lo: /home/martin/temp/SDL2/src/video/SDL_video.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_nullevents.lo: /home/martin/temp/SDL2/src/video/dummy/SDL_nullevents.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_nullframebuffer.lo: /home/martin/temp/SDL2/src/video/dummy/SDL_nullframebuffer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_nullvideo.lo: /home/martin/temp/SDL2/src/video/dummy/SDL_nullvideo.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_diskaudio.lo: /home/martin/temp/SDL2/src/audio/disk/SDL_diskaudio.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dummyaudio.lo: /home/martin/temp/SDL2/src/audio/dummy/SDL_dummyaudio.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_sysloadso.lo: /home/martin/temp/SDL2/src/loadso/dlopen/SDL_sysloadso.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_dspaudio.lo: /home/martin/temp/SDL2/src/audio/dsp/SDL_dspaudio.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11clipboard.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11clipboard.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11dyn.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11dyn.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11events.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11events.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11framebuffer.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11framebuffer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11keyboard.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11keyboard.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11messagebox.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11messagebox.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11modes.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11modes.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11mouse.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11mouse.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11opengl.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11opengl.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11opengles.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11opengles.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11shape.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11shape.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11touch.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11touch.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11video.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11video.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11window.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11window.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_x11xinput2.lo: /home/martin/temp/SDL2/src/video/x11/SDL_x11xinput2.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/edid-parse.lo: /home/martin/temp/SDL2/src/video/x11/edid-parse.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/imKStoUCS.lo: /home/martin/temp/SDL2/src/video/x11/imKStoUCS.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_ime.lo: /home/martin/temp/SDL2/src/core/linux/SDL_ime.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_systhread.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_systhread.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_syssem.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_syssem.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_sysmutex.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_sysmutex.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_syscond.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_syscond.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_systls.lo: /home/martin/temp/SDL2/src/thread/pthread/SDL_systls.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_sysjoystick.lo: /home/martin/temp/SDL2/src/joystick/linux/SDL_sysjoystick.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_syshaptic.lo: /home/martin/temp/SDL2/src/haptic/linux/SDL_syshaptic.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_syspower.lo: /home/martin/temp/SDL2/src/power/linux/SDL_syspower.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_sysfilesystem.lo: /home/martin/temp/SDL2/src/filesystem/unix/SDL_sysfilesystem.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_systimer.lo: /home/martin/temp/SDL2/src/timer/unix/SDL_systimer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_evdev.lo: /home/martin/temp/SDL2/src/core/linux/SDL_evdev.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_evdev_kbd.lo: /home/martin/temp/SDL2/src/core/linux/SDL_evdev_kbd.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
|
||||
$(objects)/SDL_dummy_main.o: /home/martin/temp/SDL2/src/main/dummy/SDL_dummy_main.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
$(objects)/SDL_test_assert.o: /home/martin/temp/SDL2/src/test/SDL_test_assert.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_common.o: /home/martin/temp/SDL2/src/test/SDL_test_common.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_compare.o: /home/martin/temp/SDL2/src/test/SDL_test_compare.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_crc32.o: /home/martin/temp/SDL2/src/test/SDL_test_crc32.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_font.o: /home/martin/temp/SDL2/src/test/SDL_test_font.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_fuzzer.o: /home/martin/temp/SDL2/src/test/SDL_test_fuzzer.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_harness.o: /home/martin/temp/SDL2/src/test/SDL_test_harness.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imageBlit.o: /home/martin/temp/SDL2/src/test/SDL_test_imageBlit.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imageBlitBlend.o: /home/martin/temp/SDL2/src/test/SDL_test_imageBlitBlend.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imageFace.o: /home/martin/temp/SDL2/src/test/SDL_test_imageFace.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imagePrimitives.o: /home/martin/temp/SDL2/src/test/SDL_test_imagePrimitives.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_imagePrimitivesBlend.o: /home/martin/temp/SDL2/src/test/SDL_test_imagePrimitivesBlend.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_log.o: /home/martin/temp/SDL2/src/test/SDL_test_log.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_md5.o: /home/martin/temp/SDL2/src/test/SDL_test_md5.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
$(objects)/SDL_test_random.o: /home/martin/temp/SDL2/src/test/SDL_test_random.c
|
||||
$(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
|
||||
|
||||
|
Before Width: | Height: | Size: 801 B |
|
Before Width: | Height: | Size: 329 B |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 429 B |
|
Before Width: | Height: | Size: 801 B |
|
Before Width: | Height: | Size: 329 B |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 429 B |
@@ -1 +0,0 @@
|
||||
../android-project/app/src/main/AndroidManifest.xml
|
||||
@@ -1,17 +0,0 @@
|
||||
# This file is used to override default values used by the Ant build system.
|
||||
#
|
||||
# This file must be checked into Version Control Systems, as it is
|
||||
# integral to the build system of your project.
|
||||
|
||||
# This file is only used by the Ant script.
|
||||
|
||||
# You can use this to override default values such as
|
||||
# 'source.dir' for the location of your java source folder and
|
||||
# 'out.dir' for the location of your output folder.
|
||||
|
||||
# You can also use it define how the release builds are signed by declaring
|
||||
# the following properties:
|
||||
# 'key.store' for the location of your keystore and
|
||||
# 'key.alias' for the name of the key to use.
|
||||
# The password will be asked during the build when you use the 'release' target.
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# This file is used to override default values used by the Ant build system.
|
||||
#
|
||||
# This file must be checked in Version Control Systems, as it is
|
||||
# integral to the build system of your project.
|
||||
|
||||
# This file is only used by the Ant script.
|
||||
|
||||
# You can use this to override default values such as
|
||||
# 'source.dir' for the location of your java source folder and
|
||||
# 'out.dir' for the location of your output folder.
|
||||
|
||||
# You can also use it define how the release builds are signed by declaring
|
||||
# the following properties:
|
||||
# 'key.store' for the location of your keystore and
|
||||
# 'key.alias' for the name of the key to use.
|
||||
# The password will be asked during the build when you use the 'release' target.
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This should be changed to the name of your project -->
|
||||
<project name="SDLActivity" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
||||
@@ -1,11 +0,0 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "build.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
# Project target.
|
||||
target=android-16
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
# Uncomment this if you're using STL in your project
|
||||
# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
|
||||
# APP_STL := stlport_static
|
||||
|
||||
APP_ABI := armeabi armeabi-v7a x86
|
||||
|
||||
# Min SDK level
|
||||
APP_PLATFORM=android-10
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := main
|
||||
|
||||
LOCAL_SRC_FILES := YourSourceHere.c
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := SDL2_static
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
$(call import-module,SDL)LOCAL_PATH := $(call my-dir)
|
||||
@@ -1,20 +0,0 @@
|
||||
# To enable ProGuard in your project, edit project.properties
|
||||
# to define the proguard.config property as described in that file.
|
||||
#
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in ${sdk.dir}/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the ProGuard
|
||||
# include property in project.properties.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
@@ -1,14 +0,0 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system edit
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
#
|
||||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-16
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
>
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hello World, SDLActivity"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">SDL App</string>
|
||||
</resources>
|
||||
@@ -1 +0,0 @@
|
||||
../android-project/app/src/main/java
|
||||
@@ -1 +0,0 @@
|
||||
include $(call all-subdir-makefiles)
|
||||
@@ -1,18 +0,0 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := main
|
||||
|
||||
SDL_PATH := ../SDL
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include
|
||||
|
||||
# Add your application source files here...
|
||||
LOCAL_SRC_FILES := YourSourceHere.c
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := SDL2
|
||||
|
||||
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
@@ -1,2 +0,0 @@
|
||||
#define SDL_REVISION "hg-0:aaaaaaaaaaah"
|
||||
#define SDL_REVISION_NUMBER 0
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
prefix=/usr/local/stow/SDL2-configure
|
||||
exec_prefix=${prefix}
|
||||
exec_prefix_set=no
|
||||
libdir=${exec_prefix}/lib
|
||||
|
||||
#usage="\
|
||||
#Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
|
||||
usage="\
|
||||
Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
--prefix=*)
|
||||
prefix=$optarg
|
||||
if test $exec_prefix_set = no ; then
|
||||
exec_prefix=$optarg
|
||||
fi
|
||||
;;
|
||||
--prefix)
|
||||
echo $prefix
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix=$optarg
|
||||
exec_prefix_set=yes
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo $exec_prefix
|
||||
;;
|
||||
--version)
|
||||
echo 2.0.5
|
||||
;;
|
||||
--cflags)
|
||||
echo -I${prefix}/include/SDL2 -D_REENTRANT
|
||||
;;
|
||||
--libs)
|
||||
echo -L${exec_prefix}/lib -Wl,-rpath,${libdir} -Wl,--enable-new-dtags -lSDL2
|
||||
;;
|
||||
--static-libs)
|
||||
# --libs|--static-libs)
|
||||
echo -L${exec_prefix}/lib -Wl,-rpath,${libdir} -Wl,--enable-new-dtags -lSDL2 -Wl,--no-undefined -lm -ldl -lpthread -lrt
|
||||
;;
|
||||
*)
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
@@ -1,11 +0,0 @@
|
||||
# sdl2 cmake project-config input for ./configure scripts
|
||||
|
||||
set(prefix "/usr/local/stow/SDL2-configure")
|
||||
set(exec_prefix "${prefix}")
|
||||
set(libdir "${exec_prefix}/lib")
|
||||
set(SDL2_PREFIX "/usr/local/stow/SDL2-configure")
|
||||
set(SDL2_EXEC_PREFIX "/usr/local/stow/SDL2-configure")
|
||||
set(SDL2_LIBDIR "${exec_prefix}/lib")
|
||||
set(SDL2_INCLUDE_DIRS "${prefix}/include/SDL2")
|
||||
set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} -Wl,-rpath,${libdir} -Wl,--enable-new-dtags -lSDL2 ")
|
||||
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
|
||||
@@ -1,15 +0,0 @@
|
||||
# sdl pkg-config source file
|
||||
|
||||
prefix=/usr/local/stow/SDL2-configure
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: sdl2
|
||||
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
|
||||
Version: 2.0.5
|
||||
Requires:
|
||||
Conflicts:
|
||||
Libs: -L${libdir} -Wl,-rpath,${libdir} -Wl,--enable-new-dtags -lSDL2
|
||||
Libs.private: -lSDL2 -Wl,--no-undefined -lm -ldl -lpthread -lrt
|
||||
Cflags: -I${includedir}/SDL2 -D_REENTRANT
|
||||
@@ -1,694 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../SDL_internal.h"
|
||||
|
||||
/* Microsoft WAVE file loading routines */
|
||||
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_wave.h"
|
||||
|
||||
|
||||
static int ReadChunk(SDL_RWops * src, Chunk * chunk);
|
||||
|
||||
struct MS_ADPCM_decodestate
|
||||
{
|
||||
Uint8 hPredictor;
|
||||
Uint16 iDelta;
|
||||
Sint16 iSamp1;
|
||||
Sint16 iSamp2;
|
||||
};
|
||||
static struct MS_ADPCM_decoder
|
||||
{
|
||||
WaveFMT wavefmt;
|
||||
Uint16 wSamplesPerBlock;
|
||||
Uint16 wNumCoef;
|
||||
Sint16 aCoeff[7][2];
|
||||
/* * * */
|
||||
struct MS_ADPCM_decodestate state[2];
|
||||
} MS_ADPCM_state;
|
||||
|
||||
static int
|
||||
InitMS_ADPCM(WaveFMT * format)
|
||||
{
|
||||
Uint8 *rogue_feel;
|
||||
int i;
|
||||
|
||||
/* Set the rogue pointer to the MS_ADPCM specific data */
|
||||
MS_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
|
||||
MS_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels);
|
||||
MS_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency);
|
||||
MS_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate);
|
||||
MS_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign);
|
||||
MS_ADPCM_state.wavefmt.bitspersample =
|
||||
SDL_SwapLE16(format->bitspersample);
|
||||
rogue_feel = (Uint8 *) format + sizeof(*format);
|
||||
if (sizeof(*format) == 16) {
|
||||
/* const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
|
||||
rogue_feel += sizeof(Uint16);
|
||||
}
|
||||
MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
|
||||
rogue_feel += sizeof(Uint16);
|
||||
MS_ADPCM_state.wNumCoef = ((rogue_feel[1] << 8) | rogue_feel[0]);
|
||||
rogue_feel += sizeof(Uint16);
|
||||
if (MS_ADPCM_state.wNumCoef != 7) {
|
||||
SDL_SetError("Unknown set of MS_ADPCM coefficients");
|
||||
return (-1);
|
||||
}
|
||||
for (i = 0; i < MS_ADPCM_state.wNumCoef; ++i) {
|
||||
MS_ADPCM_state.aCoeff[i][0] = ((rogue_feel[1] << 8) | rogue_feel[0]);
|
||||
rogue_feel += sizeof(Uint16);
|
||||
MS_ADPCM_state.aCoeff[i][1] = ((rogue_feel[1] << 8) | rogue_feel[0]);
|
||||
rogue_feel += sizeof(Uint16);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static Sint32
|
||||
MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state,
|
||||
Uint8 nybble, Sint16 * coeff)
|
||||
{
|
||||
const Sint32 max_audioval = ((1 << (16 - 1)) - 1);
|
||||
const Sint32 min_audioval = -(1 << (16 - 1));
|
||||
const Sint32 adaptive[] = {
|
||||
230, 230, 230, 230, 307, 409, 512, 614,
|
||||
768, 614, 512, 409, 307, 230, 230, 230
|
||||
};
|
||||
Sint32 new_sample, delta;
|
||||
|
||||
new_sample = ((state->iSamp1 * coeff[0]) +
|
||||
(state->iSamp2 * coeff[1])) / 256;
|
||||
if (nybble & 0x08) {
|
||||
new_sample += state->iDelta * (nybble - 0x10);
|
||||
} else {
|
||||
new_sample += state->iDelta * nybble;
|
||||
}
|
||||
if (new_sample < min_audioval) {
|
||||
new_sample = min_audioval;
|
||||
} else if (new_sample > max_audioval) {
|
||||
new_sample = max_audioval;
|
||||
}
|
||||
delta = ((Sint32) state->iDelta * adaptive[nybble]) / 256;
|
||||
if (delta < 16) {
|
||||
delta = 16;
|
||||
}
|
||||
state->iDelta = (Uint16) delta;
|
||||
state->iSamp2 = state->iSamp1;
|
||||
state->iSamp1 = (Sint16) new_sample;
|
||||
return (new_sample);
|
||||
}
|
||||
|
||||
static int
|
||||
MS_ADPCM_decode(Uint8 ** audio_buf, Uint32 * audio_len)
|
||||
{
|
||||
struct MS_ADPCM_decodestate *state[2];
|
||||
Uint8 *freeable, *encoded, *decoded;
|
||||
Sint32 encoded_len, samplesleft;
|
||||
Sint8 nybble;
|
||||
Uint8 stereo;
|
||||
Sint16 *coeff[2];
|
||||
Sint32 new_sample;
|
||||
|
||||
/* Allocate the proper sized output buffer */
|
||||
encoded_len = *audio_len;
|
||||
encoded = *audio_buf;
|
||||
freeable = *audio_buf;
|
||||
*audio_len = (encoded_len / MS_ADPCM_state.wavefmt.blockalign) *
|
||||
MS_ADPCM_state.wSamplesPerBlock *
|
||||
MS_ADPCM_state.wavefmt.channels * sizeof(Sint16);
|
||||
*audio_buf = (Uint8 *) SDL_malloc(*audio_len);
|
||||
if (*audio_buf == NULL) {
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
decoded = *audio_buf;
|
||||
|
||||
/* Get ready... Go! */
|
||||
stereo = (MS_ADPCM_state.wavefmt.channels == 2);
|
||||
state[0] = &MS_ADPCM_state.state[0];
|
||||
state[1] = &MS_ADPCM_state.state[stereo];
|
||||
while (encoded_len >= MS_ADPCM_state.wavefmt.blockalign) {
|
||||
/* Grab the initial information for this block */
|
||||
state[0]->hPredictor = *encoded++;
|
||||
if (stereo) {
|
||||
state[1]->hPredictor = *encoded++;
|
||||
}
|
||||
state[0]->iDelta = ((encoded[1] << 8) | encoded[0]);
|
||||
encoded += sizeof(Sint16);
|
||||
if (stereo) {
|
||||
state[1]->iDelta = ((encoded[1] << 8) | encoded[0]);
|
||||
encoded += sizeof(Sint16);
|
||||
}
|
||||
state[0]->iSamp1 = ((encoded[1] << 8) | encoded[0]);
|
||||
encoded += sizeof(Sint16);
|
||||
if (stereo) {
|
||||
state[1]->iSamp1 = ((encoded[1] << 8) | encoded[0]);
|
||||
encoded += sizeof(Sint16);
|
||||
}
|
||||
state[0]->iSamp2 = ((encoded[1] << 8) | encoded[0]);
|
||||
encoded += sizeof(Sint16);
|
||||
if (stereo) {
|
||||
state[1]->iSamp2 = ((encoded[1] << 8) | encoded[0]);
|
||||
encoded += sizeof(Sint16);
|
||||
}
|
||||
coeff[0] = MS_ADPCM_state.aCoeff[state[0]->hPredictor];
|
||||
coeff[1] = MS_ADPCM_state.aCoeff[state[1]->hPredictor];
|
||||
|
||||
/* Store the two initial samples we start with */
|
||||
decoded[0] = state[0]->iSamp2 & 0xFF;
|
||||
decoded[1] = state[0]->iSamp2 >> 8;
|
||||
decoded += 2;
|
||||
if (stereo) {
|
||||
decoded[0] = state[1]->iSamp2 & 0xFF;
|
||||
decoded[1] = state[1]->iSamp2 >> 8;
|
||||
decoded += 2;
|
||||
}
|
||||
decoded[0] = state[0]->iSamp1 & 0xFF;
|
||||
decoded[1] = state[0]->iSamp1 >> 8;
|
||||
decoded += 2;
|
||||
if (stereo) {
|
||||
decoded[0] = state[1]->iSamp1 & 0xFF;
|
||||
decoded[1] = state[1]->iSamp1 >> 8;
|
||||
decoded += 2;
|
||||
}
|
||||
|
||||
/* Decode and store the other samples in this block */
|
||||
samplesleft = (MS_ADPCM_state.wSamplesPerBlock - 2) *
|
||||
MS_ADPCM_state.wavefmt.channels;
|
||||
while (samplesleft > 0) {
|
||||
nybble = (*encoded) >> 4;
|
||||
new_sample = MS_ADPCM_nibble(state[0], nybble, coeff[0]);
|
||||
decoded[0] = new_sample & 0xFF;
|
||||
new_sample >>= 8;
|
||||
decoded[1] = new_sample & 0xFF;
|
||||
decoded += 2;
|
||||
|
||||
nybble = (*encoded) & 0x0F;
|
||||
new_sample = MS_ADPCM_nibble(state[1], nybble, coeff[1]);
|
||||
decoded[0] = new_sample & 0xFF;
|
||||
new_sample >>= 8;
|
||||
decoded[1] = new_sample & 0xFF;
|
||||
decoded += 2;
|
||||
|
||||
++encoded;
|
||||
samplesleft -= 2;
|
||||
}
|
||||
encoded_len -= MS_ADPCM_state.wavefmt.blockalign;
|
||||
}
|
||||
SDL_free(freeable);
|
||||
return (0);
|
||||
}
|
||||
|
||||
struct IMA_ADPCM_decodestate
|
||||
{
|
||||
Sint32 sample;
|
||||
Sint8 index;
|
||||
};
|
||||
static struct IMA_ADPCM_decoder
|
||||
{
|
||||
WaveFMT wavefmt;
|
||||
Uint16 wSamplesPerBlock;
|
||||
/* * * */
|
||||
struct IMA_ADPCM_decodestate state[2];
|
||||
} IMA_ADPCM_state;
|
||||
|
||||
static int
|
||||
InitIMA_ADPCM(WaveFMT * format)
|
||||
{
|
||||
Uint8 *rogue_feel;
|
||||
|
||||
/* Set the rogue pointer to the IMA_ADPCM specific data */
|
||||
IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
|
||||
IMA_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels);
|
||||
IMA_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency);
|
||||
IMA_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate);
|
||||
IMA_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign);
|
||||
IMA_ADPCM_state.wavefmt.bitspersample =
|
||||
SDL_SwapLE16(format->bitspersample);
|
||||
rogue_feel = (Uint8 *) format + sizeof(*format);
|
||||
if (sizeof(*format) == 16) {
|
||||
/* const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
|
||||
rogue_feel += sizeof(Uint16);
|
||||
}
|
||||
IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static Sint32
|
||||
IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state, Uint8 nybble)
|
||||
{
|
||||
const Sint32 max_audioval = ((1 << (16 - 1)) - 1);
|
||||
const Sint32 min_audioval = -(1 << (16 - 1));
|
||||
const int index_table[16] = {
|
||||
-1, -1, -1, -1,
|
||||
2, 4, 6, 8,
|
||||
-1, -1, -1, -1,
|
||||
2, 4, 6, 8
|
||||
};
|
||||
const Sint32 step_table[89] = {
|
||||
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31,
|
||||
34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130,
|
||||
143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408,
|
||||
449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282,
|
||||
1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327,
|
||||
3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630,
|
||||
9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350,
|
||||
22385, 24623, 27086, 29794, 32767
|
||||
};
|
||||
Sint32 delta, step;
|
||||
|
||||
/* Compute difference and new sample value */
|
||||
if (state->index > 88) {
|
||||
state->index = 88;
|
||||
} else if (state->index < 0) {
|
||||
state->index = 0;
|
||||
}
|
||||
/* explicit cast to avoid gcc warning about using 'char' as array index */
|
||||
step = step_table[(int)state->index];
|
||||
delta = step >> 3;
|
||||
if (nybble & 0x04)
|
||||
delta += step;
|
||||
if (nybble & 0x02)
|
||||
delta += (step >> 1);
|
||||
if (nybble & 0x01)
|
||||
delta += (step >> 2);
|
||||
if (nybble & 0x08)
|
||||
delta = -delta;
|
||||
state->sample += delta;
|
||||
|
||||
/* Update index value */
|
||||
state->index += index_table[nybble];
|
||||
|
||||
/* Clamp output sample */
|
||||
if (state->sample > max_audioval) {
|
||||
state->sample = max_audioval;
|
||||
} else if (state->sample < min_audioval) {
|
||||
state->sample = min_audioval;
|
||||
}
|
||||
return (state->sample);
|
||||
}
|
||||
|
||||
/* Fill the decode buffer with a channel block of data (8 samples) */
|
||||
static void
|
||||
Fill_IMA_ADPCM_block(Uint8 * decoded, Uint8 * encoded,
|
||||
int channel, int numchannels,
|
||||
struct IMA_ADPCM_decodestate *state)
|
||||
{
|
||||
int i;
|
||||
Sint8 nybble;
|
||||
Sint32 new_sample;
|
||||
|
||||
decoded += (channel * 2);
|
||||
for (i = 0; i < 4; ++i) {
|
||||
nybble = (*encoded) & 0x0F;
|
||||
new_sample = IMA_ADPCM_nibble(state, nybble);
|
||||
decoded[0] = new_sample & 0xFF;
|
||||
new_sample >>= 8;
|
||||
decoded[1] = new_sample & 0xFF;
|
||||
decoded += 2 * numchannels;
|
||||
|
||||
nybble = (*encoded) >> 4;
|
||||
new_sample = IMA_ADPCM_nibble(state, nybble);
|
||||
decoded[0] = new_sample & 0xFF;
|
||||
new_sample >>= 8;
|
||||
decoded[1] = new_sample & 0xFF;
|
||||
decoded += 2 * numchannels;
|
||||
|
||||
++encoded;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
IMA_ADPCM_decode(Uint8 ** audio_buf, Uint32 * audio_len)
|
||||
{
|
||||
struct IMA_ADPCM_decodestate *state;
|
||||
Uint8 *freeable, *encoded, *decoded;
|
||||
Sint32 encoded_len, samplesleft;
|
||||
unsigned int c, channels;
|
||||
|
||||
/* Check to make sure we have enough variables in the state array */
|
||||
channels = IMA_ADPCM_state.wavefmt.channels;
|
||||
if (channels > SDL_arraysize(IMA_ADPCM_state.state)) {
|
||||
SDL_SetError("IMA ADPCM decoder can only handle %u channels",
|
||||
(unsigned int)SDL_arraysize(IMA_ADPCM_state.state));
|
||||
return (-1);
|
||||
}
|
||||
state = IMA_ADPCM_state.state;
|
||||
|
||||
/* Allocate the proper sized output buffer */
|
||||
encoded_len = *audio_len;
|
||||
encoded = *audio_buf;
|
||||
freeable = *audio_buf;
|
||||
*audio_len = (encoded_len / IMA_ADPCM_state.wavefmt.blockalign) *
|
||||
IMA_ADPCM_state.wSamplesPerBlock *
|
||||
IMA_ADPCM_state.wavefmt.channels * sizeof(Sint16);
|
||||
*audio_buf = (Uint8 *) SDL_malloc(*audio_len);
|
||||
if (*audio_buf == NULL) {
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
decoded = *audio_buf;
|
||||
|
||||
/* Get ready... Go! */
|
||||
while (encoded_len >= IMA_ADPCM_state.wavefmt.blockalign) {
|
||||
/* Grab the initial information for this block */
|
||||
for (c = 0; c < channels; ++c) {
|
||||
/* Fill the state information for this block */
|
||||
state[c].sample = ((encoded[1] << 8) | encoded[0]);
|
||||
encoded += 2;
|
||||
if (state[c].sample & 0x8000) {
|
||||
state[c].sample -= 0x10000;
|
||||
}
|
||||
state[c].index = *encoded++;
|
||||
/* Reserved byte in buffer header, should be 0 */
|
||||
if (*encoded++ != 0) {
|
||||
/* Uh oh, corrupt data? Buggy code? */ ;
|
||||
}
|
||||
|
||||
/* Store the initial sample we start with */
|
||||
decoded[0] = (Uint8) (state[c].sample & 0xFF);
|
||||
decoded[1] = (Uint8) (state[c].sample >> 8);
|
||||
decoded += 2;
|
||||
}
|
||||
|
||||
/* Decode and store the other samples in this block */
|
||||
samplesleft = (IMA_ADPCM_state.wSamplesPerBlock - 1) * channels;
|
||||
while (samplesleft > 0) {
|
||||
for (c = 0; c < channels; ++c) {
|
||||
Fill_IMA_ADPCM_block(decoded, encoded,
|
||||
c, channels, &state[c]);
|
||||
encoded += 4;
|
||||
samplesleft -= 8;
|
||||
}
|
||||
decoded += (channels * 8 * 2);
|
||||
}
|
||||
encoded_len -= IMA_ADPCM_state.wavefmt.blockalign;
|
||||
}
|
||||
SDL_free(freeable);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ConvertSint24ToSint32(Uint8 ** audio_buf, Uint32 * audio_len)
|
||||
{
|
||||
const double DIVBY8388608 = 0.00000011920928955078125;
|
||||
const Uint32 original_len = *audio_len;
|
||||
const Uint32 samples = original_len / 3;
|
||||
const Uint32 expanded_len = samples * sizeof (Uint32);
|
||||
Uint8 *ptr = (Uint8 *) SDL_realloc(*audio_buf, expanded_len);
|
||||
const Uint8 *src;
|
||||
Uint32 *dst;
|
||||
Uint32 i;
|
||||
|
||||
if (!ptr) {
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
|
||||
*audio_buf = ptr;
|
||||
*audio_len = expanded_len;
|
||||
|
||||
/* work from end to start, since we're expanding in-place. */
|
||||
src = (ptr + original_len) - 3;
|
||||
dst = ((Uint32 *) (ptr + expanded_len)) - 1;
|
||||
for (i = 0; i < samples; i++) {
|
||||
/* There's probably a faster way to do all this. */
|
||||
const Sint32 converted = ((Sint32) ( (((Uint32) src[2]) << 24) |
|
||||
(((Uint32) src[1]) << 16) |
|
||||
(((Uint32) src[0]) << 8) )) >> 8;
|
||||
const double scaled = (((double) converted) * DIVBY8388608);
|
||||
src -= 3;
|
||||
*(dst--) = (Sint32) (scaled * 2147483647.0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* GUIDs that are used by WAVE_FORMAT_EXTENSIBLE */
|
||||
static const Uint8 extensible_pcm_guid[16] = { 1, 0, 0, 0, 0, 0, 16, 0, 128, 0, 0, 170, 0, 56, 155, 113 };
|
||||
static const Uint8 extensible_ieee_guid[16] = { 3, 0, 0, 0, 0, 0, 16, 0, 128, 0, 0, 170, 0, 56, 155, 113 };
|
||||
|
||||
SDL_AudioSpec *
|
||||
SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
|
||||
SDL_AudioSpec * spec, Uint8 ** audio_buf, Uint32 * audio_len)
|
||||
{
|
||||
int was_error;
|
||||
Chunk chunk;
|
||||
int lenread;
|
||||
int IEEE_float_encoded, MS_ADPCM_encoded, IMA_ADPCM_encoded;
|
||||
int samplesize;
|
||||
|
||||
/* WAV magic header */
|
||||
Uint32 RIFFchunk;
|
||||
Uint32 wavelen = 0;
|
||||
Uint32 WAVEmagic;
|
||||
Uint32 headerDiff = 0;
|
||||
|
||||
/* FMT chunk */
|
||||
WaveFMT *format = NULL;
|
||||
WaveExtensibleFMT *ext = NULL;
|
||||
|
||||
SDL_zero(chunk);
|
||||
|
||||
/* Make sure we are passed a valid data source */
|
||||
was_error = 0;
|
||||
if (src == NULL) {
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Check the magic header */
|
||||
RIFFchunk = SDL_ReadLE32(src);
|
||||
wavelen = SDL_ReadLE32(src);
|
||||
if (wavelen == WAVE) { /* The RIFFchunk has already been read */
|
||||
WAVEmagic = wavelen;
|
||||
wavelen = RIFFchunk;
|
||||
RIFFchunk = RIFF;
|
||||
} else {
|
||||
WAVEmagic = SDL_ReadLE32(src);
|
||||
}
|
||||
if ((RIFFchunk != RIFF) || (WAVEmagic != WAVE)) {
|
||||
SDL_SetError("Unrecognized file type (not WAVE)");
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
headerDiff += sizeof(Uint32); /* for WAVE */
|
||||
|
||||
/* Read the audio data format chunk */
|
||||
chunk.data = NULL;
|
||||
do {
|
||||
SDL_free(chunk.data);
|
||||
chunk.data = NULL;
|
||||
lenread = ReadChunk(src, &chunk);
|
||||
if (lenread < 0) {
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
/* 2 Uint32's for chunk header+len, plus the lenread */
|
||||
headerDiff += lenread + 2 * sizeof(Uint32);
|
||||
} while ((chunk.magic == FACT) || (chunk.magic == LIST) || (chunk.magic == BEXT) || (chunk.magic == JUNK));
|
||||
|
||||
/* Decode the audio data format */
|
||||
format = (WaveFMT *) chunk.data;
|
||||
if (chunk.magic != FMT) {
|
||||
SDL_SetError("Complex WAVE files not supported");
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
IEEE_float_encoded = MS_ADPCM_encoded = IMA_ADPCM_encoded = 0;
|
||||
switch (SDL_SwapLE16(format->encoding)) {
|
||||
case PCM_CODE:
|
||||
/* We can understand this */
|
||||
break;
|
||||
case IEEE_FLOAT_CODE:
|
||||
IEEE_float_encoded = 1;
|
||||
/* We can understand this */
|
||||
break;
|
||||
case MS_ADPCM_CODE:
|
||||
/* Try to understand this */
|
||||
if (InitMS_ADPCM(format) < 0) {
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
MS_ADPCM_encoded = 1;
|
||||
break;
|
||||
case IMA_ADPCM_CODE:
|
||||
/* Try to understand this */
|
||||
if (InitIMA_ADPCM(format) < 0) {
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
IMA_ADPCM_encoded = 1;
|
||||
break;
|
||||
case EXTENSIBLE_CODE:
|
||||
/* note that this ignores channel masks, smaller valid bit counts
|
||||
inside a larger container, and most subtypes. This is just enough
|
||||
to get things that didn't really _need_ WAVE_FORMAT_EXTENSIBLE
|
||||
to be useful working when they use this format flag. */
|
||||
ext = (WaveExtensibleFMT *) format;
|
||||
if (SDL_SwapLE16(ext->size) < 22) {
|
||||
SDL_SetError("bogus extended .wav header");
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
if (SDL_memcmp(ext->subformat, extensible_pcm_guid, 16) == 0) {
|
||||
break; /* cool. */
|
||||
} else if (SDL_memcmp(ext->subformat, extensible_ieee_guid, 16) == 0) {
|
||||
IEEE_float_encoded = 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case MP3_CODE:
|
||||
SDL_SetError("MPEG Layer 3 data not supported");
|
||||
was_error = 1;
|
||||
goto done;
|
||||
default:
|
||||
SDL_SetError("Unknown WAVE data format: 0x%.4x",
|
||||
SDL_SwapLE16(format->encoding));
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
SDL_zerop(spec);
|
||||
spec->freq = SDL_SwapLE32(format->frequency);
|
||||
|
||||
if (IEEE_float_encoded) {
|
||||
if ((SDL_SwapLE16(format->bitspersample)) != 32) {
|
||||
was_error = 1;
|
||||
} else {
|
||||
spec->format = AUDIO_F32;
|
||||
}
|
||||
} else {
|
||||
switch (SDL_SwapLE16(format->bitspersample)) {
|
||||
case 4:
|
||||
if (MS_ADPCM_encoded || IMA_ADPCM_encoded) {
|
||||
spec->format = AUDIO_S16;
|
||||
} else {
|
||||
was_error = 1;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
spec->format = AUDIO_U8;
|
||||
break;
|
||||
case 16:
|
||||
spec->format = AUDIO_S16;
|
||||
break;
|
||||
case 24: /* convert this. */
|
||||
spec->format = AUDIO_S32;
|
||||
break;
|
||||
case 32:
|
||||
spec->format = AUDIO_S32;
|
||||
break;
|
||||
default:
|
||||
was_error = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (was_error) {
|
||||
SDL_SetError("Unknown %d-bit PCM data format",
|
||||
SDL_SwapLE16(format->bitspersample));
|
||||
goto done;
|
||||
}
|
||||
spec->channels = (Uint8) SDL_SwapLE16(format->channels);
|
||||
spec->samples = 4096; /* Good default buffer size */
|
||||
|
||||
/* Read the audio data chunk */
|
||||
*audio_buf = NULL;
|
||||
do {
|
||||
SDL_free(*audio_buf);
|
||||
*audio_buf = NULL;
|
||||
lenread = ReadChunk(src, &chunk);
|
||||
if (lenread < 0) {
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
*audio_len = lenread;
|
||||
*audio_buf = chunk.data;
|
||||
if (chunk.magic != DATA)
|
||||
headerDiff += lenread + 2 * sizeof(Uint32);
|
||||
} while (chunk.magic != DATA);
|
||||
headerDiff += 2 * sizeof(Uint32); /* for the data chunk and len */
|
||||
|
||||
if (MS_ADPCM_encoded) {
|
||||
if (MS_ADPCM_decode(audio_buf, audio_len) < 0) {
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
if (IMA_ADPCM_encoded) {
|
||||
if (IMA_ADPCM_decode(audio_buf, audio_len) < 0) {
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (SDL_SwapLE16(format->bitspersample) == 24) {
|
||||
if (ConvertSint24ToSint32(audio_buf, audio_len) < 0) {
|
||||
was_error = 1;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/* Don't return a buffer that isn't a multiple of samplesize */
|
||||
samplesize = ((SDL_AUDIO_BITSIZE(spec->format)) / 8) * spec->channels;
|
||||
*audio_len &= ~(samplesize - 1);
|
||||
|
||||
done:
|
||||
SDL_free(format);
|
||||
if (src) {
|
||||
if (freesrc) {
|
||||
SDL_RWclose(src);
|
||||
} else {
|
||||
/* seek to the end of the file (given by the RIFF chunk) */
|
||||
SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
|
||||
}
|
||||
}
|
||||
if (was_error) {
|
||||
spec = NULL;
|
||||
}
|
||||
return (spec);
|
||||
}
|
||||
|
||||
/* Since the WAV memory is allocated in the shared library, it must also
|
||||
be freed here. (Necessary under Win32, VC++)
|
||||
*/
|
||||
void
|
||||
SDL_FreeWAV(Uint8 * audio_buf)
|
||||
{
|
||||
SDL_free(audio_buf);
|
||||
}
|
||||
|
||||
static int
|
||||
ReadChunk(SDL_RWops * src, Chunk * chunk)
|
||||
{
|
||||
chunk->magic = SDL_ReadLE32(src);
|
||||
chunk->length = SDL_ReadLE32(src);
|
||||
chunk->data = (Uint8 *) SDL_malloc(chunk->length);
|
||||
if (chunk->data == NULL) {
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
if (SDL_RWread(src, chunk->data, chunk->length, 1) != 1) {
|
||||
SDL_free(chunk->data);
|
||||
chunk->data = NULL;
|
||||
return SDL_Error(SDL_EFREAD);
|
||||
}
|
||||
return (chunk->length);
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../SDL_internal.h"
|
||||
|
||||
/* WAVE files are little-endian */
|
||||
|
||||
/*******************************************/
|
||||
/* Define values for Microsoft WAVE format */
|
||||
/*******************************************/
|
||||
#define RIFF 0x46464952 /* "RIFF" */
|
||||
#define WAVE 0x45564157 /* "WAVE" */
|
||||
#define FACT 0x74636166 /* "fact" */
|
||||
#define LIST 0x5453494c /* "LIST" */
|
||||
#define BEXT 0x74786562 /* "bext" */
|
||||
#define JUNK 0x4B4E554A /* "JUNK" */
|
||||
#define FMT 0x20746D66 /* "fmt " */
|
||||
#define DATA 0x61746164 /* "data" */
|
||||
#define PCM_CODE 0x0001
|
||||
#define MS_ADPCM_CODE 0x0002
|
||||
#define IEEE_FLOAT_CODE 0x0003
|
||||
#define IMA_ADPCM_CODE 0x0011
|
||||
#define MP3_CODE 0x0055
|
||||
#define EXTENSIBLE_CODE 0xFFFE
|
||||
#define WAVE_MONO 1
|
||||
#define WAVE_STEREO 2
|
||||
|
||||
/* Normally, these three chunks come consecutively in a WAVE file */
|
||||
typedef struct WaveFMT
|
||||
{
|
||||
/* Not saved in the chunk we read:
|
||||
Uint32 FMTchunk;
|
||||
Uint32 fmtlen;
|
||||
*/
|
||||
Uint16 encoding;
|
||||
Uint16 channels; /* 1 = mono, 2 = stereo */
|
||||
Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */
|
||||
Uint32 byterate; /* Average bytes per second */
|
||||
Uint16 blockalign; /* Bytes per sample block */
|
||||
Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */
|
||||
} WaveFMT;
|
||||
|
||||
/* The general chunk found in the WAVE file */
|
||||
typedef struct Chunk
|
||||
{
|
||||
Uint32 magic;
|
||||
Uint32 length;
|
||||
Uint8 *data;
|
||||
} Chunk;
|
||||
|
||||
typedef struct WaveExtensibleFMT
|
||||
{
|
||||
WaveFMT format;
|
||||
Uint16 size;
|
||||
Uint16 validbits;
|
||||
Uint32 channelmask;
|
||||
Uint8 subformat[16]; /* a GUID. */
|
||||
} WaveExtensibleFMT;
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include "../SDL_internal.h"
|
||||
|
||||
/**
|
||||
* \brief Report the alignment this system needs for SIMD allocations.
|
||||
*
|
||||
* This will return the minimum number of bytes to which a pointer must be
|
||||
* aligned to be compatible with SIMD instructions on the current machine.
|
||||
* For example, if the machine supports SSE only, it will return 16, but if
|
||||
* it supports AVX-512F, it'll return 64 (etc). This only reports values for
|
||||
* instruction sets SDL knows about, so if your SDL build doesn't have
|
||||
* SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
|
||||
* not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
|
||||
* Plan accordingly.
|
||||
*/
|
||||
extern size_t SDL_SIMDGetAlignment(void);
|
||||
|
||||
/**
|
||||
* \brief Allocate memory in a SIMD-friendly way.
|
||||
*
|
||||
* This will allocate a block of memory that is suitable for use with SIMD
|
||||
* instructions. Specifically, it will be properly aligned and padded for
|
||||
* the system's supported vector instructions.
|
||||
*
|
||||
* The memory returned will be padded such that it is safe to read or write
|
||||
* an incomplete vector at the end of the memory block. This can be useful
|
||||
* so you don't have to drop back to a scalar fallback at the end of your
|
||||
* SIMD processing loop to deal with the final elements without overflowing
|
||||
* the allocated buffer.
|
||||
*
|
||||
* You must free this memory with SDL_FreeSIMD(), not free() or SDL_free()
|
||||
* or delete[], etc.
|
||||
*
|
||||
* Note that SDL will only deal with SIMD instruction sets it is aware of;
|
||||
* for example, SDL 2.0.8 knows that SSE wants 16-byte vectors
|
||||
* (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't
|
||||
* know that AVX-512 wants 64. To be clear: if you can't decide to use an
|
||||
* instruction set with an SDL_Has*() function, don't use that instruction
|
||||
* set with memory allocated through here.
|
||||
*
|
||||
* SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
|
||||
* out of memory.
|
||||
*
|
||||
* \param len The length, in bytes, of the block to allocated. The actual
|
||||
* allocated block might be larger due to padding, etc.
|
||||
* \return Pointer to newly-allocated block, NULL if out of memory.
|
||||
*
|
||||
* \sa SDL_SIMDAlignment
|
||||
* \sa SDL_SIMDFree
|
||||
*/
|
||||
extern void * SDL_SIMDAlloc(const size_t len);
|
||||
|
||||
/**
|
||||
* \brief Deallocate memory obtained from SDL_SIMDAlloc
|
||||
*
|
||||
* It is not valid to use this function on a pointer from anything but
|
||||
* SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
|
||||
* SDL_malloc, memalign, new[], etc.
|
||||
*
|
||||
* However, SDL_SIMDFree(NULL) is a legal no-op.
|
||||
*
|
||||
* \sa SDL_SIMDAlloc
|
||||
*/
|
||||
extern void SDL_SIMDFree(void *ptr);
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../SDL_internal.h"
|
||||
|
||||
#include "SDL_vulkan_internal.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#if SDL_VIDEO_VULKAN
|
||||
|
||||
const char *SDL_Vulkan_GetResultString(VkResult result)
|
||||
{
|
||||
switch((int)result)
|
||||
{
|
||||
case VK_SUCCESS:
|
||||
return "VK_SUCCESS";
|
||||
case VK_NOT_READY:
|
||||
return "VK_NOT_READY";
|
||||
case VK_TIMEOUT:
|
||||
return "VK_TIMEOUT";
|
||||
case VK_EVENT_SET:
|
||||
return "VK_EVENT_SET";
|
||||
case VK_EVENT_RESET:
|
||||
return "VK_EVENT_RESET";
|
||||
case VK_INCOMPLETE:
|
||||
return "VK_INCOMPLETE";
|
||||
case VK_ERROR_OUT_OF_HOST_MEMORY:
|
||||
return "VK_ERROR_OUT_OF_HOST_MEMORY";
|
||||
case VK_ERROR_OUT_OF_DEVICE_MEMORY:
|
||||
return "VK_ERROR_OUT_OF_DEVICE_MEMORY";
|
||||
case VK_ERROR_INITIALIZATION_FAILED:
|
||||
return "VK_ERROR_INITIALIZATION_FAILED";
|
||||
case VK_ERROR_DEVICE_LOST:
|
||||
return "VK_ERROR_DEVICE_LOST";
|
||||
case VK_ERROR_MEMORY_MAP_FAILED:
|
||||
return "VK_ERROR_MEMORY_MAP_FAILED";
|
||||
case VK_ERROR_LAYER_NOT_PRESENT:
|
||||
return "VK_ERROR_LAYER_NOT_PRESENT";
|
||||
case VK_ERROR_EXTENSION_NOT_PRESENT:
|
||||
return "VK_ERROR_EXTENSION_NOT_PRESENT";
|
||||
case VK_ERROR_FEATURE_NOT_PRESENT:
|
||||
return "VK_ERROR_FEATURE_NOT_PRESENT";
|
||||
case VK_ERROR_INCOMPATIBLE_DRIVER:
|
||||
return "VK_ERROR_INCOMPATIBLE_DRIVER";
|
||||
case VK_ERROR_TOO_MANY_OBJECTS:
|
||||
return "VK_ERROR_TOO_MANY_OBJECTS";
|
||||
case VK_ERROR_FORMAT_NOT_SUPPORTED:
|
||||
return "VK_ERROR_FORMAT_NOT_SUPPORTED";
|
||||
case VK_ERROR_FRAGMENTED_POOL:
|
||||
return "VK_ERROR_FRAGMENTED_POOL";
|
||||
case VK_ERROR_SURFACE_LOST_KHR:
|
||||
return "VK_ERROR_SURFACE_LOST_KHR";
|
||||
case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR:
|
||||
return "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR";
|
||||
case VK_SUBOPTIMAL_KHR:
|
||||
return "VK_SUBOPTIMAL_KHR";
|
||||
case VK_ERROR_OUT_OF_DATE_KHR:
|
||||
return "VK_ERROR_OUT_OF_DATE_KHR";
|
||||
case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR:
|
||||
return "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR";
|
||||
case VK_ERROR_VALIDATION_FAILED_EXT:
|
||||
return "VK_ERROR_VALIDATION_FAILED_EXT";
|
||||
case VK_ERROR_OUT_OF_POOL_MEMORY_KHR:
|
||||
return "VK_ERROR_OUT_OF_POOL_MEMORY_KHR";
|
||||
case VK_ERROR_INVALID_SHADER_NV:
|
||||
return "VK_ERROR_INVALID_SHADER_NV";
|
||||
case VK_RESULT_MAX_ENUM:
|
||||
case VK_RESULT_RANGE_SIZE:
|
||||
break;
|
||||
}
|
||||
if(result < 0)
|
||||
return "VK_ERROR_<Unknown>";
|
||||
return "VK_<Unknown>";
|
||||
}
|
||||
|
||||
VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
|
||||
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties,
|
||||
Uint32 *extensionCount)
|
||||
{
|
||||
Uint32 count = 0;
|
||||
VkResult result = vkEnumerateInstanceExtensionProperties(NULL, &count, NULL);
|
||||
VkExtensionProperties *retval;
|
||||
if(result == VK_ERROR_INCOMPATIBLE_DRIVER)
|
||||
{
|
||||
/* Avoid the ERR_MAX_STRLEN limit by passing part of the message
|
||||
* as a string argument.
|
||||
*/
|
||||
SDL_SetError(
|
||||
"You probably don't have a working Vulkan driver installed. %s %s %s(%d)",
|
||||
"Getting Vulkan extensions failed:",
|
||||
"vkEnumerateInstanceExtensionProperties returned",
|
||||
SDL_Vulkan_GetResultString(result),
|
||||
(int)result);
|
||||
return NULL;
|
||||
}
|
||||
else if(result != VK_SUCCESS)
|
||||
{
|
||||
SDL_SetError(
|
||||
"Getting Vulkan extensions failed: vkEnumerateInstanceExtensionProperties returned "
|
||||
"%s(%d)",
|
||||
SDL_Vulkan_GetResultString(result),
|
||||
(int)result);
|
||||
return NULL;
|
||||
}
|
||||
if(count == 0)
|
||||
{
|
||||
retval = SDL_calloc(1, sizeof(VkExtensionProperties)); // so we can return non-null
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = SDL_calloc(count, sizeof(VkExtensionProperties));
|
||||
}
|
||||
if(!retval)
|
||||
{
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
result = vkEnumerateInstanceExtensionProperties(NULL, &count, retval);
|
||||
if(result != VK_SUCCESS)
|
||||
{
|
||||
SDL_SetError(
|
||||
"Getting Vulkan extensions failed: vkEnumerateInstanceExtensionProperties returned "
|
||||
"%s(%d)",
|
||||
SDL_Vulkan_GetResultString(result),
|
||||
(int)result);
|
||||
SDL_free(retval);
|
||||
return NULL;
|
||||
}
|
||||
*extensionCount = count;
|
||||
return retval;
|
||||
}
|
||||
|
||||
SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount,
|
||||
const char **userNames,
|
||||
unsigned nameCount,
|
||||
const char *const *names)
|
||||
{
|
||||
if (userNames) {
|
||||
unsigned i;
|
||||
|
||||
if (*userCount < nameCount) {
|
||||
SDL_SetError("Output array for SDL_Vulkan_GetInstanceExtensions needs to be at least %d big", nameCount);
|
||||
return SDL_FALSE;
|
||||
}
|
||||
for (i = 0; i < nameCount; i++) {
|
||||
userNames[i] = names[i];
|
||||
}
|
||||
}
|
||||
*userCount = nameCount;
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
/* We're going to do this by default */
|
||||
#define SDL_ANDROID_BLOCK_ON_PAUSE 1
|
||||
|
||||
#include "SDL_androidevents.h"
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_androidwindow.h"
|
||||
|
||||
#if !SDL_AUDIO_DISABLED
|
||||
/* Can't include sysaudio "../../audio/android/SDL_androidaudio.h"
|
||||
* because of THIS redefinition */
|
||||
extern void ANDROIDAUDIO_ResumeDevices(void);
|
||||
extern void ANDROIDAUDIO_PauseDevices(void);
|
||||
#else
|
||||
static void ANDROIDAUDIO_ResumeDevices(void) {}
|
||||
static void ANDROIDAUDIO_PauseDevices(void) {}
|
||||
#endif
|
||||
|
||||
static void
|
||||
android_egl_context_restore()
|
||||
{
|
||||
SDL_Event event;
|
||||
SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata;
|
||||
if (SDL_GL_MakeCurrent(Android_Window, (SDL_GLContext) data->egl_context) < 0) {
|
||||
/* The context is no longer valid, create a new one */
|
||||
data->egl_context = (EGLContext) SDL_GL_CreateContext(Android_Window);
|
||||
SDL_GL_MakeCurrent(Android_Window, (SDL_GLContext) data->egl_context);
|
||||
event.type = SDL_RENDER_DEVICE_RESET;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
android_egl_context_backup()
|
||||
{
|
||||
/* Keep a copy of the EGL Context so we can try to restore it when we resume */
|
||||
SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata;
|
||||
data->egl_context = SDL_GL_GetCurrentContext();
|
||||
/* We need to do this so the EGLSurface can be freed */
|
||||
SDL_GL_MakeCurrent(Android_Window, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
Android_PumpEvents(_THIS)
|
||||
{
|
||||
static int isPaused = 0;
|
||||
#if SDL_ANDROID_BLOCK_ON_PAUSE
|
||||
static int isPausing = 0;
|
||||
#endif
|
||||
/* No polling necessary */
|
||||
|
||||
/*
|
||||
* Android_ResumeSem and Android_PauseSem are signaled from Java_org_libsdl_app_SDLActivity_nativePause and Java_org_libsdl_app_SDLActivity_nativeResume
|
||||
* When the pause semaphore is signaled, if SDL_ANDROID_BLOCK_ON_PAUSE is defined the event loop will block until the resume signal is emitted.
|
||||
*/
|
||||
|
||||
#if SDL_ANDROID_BLOCK_ON_PAUSE
|
||||
if (isPaused && !isPausing) {
|
||||
/* Make sure this is the last thing we do before pausing */
|
||||
android_egl_context_backup();
|
||||
ANDROIDAUDIO_PauseDevices();
|
||||
if(SDL_SemWait(Android_ResumeSem) == 0) {
|
||||
#else
|
||||
if (isPaused) {
|
||||
if(SDL_SemTryWait(Android_ResumeSem) == 0) {
|
||||
#endif
|
||||
isPaused = 0;
|
||||
ANDROIDAUDIO_ResumeDevices();
|
||||
/* Restore the GL Context from here, as this operation is thread dependent */
|
||||
if (!SDL_HasEvent(SDL_QUIT)) {
|
||||
android_egl_context_restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if SDL_ANDROID_BLOCK_ON_PAUSE
|
||||
if( isPausing || SDL_SemTryWait(Android_PauseSem) == 0 ) {
|
||||
/* We've been signaled to pause, but before we block ourselves,
|
||||
we need to make sure that certain key events have reached the app */
|
||||
if (SDL_HasEvent(SDL_WINDOWEVENT) || SDL_HasEvent(SDL_APP_WILLENTERBACKGROUND) || SDL_HasEvent(SDL_APP_DIDENTERBACKGROUND) ) {
|
||||
isPausing = 1;
|
||||
}
|
||||
else {
|
||||
isPausing = 0;
|
||||
isPaused = 1;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(SDL_SemTryWait(Android_PauseSem) == 0) {
|
||||
android_egl_context_backup();
|
||||
ANDROIDAUDIO_PauseDevices();
|
||||
isPaused = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_log.h"
|
||||
#include "SDL_androidtouch.h"
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
#include "../../events/SDL_touch_c.h"
|
||||
#include "../../core/android/SDL_android.h"
|
||||
|
||||
#define ACTION_DOWN 0
|
||||
#define ACTION_UP 1
|
||||
#define ACTION_MOVE 2
|
||||
#define ACTION_CANCEL 3
|
||||
#define ACTION_OUTSIDE 4
|
||||
#define ACTION_POINTER_DOWN 5
|
||||
#define ACTION_POINTER_UP 6
|
||||
|
||||
static void Android_GetWindowCoordinates(float x, float y,
|
||||
int *window_x, int *window_y)
|
||||
{
|
||||
int window_w, window_h;
|
||||
|
||||
SDL_GetWindowSize(Android_Window, &window_w, &window_h);
|
||||
*window_x = (int)(x * window_w);
|
||||
*window_y = (int)(y * window_h);
|
||||
}
|
||||
|
||||
static SDL_bool separate_mouse_and_touch = SDL_FALSE;
|
||||
|
||||
static void SDLCALL
|
||||
SeparateEventsHintWatcher(void *userdata, const char *name,
|
||||
const char *oldValue, const char *newValue)
|
||||
{
|
||||
separate_mouse_and_touch = (newValue && (SDL_strcmp(newValue, "1") == 0));
|
||||
|
||||
Android_JNI_SetSeparateMouseAndTouch(separate_mouse_and_touch);
|
||||
}
|
||||
|
||||
void Android_InitTouch(void)
|
||||
{
|
||||
int i;
|
||||
int* ids;
|
||||
const int number = Android_JNI_GetTouchDeviceIds(&ids);
|
||||
|
||||
SDL_AddHintCallback(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH,
|
||||
SeparateEventsHintWatcher, NULL);
|
||||
|
||||
if (0 < number) {
|
||||
for (i = 0; i < number; ++i) {
|
||||
SDL_AddTouch((SDL_TouchID) ids[i], ""); /* no error handling */
|
||||
}
|
||||
SDL_free(ids);
|
||||
}
|
||||
}
|
||||
|
||||
void Android_QuitTouch(void)
|
||||
{
|
||||
SDL_DelHintCallback(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH,
|
||||
SeparateEventsHintWatcher, NULL);
|
||||
separate_mouse_and_touch = SDL_FALSE;
|
||||
}
|
||||
|
||||
void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p)
|
||||
{
|
||||
SDL_TouchID touchDeviceId = 0;
|
||||
SDL_FingerID fingerId = 0;
|
||||
int window_x, window_y;
|
||||
static SDL_FingerID pointerFingerID = 0;
|
||||
|
||||
if (!Android_Window) {
|
||||
return;
|
||||
}
|
||||
|
||||
touchDeviceId = (SDL_TouchID)touch_device_id_in;
|
||||
if (SDL_AddTouch(touchDeviceId, "") < 0) {
|
||||
SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
fingerId = (SDL_FingerID)pointer_finger_id_in;
|
||||
switch (action) {
|
||||
case ACTION_DOWN:
|
||||
/* Primary pointer down */
|
||||
if (!separate_mouse_and_touch) {
|
||||
Android_GetWindowCoordinates(x, y, &window_x, &window_y);
|
||||
/* send moved event */
|
||||
SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y);
|
||||
/* send mouse down event */
|
||||
SDL_SendMouseButton(Android_Window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
|
||||
}
|
||||
pointerFingerID = fingerId;
|
||||
case ACTION_POINTER_DOWN:
|
||||
/* Non primary pointer down */
|
||||
SDL_SendTouch(touchDeviceId, fingerId, SDL_TRUE, x, y, p);
|
||||
break;
|
||||
|
||||
case ACTION_MOVE:
|
||||
if (!pointerFingerID) {
|
||||
if (!separate_mouse_and_touch) {
|
||||
Android_GetWindowCoordinates(x, y, &window_x, &window_y);
|
||||
/* send moved event */
|
||||
SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y);
|
||||
}
|
||||
}
|
||||
SDL_SendTouchMotion(touchDeviceId, fingerId, x, y, p);
|
||||
break;
|
||||
|
||||
case ACTION_UP:
|
||||
/* Primary pointer up */
|
||||
if (!separate_mouse_and_touch) {
|
||||
/* send mouse up */
|
||||
SDL_SendMouseButton(Android_Window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
|
||||
}
|
||||
pointerFingerID = (SDL_FingerID) 0;
|
||||
case ACTION_POINTER_UP:
|
||||
/* Non primary pointer up */
|
||||
SDL_SendTouch(touchDeviceId, fingerId, SDL_FALSE, x, y, p);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,170 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_MIR
|
||||
|
||||
#define DEBUG_DYNAMIC_MIR 0
|
||||
|
||||
#include "SDL_mirdyn.h"
|
||||
|
||||
#if DEBUG_DYNAMIC_MIR
|
||||
#include "SDL_log.h"
|
||||
#endif
|
||||
|
||||
#ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
|
||||
|
||||
#include "SDL_name.h"
|
||||
#include "SDL_loadso.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *lib;
|
||||
const char *libname;
|
||||
} mirdynlib;
|
||||
|
||||
#ifndef SDL_VIDEO_DRIVER_MIR_DYNAMIC
|
||||
#define SDL_VIDEO_DRIVER_MIR_DYNAMIC NULL
|
||||
#endif
|
||||
#ifndef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
|
||||
#define SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON NULL
|
||||
#endif
|
||||
|
||||
static mirdynlib mirlibs[] = {
|
||||
{NULL, SDL_VIDEO_DRIVER_MIR_DYNAMIC},
|
||||
{NULL, SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON}
|
||||
};
|
||||
|
||||
static void *
|
||||
MIR_GetSym(const char *fnname, int *pHasModule)
|
||||
{
|
||||
int i;
|
||||
void *fn = NULL;
|
||||
for (i = 0; i < SDL_TABLESIZE(mirlibs); i++) {
|
||||
if (mirlibs[i].lib != NULL) {
|
||||
fn = SDL_LoadFunction(mirlibs[i].lib, fnname);
|
||||
if (fn != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG_DYNAMIC_MIR
|
||||
if (fn != NULL)
|
||||
SDL_Log("MIR: Found '%s' in %s (%p)\n", fnname, mirlibs[i].libname, fn);
|
||||
else
|
||||
SDL_Log("MIR: Symbol '%s' NOT FOUND!\n", fnname);
|
||||
#endif
|
||||
|
||||
if (fn == NULL)
|
||||
*pHasModule = 0; /* kill this module. */
|
||||
|
||||
return fn;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_MIR_DYNAMIC */
|
||||
|
||||
/* Define all the function pointers and wrappers... */
|
||||
#define SDL_MIR_MODULE(modname) int SDL_MIR_HAVE_##modname = 0;
|
||||
#define SDL_MIR_SYM(rc,fn,params) SDL_DYNMIRFN_##fn MIR_##fn = NULL;
|
||||
#define SDL_MIR_SYM_CONST(type,name) SDL_DYMMIRCONST_##name MIR_##name = NULL;
|
||||
#include "SDL_mirsym.h"
|
||||
|
||||
static int mir_load_refcount = 0;
|
||||
|
||||
void
|
||||
SDL_MIR_UnloadSymbols(void)
|
||||
{
|
||||
/* Don't actually unload if more than one module is using the libs... */
|
||||
if (mir_load_refcount > 0) {
|
||||
if (--mir_load_refcount == 0) {
|
||||
#ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
|
||||
int i;
|
||||
#endif
|
||||
|
||||
/* set all the function pointers to NULL. */
|
||||
#define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 0;
|
||||
#define SDL_MIR_SYM(rc,fn,params) MIR_##fn = NULL;
|
||||
#define SDL_MIR_SYM_CONST(type,name) MIR_##name = NULL;
|
||||
#include "SDL_mirsym.h"
|
||||
|
||||
|
||||
#ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
|
||||
for (i = 0; i < SDL_TABLESIZE(mirlibs); i++) {
|
||||
if (mirlibs[i].lib != NULL) {
|
||||
SDL_UnloadObject(mirlibs[i].lib);
|
||||
mirlibs[i].lib = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* returns non-zero if all needed symbols were loaded. */
|
||||
int
|
||||
SDL_MIR_LoadSymbols(void)
|
||||
{
|
||||
int rc = 1; /* always succeed if not using Dynamic MIR stuff. */
|
||||
|
||||
/* deal with multiple modules (dga, wayland, mir, etc) needing these symbols... */
|
||||
if (mir_load_refcount++ == 0) {
|
||||
#ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
|
||||
int i;
|
||||
int *thismod = NULL;
|
||||
for (i = 0; i < SDL_TABLESIZE(mirlibs); i++) {
|
||||
if (mirlibs[i].libname != NULL) {
|
||||
mirlibs[i].lib = SDL_LoadObject(mirlibs[i].libname);
|
||||
}
|
||||
}
|
||||
|
||||
#define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */
|
||||
#include "SDL_mirsym.h"
|
||||
|
||||
#define SDL_MIR_MODULE(modname) thismod = &SDL_MIR_HAVE_##modname;
|
||||
#define SDL_MIR_SYM(rc,fn,params) MIR_##fn = (SDL_DYNMIRFN_##fn) MIR_GetSym(#fn,thismod);
|
||||
#define SDL_MIR_SYM_CONST(type,name) MIR_##name = *(SDL_DYMMIRCONST_##name*) MIR_GetSym(#name,thismod);
|
||||
#include "SDL_mirsym.h"
|
||||
|
||||
if ((SDL_MIR_HAVE_MIR_CLIENT) && (SDL_MIR_HAVE_XKBCOMMON)) {
|
||||
/* all required symbols loaded. */
|
||||
SDL_ClearError();
|
||||
} else {
|
||||
/* in case something got loaded... */
|
||||
SDL_MIR_UnloadSymbols();
|
||||
rc = 0;
|
||||
}
|
||||
|
||||
#else /* no dynamic MIR */
|
||||
|
||||
#define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */
|
||||
#define SDL_MIR_SYM(rc,fn,params) MIR_##fn = fn;
|
||||
#define SDL_MIR_SYM_CONST(type,name) MIR_##name = name;
|
||||
#include "SDL_mirsym.h"
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_MIR */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#ifndef SDL_mirdyn_h_
|
||||
#define SDL_mirdyn_h_
|
||||
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <mir_toolkit/mir_client_library.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int SDL_MIR_LoadSymbols(void);
|
||||
void SDL_MIR_UnloadSymbols(void);
|
||||
|
||||
/* Declare all the function pointers and wrappers... */
|
||||
#define SDL_MIR_SYM(rc,fn,params) \
|
||||
typedef rc (*SDL_DYNMIRFN_##fn) params; \
|
||||
extern SDL_DYNMIRFN_##fn MIR_##fn;
|
||||
#define SDL_MIR_SYM_CONST(type, name) \
|
||||
typedef type SDL_DYMMIRCONST_##name; \
|
||||
extern SDL_DYMMIRCONST_##name MIR_##name;
|
||||
#include "SDL_mirsym.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !defined SDL_mirdyn_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,321 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_MIR
|
||||
|
||||
#include "../../events/SDL_events_c.h"
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
#include "../../events/SDL_touch_c.h"
|
||||
#include "../../events/scancodes_xfree86.h"
|
||||
|
||||
#include "SDL_mirevents.h"
|
||||
#include "SDL_mirwindow.h"
|
||||
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#include "SDL_mirdyn.h"
|
||||
|
||||
static void
|
||||
HandleKeyText(int32_t key_code)
|
||||
{
|
||||
char text[8];
|
||||
int size = 0;
|
||||
|
||||
size = MIR_xkb_keysym_to_utf8(key_code, text, sizeof text);
|
||||
|
||||
if (size > 0) {
|
||||
text[size] = '\0';
|
||||
SDL_SendKeyboardText(text);
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME
|
||||
Mir still needs to implement its IM API, for now we assume
|
||||
a single key press produces a character.
|
||||
*/
|
||||
static void
|
||||
HandleKeyEvent(MirKeyboardEvent const* key_event, SDL_Window* window)
|
||||
{
|
||||
xkb_keysym_t key_code;
|
||||
Uint8 key_state;
|
||||
int event_scancode;
|
||||
uint32_t sdl_scancode = SDL_SCANCODE_UNKNOWN;
|
||||
|
||||
MirKeyboardAction action = MIR_mir_keyboard_event_action(key_event);
|
||||
|
||||
key_state = SDL_PRESSED;
|
||||
key_code = MIR_mir_keyboard_event_key_code(key_event);
|
||||
event_scancode = MIR_mir_keyboard_event_scan_code(key_event);
|
||||
|
||||
if (action == mir_keyboard_action_up)
|
||||
key_state = SDL_RELEASED;
|
||||
|
||||
if (event_scancode < SDL_arraysize(xfree86_scancode_table2))
|
||||
sdl_scancode = xfree86_scancode_table2[event_scancode];
|
||||
|
||||
if (sdl_scancode != SDL_SCANCODE_UNKNOWN)
|
||||
SDL_SendKeyboardKey(key_state, sdl_scancode);
|
||||
|
||||
if (key_state == SDL_PRESSED)
|
||||
HandleKeyText(key_code);
|
||||
}
|
||||
|
||||
static void
|
||||
HandleMouseButton(SDL_Window* sdl_window, Uint8 state, MirPointerEvent const* pointer)
|
||||
{
|
||||
uint32_t sdl_button = SDL_BUTTON_LEFT;
|
||||
MirPointerButton button_state = mir_pointer_button_primary;
|
||||
|
||||
static uint32_t old_button_states = 0;
|
||||
uint32_t new_button_states = MIR_mir_pointer_event_buttons(pointer);
|
||||
|
||||
// XOR on our old button states vs our new states to get the newley pressed/released button
|
||||
button_state = new_button_states ^ old_button_states;
|
||||
|
||||
switch (button_state) {
|
||||
case mir_pointer_button_primary:
|
||||
sdl_button = SDL_BUTTON_LEFT;
|
||||
break;
|
||||
case mir_pointer_button_secondary:
|
||||
sdl_button = SDL_BUTTON_RIGHT;
|
||||
break;
|
||||
case mir_pointer_button_tertiary:
|
||||
sdl_button = SDL_BUTTON_MIDDLE;
|
||||
break;
|
||||
case mir_pointer_button_forward:
|
||||
sdl_button = SDL_BUTTON_X1;
|
||||
break;
|
||||
case mir_pointer_button_back:
|
||||
sdl_button = SDL_BUTTON_X2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
old_button_states = new_button_states;
|
||||
|
||||
SDL_SendMouseButton(sdl_window, 0, state, sdl_button);
|
||||
}
|
||||
|
||||
static void
|
||||
HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
|
||||
{
|
||||
SDL_Mouse* mouse = SDL_GetMouse();
|
||||
SDL_SendMouseMotion(sdl_window, 0, mouse->relative_mode, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
HandleTouchPress(int device_id, int source_id, SDL_bool down, float x, float y, float pressure)
|
||||
{
|
||||
SDL_SendTouch(device_id, source_id, down, x, y, pressure);
|
||||
}
|
||||
|
||||
static void
|
||||
HandleTouchMotion(int device_id, int source_id, float x, float y, float pressure)
|
||||
{
|
||||
SDL_SendTouchMotion(device_id, source_id, x, y, pressure);
|
||||
}
|
||||
|
||||
static void
|
||||
HandleMouseScroll(SDL_Window* sdl_window, float hscroll, float vscroll)
|
||||
{
|
||||
SDL_SendMouseWheel(sdl_window, 0, hscroll, vscroll, SDL_MOUSEWHEEL_NORMAL);
|
||||
}
|
||||
|
||||
static void
|
||||
AddTouchDevice(int device_id)
|
||||
{
|
||||
if (SDL_AddTouch(device_id, "") < 0)
|
||||
SDL_SetError("Error: can't add touch %s, %d", __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
static void
|
||||
HandleTouchEvent(MirTouchEvent const* touch, int device_id, SDL_Window* sdl_window)
|
||||
{
|
||||
int i, point_count;
|
||||
point_count = MIR_mir_touch_event_point_count(touch);
|
||||
|
||||
AddTouchDevice(device_id);
|
||||
|
||||
for (i = 0; i < point_count; i++) {
|
||||
int id = MIR_mir_touch_event_id(touch, i);
|
||||
|
||||
int width = sdl_window->w;
|
||||
int height = sdl_window->h;
|
||||
|
||||
float x = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_x);
|
||||
float y = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_y);
|
||||
|
||||
float n_x = x / width;
|
||||
float n_y = y / height;
|
||||
|
||||
float pressure = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_pressure);
|
||||
|
||||
switch (MIR_mir_touch_event_action(touch, i)) {
|
||||
case mir_touch_action_up:
|
||||
HandleTouchPress(device_id, id, SDL_FALSE, n_x, n_y, pressure);
|
||||
break;
|
||||
case mir_touch_action_down:
|
||||
HandleTouchPress(device_id, id, SDL_TRUE, n_x, n_y, pressure);
|
||||
break;
|
||||
case mir_touch_action_change:
|
||||
HandleTouchMotion(device_id, id, n_x, n_y, pressure);
|
||||
break;
|
||||
case mir_touch_actions:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
HandleMouseEvent(MirPointerEvent const* pointer, SDL_Window* sdl_window)
|
||||
{
|
||||
SDL_SetMouseFocus(sdl_window);
|
||||
|
||||
switch (MIR_mir_pointer_event_action(pointer)) {
|
||||
case mir_pointer_action_button_down:
|
||||
HandleMouseButton(sdl_window, SDL_PRESSED, pointer);
|
||||
break;
|
||||
case mir_pointer_action_button_up:
|
||||
HandleMouseButton(sdl_window, SDL_RELEASED, pointer);
|
||||
break;
|
||||
case mir_pointer_action_motion: {
|
||||
int x, y;
|
||||
float hscroll, vscroll;
|
||||
SDL_Mouse* mouse = SDL_GetMouse();
|
||||
x = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_x);
|
||||
y = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_y);
|
||||
|
||||
if (mouse) {
|
||||
if (mouse->relative_mode) {
|
||||
int relative_x = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_relative_x);
|
||||
int relative_y = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_relative_y);
|
||||
HandleMouseMotion(sdl_window, relative_x, relative_y);
|
||||
}
|
||||
else if (mouse->x != x || mouse->y != y) {
|
||||
HandleMouseMotion(sdl_window, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
hscroll = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_hscroll);
|
||||
vscroll = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_vscroll);
|
||||
if (vscroll != 0 || hscroll != 0)
|
||||
HandleMouseScroll(sdl_window, hscroll, vscroll);
|
||||
}
|
||||
break;
|
||||
case mir_pointer_action_leave:
|
||||
SDL_SetMouseFocus(NULL);
|
||||
break;
|
||||
case mir_pointer_action_enter:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
HandleInput(MirInputEvent const* input_event, SDL_Window* window)
|
||||
{
|
||||
switch (MIR_mir_input_event_get_type(input_event)) {
|
||||
case (mir_input_event_type_key):
|
||||
HandleKeyEvent(MIR_mir_input_event_get_keyboard_event(input_event), window);
|
||||
break;
|
||||
case (mir_input_event_type_pointer):
|
||||
HandleMouseEvent(MIR_mir_input_event_get_pointer_event(input_event), window);
|
||||
break;
|
||||
case (mir_input_event_type_touch):
|
||||
HandleTouchEvent(MIR_mir_input_event_get_touch_event(input_event),
|
||||
MIR_mir_input_event_get_device_id(input_event),
|
||||
window);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
HandleResize(MirResizeEvent const* resize_event, SDL_Window* window)
|
||||
{
|
||||
int new_w = MIR_mir_resize_event_get_width (resize_event);
|
||||
int new_h = MIR_mir_resize_event_get_height(resize_event);
|
||||
|
||||
int old_w = window->w;
|
||||
int old_h = window->h;
|
||||
|
||||
if (new_w != old_w || new_h != old_h)
|
||||
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, new_w, new_h);
|
||||
}
|
||||
|
||||
static void
|
||||
HandleWindow(MirWindowEvent const* event, SDL_Window* window)
|
||||
{
|
||||
MirWindowAttrib attrib = MIR_mir_window_event_get_attribute(event);
|
||||
int value = MIR_mir_window_event_get_attribute_value(event);
|
||||
|
||||
if (attrib == mir_window_attrib_focus) {
|
||||
if (value == mir_window_focus_state_focused) {
|
||||
SDL_SetKeyboardFocus(window);
|
||||
}
|
||||
else if (value == mir_window_focus_state_unfocused) {
|
||||
SDL_SetKeyboardFocus(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_HandleClose(SDL_Window* window) {
|
||||
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
MIR_HandleEvent(MirWindow* mirwindow, MirEvent const* ev, void* context)
|
||||
{
|
||||
MirEventType event_type = MIR_mir_event_get_type(ev);
|
||||
SDL_Window* window = (SDL_Window*)context;
|
||||
|
||||
if (window) {
|
||||
switch (event_type) {
|
||||
case (mir_event_type_input):
|
||||
HandleInput(MIR_mir_event_get_input_event(ev), window);
|
||||
break;
|
||||
case (mir_event_type_resize):
|
||||
HandleResize(MIR_mir_event_get_resize_event(ev), window);
|
||||
break;
|
||||
case (mir_event_type_window):
|
||||
HandleWindow(MIR_mir_event_get_window_event(ev), window);
|
||||
break;
|
||||
case (mir_event_type_close_window):
|
||||
MIR_HandleClose(window);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_MIR */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#ifndef SDL_mirevents_h_
|
||||
#define SDL_mirevents_h_
|
||||
|
||||
#include <mir_toolkit/mir_client_library.h>
|
||||
|
||||
extern void
|
||||
MIR_HandleEvent(MirWindow*, MirEvent const* ev, void* context);
|
||||
|
||||
#endif /* SDL_mirevents_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_MIR
|
||||
|
||||
#include "SDL_mirevents.h"
|
||||
#include "SDL_mirframebuffer.h"
|
||||
#include "SDL_mirwindow.h"
|
||||
|
||||
#include "SDL_mirdyn.h"
|
||||
|
||||
int
|
||||
MIR_CreateWindowFramebuffer(_THIS, SDL_Window* window, Uint32* format,
|
||||
void** pixels, int* pitch)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
|
||||
mir_data->software = SDL_TRUE;
|
||||
|
||||
if (MIR_CreateWindow(_this, window) < 0)
|
||||
return SDL_SetError("Failed to create a mir window.");
|
||||
|
||||
*format = MIR_GetSDLPixelFormat(mir_data->pixel_format);
|
||||
if (*format == SDL_PIXELFORMAT_UNKNOWN)
|
||||
return SDL_SetError("Unknown pixel format");
|
||||
|
||||
*pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3);
|
||||
|
||||
*pixels = SDL_malloc(window->h*(*pitch));
|
||||
if (*pixels == NULL)
|
||||
return SDL_OutOfMemory();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
MIR_UpdateWindowFramebuffer(_THIS, SDL_Window* window,
|
||||
const SDL_Rect* rects, int numrects)
|
||||
{
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
|
||||
MirGraphicsRegion region;
|
||||
MirBufferStream* bs;
|
||||
int i, j, x, y, w, h, start;
|
||||
int bytes_per_pixel, bytes_per_row, s_stride, d_stride;
|
||||
char* s_dest;
|
||||
char* pixels;
|
||||
|
||||
bs = MIR_mir_window_get_buffer_stream(mir_window->window);
|
||||
MIR_mir_buffer_stream_get_graphics_region(bs, ®ion);
|
||||
|
||||
s_dest = region.vaddr;
|
||||
pixels = (char*)window->surface->pixels;
|
||||
|
||||
s_stride = window->surface->pitch;
|
||||
d_stride = region.stride;
|
||||
bytes_per_pixel = window->surface->format->BytesPerPixel;
|
||||
|
||||
for (i = 0; i < numrects; i++) {
|
||||
s_dest = region.vaddr;
|
||||
pixels = (char*)window->surface->pixels;
|
||||
|
||||
x = rects[i].x;
|
||||
y = rects[i].y;
|
||||
w = rects[i].w;
|
||||
h = rects[i].h;
|
||||
|
||||
if (w <= 0 || h <= 0 || (x + w) <= 0 || (y + h) <= 0)
|
||||
continue;
|
||||
|
||||
if (x < 0) {
|
||||
x += w;
|
||||
w += rects[i].x;
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
y += h;
|
||||
h += rects[i].y;
|
||||
}
|
||||
|
||||
if (x + w > window->w)
|
||||
w = window->w - x;
|
||||
if (y + h > window->h)
|
||||
h = window->h - y;
|
||||
|
||||
start = y * s_stride + x;
|
||||
pixels += start;
|
||||
s_dest += start;
|
||||
|
||||
bytes_per_row = bytes_per_pixel * w;
|
||||
for (j = 0; j < h; j++) {
|
||||
SDL_memcpy(s_dest, pixels, bytes_per_row);
|
||||
pixels += s_stride;
|
||||
s_dest += d_stride;
|
||||
}
|
||||
}
|
||||
|
||||
MIR_mir_buffer_stream_swap_buffers_sync(bs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
MIR_DestroyWindowFramebuffer(_THIS, SDL_Window* window)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_MIR */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#ifndef SDL_mirframebuffer_h_
|
||||
#define SDL_mirframebuffer_h_
|
||||
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
#include "SDL_mirvideo.h"
|
||||
|
||||
extern int
|
||||
MIR_CreateWindowFramebuffer(_THIS, SDL_Window* sdl_window, Uint32* format,
|
||||
void** pixels, int* pitch);
|
||||
|
||||
extern int
|
||||
MIR_UpdateWindowFramebuffer(_THIS, SDL_Window* sdl_window,
|
||||
const SDL_Rect* rects, int numrects);
|
||||
|
||||
extern void
|
||||
MIR_DestroyWindowFramebuffer(_THIS, SDL_Window* sdl_window);
|
||||
|
||||
#endif /* SDL_mirframebuffer_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,292 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_MIR
|
||||
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
#include "../SDL_sysvideo.h"
|
||||
#include "SDL_assert.h"
|
||||
|
||||
#include "SDL_mirdyn.h"
|
||||
|
||||
#include "SDL_mirvideo.h"
|
||||
#include "SDL_mirmouse.h"
|
||||
#include "SDL_mirwindow.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MirCursorConfiguration* conf;
|
||||
MirBufferStream* stream;
|
||||
char const* name;
|
||||
} MIR_Cursor;
|
||||
|
||||
static SDL_Cursor*
|
||||
MIR_CreateDefaultCursor()
|
||||
{
|
||||
SDL_Cursor* cursor;
|
||||
|
||||
cursor = SDL_calloc(1, sizeof(SDL_Cursor));
|
||||
if (cursor) {
|
||||
|
||||
MIR_Cursor* mir_cursor = SDL_calloc(1, sizeof(MIR_Cursor));
|
||||
if (mir_cursor) {
|
||||
mir_cursor->conf = NULL;
|
||||
mir_cursor->stream = NULL;
|
||||
mir_cursor->name = NULL;
|
||||
cursor->driverdata = mir_cursor;
|
||||
}
|
||||
else {
|
||||
SDL_OutOfMemory();
|
||||
SDL_free(cursor);
|
||||
cursor = NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
SDL_OutOfMemory();
|
||||
}
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
static void
|
||||
CopySurfacePixelsToMirStream(SDL_Surface* surface, MirBufferStream* stream)
|
||||
{
|
||||
char* dest, *pixels;
|
||||
int i, s_w, s_h, r_stride, p_stride, bytes_per_pixel, bytes_per_row;
|
||||
|
||||
MirGraphicsRegion region;
|
||||
MIR_mir_buffer_stream_get_graphics_region(stream, ®ion);
|
||||
|
||||
s_w = surface->w;
|
||||
s_h = surface->h;
|
||||
|
||||
bytes_per_pixel = surface->format->BytesPerPixel;
|
||||
bytes_per_row = bytes_per_pixel * s_w;
|
||||
|
||||
dest = region.vaddr;
|
||||
pixels = (char*)surface->pixels;
|
||||
|
||||
r_stride = region.stride;
|
||||
p_stride = surface->pitch;
|
||||
|
||||
for (i = 0; i < s_h; i++)
|
||||
{
|
||||
SDL_memcpy(dest, pixels, bytes_per_row);
|
||||
dest += r_stride;
|
||||
pixels += p_stride;
|
||||
}
|
||||
}
|
||||
|
||||
static SDL_Cursor*
|
||||
MIR_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y)
|
||||
{
|
||||
MirCursorConfiguration* conf;
|
||||
MirBufferStream* stream;
|
||||
|
||||
int s_w = surface->w;
|
||||
int s_h = surface->h;
|
||||
|
||||
MIR_Data* mir_data = (MIR_Data*)SDL_GetVideoDevice()->driverdata;
|
||||
SDL_Cursor* cursor = MIR_CreateDefaultCursor();
|
||||
MIR_Cursor* mir_cursor;
|
||||
|
||||
if (!cursor) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mir_cursor = (MIR_Cursor*)cursor->driverdata;
|
||||
|
||||
stream = MIR_mir_connection_create_buffer_stream_sync(mir_data->connection,
|
||||
s_w, s_h, mir_data->pixel_format,
|
||||
mir_buffer_usage_software);
|
||||
|
||||
conf = MIR_mir_cursor_configuration_from_buffer_stream(stream, hot_x, hot_y);
|
||||
|
||||
CopySurfacePixelsToMirStream(surface, stream);
|
||||
MIR_mir_buffer_stream_swap_buffers_sync(stream);
|
||||
|
||||
mir_cursor->conf = conf;
|
||||
mir_cursor->stream = stream;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
static SDL_Cursor*
|
||||
MIR_CreateSystemCursor(SDL_SystemCursor id)
|
||||
{
|
||||
char const* cursor_name = NULL;
|
||||
SDL_Cursor* cursor;
|
||||
MIR_Cursor* mir_cursor;
|
||||
|
||||
switch(id) {
|
||||
case SDL_SYSTEM_CURSOR_ARROW:
|
||||
cursor_name = MIR_mir_arrow_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_IBEAM:
|
||||
cursor_name = MIR_mir_caret_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WAIT:
|
||||
cursor_name = MIR_mir_busy_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_CROSSHAIR:
|
||||
/* Unsupported */
|
||||
cursor_name = MIR_mir_arrow_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_WAITARROW:
|
||||
cursor_name = MIR_mir_busy_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_SIZENWSE:
|
||||
cursor_name = MIR_mir_omnidirectional_resize_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_SIZENESW:
|
||||
cursor_name = MIR_mir_omnidirectional_resize_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_SIZEWE:
|
||||
cursor_name = MIR_mir_horizontal_resize_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_SIZENS:
|
||||
cursor_name = MIR_mir_vertical_resize_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_SIZEALL:
|
||||
cursor_name = MIR_mir_omnidirectional_resize_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_NO:
|
||||
/* Unsupported */
|
||||
cursor_name = MIR_mir_closed_hand_cursor_name;
|
||||
break;
|
||||
case SDL_SYSTEM_CURSOR_HAND:
|
||||
cursor_name = MIR_mir_open_hand_cursor_name;
|
||||
break;
|
||||
default:
|
||||
SDL_assert(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cursor = MIR_CreateDefaultCursor();
|
||||
if (!cursor) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mir_cursor = (MIR_Cursor*)cursor->driverdata;
|
||||
mir_cursor->name = cursor_name;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_FreeCursor(SDL_Cursor* cursor)
|
||||
{
|
||||
if (cursor) {
|
||||
|
||||
if (cursor->driverdata) {
|
||||
MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
|
||||
|
||||
if (mir_cursor->conf)
|
||||
MIR_mir_cursor_configuration_destroy(mir_cursor->conf);
|
||||
if (mir_cursor->stream)
|
||||
MIR_mir_buffer_stream_release_sync(mir_cursor->stream);
|
||||
|
||||
SDL_free(mir_cursor);
|
||||
}
|
||||
|
||||
SDL_free(cursor);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_ShowCursor(SDL_Cursor* cursor)
|
||||
{
|
||||
MIR_Data* mir_data = (MIR_Data*)SDL_GetVideoDevice()->driverdata;
|
||||
MIR_Window* mir_window = mir_data->current_window;
|
||||
|
||||
if (cursor && cursor->driverdata) {
|
||||
if (mir_window && MIR_mir_window_is_valid(mir_window->window)) {
|
||||
MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
|
||||
|
||||
if (mir_cursor->name != NULL) {
|
||||
MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
|
||||
MIR_mir_window_spec_set_cursor_name(spec, mir_cursor->name);
|
||||
MIR_mir_window_apply_spec(mir_window->window, spec);
|
||||
MIR_mir_window_spec_release(spec);
|
||||
}
|
||||
|
||||
if (mir_cursor->conf) {
|
||||
MIR_mir_window_configure_cursor(mir_window->window, mir_cursor->conf);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(mir_window && MIR_mir_window_is_valid(mir_window->window)) {
|
||||
MIR_mir_window_configure_cursor(mir_window->window, NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_WarpMouse(SDL_Window* window, int x, int y)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_WarpMouseGlobal(int x, int y)
|
||||
{
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_SetRelativeMouseMode(SDL_bool enabled)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TODO Actually implement the cursor, need to wait for mir support */
|
||||
void
|
||||
MIR_InitMouse()
|
||||
{
|
||||
SDL_Mouse* mouse = SDL_GetMouse();
|
||||
|
||||
mouse->CreateCursor = MIR_CreateCursor;
|
||||
mouse->ShowCursor = MIR_ShowCursor;
|
||||
mouse->FreeCursor = MIR_FreeCursor;
|
||||
mouse->WarpMouse = MIR_WarpMouse;
|
||||
mouse->WarpMouseGlobal = MIR_WarpMouseGlobal;
|
||||
mouse->CreateSystemCursor = MIR_CreateSystemCursor;
|
||||
mouse->SetRelativeMouseMode = MIR_SetRelativeMouseMode;
|
||||
|
||||
SDL_SetDefaultCursor(MIR_CreateDefaultCursor());
|
||||
}
|
||||
|
||||
void
|
||||
MIR_FiniMouse()
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_MIR */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#ifndef SDL_mirmouse_h_
|
||||
#define SDL_mirmouse_h_
|
||||
|
||||
extern void
|
||||
MIR_InitMouse();
|
||||
|
||||
extern void
|
||||
MIR_FiniMouse();
|
||||
|
||||
#endif /* SDL_mirmouse_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_MIR
|
||||
|
||||
#include "SDL_miropengl.h"
|
||||
|
||||
#include "SDL_mirdyn.h"
|
||||
|
||||
int
|
||||
MIR_GL_SwapWindow(_THIS, SDL_Window* window)
|
||||
{
|
||||
MIR_Window* mir_wind = window->driverdata;
|
||||
|
||||
return SDL_EGL_SwapBuffers(_this, mir_wind->egl_surface);
|
||||
}
|
||||
|
||||
int
|
||||
MIR_GL_MakeCurrent(_THIS, SDL_Window* window, SDL_GLContext context)
|
||||
{
|
||||
if (window) {
|
||||
EGLSurface egl_surface = ((MIR_Window*)window->driverdata)->egl_surface;
|
||||
return SDL_EGL_MakeCurrent(_this, egl_surface, context);
|
||||
}
|
||||
|
||||
return SDL_EGL_MakeCurrent(_this, NULL, NULL);
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
MIR_GL_CreateContext(_THIS, SDL_Window* window)
|
||||
{
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
|
||||
SDL_GLContext context;
|
||||
context = SDL_EGL_CreateContext(_this, mir_window->egl_surface);
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
int
|
||||
MIR_GL_LoadLibrary(_THIS, const char* path)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
|
||||
SDL_EGL_LoadLibrary(_this, path, MIR_mir_connection_get_egl_native_display(mir_data->connection), 0);
|
||||
|
||||
SDL_EGL_ChooseConfig(_this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_MIR */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#ifndef SDL_miropengl_h_
|
||||
#define SDL_miropengl_h_
|
||||
|
||||
#include "SDL_mirwindow.h"
|
||||
|
||||
#include "../SDL_egl_c.h"
|
||||
|
||||
#define MIR_GL_DeleteContext SDL_EGL_DeleteContext
|
||||
#define MIR_GL_GetSwapInterval SDL_EGL_GetSwapInterval
|
||||
#define MIR_GL_SetSwapInterval SDL_EGL_SetSwapInterval
|
||||
#define MIR_GL_UnloadLibrary SDL_EGL_UnloadLibrary
|
||||
#define MIR_GL_GetProcAddress SDL_EGL_GetProcAddress
|
||||
|
||||
extern int
|
||||
MIR_GL_SwapWindow(_THIS, SDL_Window* window);
|
||||
|
||||
extern int
|
||||
MIR_GL_MakeCurrent(_THIS, SDL_Window* window, SDL_GLContext context);
|
||||
|
||||
extern SDL_GLContext
|
||||
MIR_GL_CreateContext(_THIS, SDL_Window* window);
|
||||
|
||||
extern int
|
||||
MIR_GL_LoadLibrary(_THIS, const char* path);
|
||||
|
||||
#endif /* SDL_miropengl_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
#ifndef SDL_MIR_MODULE
|
||||
#define SDL_MIR_MODULE(modname)
|
||||
#endif
|
||||
|
||||
#ifndef SDL_MIR_SYM
|
||||
#define SDL_MIR_SYM(rc,fn,params)
|
||||
#endif
|
||||
|
||||
#ifndef SDL_MIR_SYM_CONST
|
||||
#define SDL_MIR_SYM_CONST(type, name)
|
||||
#endif
|
||||
|
||||
SDL_MIR_MODULE(MIR_CLIENT)
|
||||
SDL_MIR_SYM(MirWindow *,mir_create_window_sync,(MirWindowSpec* spec))
|
||||
SDL_MIR_SYM(MirEGLNativeWindowType,mir_buffer_stream_get_egl_native_window,(MirBufferStream *surface))
|
||||
SDL_MIR_SYM(bool,mir_buffer_stream_get_graphics_region,(MirBufferStream *stream, MirGraphicsRegion *graphics_region))
|
||||
SDL_MIR_SYM(void,mir_buffer_stream_swap_buffers_sync,(MirBufferStream *stream))
|
||||
SDL_MIR_SYM(void,mir_window_set_event_handler,(MirWindow* window, MirWindowEventCallback callback, void* context))
|
||||
SDL_MIR_SYM(MirWindowSpec*,mir_create_normal_window_spec,(MirConnection *connection, int width, int height))
|
||||
SDL_MIR_SYM(MirWindowSpec*,mir_create_window_spec,(MirConnection *connection))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_buffer_usage,(MirWindowSpec *spec, MirBufferUsage usage))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_name,(MirWindowSpec *spec, char const *name))
|
||||
SDL_MIR_SYM(void,mir_window_spec_release,(MirWindowSpec *spec))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_width,(MirWindowSpec *spec, unsigned width))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_height,(MirWindowSpec *spec, unsigned height))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_min_width,(MirWindowSpec *spec, unsigned min_width))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_min_height,(MirWindowSpec *spec, unsigned min_height))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_max_width,(MirWindowSpec *spec, unsigned max_width))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_max_height,(MirWindowSpec *spec, unsigned max_height))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_type,(MirWindowSpec *spec, MirWindowType type))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_state,(MirWindowSpec *spec, MirWindowState state))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_pointer_confinement,(MirWindowSpec *spec, MirPointerConfinementState state))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_pixel_format,(MirWindowSpec *spec, MirPixelFormat pixel_format))
|
||||
SDL_MIR_SYM(void,mir_window_spec_set_cursor_name,(MirWindowSpec *spec, char const* cursor_name))
|
||||
SDL_MIR_SYM(void,mir_window_apply_spec,(MirWindow* window, MirWindowSpec* spec))
|
||||
SDL_MIR_SYM(void,mir_window_get_parameters,(MirWindow *window, MirWindowParameters *params))
|
||||
SDL_MIR_SYM(MirBufferStream*,mir_window_get_buffer_stream,(MirWindow* window))
|
||||
SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_buffer_stream,(MirBufferStream const* stream, int hot_x, int hot_y))
|
||||
SDL_MIR_SYM(MirBufferStream*,mir_connection_create_buffer_stream_sync,(MirConnection *connection, int w, int h, MirPixelFormat format, MirBufferUsage usage))
|
||||
SDL_MIR_SYM(MirKeyboardAction,mir_keyboard_event_action,(MirKeyboardEvent const *event))
|
||||
SDL_MIR_SYM(xkb_keysym_t,mir_keyboard_event_key_code,(MirKeyboardEvent const *event))
|
||||
SDL_MIR_SYM(int,mir_keyboard_event_scan_code,(MirKeyboardEvent const *event))
|
||||
SDL_MIR_SYM(bool,mir_pointer_event_button_state,(MirPointerEvent const *event, MirPointerButton button))
|
||||
SDL_MIR_SYM(MirPointerButtons,mir_pointer_event_buttons,(MirPointerEvent const *event))
|
||||
SDL_MIR_SYM(MirInputDeviceId,mir_input_event_get_device_id,(MirInputEvent const* ev))
|
||||
SDL_MIR_SYM(MirTouchId,mir_touch_event_id,(MirTouchEvent const *event, size_t touch_index))
|
||||
SDL_MIR_SYM(float,mir_touch_event_axis_value,(MirTouchEvent const *event, size_t touch_index, MirTouchAxis axis))
|
||||
SDL_MIR_SYM(MirTouchAction,mir_touch_event_action,(MirTouchEvent const *event, size_t touch_index))
|
||||
SDL_MIR_SYM(MirPointerAction,mir_pointer_event_action,(MirPointerEvent const *event))
|
||||
SDL_MIR_SYM(float,mir_pointer_event_axis_value,(MirPointerEvent const *event, MirPointerAxis))
|
||||
SDL_MIR_SYM(MirEventType,mir_event_get_type,(MirEvent const *event))
|
||||
SDL_MIR_SYM(MirInputEventType,mir_input_event_get_type,(MirInputEvent const *event))
|
||||
SDL_MIR_SYM(MirInputEvent const*,mir_event_get_input_event,(MirEvent const *event))
|
||||
SDL_MIR_SYM(MirResizeEvent const*,mir_event_get_resize_event,(MirEvent const *event))
|
||||
SDL_MIR_SYM(MirKeyboardEvent const*,mir_input_event_get_keyboard_event,(MirInputEvent const *event))
|
||||
SDL_MIR_SYM(MirPointerEvent const*,mir_input_event_get_pointer_event,(MirInputEvent const *event))
|
||||
SDL_MIR_SYM(MirTouchEvent const*,mir_input_event_get_touch_event,(MirInputEvent const *event))
|
||||
SDL_MIR_SYM(MirWindowEvent const*,mir_event_get_window_event,(MirEvent const *event))
|
||||
SDL_MIR_SYM(unsigned int,mir_touch_event_point_count,(MirTouchEvent const *event))
|
||||
SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
|
||||
SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
|
||||
SDL_MIR_SYM(bool,mir_connection_is_valid,(MirConnection *connection))
|
||||
SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
|
||||
SDL_MIR_SYM(MirPixelFormat,mir_connection_get_egl_pixel_format,(MirConnection* connection, void* egldisplay, void* eglconfig))
|
||||
SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
|
||||
SDL_MIR_SYM(char const *,mir_window_get_error_message,(MirWindow *window))
|
||||
SDL_MIR_SYM(bool,mir_window_is_valid,(MirWindow *window))
|
||||
SDL_MIR_SYM(void,mir_window_release_sync,(MirWindow* window))
|
||||
SDL_MIR_SYM(void,mir_buffer_stream_release_sync,(MirBufferStream *stream))
|
||||
SDL_MIR_SYM(void,mir_window_configure_cursor,(MirWindow* window, MirCursorConfiguration const* conf))
|
||||
SDL_MIR_SYM(void,mir_cursor_configuration_destroy,(MirCursorConfiguration* conf))
|
||||
SDL_MIR_SYM(int,mir_resize_event_get_width,(MirResizeEvent const* resize_event))
|
||||
SDL_MIR_SYM(int,mir_resize_event_get_height,(MirResizeEvent const* resize_event))
|
||||
SDL_MIR_SYM(char const*,mir_connection_get_error_message,(MirConnection* connection))
|
||||
SDL_MIR_SYM(MirWindowAttrib,mir_window_event_get_attribute,(MirWindowEvent const* event))
|
||||
SDL_MIR_SYM(int,mir_window_event_get_attribute_value,(MirWindowEvent const* window_event))
|
||||
SDL_MIR_SYM(MirDisplayConfig*,mir_connection_create_display_configuration,(MirConnection* connection))
|
||||
SDL_MIR_SYM(void,mir_display_config_release,(MirDisplayConfig* config))
|
||||
SDL_MIR_SYM(int,mir_display_config_get_num_outputs,(MirDisplayConfig const* config))
|
||||
SDL_MIR_SYM(MirOutput*,mir_display_config_get_mutable_output,(MirDisplayConfig* config, size_t index))
|
||||
SDL_MIR_SYM(int,mir_output_get_num_modes,(MirOutput const* output))
|
||||
SDL_MIR_SYM(MirOutputMode const*,mir_output_get_current_mode,(MirOutput const* output))
|
||||
SDL_MIR_SYM(MirPixelFormat,mir_output_get_current_pixel_format,(MirOutput const* output))
|
||||
SDL_MIR_SYM(int,mir_output_get_position_x,(MirOutput const* output))
|
||||
SDL_MIR_SYM(int,mir_output_get_position_y,(MirOutput const* output))
|
||||
SDL_MIR_SYM(bool,mir_output_is_enabled,(MirOutput const* output))
|
||||
SDL_MIR_SYM(MirOutputConnectionState,mir_output_get_connection_state,(MirOutput const* output))
|
||||
SDL_MIR_SYM(size_t,mir_output_get_preferred_mode_index,(MirOutput const* output))
|
||||
SDL_MIR_SYM(MirOutputType,mir_output_get_type,(MirOutput const* output))
|
||||
SDL_MIR_SYM(char const*,mir_output_type_name,(MirOutputType type))
|
||||
SDL_MIR_SYM(void,mir_output_set_current_mode,(MirOutput* output, MirOutputMode const* mode))
|
||||
SDL_MIR_SYM(MirOutputMode const*,mir_output_get_mode,(MirOutput const* output, size_t index))
|
||||
SDL_MIR_SYM(int,mir_output_mode_get_width,(MirOutputMode const* mode))
|
||||
SDL_MIR_SYM(int,mir_output_mode_get_height,(MirOutputMode const* mode))
|
||||
SDL_MIR_SYM(double,mir_output_mode_get_refresh_rate,(MirOutputMode const* mode))
|
||||
SDL_MIR_SYM(bool,mir_output_is_gamma_supported,(MirOutput const* output))
|
||||
SDL_MIR_SYM(uint32_t,mir_output_get_gamma_size,(MirOutput const* output))
|
||||
SDL_MIR_SYM(void,mir_output_get_gamma,(MirOutput const* output, uint16_t* red, uint16_t* green, uint16_t* blue, uint32_t size))
|
||||
SDL_MIR_SYM(void,mir_output_set_gamma,(MirOutput* output, uint16_t const* red, uint16_t const* green, uint16_t const* blue, uint32_t size))
|
||||
|
||||
SDL_MIR_SYM_CONST(char const*,mir_omnidirectional_resize_cursor_name)
|
||||
SDL_MIR_SYM_CONST(char const*,mir_busy_cursor_name)
|
||||
SDL_MIR_SYM_CONST(char const*,mir_arrow_cursor_name)
|
||||
SDL_MIR_SYM_CONST(char const*,mir_caret_cursor_name)
|
||||
SDL_MIR_SYM_CONST(char const*,mir_vertical_resize_cursor_name)
|
||||
SDL_MIR_SYM_CONST(char const*,mir_horizontal_resize_cursor_name)
|
||||
SDL_MIR_SYM_CONST(char const*,mir_open_hand_cursor_name)
|
||||
SDL_MIR_SYM_CONST(char const*,mir_closed_hand_cursor_name)
|
||||
SDL_MIR_SYM_CONST(char const*,mir_disabled_cursor_name)
|
||||
|
||||
SDL_MIR_MODULE(XKBCOMMON)
|
||||
SDL_MIR_SYM(int,xkb_keysym_to_utf8,(xkb_keysym_t keysym, char *buffer, size_t size))
|
||||
|
||||
#undef SDL_MIR_MODULE
|
||||
#undef SDL_MIR_SYM
|
||||
#undef SDL_MIR_SYM_CONST
|
||||
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,423 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_MIR
|
||||
|
||||
#include "SDL_assert.h"
|
||||
#include "SDL_log.h"
|
||||
|
||||
#include "SDL_mirwindow.h"
|
||||
#include "SDL_video.h"
|
||||
|
||||
#include "SDL_mirframebuffer.h"
|
||||
#include "SDL_mirmouse.h"
|
||||
#include "SDL_miropengl.h"
|
||||
#include "SDL_mirvideo.h"
|
||||
#include "SDL_mirvulkan.h"
|
||||
|
||||
#include "SDL_mirdyn.h"
|
||||
|
||||
#define MIR_DRIVER_NAME "mir"
|
||||
|
||||
static const Uint32 mir_pixel_format_to_sdl_format[] = {
|
||||
SDL_PIXELFORMAT_UNKNOWN, /* mir_pixel_format_invalid */
|
||||
SDL_PIXELFORMAT_ABGR8888, /* mir_pixel_format_abgr_8888 */
|
||||
SDL_PIXELFORMAT_BGR888, /* mir_pixel_format_xbgr_8888 */
|
||||
SDL_PIXELFORMAT_ARGB8888, /* mir_pixel_format_argb_8888 */
|
||||
SDL_PIXELFORMAT_RGB888, /* mir_pixel_format_xrgb_8888 */
|
||||
SDL_PIXELFORMAT_BGR24, /* mir_pixel_format_bgr_888 */
|
||||
SDL_PIXELFORMAT_RGB24, /* mir_pixel_format_rgb_888 */
|
||||
SDL_PIXELFORMAT_RGB565, /* mir_pixel_format_rgb_565 */
|
||||
SDL_PIXELFORMAT_RGBA5551, /* mir_pixel_format_rgba_5551 */
|
||||
SDL_PIXELFORMAT_RGBA4444 /* mir_pixel_format_rgba_4444 */
|
||||
};
|
||||
|
||||
Uint32
|
||||
MIR_GetSDLPixelFormat(MirPixelFormat format)
|
||||
{
|
||||
return mir_pixel_format_to_sdl_format[format];
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_VideoInit(_THIS);
|
||||
|
||||
static void
|
||||
MIR_VideoQuit(_THIS);
|
||||
|
||||
static int
|
||||
MIR_GetDisplayBounds(_THIS, SDL_VideoDisplay* display, SDL_Rect* rect);
|
||||
|
||||
static void
|
||||
MIR_GetDisplayModes(_THIS, SDL_VideoDisplay* sdl_display);
|
||||
|
||||
static int
|
||||
MIR_SetDisplayMode(_THIS, SDL_VideoDisplay* sdl_display, SDL_DisplayMode* mode);
|
||||
|
||||
static SDL_WindowShaper*
|
||||
MIR_CreateShaper(SDL_Window* window)
|
||||
{
|
||||
/* FIXME Im not sure if mir support this atm, will have to come back to this */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_SetWindowShape(SDL_WindowShaper* shaper, SDL_Surface* shape, SDL_WindowShapeMode* shape_mode)
|
||||
{
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_ResizeWindowShape(SDL_Window* window)
|
||||
{
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_Available()
|
||||
{
|
||||
int available = 0;
|
||||
|
||||
if (SDL_MIR_LoadSymbols()) {
|
||||
|
||||
/* Lets ensure we can connect to the mir server */
|
||||
MirConnection* connection = MIR_mir_connect_sync(NULL, SDL_FUNCTION);
|
||||
|
||||
if (!MIR_mir_connection_is_valid(connection)) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Unable to connect to the mir server %s",
|
||||
MIR_mir_connection_get_error_message(connection));
|
||||
|
||||
return available;
|
||||
}
|
||||
|
||||
MIR_mir_connection_release(connection);
|
||||
|
||||
available = 1;
|
||||
SDL_MIR_UnloadSymbols();
|
||||
}
|
||||
|
||||
return available;
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_DeleteDevice(SDL_VideoDevice* device)
|
||||
{
|
||||
SDL_free(device);
|
||||
SDL_MIR_UnloadSymbols();
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_PumpEvents(_THIS)
|
||||
{
|
||||
}
|
||||
|
||||
static SDL_VideoDevice*
|
||||
MIR_CreateDevice(int device_index)
|
||||
{
|
||||
MIR_Data* mir_data;
|
||||
SDL_VideoDevice* device = NULL;
|
||||
|
||||
if (!SDL_MIR_LoadSymbols()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
device = SDL_calloc(1, sizeof(SDL_VideoDevice));
|
||||
if (!device) {
|
||||
SDL_MIR_UnloadSymbols();
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mir_data = SDL_calloc(1, sizeof(MIR_Data));
|
||||
if (!mir_data) {
|
||||
SDL_free(device);
|
||||
SDL_MIR_UnloadSymbols();
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
device->driverdata = mir_data;
|
||||
|
||||
/* mirvideo */
|
||||
device->VideoInit = MIR_VideoInit;
|
||||
device->VideoQuit = MIR_VideoQuit;
|
||||
device->GetDisplayBounds = MIR_GetDisplayBounds;
|
||||
device->GetDisplayModes = MIR_GetDisplayModes;
|
||||
device->SetDisplayMode = MIR_SetDisplayMode;
|
||||
device->free = MIR_DeleteDevice;
|
||||
|
||||
/* miropengles */
|
||||
device->GL_SwapWindow = MIR_GL_SwapWindow;
|
||||
device->GL_MakeCurrent = MIR_GL_MakeCurrent;
|
||||
device->GL_CreateContext = MIR_GL_CreateContext;
|
||||
device->GL_DeleteContext = MIR_GL_DeleteContext;
|
||||
device->GL_LoadLibrary = MIR_GL_LoadLibrary;
|
||||
device->GL_UnloadLibrary = MIR_GL_UnloadLibrary;
|
||||
device->GL_GetSwapInterval = MIR_GL_GetSwapInterval;
|
||||
device->GL_SetSwapInterval = MIR_GL_SetSwapInterval;
|
||||
device->GL_GetProcAddress = MIR_GL_GetProcAddress;
|
||||
|
||||
/* mirwindow */
|
||||
device->CreateSDLWindow = MIR_CreateWindow;
|
||||
device->DestroyWindow = MIR_DestroyWindow;
|
||||
device->GetWindowWMInfo = MIR_GetWindowWMInfo;
|
||||
device->SetWindowFullscreen = MIR_SetWindowFullscreen;
|
||||
device->MaximizeWindow = MIR_MaximizeWindow;
|
||||
device->MinimizeWindow = MIR_MinimizeWindow;
|
||||
device->RestoreWindow = MIR_RestoreWindow;
|
||||
device->ShowWindow = MIR_RestoreWindow;
|
||||
device->HideWindow = MIR_HideWindow;
|
||||
device->SetWindowSize = MIR_SetWindowSize;
|
||||
device->SetWindowMinimumSize = MIR_SetWindowMinimumSize;
|
||||
device->SetWindowMaximumSize = MIR_SetWindowMaximumSize;
|
||||
device->SetWindowTitle = MIR_SetWindowTitle;
|
||||
device->SetWindowGrab = MIR_SetWindowGrab;
|
||||
device->SetWindowGammaRamp = MIR_SetWindowGammaRamp;
|
||||
device->GetWindowGammaRamp = MIR_GetWindowGammaRamp;
|
||||
|
||||
device->CreateSDLWindowFrom = NULL;
|
||||
device->SetWindowIcon = NULL;
|
||||
device->RaiseWindow = NULL;
|
||||
device->SetWindowBordered = NULL;
|
||||
device->SetWindowResizable = NULL;
|
||||
device->OnWindowEnter = NULL;
|
||||
device->SetWindowPosition = NULL;
|
||||
|
||||
/* mirframebuffer */
|
||||
device->CreateWindowFramebuffer = MIR_CreateWindowFramebuffer;
|
||||
device->UpdateWindowFramebuffer = MIR_UpdateWindowFramebuffer;
|
||||
device->DestroyWindowFramebuffer = MIR_DestroyWindowFramebuffer;
|
||||
|
||||
device->shape_driver.CreateShaper = MIR_CreateShaper;
|
||||
device->shape_driver.SetWindowShape = MIR_SetWindowShape;
|
||||
device->shape_driver.ResizeWindowShape = MIR_ResizeWindowShape;
|
||||
|
||||
device->PumpEvents = MIR_PumpEvents;
|
||||
|
||||
device->SuspendScreenSaver = NULL;
|
||||
|
||||
device->StartTextInput = NULL;
|
||||
device->StopTextInput = NULL;
|
||||
device->SetTextInputRect = NULL;
|
||||
|
||||
device->HasScreenKeyboardSupport = NULL;
|
||||
device->ShowScreenKeyboard = NULL;
|
||||
device->HideScreenKeyboard = NULL;
|
||||
device->IsScreenKeyboardShown = NULL;
|
||||
|
||||
device->SetClipboardText = NULL;
|
||||
device->GetClipboardText = NULL;
|
||||
device->HasClipboardText = NULL;
|
||||
|
||||
device->ShowMessageBox = NULL;
|
||||
|
||||
#if SDL_VIDEO_VULKAN
|
||||
device->Vulkan_LoadLibrary = MIR_Vulkan_LoadLibrary;
|
||||
device->Vulkan_UnloadLibrary = MIR_Vulkan_UnloadLibrary;
|
||||
device->Vulkan_GetInstanceExtensions = MIR_Vulkan_GetInstanceExtensions;
|
||||
device->Vulkan_CreateSurface = MIR_Vulkan_CreateSurface;
|
||||
#endif
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
VideoBootStrap MIR_bootstrap = {
|
||||
MIR_DRIVER_NAME, "SDL Mir video driver",
|
||||
MIR_Available, MIR_CreateDevice
|
||||
};
|
||||
|
||||
static SDL_DisplayMode
|
||||
MIR_ConvertModeToSDLMode(MirOutputMode const* mode, MirPixelFormat format)
|
||||
{
|
||||
SDL_DisplayMode sdl_mode = {
|
||||
.format = MIR_GetSDLPixelFormat(format),
|
||||
.w = MIR_mir_output_mode_get_width(mode),
|
||||
.h = MIR_mir_output_mode_get_height(mode),
|
||||
.refresh_rate = MIR_mir_output_mode_get_refresh_rate(mode),
|
||||
.driverdata = NULL
|
||||
};
|
||||
|
||||
return sdl_mode;
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_AddModeToDisplay(SDL_VideoDisplay* display, MirOutputMode const* mode, MirPixelFormat format)
|
||||
{
|
||||
SDL_DisplayMode sdl_mode = MIR_ConvertModeToSDLMode(mode, format);
|
||||
SDL_AddDisplayMode(display, &sdl_mode);
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_InitDisplayFromOutput(_THIS, MirOutput* output)
|
||||
{
|
||||
SDL_VideoDisplay display;
|
||||
int m;
|
||||
|
||||
MirPixelFormat format = MIR_mir_output_get_current_pixel_format(output);
|
||||
int num_modes = MIR_mir_output_get_num_modes(output);
|
||||
SDL_DisplayMode current_mode = MIR_ConvertModeToSDLMode(MIR_mir_output_get_current_mode(output), format);
|
||||
|
||||
SDL_zero(display);
|
||||
|
||||
// Unfortunate cast, but SDL_AddVideoDisplay will strdup this pointer so its read-only in this case.
|
||||
display.name = (char*)MIR_mir_output_type_name(MIR_mir_output_get_type(output));
|
||||
|
||||
for (m = 0; m < num_modes; m++) {
|
||||
MirOutputMode const* mode = MIR_mir_output_get_mode(output, m);
|
||||
MIR_AddModeToDisplay(&display, mode, format);
|
||||
}
|
||||
|
||||
display.desktop_mode = current_mode;
|
||||
display.current_mode = current_mode;
|
||||
|
||||
display.driverdata = output;
|
||||
SDL_AddVideoDisplay(&display);
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_InitDisplays(_THIS)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
int num_outputs = MIR_mir_display_config_get_num_outputs(mir_data->display_config);
|
||||
int d;
|
||||
|
||||
for (d = 0; d < num_outputs; d++) {
|
||||
MirOutput* output = MIR_mir_display_config_get_mutable_output(mir_data->display_config, d);
|
||||
SDL_bool enabled = MIR_mir_output_is_enabled(output);
|
||||
MirOutputConnectionState state = MIR_mir_output_get_connection_state(output);
|
||||
|
||||
if (enabled && state == mir_output_connection_state_connected) {
|
||||
MIR_InitDisplayFromOutput(_this, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_VideoInit(_THIS)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
|
||||
mir_data->connection = MIR_mir_connect_sync(NULL, SDL_FUNCTION);
|
||||
mir_data->current_window = NULL;
|
||||
mir_data->software = SDL_FALSE;
|
||||
mir_data->pixel_format = mir_pixel_format_invalid;
|
||||
|
||||
if (!MIR_mir_connection_is_valid(mir_data->connection)) {
|
||||
return SDL_SetError("Failed to connect to the mir server: %s",
|
||||
MIR_mir_connection_get_error_message(mir_data->connection));
|
||||
}
|
||||
|
||||
mir_data->display_config = MIR_mir_connection_create_display_configuration(mir_data->connection);
|
||||
|
||||
MIR_InitDisplays(_this);
|
||||
MIR_InitMouse();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_CleanUpDisplayConfig(_THIS)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
int i;
|
||||
|
||||
// SDL_VideoQuit frees the display driverdata, we own it not them
|
||||
for (i = 0; i < _this->num_displays; ++i) {
|
||||
_this->displays[i].driverdata = NULL;
|
||||
}
|
||||
|
||||
MIR_mir_display_config_release(mir_data->display_config);
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_VideoQuit(_THIS)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
|
||||
MIR_CleanUpDisplayConfig(_this);
|
||||
|
||||
MIR_FiniMouse();
|
||||
|
||||
MIR_GL_DeleteContext(_this, NULL);
|
||||
MIR_GL_UnloadLibrary(_this);
|
||||
|
||||
MIR_mir_connection_release(mir_data->connection);
|
||||
|
||||
SDL_free(mir_data);
|
||||
_this->driverdata = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_GetDisplayBounds(_THIS, SDL_VideoDisplay* display, SDL_Rect* rect)
|
||||
{
|
||||
MirOutput const* output = display->driverdata;
|
||||
|
||||
rect->x = MIR_mir_output_get_position_x(output);
|
||||
rect->y = MIR_mir_output_get_position_y(output);
|
||||
rect->w = display->current_mode.w;
|
||||
rect->h = display->current_mode.h;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
MIR_GetDisplayModes(_THIS, SDL_VideoDisplay* display)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
MIR_SetDisplayMode(_THIS, SDL_VideoDisplay* display, SDL_DisplayMode* mode)
|
||||
{
|
||||
int m;
|
||||
MirOutput* output = display->driverdata;
|
||||
int num_modes = MIR_mir_output_get_num_modes(output);
|
||||
Uint32 sdl_format = MIR_GetSDLPixelFormat(
|
||||
MIR_mir_output_get_current_pixel_format(output));
|
||||
|
||||
for (m = 0; m < num_modes; m++) {
|
||||
MirOutputMode const* mir_mode = MIR_mir_output_get_mode(output, m);
|
||||
int width = MIR_mir_output_mode_get_width(mir_mode);
|
||||
int height = MIR_mir_output_mode_get_height(mir_mode);
|
||||
double refresh_rate = MIR_mir_output_mode_get_refresh_rate(mir_mode);
|
||||
|
||||
if (mode->format == sdl_format &&
|
||||
mode->w == width &&
|
||||
mode->h == height &&
|
||||
mode->refresh_rate == refresh_rate) {
|
||||
|
||||
// FIXME Currently wont actually *set* anything. Need to wait for applying display changes
|
||||
MIR_mir_output_set_current_mode(output, mir_mode);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_MIR */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#ifndef SDL_mirvideo_h__
|
||||
#define SDL_mirvideo_h__
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <mir_toolkit/mir_client_library.h>
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
typedef struct MIR_Window MIR_Window;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MirConnection* connection;
|
||||
MirDisplayConfig* display_config;
|
||||
MIR_Window* current_window;
|
||||
SDL_bool software;
|
||||
MirPixelFormat pixel_format;
|
||||
} MIR_Data;
|
||||
|
||||
extern Uint32
|
||||
MIR_GetSDLPixelFormat(MirPixelFormat format);
|
||||
|
||||
#endif /* SDL_mirvideo_h__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,374 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_MIR
|
||||
|
||||
#include "../SDL_egl_c.h"
|
||||
#include "../SDL_sysvideo.h"
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
|
||||
#include "SDL_mirevents.h"
|
||||
#include "SDL_mirwindow.h"
|
||||
|
||||
#include "SDL_mirdyn.h"
|
||||
|
||||
static int
|
||||
IsMirWindowValid(MIR_Window* mir_window)
|
||||
{
|
||||
if (!MIR_mir_window_is_valid(mir_window->window)) {
|
||||
const char* error = MIR_mir_window_get_error_message(mir_window->window);
|
||||
return SDL_SetError("Failed to create a mir surface: %s", error);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static MirPixelFormat
|
||||
FindValidPixelFormat(MIR_Data* mir_data)
|
||||
{
|
||||
unsigned int pf_size = 32;
|
||||
unsigned int valid_formats;
|
||||
unsigned int f;
|
||||
|
||||
MirPixelFormat formats[pf_size];
|
||||
MIR_mir_connection_get_available_surface_formats(mir_data->connection, formats,
|
||||
pf_size, &valid_formats);
|
||||
|
||||
for (f = 0; f < valid_formats; f++) {
|
||||
MirPixelFormat cur_pf = formats[f];
|
||||
|
||||
if (cur_pf == mir_pixel_format_abgr_8888 ||
|
||||
cur_pf == mir_pixel_format_xbgr_8888 ||
|
||||
cur_pf == mir_pixel_format_argb_8888 ||
|
||||
cur_pf == mir_pixel_format_xrgb_8888) {
|
||||
|
||||
return cur_pf;
|
||||
}
|
||||
}
|
||||
|
||||
return mir_pixel_format_invalid;
|
||||
}
|
||||
|
||||
int
|
||||
MIR_CreateWindow(_THIS, SDL_Window* window)
|
||||
{
|
||||
MIR_Window* mir_window;
|
||||
MIR_Data* mir_data;
|
||||
MirPixelFormat pixel_format;
|
||||
MirBufferUsage buffer_usage;
|
||||
|
||||
MirWindowSpec* spec;
|
||||
|
||||
mir_window = SDL_calloc(1, sizeof(MIR_Window));
|
||||
if (!mir_window)
|
||||
return SDL_OutOfMemory();
|
||||
|
||||
mir_data = _this->driverdata;
|
||||
window->driverdata = mir_window;
|
||||
|
||||
if (window->x == SDL_WINDOWPOS_UNDEFINED)
|
||||
window->x = 0;
|
||||
|
||||
if (window->y == SDL_WINDOWPOS_UNDEFINED)
|
||||
window->y = 0;
|
||||
|
||||
mir_window->mir_data = mir_data;
|
||||
mir_window->sdl_window = window;
|
||||
|
||||
if (window->flags & SDL_WINDOW_OPENGL) {
|
||||
pixel_format = MIR_mir_connection_get_egl_pixel_format(mir_data->connection,
|
||||
_this->egl_data->egl_display,
|
||||
_this->egl_data->egl_config);
|
||||
}
|
||||
else {
|
||||
pixel_format = FindValidPixelFormat(mir_data);
|
||||
}
|
||||
|
||||
mir_data->pixel_format = pixel_format;
|
||||
if (pixel_format == mir_pixel_format_invalid) {
|
||||
return SDL_SetError("Failed to find a valid pixel format.");
|
||||
}
|
||||
|
||||
buffer_usage = mir_buffer_usage_hardware;
|
||||
if (mir_data->software)
|
||||
buffer_usage = mir_buffer_usage_software;
|
||||
|
||||
spec = MIR_mir_create_normal_window_spec(mir_data->connection,
|
||||
window->w,
|
||||
window->h);
|
||||
|
||||
MIR_mir_window_spec_set_buffer_usage(spec, buffer_usage);
|
||||
MIR_mir_window_spec_set_name(spec, "Mir surface");
|
||||
MIR_mir_window_spec_set_pixel_format(spec, pixel_format);
|
||||
|
||||
if (window->flags & SDL_WINDOW_INPUT_FOCUS)
|
||||
SDL_SetKeyboardFocus(window);
|
||||
|
||||
mir_window->window = MIR_mir_create_window_sync(spec);
|
||||
MIR_mir_window_set_event_handler(mir_window->window, MIR_HandleEvent, window);
|
||||
|
||||
MIR_mir_window_spec_release(spec);
|
||||
|
||||
if (!MIR_mir_window_is_valid(mir_window->window)) {
|
||||
return SDL_SetError("Failed to create a mir surface: %s",
|
||||
MIR_mir_window_get_error_message(mir_window->window));
|
||||
}
|
||||
|
||||
if (window->flags & SDL_WINDOW_OPENGL) {
|
||||
EGLNativeWindowType egl_native_window =
|
||||
(EGLNativeWindowType)MIR_mir_buffer_stream_get_egl_native_window(
|
||||
MIR_mir_window_get_buffer_stream(mir_window->window));
|
||||
|
||||
mir_window->egl_surface = SDL_EGL_CreateSurface(_this, egl_native_window);
|
||||
|
||||
if (mir_window->egl_surface == EGL_NO_SURFACE) {
|
||||
return SDL_SetError("Failed to create a window surface %p",
|
||||
_this->egl_data->egl_display);
|
||||
}
|
||||
}
|
||||
else {
|
||||
mir_window->egl_surface = EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
mir_data->current_window = mir_window;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
MIR_DestroyWindow(_THIS, SDL_Window* window)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
|
||||
if (mir_data) {
|
||||
SDL_EGL_DestroySurface(_this, mir_window->egl_surface);
|
||||
MIR_mir_window_release_sync(mir_window->window);
|
||||
|
||||
mir_data->current_window = NULL;
|
||||
|
||||
SDL_free(mir_window);
|
||||
}
|
||||
window->driverdata = NULL;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info)
|
||||
{
|
||||
if (info->version.major == SDL_MAJOR_VERSION &&
|
||||
info->version.minor == SDL_MINOR_VERSION) {
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
|
||||
info->subsystem = SDL_SYSWM_MIR;
|
||||
info->info.mir.connection = mir_window->mir_data->connection;
|
||||
// Cannot change this to window due to it being in the public API
|
||||
info->info.mir.surface = mir_window->window;
|
||||
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
UpdateMirWindowState(MIR_Data* mir_data, MIR_Window* mir_window, MirWindowState window_state)
|
||||
{
|
||||
if (IsMirWindowValid(mir_window)) {
|
||||
MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
|
||||
MIR_mir_window_spec_set_state(spec, window_state);
|
||||
|
||||
MIR_mir_window_apply_spec(mir_window->window, spec);
|
||||
MIR_mir_window_spec_release(spec);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MIR_SetWindowFullscreen(_THIS, SDL_Window* window,
|
||||
SDL_VideoDisplay* display,
|
||||
SDL_bool fullscreen)
|
||||
{
|
||||
if (IsMirWindowValid(window->driverdata)) {
|
||||
MirWindowState state;
|
||||
|
||||
if (fullscreen) {
|
||||
state = mir_window_state_fullscreen;
|
||||
}
|
||||
else {
|
||||
state = mir_window_state_restored;
|
||||
}
|
||||
|
||||
UpdateMirWindowState(_this->driverdata, window->driverdata, state);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MIR_MaximizeWindow(_THIS, SDL_Window* window)
|
||||
{
|
||||
UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_maximized);
|
||||
}
|
||||
|
||||
void
|
||||
MIR_MinimizeWindow(_THIS, SDL_Window* window)
|
||||
{
|
||||
UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_minimized);
|
||||
}
|
||||
|
||||
void
|
||||
MIR_RestoreWindow(_THIS, SDL_Window * window)
|
||||
{
|
||||
UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_restored);
|
||||
}
|
||||
|
||||
void
|
||||
MIR_HideWindow(_THIS, SDL_Window* window)
|
||||
{
|
||||
UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_hidden);
|
||||
}
|
||||
|
||||
void
|
||||
MIR_SetWindowSize(_THIS, SDL_Window* window)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
|
||||
if (IsMirWindowValid(mir_window)) {
|
||||
MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
|
||||
MIR_mir_window_spec_set_width (spec, window->w);
|
||||
MIR_mir_window_spec_set_height(spec, window->h);
|
||||
|
||||
MIR_mir_window_apply_spec(mir_window->window, spec);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MIR_SetWindowMinimumSize(_THIS, SDL_Window* window)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
|
||||
if (IsMirWindowValid(mir_window)) {
|
||||
MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
|
||||
MIR_mir_window_spec_set_min_width (spec, window->min_w);
|
||||
MIR_mir_window_spec_set_min_height(spec, window->min_h);
|
||||
|
||||
MIR_mir_window_apply_spec(mir_window->window, spec);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MIR_SetWindowMaximumSize(_THIS, SDL_Window* window)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
|
||||
if (IsMirWindowValid(mir_window)) {
|
||||
MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
|
||||
MIR_mir_window_spec_set_max_width (spec, window->max_w);
|
||||
MIR_mir_window_spec_set_max_height(spec, window->max_h);
|
||||
|
||||
MIR_mir_window_apply_spec(mir_window->window, spec);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MIR_SetWindowTitle(_THIS, SDL_Window* window)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
char const* title = window->title ? window->title : "";
|
||||
MirWindowSpec* spec;
|
||||
|
||||
if (IsMirWindowValid(mir_window) < 0)
|
||||
return;
|
||||
|
||||
spec = MIR_mir_create_window_spec(mir_data->connection);
|
||||
MIR_mir_window_spec_set_name(spec, title);
|
||||
|
||||
MIR_mir_window_apply_spec(mir_window->window, spec);
|
||||
MIR_mir_window_spec_release(spec);
|
||||
}
|
||||
|
||||
void
|
||||
MIR_SetWindowGrab(_THIS, SDL_Window* window, SDL_bool grabbed)
|
||||
{
|
||||
MIR_Data* mir_data = _this->driverdata;
|
||||
MIR_Window* mir_window = window->driverdata;
|
||||
MirPointerConfinementState confined = mir_pointer_unconfined;
|
||||
MirWindowSpec* spec;
|
||||
|
||||
if (grabbed)
|
||||
confined = mir_pointer_confined_to_window;
|
||||
|
||||
spec = MIR_mir_create_window_spec(mir_data->connection);
|
||||
MIR_mir_window_spec_set_pointer_confinement(spec, confined);
|
||||
|
||||
MIR_mir_window_apply_spec(mir_window->window, spec);
|
||||
MIR_mir_window_spec_release(spec);
|
||||
}
|
||||
|
||||
int
|
||||
MIR_SetWindowGammaRamp(_THIS, SDL_Window* window, Uint16 const* ramp)
|
||||
{
|
||||
MirOutput* output = SDL_GetDisplayForWindow(window)->driverdata;
|
||||
Uint32 ramp_size = 256;
|
||||
|
||||
// FIXME Need to apply the changes to the output, once that public API function is around
|
||||
if (MIR_mir_output_is_gamma_supported(output) == mir_output_gamma_supported) {
|
||||
MIR_mir_output_set_gamma(output,
|
||||
ramp + ramp_size * 0,
|
||||
ramp + ramp_size * 1,
|
||||
ramp + ramp_size * 2,
|
||||
ramp_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
MIR_GetWindowGammaRamp(_THIS, SDL_Window* window, Uint16* ramp)
|
||||
{
|
||||
MirOutput* output = SDL_GetDisplayForWindow(window)->driverdata;
|
||||
Uint32 ramp_size = 256;
|
||||
|
||||
if (MIR_mir_output_is_gamma_supported(output) == mir_output_gamma_supported) {
|
||||
if (MIR_mir_output_get_gamma_size(output) == ramp_size) {
|
||||
MIR_mir_output_get_gamma(output,
|
||||
ramp + ramp_size * 0,
|
||||
ramp + ramp_size * 1,
|
||||
ramp + ramp_size * 2,
|
||||
ramp_size);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_MIR */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
|
||||
*/
|
||||
|
||||
#ifndef SDL_mirwindow_h_
|
||||
#define SDL_mirwindow_h_
|
||||
|
||||
#include "../SDL_sysvideo.h"
|
||||
#include "SDL_syswm.h"
|
||||
|
||||
#include "SDL_mirvideo.h"
|
||||
|
||||
struct MIR_Window {
|
||||
SDL_Window* sdl_window;
|
||||
MIR_Data* mir_data;
|
||||
|
||||
MirWindow* window;
|
||||
EGLSurface egl_surface;
|
||||
};
|
||||
|
||||
|
||||
extern int
|
||||
MIR_CreateWindow(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_DestroyWindow(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_SetWindowFullscreen(_THIS, SDL_Window* window,
|
||||
SDL_VideoDisplay* display,
|
||||
SDL_bool fullscreen);
|
||||
|
||||
extern void
|
||||
MIR_MaximizeWindow(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_MinimizeWindow(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_RestoreWindow(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_HideWindow(_THIS, SDL_Window* window);
|
||||
|
||||
extern SDL_bool
|
||||
MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info);
|
||||
|
||||
extern void
|
||||
MIR_SetWindowSize(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_SetWindowMinimumSize(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_SetWindowMaximumSize(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_SetWindowTitle(_THIS, SDL_Window* window);
|
||||
|
||||
extern void
|
||||
MIR_SetWindowGrab(_THIS, SDL_Window* window, SDL_bool grabbed);
|
||||
|
||||
extern int
|
||||
MIR_SetWindowGammaRamp(_THIS, SDL_Window* window, Uint16 const* ramp);
|
||||
|
||||
extern int
|
||||
MIR_GetWindowGammaRamp(_THIS, SDL_Window* window, Uint16* ramp);
|
||||
|
||||
#endif /* SDL_mirwindow_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,309 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely.
|
||||
*/
|
||||
/* Usage:
|
||||
* Spacebar to begin recording a gesture on all touches.
|
||||
* s to save all touches into "./gestureSave"
|
||||
* l to load all touches from "./gestureSave"
|
||||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include <stdlib.h> /* for exit() */
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
|
||||
#define WIDTH 640
|
||||
#define HEIGHT 480
|
||||
#define BPP 4
|
||||
|
||||
/* MUST BE A POWER OF 2! */
|
||||
#define EVENT_BUF_SIZE 256
|
||||
|
||||
|
||||
#define VERBOSE 0
|
||||
|
||||
static SDL_Event events[EVENT_BUF_SIZE];
|
||||
static int eventWrite;
|
||||
|
||||
|
||||
static int colors[7] = {0xFF,0xFF00,0xFF0000,0xFFFF00,0x00FFFF,0xFF00FF,0xFFFFFF};
|
||||
|
||||
SDL_Surface *screen;
|
||||
SDL_Window *window;
|
||||
SDL_bool quitting = SDL_FALSE;
|
||||
|
||||
typedef struct {
|
||||
float x,y;
|
||||
} Point;
|
||||
|
||||
typedef struct {
|
||||
float ang,r;
|
||||
Point p;
|
||||
} Knob;
|
||||
|
||||
static Knob knob;
|
||||
|
||||
void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col)
|
||||
{
|
||||
Uint32 *pixmem32;
|
||||
Uint32 colour;
|
||||
Uint8 r,g,b;
|
||||
int x = (int)_x;
|
||||
int y = (int)_y;
|
||||
float a;
|
||||
|
||||
if(x < 0 || x >= screen->w) return;
|
||||
if(y < 0 || y >= screen->h) return;
|
||||
|
||||
pixmem32 = (Uint32*) screen->pixels + y*screen->pitch/BPP + x;
|
||||
|
||||
SDL_memcpy(&colour,pixmem32,screen->format->BytesPerPixel);
|
||||
|
||||
SDL_GetRGB(colour,screen->format,&r,&g,&b);
|
||||
/* r = 0;g = 0; b = 0; */
|
||||
a = (float)((col>>24)&0xFF);
|
||||
if(a == 0) a = 0xFF; /* Hack, to make things easier. */
|
||||
a /= 0xFF;
|
||||
r = (Uint8)(r*(1-a) + ((col>>16)&0xFF)*(a));
|
||||
g = (Uint8)(g*(1-a) + ((col>> 8)&0xFF)*(a));
|
||||
b = (Uint8)(b*(1-a) + ((col>> 0)&0xFF)*(a));
|
||||
colour = SDL_MapRGB( screen->format,r, g, b);
|
||||
|
||||
|
||||
*pixmem32 = colour;
|
||||
}
|
||||
|
||||
void drawLine(SDL_Surface *screen,float x0,float y0,float x1,float y1,unsigned int col) {
|
||||
float t;
|
||||
for(t=0;t<1;t+=(float)(1.f/SDL_max(SDL_fabs(x0-x1),SDL_fabs(y0-y1))))
|
||||
setpix(screen,x1+t*(x0-x1),y1+t*(y0-y1),col);
|
||||
}
|
||||
|
||||
void drawCircle(SDL_Surface* screen,float x,float y,float r,unsigned int c)
|
||||
{
|
||||
float tx,ty;
|
||||
float xr;
|
||||
for(ty = (float)-SDL_fabs(r);ty <= (float)SDL_fabs((int)r);ty++) {
|
||||
xr = (float)SDL_sqrt(r*r - ty*ty);
|
||||
if(r > 0) { /* r > 0 ==> filled circle */
|
||||
for(tx=-xr+.5f;tx<=xr-.5;tx++) {
|
||||
setpix(screen,x+tx,y+ty,c);
|
||||
}
|
||||
}
|
||||
else {
|
||||
setpix(screen,x-xr+.5f,y+ty,c);
|
||||
setpix(screen,x+xr-.5f,y+ty,c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void drawKnob(SDL_Surface* screen,Knob k) {
|
||||
drawCircle(screen,k.p.x*screen->w,k.p.y*screen->h,k.r*screen->w,0xFFFFFF);
|
||||
drawCircle(screen,(k.p.x+k.r/2*SDL_cosf(k.ang))*screen->w,
|
||||
(k.p.y+k.r/2*SDL_sinf(k.ang))*screen->h,k.r/4*screen->w,0);
|
||||
}
|
||||
|
||||
void DrawScreen(SDL_Surface* screen, SDL_Window* window)
|
||||
{
|
||||
int i;
|
||||
#if 1
|
||||
SDL_FillRect(screen, NULL, 0);
|
||||
#else
|
||||
int x, y;
|
||||
for(y = 0;y < screen->h;y++)
|
||||
for(x = 0;x < screen->w;x++)
|
||||
setpix(screen,(float)x,(float)y,((x%255)<<16) + ((y%255)<<8) + (x+y)%255);
|
||||
#endif
|
||||
|
||||
/* draw Touch History */
|
||||
for(i = eventWrite; i < eventWrite+EVENT_BUF_SIZE; ++i) {
|
||||
const SDL_Event *event = &events[i&(EVENT_BUF_SIZE-1)];
|
||||
float age = (float)(i - eventWrite) / EVENT_BUF_SIZE;
|
||||
float x, y;
|
||||
unsigned int c, col;
|
||||
|
||||
if(event->type == SDL_FINGERMOTION ||
|
||||
event->type == SDL_FINGERDOWN ||
|
||||
event->type == SDL_FINGERUP) {
|
||||
x = event->tfinger.x;
|
||||
y = event->tfinger.y;
|
||||
|
||||
/* draw the touch: */
|
||||
c = colors[event->tfinger.fingerId%7];
|
||||
col = ((unsigned int)(c*(.1+.85))) | (unsigned int)(0xFF*age)<<24;
|
||||
|
||||
if(event->type == SDL_FINGERMOTION)
|
||||
drawCircle(screen,x*screen->w,y*screen->h,5,col);
|
||||
else if(event->type == SDL_FINGERDOWN)
|
||||
drawCircle(screen,x*screen->w,y*screen->h,-10,col);
|
||||
}
|
||||
}
|
||||
|
||||
if(knob.p.x > 0)
|
||||
drawKnob(screen,knob);
|
||||
|
||||
SDL_UpdateWindowSurface(window);
|
||||
}
|
||||
|
||||
/* Returns a new SDL_Window if window is NULL or window if not. */
|
||||
SDL_Window* initWindow(SDL_Window *window, int width,int height)
|
||||
{
|
||||
if (!window) {
|
||||
window = SDL_CreateWindow("Gesture Test",
|
||||
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
||||
width, height, SDL_WINDOW_RESIZABLE);
|
||||
}
|
||||
return window;
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
SDL_Event event;
|
||||
SDL_RWops *stream;
|
||||
|
||||
while(SDL_PollEvent(&event))
|
||||
{
|
||||
/* Record _all_ events */
|
||||
events[eventWrite & (EVENT_BUF_SIZE-1)] = event;
|
||||
eventWrite++;
|
||||
|
||||
switch (event.type)
|
||||
{
|
||||
case SDL_QUIT:
|
||||
quitting = SDL_TRUE;
|
||||
break;
|
||||
case SDL_KEYDOWN:
|
||||
switch (event.key.keysym.sym)
|
||||
{
|
||||
case SDLK_i:
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < SDL_GetNumTouchDevices(); ++i) {
|
||||
SDL_TouchID id = SDL_GetTouchDevice(i);
|
||||
SDL_Log("Fingers Down on device %"SDL_PRIs64": %d", id, SDL_GetNumTouchFingers(id));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SDLK_SPACE:
|
||||
SDL_RecordGesture(-1);
|
||||
break;
|
||||
case SDLK_s:
|
||||
stream = SDL_RWFromFile("gestureSave", "w");
|
||||
SDL_Log("Wrote %i templates", SDL_SaveAllDollarTemplates(stream));
|
||||
SDL_RWclose(stream);
|
||||
break;
|
||||
case SDLK_l:
|
||||
stream = SDL_RWFromFile("gestureSave", "r");
|
||||
SDL_Log("Loaded: %i", SDL_LoadDollarTemplates(-1, stream));
|
||||
SDL_RWclose(stream);
|
||||
break;
|
||||
case SDLK_ESCAPE:
|
||||
quitting = SDL_TRUE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SDL_WINDOWEVENT:
|
||||
if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
|
||||
if (!(window = initWindow(window, event.window.data1, event.window.data2)) ||
|
||||
!(screen = SDL_GetWindowSurface(window)))
|
||||
{
|
||||
SDL_Quit();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SDL_FINGERMOTION:
|
||||
#if VERBOSE
|
||||
SDL_Log("Finger: %"SDL_PRIs64",x: %f, y: %f",event.tfinger.fingerId,
|
||||
event.tfinger.x,event.tfinger.y);
|
||||
#endif
|
||||
break;
|
||||
case SDL_FINGERDOWN:
|
||||
#if VERBOSE
|
||||
SDL_Log("Finger: %"SDL_PRIs64" down - x: %f, y: %f",
|
||||
event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
|
||||
#endif
|
||||
break;
|
||||
case SDL_FINGERUP:
|
||||
#if VERBOSE
|
||||
SDL_Log("Finger: %"SDL_PRIs64" up - x: %f, y: %f",
|
||||
event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
|
||||
#endif
|
||||
break;
|
||||
case SDL_MULTIGESTURE:
|
||||
#if VERBOSE
|
||||
SDL_Log("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f",
|
||||
event.mgesture.x,
|
||||
event.mgesture.y,
|
||||
event.mgesture.dTheta,
|
||||
event.mgesture.dDist);
|
||||
SDL_Log("MG: numDownTouch = %i",event.mgesture.numFingers);
|
||||
#endif
|
||||
knob.p.x = event.mgesture.x;
|
||||
knob.p.y = event.mgesture.y;
|
||||
knob.ang += event.mgesture.dTheta;
|
||||
knob.r += event.mgesture.dDist;
|
||||
break;
|
||||
case SDL_DOLLARGESTURE:
|
||||
SDL_Log("Gesture %"SDL_PRIs64" performed, error: %f",
|
||||
event.dgesture.gestureId,
|
||||
event.dgesture.error);
|
||||
break;
|
||||
case SDL_DOLLARRECORD:
|
||||
SDL_Log("Recorded gesture: %"SDL_PRIs64"",event.dgesture.gestureId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
DrawScreen(screen, window);
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
if (quitting) {
|
||||
emscripten_cancel_main_loop();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
window = NULL;
|
||||
screen = NULL;
|
||||
quitting = SDL_FALSE;
|
||||
|
||||
/* Enable standard application logging */
|
||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
||||
|
||||
/* gesture variables */
|
||||
knob.r = .1f;
|
||||
knob.ang = 0;
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1;
|
||||
|
||||
if (!(window = initWindow(window, WIDTH, HEIGHT)) ||
|
||||
!(screen = SDL_GetWindowSurface(window)))
|
||||
{
|
||||
SDL_Quit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_set_main_loop(loop, 0, 1);
|
||||
#else
|
||||
while(!quitting) {
|
||||
loop();
|
||||
}
|
||||
#endif
|
||||
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Visual and Interactive Test Automation for SDL 2.0
|
||||
Copyright (C) 2013 Apoorv Upreti <apoorvupreti@gmail.com>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
@@ -1,37 +0,0 @@
|
||||
# Makefile to build the SDL tests
|
||||
srcdir = @srcdir@
|
||||
CC = @CC@
|
||||
EXE = @EXE@
|
||||
CFLAGS = @CFLAGS@ -I../include -I./include
|
||||
LIBS = @LIBS@
|
||||
TARGETS = \
|
||||
testharness$(EXE) \
|
||||
testquit$(EXE)
|
||||
all: Makefile $(TARGETS)
|
||||
Makefile: $(srcdir)/Makefile.in
|
||||
$(SHELL) config.status $@
|
||||
testharness$(EXE): $(srcdir)/src/action_configparser.c \
|
||||
$(srcdir)/src/harness_argparser.c \
|
||||
$(srcdir)/src/rwhelper.c \
|
||||
$(srcdir)/src/testharness.c \
|
||||
$(srcdir)/src/variator_exhaustive.c \
|
||||
$(srcdir)/src/variators.c \
|
||||
$(srcdir)/src/screenshot.c \
|
||||
$(srcdir)/src/harness_argparser.c \
|
||||
$(srcdir)/src/sut_configparser.c \
|
||||
$(srcdir)/src/variator_common.c \
|
||||
$(srcdir)/src/variator_random.c \
|
||||
$(srcdir)/src/parsehelper.c \
|
||||
$(srcdir)/src/mischelper.c \
|
||||
$(srcdir)/src/linux/linux_process.c \
|
||||
$(srcdir)/src/windows/windows_process.c \
|
||||
$(srcdir)/src/windows/windows_screenshot.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
testquit$(EXE): $(srcdir)/unittest/testquit.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
clean:
|
||||
rm -f $(TARGETS)
|
||||
distclean: clean
|
||||
rm -f Makefile
|
||||
rm -f config.status config.cache config.log
|
||||
rm -rf $(srcdir)/autom4te*
|
||||
@@ -1,214 +0,0 @@
|
||||
/*!
|
||||
|
||||
\mainpage Visual and Interactive Test Automation for SDL 2.0
|
||||
|
||||
\section license_sec License
|
||||
Check the file \c COPYING.txt for licensing information.
|
||||
|
||||
\section intro_sec Introduction
|
||||
The goal of this GSoC project is to automate the testing of testsprite2.
|
||||
testsprite2 takes 26 parameters which have thousands of valid combinations and is
|
||||
used to validate SDL's window, mouse and rendering behaviour. By having a test
|
||||
harness that runs testsprite2 with various command line argument strings and
|
||||
validates the output for each run, we can make testing an easier task for
|
||||
maintainers, contributors and testers. The test harness can be used by a continuous
|
||||
integration system (like buildbot or jenkins) to validate SDL after checkins.
|
||||
|
||||
SDL Homepage: http://libsdl.org/
|
||||
|
||||
\section build_sec Building
|
||||
|
||||
\subsection build_linux Building on Linux/Cygwin
|
||||
<tt>./autogen.sh; ./configure; make;</tt>
|
||||
|
||||
\subsection build_windows Building on Windows
|
||||
Use the Visual Studio solution under \c SDL/VisualC/visualtest.
|
||||
|
||||
\section docs_sec Documentation
|
||||
Documentation is available via Doxygen. To build the documentation, cd to the
|
||||
SDL/visualtest/docs directory and run \c doxygen. A good starting point for
|
||||
exploring the documentation is \c SDL/visualtest/docs/html/index.html
|
||||
|
||||
\section usage_sec Usage
|
||||
To see all the options supported by the test harness, just run \c testharness
|
||||
with no arguments.
|
||||
|
||||
At the moment the following options are supported:
|
||||
\li \c sutapp - Path to the system under test (SUT) application
|
||||
\li \c sutargs - Launch the SUT with the specified arguments string
|
||||
\li \c timeout - The maximum time after which the SUT process will be killed;
|
||||
passed as hh:mm:ss; default 00:01:00
|
||||
\li \c variator - Which variator to use; see \ref variators_sec
|
||||
\li \c num-variations - The number of variations to run for; taken to be
|
||||
1 for the random variator and ALL for the exhaustive variator by default
|
||||
\li \c no-launch - Just print the arguments string for each variation without
|
||||
launching the SUT or performing any actions
|
||||
\li \c parameter-config - A config file that describes the command line parameters
|
||||
supported by the SUT; see \ref paramconfig_sec or the sample *.parameters files
|
||||
for more details
|
||||
\li \c action-config - A config file with a list of actions to be performed while
|
||||
the SUT is running; see \ref actionconfig_sec or the sample *.actions files
|
||||
\li \c output-dir - Path to the directory where screenshots should be saved; is
|
||||
created if it doesn't exist; taken to be "./output" by default
|
||||
\li \c verify-dir - Path to the directory with the verification images; taken to
|
||||
be "./verify" by default
|
||||
|
||||
Paths can be relative or absolute.
|
||||
|
||||
Alternatively, the options can be passed as a config file for convenience:
|
||||
|
||||
<tt>testharness \-\-config testsprite2_sample.config</tt>
|
||||
|
||||
For a sample, take a look at the *.config files in this repository.
|
||||
|
||||
We can also pass a config file and override certain options as necessary:
|
||||
<tt>testharness \-\-config testsprite2_sample.config \-\-num-variations 10</tt>
|
||||
|
||||
Note: You may find it convenient to copy the SUT executable along with any
|
||||
resources to the test harness directory. Also note that testsprite2 and its
|
||||
resources (icon.bmp) are automatically copied when using the Visual Studio
|
||||
solution.
|
||||
|
||||
\subsection usageexamples_subsec Usage examples:
|
||||
|
||||
Passing a custom arguments string:
|
||||
<tt>testharness \-\-sutapp testsprite2 \-\-sutargs "\-\-cyclecolor \-\-blend mod
|
||||
\-\-iterations 2" \-\-action-config xyz.actions</tt>
|
||||
|
||||
Using the random variator:
|
||||
<tt>testharness \-\-sutapp testsprite2 \-\-variator random \-\-num-variations 5
|
||||
\-\-parameter-config xyz.parameters \-\-action-config xyz.actions</tt>
|
||||
|
||||
\subsection config_subsec Config Files
|
||||
Config files are an alternate way to pass parameters to the test harness. We
|
||||
describe the paramters in a config file and pass that to the test harness using
|
||||
the \-\-config option. The config file consists of lines of the form "x=y" where
|
||||
x is an option and y is it's value. For boolean options, we simply give the name
|
||||
of the option to indicate that it is to be passed to the testharness.
|
||||
|
||||
The hash '#' character can be used to start a comment from that point to the end
|
||||
of the line.
|
||||
|
||||
\section paramconfig_sec The SUT Parameters File
|
||||
To generate variations we need to describe the parameters the will be passed to
|
||||
the SUT. This description is given in a parameters file. Each line of the parameters
|
||||
file (except the blank lines) represents one command line option with five
|
||||
comma separated fields:
|
||||
<tt>name, type, values, required, categories</tt>
|
||||
|
||||
\li \c name is the name of the option, e.g., \c \-\-cyclecolor.
|
||||
\li \c type can have one of three values - integer, boolean and enum.
|
||||
\li \c values - for integer options this is the valid range of values the option
|
||||
can take, i.e., [min max]. For enum options this is a list of strings that
|
||||
the option can take, e.g., [val1 val2 val3]. For boolean options this field
|
||||
is ignored.
|
||||
\li \c required - true if the option is required, false otherwise.
|
||||
\li \c categories - a list of categories that the option belongs to. For example,
|
||||
[video mouse audio]
|
||||
|
||||
Just like with config files, hash characters can be used to start comments.
|
||||
|
||||
\subsection additionalnotes_subsec Additional Notes
|
||||
|
||||
\li If you want to have an option that always takes a certain value, use an enum
|
||||
with only one value.
|
||||
\li Currently there isn't any way to turn an option off, i.e., all options will
|
||||
be included in the command line options string that is generated using the
|
||||
config. If you don't want an option to be passed to the SUT, remove it from
|
||||
the config file or comment it out.
|
||||
|
||||
\section variators_sec Variators
|
||||
Variators are the mechanism by which we generate strings of command line arguments
|
||||
to test the SUT with. A variator is quite simply an iterator that iterates through
|
||||
different variations of command line options. There are two variators supported at
|
||||
the moment:
|
||||
\li \b Exhaustive - Generate all possible combinations of command line arguments
|
||||
that are valid.
|
||||
\li \b Random - Generate a random variation each time the variator is called.
|
||||
|
||||
As an example, let's try a simple .parameters file:\n
|
||||
<tt>
|
||||
\-\-blend, enum, [add mod], false, [] \n
|
||||
\-\-fullscreen, boolean, [], false, []
|
||||
</tt>
|
||||
|
||||
The exhaustive variator would generate the following four variations:\n
|
||||
<tt>
|
||||
\-\-blend add \n
|
||||
\-\-blend mod \n
|
||||
\-\-blend add \-\-fullscreen \n
|
||||
\-\-blend mod \-\-fullscreen \n
|
||||
</tt>
|
||||
|
||||
The random variator would simply generate a random variation like the following:\n
|
||||
<tt>\-\-blend mod</tt>
|
||||
|
||||
\section actionconfig_sec The Actions File
|
||||
Once the SUT process has been launched, automated testing happens using a mechanism
|
||||
called actions. A list of actions is read from a file and each action is performed
|
||||
on the SUT process sequentially. Each line in the actions file describes an action.
|
||||
The format for an action is <tt>hh:mm:ss ACTION_NAME additional parameters</tt>.
|
||||
There are five actions supported at the moment:
|
||||
\li \b SCREENSHOT - Takes a screenshot of each window owned by the SUT process. The
|
||||
images are saved as \c [hash]_[i].bmp where \c [hash] is the 32 character long
|
||||
hexadecimal MD5 hash of the arguments string that was passed to the SUT while
|
||||
launching it and \c i is the window number. i = 1 is an exceptional case
|
||||
where the \c _[i] is dropped and the filename is simply \c [hash].bmp\n
|
||||
Note: The screenshots are only of the window's client area.
|
||||
\li \b VERIFY - Verifies the screenshots taken by the last SCREENSHOT action by
|
||||
comparing them against a verification image. Each \c [hash]_i.bmp image output
|
||||
by the SCREENSHOT action is compared against a \c [hash].bmp image in the
|
||||
verify-dir.
|
||||
\li \b QUIT - Gracefully quits the SUT process. On Windows this means sending a
|
||||
WM_CLOSE message to each window owned by the SUT process. On Linux it means
|
||||
sending a SIGQUIT signal to the SUT process.
|
||||
\li \b KILL - Forcefully kills the SUT process. This is useful when the SUT process
|
||||
doesn't respond to the QUIT action.
|
||||
\li <b>LAUNCH [/path/to/executable] [args]</b> - Runs an executable with \c [args]
|
||||
as the arguments string.
|
||||
|
||||
Just like with config files, hash characters can be used to start comments.
|
||||
|
||||
\section contint_sec Continuous Integration (CI)
|
||||
One of the goals of the project was to create a test harness that integrates
|
||||
with CI systems to provide automated visual and interactive testing to SDL.
|
||||
|
||||
At the moment the test harness can be run in two modes that are useful for CI:
|
||||
\li Crash testing mode - launch the SUT with every variation and all parameters,
|
||||
report to the CI if there's a crash
|
||||
\li Visual testing mode - launch and visually verify the SUT for a smaller subset
|
||||
of the parameters
|
||||
|
||||
Look at the launch_harness.sh/launch_harness.cmd for an example scripts that run the
|
||||
test harness for all variations with all parameters and report an error on a crash.
|
||||
The script uses the testsprite2_crashtest config, so remember to copy those files
|
||||
over to the test harness executable directory along with the script.
|
||||
|
||||
\section todo_sec TODOs
|
||||
\li Allow specifying a clipping box along with the VERIFY action, i.e., hh:mm:ss
|
||||
VERIFY x, y, w, h
|
||||
\li Add support for spaces between the equals sign in test harness config files
|
||||
\li Implement the SCREENSHOT action on Linux
|
||||
\li Add a pairwise variator
|
||||
\li Add actions to inject keyboard/mouse events
|
||||
\li Add actions to manipulate the SUT window, e.g., minimize, restore, resize
|
||||
\li Add support to load and save screenshots as .pngs instead of .bmps
|
||||
|
||||
\section issues_sec Known Issues
|
||||
\li The QUIT action does not work on a testsprite2 process with multiple windows.
|
||||
This appears to be an issue with testsprite2.
|
||||
\li The SCREENSHOT action doesn't capture the testsprite2 window correctly if the
|
||||
--fullscreen option is supplied. It works with --fullscreen-desktop, however.
|
||||
|
||||
\section moreinfo_sec More Information
|
||||
|
||||
Author Contact Info:\n
|
||||
Apoorv Upreti \c \<apoorvupreti@gmail.com\>
|
||||
|
||||
Other useful links:
|
||||
- Project Repository: https://bitbucket.org/nerdap/sdlvisualtest
|
||||
- Project Wiki: https://github.com/nerdap/autotestsprite2/wiki
|
||||
- Project Blog: http://nerdap.github.io
|
||||
- Verification images for testsprite2_blendmodes: https://www.dropbox.com/s/nm02aem76m812ng/testsprite2_blendmodes.zip
|
||||
- Verification images for testsprite2_geometry: https://www.dropbox.com/s/csypwryopaslpaf/testsprite2_geometry.zip
|
||||
*/
|
||||
@@ -1,359 +0,0 @@
|
||||
# Configure paths for SDL
|
||||
# Sam Lantinga 9/21/99
|
||||
# stolen from Manish Singh
|
||||
# stolen back from Frank Belew
|
||||
# stolen from Manish Singh
|
||||
# Shamelessly stolen from Owen Taylor
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_SDL2],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the sdl2-config script
|
||||
dnl
|
||||
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
|
||||
sdl_prefix="$withval", sdl_prefix="")
|
||||
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
|
||||
sdl_exec_prefix="$withval", sdl_exec_prefix="")
|
||||
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
|
||||
, enable_sdltest=yes)
|
||||
|
||||
min_sdl_version=ifelse([$1], ,0.9.0,$1)
|
||||
|
||||
if test "x$sdl_prefix$sdl_exec_prefix" = x ; then
|
||||
PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version],
|
||||
[sdl_pc=yes],
|
||||
[sdl_pc=no])
|
||||
else
|
||||
sdl_pc=no
|
||||
if test x$sdl_exec_prefix != x ; then
|
||||
sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
|
||||
if test x${SDL_CONFIG+set} != xset ; then
|
||||
SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config
|
||||
fi
|
||||
fi
|
||||
if test x$sdl_prefix != x ; then
|
||||
sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
|
||||
if test x${SDL_CONFIG+set} != xset ; then
|
||||
SDL_CONFIG=$sdl_prefix/bin/sdl2-config
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$sdl_pc" = xyes ; then
|
||||
no_sdl=""
|
||||
SDL_CONFIG="pkg-config sdl2"
|
||||
else
|
||||
as_save_PATH="$PATH"
|
||||
if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
|
||||
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
|
||||
fi
|
||||
AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])
|
||||
PATH="$as_save_PATH"
|
||||
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
|
||||
no_sdl=""
|
||||
|
||||
if test "$SDL_CONFIG" = "no" ; then
|
||||
no_sdl=yes
|
||||
else
|
||||
SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
|
||||
SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
|
||||
|
||||
sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_sdltest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $SDL_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
|
||||
LIBS="$LIBS $SDL_LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed SDL is sufficiently new. (Also sanity
|
||||
dnl checks the results of sdl2-config to some extent
|
||||
dnl
|
||||
rm -f conf.sdltest
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "SDL.h"
|
||||
|
||||
char*
|
||||
my_strdup (char *str)
|
||||
{
|
||||
char *new_str;
|
||||
|
||||
if (str)
|
||||
{
|
||||
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
|
||||
strcpy (new_str, str);
|
||||
}
|
||||
else
|
||||
new_str = NULL;
|
||||
|
||||
return new_str;
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
/* This hangs on some systems (?)
|
||||
system ("touch conf.sdltest");
|
||||
*/
|
||||
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = my_strdup("$min_sdl_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_sdl_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (($sdl_major_version > major) ||
|
||||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
|
||||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
|
||||
printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
|
||||
printf("*** best to upgrade to the required version.\n");
|
||||
printf("*** If sdl2-config was wrong, set the environment variable SDL_CONFIG\n");
|
||||
printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
|
||||
printf("*** config.cache before re-running configure\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_sdl" = x ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
if test "x$no_sdl" = x ; then
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
if test "$SDL_CONFIG" = "no" ; then
|
||||
echo "*** The sdl2-config script installed by SDL could not be found"
|
||||
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the SDL_CONFIG environment variable to the"
|
||||
echo "*** full path to sdl2-config."
|
||||
else
|
||||
if test -f conf.sdltest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run SDL test program, checking why..."
|
||||
CFLAGS="$CFLAGS $SDL_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
|
||||
LIBS="$LIBS $SDL_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include "SDL.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{ return 0; }
|
||||
#undef main
|
||||
#define main K_and_R_C_main
|
||||
], [ return 0; ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding SDL or finding the wrong"
|
||||
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
|
||||
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the sdl2-config script: $SDL_CONFIG" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
SDL_CFLAGS=""
|
||||
SDL_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(SDL_CFLAGS)
|
||||
AC_SUBST(SDL_LIBS)
|
||||
rm -f conf.sdltest
|
||||
])
|
||||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
# serial 1 (pkg-config-0.24)
|
||||
#
|
||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
# ----------------------------------
|
||||
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
|
||||
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
|
||||
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
|
||||
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
fi[]dnl
|
||||
])# PKG_PROG_PKG_CONFIG
|
||||
|
||||
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
# Check to see whether a particular set of modules exists. Similar
|
||||
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
#
|
||||
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
# only at the first occurence in configure.ac, so if the first place
|
||||
# it's called might be skipped (such as if it is within an "if", you
|
||||
# have to call PKG_CHECK_EXISTS manually
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
m4_default([$2], [:])
|
||||
m4_ifvaln([$3], [else
|
||||
$3])dnl
|
||||
fi])
|
||||
|
||||
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
# ---------------------------------------------
|
||||
m4_define([_PKG_CONFIG],
|
||||
[if test -n "$$1"; then
|
||||
pkg_cv_[]$1="$$1"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
PKG_CHECK_EXISTS([$3],
|
||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
||||
[pkg_failed=yes])
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi[]dnl
|
||||
])# _PKG_CONFIG
|
||||
|
||||
# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
# -----------------------------
|
||||
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi[]dnl
|
||||
])# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
|
||||
|
||||
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
# [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
#
|
||||
# Note that if there is a possibility the first call to
|
||||
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
#
|
||||
#
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_MODULES],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
|
||||
pkg_failed=no
|
||||
AC_MSG_CHECKING([for $1])
|
||||
|
||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
|
||||
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.])
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
AC_MSG_RESULT([no])
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
m4_default([$4], [AC_MSG_ERROR(
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
|
||||
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
installed software in a non-standard prefix.
|
||||
|
||||
_PKG_TEXT])dnl
|
||||
])
|
||||
elif test $pkg_failed = untried; then
|
||||
AC_MSG_RESULT([no])
|
||||
m4_default([$4], [AC_MSG_FAILURE(
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
|
||||
_PKG_TEXT
|
||||
|
||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
|
||||
])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
$3
|
||||
fi[]dnl
|
||||
])# PKG_CHECK_MODULES
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Regenerate configuration files
|
||||
cp acinclude.m4 aclocal.m4
|
||||
found=false
|
||||
for autoconf in autoconf autoconf259 autoconf-2.59
|
||||
do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
|
||||
done
|
||||
if test x$found = xfalse; then
|
||||
echo "Couldn't find autoconf, aborting"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1 +0,0 @@
|
||||
/usr/share/automake-1.11/compile
|
||||
@@ -1,23 +0,0 @@
|
||||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "apoorvupreti@gmail.com"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "sdlvisualtest"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "sdlvisualtest 0.01"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "sdlvisualtest"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "0.01"
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
@@ -1,22 +0,0 @@
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
@@ -1,3 +0,0 @@
|
||||
00:00:03 SCREENSHOT
|
||||
00:00:06 VERIFY
|
||||
00:00:09 QUIT
|
||||
@@ -1,5 +0,0 @@
|
||||
parameter-config=testsprite2_blendmodes.parameters
|
||||
variator=exhaustive
|
||||
sutapp=testsprite2
|
||||
timeout=00:00:15
|
||||
action-config=testsprite2_blendmodes.actions
|
||||
@@ -1,5 +0,0 @@
|
||||
# parameter name, type, value range, required, categories
|
||||
--blend, enum, [none blend add mod], false, []
|
||||
--cyclecolor, boolean, [], false, []
|
||||
--cyclealpha, boolean, [], false, []
|
||||
--iterations, integer, [1000 1000], true, []
|
||||
@@ -1 +0,0 @@
|
||||
00:00:02 QUIT
|
||||
@@ -1,5 +0,0 @@
|
||||
parameter-config=testsprite2_crashtest.parameters
|
||||
variator=exhaustive
|
||||
sutapp=testsprite2
|
||||
timeout=00:00:10
|
||||
action-config=testsprite2_crashtest.actions
|
||||
@@ -1,24 +0,0 @@
|
||||
# parameter name, type, value range, required, categories
|
||||
--display, integer, [1 5], false, []
|
||||
--fullscreen, boolean, [], false, []
|
||||
--fullscreen-desktop, boolean, [], false, []
|
||||
--title, enum, [vartest bartest footest], false, []
|
||||
--icon, enum, [icon.bmp], false, []
|
||||
--center, boolean, [], false, []
|
||||
--position, enum, [300,300], false, []
|
||||
--geometry, enum, [500x500], false, []
|
||||
--min-geometry, enum, [100x100 200x200], false, []
|
||||
--max-geometry, enum, [600x600 700x700], false, []
|
||||
--logical, enum, [500x500 550x450], false, []
|
||||
--scale, integer, [1 5], false, []
|
||||
--depth, integer, [1 5], false, []
|
||||
--refresh, integer, [1 5], false, []
|
||||
--vsync, boolean, [], false, []
|
||||
--noframe, boolean, [], false, []
|
||||
--resize, boolean, [], false, []
|
||||
--minimize, boolean, [], false, []
|
||||
--maximize, boolean, [], false, []
|
||||
--grab, boolean, [], false, [mouse]
|
||||
--blend, enum, [none blend add mod], false, []
|
||||
--cyclecolor, boolean, [], false, []
|
||||
--cyclealpha, boolean, [], false, []
|
||||
@@ -1,3 +0,0 @@
|
||||
00:00:03 SCREENSHOT
|
||||
00:00:06 VERIFY
|
||||
00:00:09 QUIT
|
||||
@@ -1,5 +0,0 @@
|
||||
parameter-config=testsprite2_fullscreen.parameters
|
||||
variator=exhaustive
|
||||
sutapp=testsprite2
|
||||
timeout=00:00:15
|
||||
action-config=testsprite2_fullscreen.actions
|
||||
@@ -1,5 +0,0 @@
|
||||
# parameter name, type, value range, required, categories
|
||||
--blend, enum, [none blend add mod], false, []
|
||||
--fullscreen, boolean, [], false, []
|
||||
--fullscreen-desktop, boolean, [], false, []
|
||||
--iterations, integer, [1000 1000], true, []
|
||||
@@ -1,3 +0,0 @@
|
||||
00:00:03 SCREENSHOT
|
||||
00:00:06 VERIFY
|
||||
00:00:09 QUIT
|
||||
@@ -1,5 +0,0 @@
|
||||
parameter-config=testsprite2_geometry.parameters
|
||||
variator=exhaustive
|
||||
sutapp=testsprite2
|
||||
timeout=00:00:15
|
||||
action-config=testsprite2_geometry.actions
|
||||
@@ -1,5 +0,0 @@
|
||||
# parameter name, type, value range, required, categories
|
||||
--geometry, enum, [500x500 600x600], false, []
|
||||
--logical, enum, [300x500 550x450], false, []
|
||||
--scale, integer, [1 5], false, []
|
||||
--iterations, integer, [1000 1000], true, []
|
||||
@@ -1,166 +0,0 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT([sdlvisualtest], [0.01], [apoorvupreti@gmail.com])
|
||||
|
||||
dnl Detect the canonical build and host environments
|
||||
AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
dnl Check for tools
|
||||
|
||||
AC_PROG_CC
|
||||
|
||||
dnl Check for compiler environment
|
||||
|
||||
AC_C_CONST
|
||||
|
||||
dnl We only care about this for building testnative at the moment, so these
|
||||
dnl values shouldn't be considered absolute truth.
|
||||
dnl (Haiku, for example, sets none of these.)
|
||||
ISUNIX="false"
|
||||
ISWINDOWS="false"
|
||||
ISMACOSX="false"
|
||||
|
||||
dnl Figure out which math or extra library to use
|
||||
case "$host" in
|
||||
*-*-cygwin* | *-*-mingw32*)
|
||||
ISWINDOWS="true"
|
||||
EXE=".exe"
|
||||
MATHLIB=""
|
||||
EXTRALIB="-lshlwapi"
|
||||
SYS_GL_LIBS="-lopengl32"
|
||||
;;
|
||||
*-*-haiku*)
|
||||
EXE=""
|
||||
MATHLIB=""
|
||||
EXTRALIB=""
|
||||
SYS_GL_LIBS="-lGL"
|
||||
;;
|
||||
*-*-darwin* )
|
||||
ISMACOSX="true"
|
||||
EXE=""
|
||||
MATHLIB=""
|
||||
EXTRALIB=""
|
||||
|
||||
;;
|
||||
*-*-aix*)
|
||||
ISUNIX="true"
|
||||
EXE=""
|
||||
if test x$ac_cv_prog_gcc = xyes; then
|
||||
CFLAGS="-mthreads"
|
||||
fi
|
||||
MATHLIB=""
|
||||
EXTRALIB=""
|
||||
SYS_GL_LIBS=""
|
||||
;;
|
||||
*-*-mint*)
|
||||
EXE=""
|
||||
MATHLIB=""
|
||||
EXTRALIB=""
|
||||
AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
|
||||
if test "x$OSMESA_CONFIG" = "xyes"; then
|
||||
OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
|
||||
OSMESA_LIBS=`$OSMESA_CONFIG --libs`
|
||||
CFLAGS="$CFLAGS $OSMESA_CFLAGS"
|
||||
SYS_GL_LIBS="$OSMESA_LIBS"
|
||||
else
|
||||
SYS_GL_LIBS="-lOSMesa"
|
||||
fi
|
||||
;;
|
||||
*-*-qnx*)
|
||||
EXE=""
|
||||
MATHLIB=""
|
||||
EXTRALIB=""
|
||||
SYS_GL_LIBS="-lGLES_CM"
|
||||
;;
|
||||
*)
|
||||
dnl Oh well, call it Unix...
|
||||
ISUNIX="true"
|
||||
EXE=""
|
||||
MATHLIB="-lm"
|
||||
EXTRALIB=""
|
||||
SYS_GL_LIBS="-lGL"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(EXE)
|
||||
AC_SUBST(MATHLIB)
|
||||
AC_SUBST(EXTRALIB)
|
||||
AC_SUBST(ISMACOSX)
|
||||
AC_SUBST(ISWINDOWS)
|
||||
AC_SUBST(ISUNIX)
|
||||
|
||||
dnl Check for SDL
|
||||
SDL_VERSION=2.0.0
|
||||
AM_PATH_SDL2($SDL_VERSION,
|
||||
:,
|
||||
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
|
||||
)
|
||||
CFLAGS="$CFLAGS $SDL_CFLAGS"
|
||||
LIBS="$LIBS -lSDL2_test $SDL_LIBS $EXTRALIB"
|
||||
|
||||
dnl Check for X11 path, needed for OpenGL on some systems
|
||||
AC_PATH_X
|
||||
if test x$have_x = xyes; then
|
||||
if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
|
||||
:
|
||||
else
|
||||
CFLAGS="$CFLAGS -I$ac_x_includes"
|
||||
fi
|
||||
if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
|
||||
:
|
||||
else
|
||||
XPATH="-L$ac_x_libraries"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check for OpenGL
|
||||
AC_MSG_CHECKING(for OpenGL support)
|
||||
have_opengl=no
|
||||
AC_TRY_COMPILE([
|
||||
#include "SDL_opengl.h"
|
||||
],[
|
||||
],[
|
||||
have_opengl=yes
|
||||
])
|
||||
AC_MSG_RESULT($have_opengl)
|
||||
|
||||
dnl Check for OpenGL ES
|
||||
AC_MSG_CHECKING(for OpenGL ES support)
|
||||
have_opengles=no
|
||||
AC_TRY_COMPILE([
|
||||
#if defined (__IPHONEOS__)
|
||||
#include <OpenGLES/ES1/gl.h>
|
||||
#else
|
||||
#include <GLES/gl.h>
|
||||
#endif /* __QNXNTO__ */
|
||||
],[
|
||||
],[
|
||||
have_opengles=yes
|
||||
])
|
||||
AC_MSG_RESULT($have_opengles)
|
||||
|
||||
GLLIB=""
|
||||
if test x$have_opengles = xyes; then
|
||||
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
|
||||
GLLIB="$XPATH -lGLESv1_CM"
|
||||
elif test x$have_opengl = xyes; then
|
||||
CFLAGS="$CFLAGS -DHAVE_OPENGL"
|
||||
GLLIB="$XPATH $SYS_GL_LIBS"
|
||||
else
|
||||
GLLIB=""
|
||||
fi
|
||||
|
||||
AC_SUBST(GLLIB)
|
||||
|
||||
dnl Check for SDL_ttf
|
||||
AC_CHECK_LIB(SDL2_ttf, TTF_Init, have_SDL_ttf=yes)
|
||||
if test x$have_SDL_ttf = xyes; then
|
||||
CFLAGS="$CFLAGS -DHAVE_SDL_TTF"
|
||||
SDL_TTF_LIB="-lSDL2_ttf"
|
||||
fi
|
||||
AC_SUBST(SDL_TTF_LIB)
|
||||
|
||||
dnl Finally create all the generated files
|
||||
dnl AC_OUTPUT([Makefile])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT()
|
||||
@@ -1 +0,0 @@
|
||||
/usr/share/automake-1.11/depcomp
|
||||
@@ -1,149 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_action_configparser.h
|
||||
*
|
||||
* Header file for the parser for action config files.
|
||||
*/
|
||||
|
||||
#ifndef SDL_visualtest_action_configparser_h_
|
||||
#define SDL_visualtest_action_configparser_h_
|
||||
|
||||
/** The maximum length of one line in the actions file */
|
||||
#define MAX_ACTION_LINE_LENGTH 300
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Type of the action.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/*! Launch an application with some given arguments */
|
||||
SDL_ACTION_LAUNCH = 0,
|
||||
/*! Kill the SUT process */
|
||||
SDL_ACTION_KILL,
|
||||
/*! Quit (Gracefully exit) the SUT process */
|
||||
SDL_ACTION_QUIT,
|
||||
/*! Take a screenshot of the SUT window */
|
||||
SDL_ACTION_SCREENSHOT,
|
||||
/*! Verify a previously taken screenshot */
|
||||
SDL_ACTION_VERIFY
|
||||
} SDLVisualTest_ActionType;
|
||||
|
||||
/**
|
||||
* Struct that defines an action that will be performed on the SUT process at
|
||||
* a specific time.
|
||||
*/
|
||||
typedef struct SDLVisualTest_Action
|
||||
{
|
||||
/*! The type of action to be performed */
|
||||
SDLVisualTest_ActionType type;
|
||||
/*! The time, in milliseconds from the launch of the SUT, when the action
|
||||
will be performed */
|
||||
int time;
|
||||
/*! Any additional information needed to perform the action. */
|
||||
union
|
||||
{
|
||||
/*! The path and arguments to the process to be launched */
|
||||
struct
|
||||
{
|
||||
char* path;
|
||||
char* args;
|
||||
} process;
|
||||
} extra;
|
||||
} SDLVisualTest_Action;
|
||||
|
||||
/**
|
||||
* Struct for a node in the action queue.
|
||||
*/
|
||||
typedef struct SDLVisualTest_ActionNode
|
||||
{
|
||||
/*! The action in this node */
|
||||
SDLVisualTest_Action action;
|
||||
/*! Pointer to the next element in the queue */
|
||||
struct SDLVisualTest_ActionNode* next;
|
||||
} SDLVisualTest_ActionNode;
|
||||
|
||||
/**
|
||||
* Queue structure for actions loaded from the actions config file.
|
||||
*/
|
||||
typedef struct SDLVisualTest_ActionQueue
|
||||
{
|
||||
/*! Pointer to the front of the queue */
|
||||
SDLVisualTest_ActionNode* front;
|
||||
/*! Pointer to the rear of the queue */
|
||||
SDLVisualTest_ActionNode* rear;
|
||||
/*! Number of nodes in the queue */
|
||||
int size;
|
||||
} SDLVisualTest_ActionQueue;
|
||||
|
||||
/**
|
||||
* Add an action pointed to by \c action to the rear of the action queue pointed
|
||||
* to by \c queue.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDLVisualTest_EnqueueAction(SDLVisualTest_ActionQueue* queue,
|
||||
SDLVisualTest_Action action);
|
||||
|
||||
/**
|
||||
* Remove an action from the front of the action queue pointed to by \c queue.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDLVisualTest_DequeueAction(SDLVisualTest_ActionQueue* queue);
|
||||
|
||||
/**
|
||||
* Initialize the action queue pointed to by \c queue.
|
||||
*/
|
||||
void SDLVisualTest_InitActionQueue(SDLVisualTest_ActionQueue* queue);
|
||||
|
||||
/**
|
||||
* Get the action at the front of the action queue pointed to by \c queue.
|
||||
* The returned action pointer may become invalid after subsequent dequeues.
|
||||
*
|
||||
* \return pointer to the action on success, NULL on failure.
|
||||
*/
|
||||
SDLVisualTest_Action* SDLVisualTest_GetQueueFront(SDLVisualTest_ActionQueue* queue);
|
||||
|
||||
/**
|
||||
* Check if the queue pointed to by \c queue is empty or not.
|
||||
*
|
||||
* \return 1 if the queue is empty, 0 otherwise.
|
||||
*/
|
||||
int SDLVisualTest_IsActionQueueEmpty(SDLVisualTest_ActionQueue* queue);
|
||||
|
||||
/**
|
||||
* Dequeues all the elements in the queque pointed to by \c queue.
|
||||
*/
|
||||
void SDLVisualTest_EmptyActionQueue(SDLVisualTest_ActionQueue* queue);
|
||||
|
||||
/**
|
||||
* Inserts an action \c action into the queue pointed to by \c queue such that
|
||||
* the times of actions in the queue increase as we move from the front to the
|
||||
* rear.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDLVisualTest_InsertIntoActionQueue(SDLVisualTest_ActionQueue* queue,
|
||||
SDLVisualTest_Action action);
|
||||
|
||||
/**
|
||||
* Parses an action config file with path \c file and populates an action queue
|
||||
* pointed to by \c queue with actions.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDLVisualTest_ParseActionConfig(char* file, SDLVisualTest_ActionQueue* queue);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_action_configparser_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,64 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_exhaustive_variator.h
|
||||
*
|
||||
* Header for the exhaustive variator.
|
||||
*/
|
||||
|
||||
#include "SDL_visualtest_harness_argparser.h"
|
||||
#include "SDL_visualtest_variator_common.h"
|
||||
|
||||
#ifndef SDL_visualtest_exhaustive_variator_h_
|
||||
#define SDL_visualtest_exhaustive_variator_h_
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Struct for the variator that exhaustively iterates through all variations of
|
||||
* command line arguments to the SUT.
|
||||
*/
|
||||
typedef struct SDLVisualTest_ExhaustiveVariator
|
||||
{
|
||||
/*! The current variation. */
|
||||
SDLVisualTest_Variation variation;
|
||||
/*! Configuration object for the SUT that the variator is running for. */
|
||||
SDLVisualTest_SUTConfig config;
|
||||
/*! Buffer to store the arguments string built from the variation */
|
||||
char buffer[MAX_SUT_ARGS_LEN];
|
||||
} SDLVisualTest_ExhaustiveVariator;
|
||||
|
||||
/**
|
||||
* Initializes the variator.
|
||||
*
|
||||
* \return 1 on success, 0 on failure
|
||||
*/
|
||||
int SDLVisualTest_InitExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator,
|
||||
SDLVisualTest_SUTConfig* config);
|
||||
|
||||
/**
|
||||
* Gets the arguments string for the next variation using the variator and updates
|
||||
* the variator's current variation object to the next variation.
|
||||
*
|
||||
* \return The arguments string representing the next variation on success, and
|
||||
* NULL on failure or if we have iterated through all possible variations.
|
||||
* In the latter case subsequent calls will start the variations again from
|
||||
* the very beginning. The pointer returned should not be freed.
|
||||
*/
|
||||
char* SDLVisualTest_GetNextExhaustiveVariation(SDLVisualTest_ExhaustiveVariator* variator);
|
||||
|
||||
/**
|
||||
* Frees any resources associated with the variator.
|
||||
*/
|
||||
void SDLVisualTest_FreeExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_exhaustive_variator_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,75 +0,0 @@
|
||||
/**
|
||||
* \file SDL_visualtest_harness_argparser.h
|
||||
*
|
||||
* Provides functionality to parse command line arguments to the test harness.
|
||||
*/
|
||||
|
||||
#include <SDL.h>
|
||||
#include "SDL_visualtest_sut_configparser.h"
|
||||
#include "SDL_visualtest_variator_common.h"
|
||||
#include "SDL_visualtest_action_configparser.h"
|
||||
|
||||
#ifndef SDL_visualtest_harness_argparser_h_
|
||||
#define SDL_visualtest_harness_argparser_h_
|
||||
|
||||
/** Maximum length of a path string */
|
||||
#define MAX_PATH_LEN 300
|
||||
/** Maximum length of a string of SUT arguments */
|
||||
#define MAX_SUT_ARGS_LEN 600
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Stores the state of the test harness.
|
||||
*/
|
||||
typedef struct SDLVisualTest_HarnessState
|
||||
{
|
||||
/*! Path to the System Under Test (SUT) executable */
|
||||
char sutapp[MAX_PATH_LEN];
|
||||
/*! Command line arguments to be passed to the SUT */
|
||||
char sutargs[MAX_SUT_ARGS_LEN];
|
||||
/*! Time in milliseconds after which to kill the SUT */
|
||||
int timeout;
|
||||
/*! Configuration object for the SUT */
|
||||
SDLVisualTest_SUTConfig sut_config;
|
||||
/*! What type of variator to use to generate argument strings */
|
||||
SDLVisualTest_VariatorType variator_type;
|
||||
/*! The number of variations to generate */
|
||||
int num_variations;
|
||||
/*! If true, the test harness will just print the different variations
|
||||
without launching the SUT for each one */
|
||||
SDL_bool no_launch;
|
||||
/*! A queue with actions to be performed while the SUT is running */
|
||||
SDLVisualTest_ActionQueue action_queue;
|
||||
/*! Output directory to save the screenshots */
|
||||
char output_dir[MAX_PATH_LEN];
|
||||
/*! Path to directory with the verification images */
|
||||
char verify_dir[MAX_PATH_LEN];
|
||||
} SDLVisualTest_HarnessState;
|
||||
|
||||
/**
|
||||
* Parse command line paramters to the test harness and populate a state object.
|
||||
*
|
||||
* \param argv The array of command line parameters.
|
||||
* \param state Pointer to the state object to be populated.
|
||||
*
|
||||
* \return Non-zero on success, zero on failure.
|
||||
*/
|
||||
int SDLVisualTest_ParseHarnessArgs(char** argv, SDLVisualTest_HarnessState* state);
|
||||
|
||||
/**
|
||||
* Frees any resources associated with the state object pointed to by \c state.
|
||||
*/
|
||||
void SDLVisualTest_FreeHarnessState(SDLVisualTest_HarnessState* state);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_harness_argparser_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* \file mischelper.c
|
||||
*
|
||||
* Header with miscellaneous helper functions.
|
||||
*/
|
||||
|
||||
#ifndef SDL_visualtest_mischelper_h_
|
||||
#define SDL_visualtest_mischelper_h_
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Stores a 32 digit hexadecimal string representing the MD5 hash of the
|
||||
* string \c str in \c hash.
|
||||
*/
|
||||
void SDLVisualTest_HashString(char* str, char hash[33]);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_mischelper_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,46 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_parsehelper.h
|
||||
*
|
||||
* Header with some helper functions for parsing strings.
|
||||
*/
|
||||
|
||||
#ifndef SDL_visualtest_parsehelper_h_
|
||||
#define SDL_visualtest_parsehelper_h_
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Takes an string of command line arguments and breaks them up into an array
|
||||
* based on whitespace.
|
||||
*
|
||||
* \param args The string of arguments.
|
||||
*
|
||||
* \return NULL on failure, an array of strings on success. The last element
|
||||
* of the array is NULL. The first element of the array is NULL and should
|
||||
* be set to the path of the executable by the caller.
|
||||
*/
|
||||
char** SDLVisualTest_ParseArgsToArgv(char* args);
|
||||
|
||||
/**
|
||||
* Takes a string and breaks it into tokens by splitting on whitespace.
|
||||
*
|
||||
* \param str The string to be split.
|
||||
* \param max_token_len Length of each element in the array to be returned.
|
||||
*
|
||||
* \return NULL on failure; an array of strings with the tokens on success. The
|
||||
* last element of the array is NULL.
|
||||
*/
|
||||
char** SDLVisualTest_Tokenize(char* str, int max_token_len);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_parsehelper_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,112 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_process.h
|
||||
*
|
||||
* Provides cross-platfrom process launching and termination functionality.
|
||||
*/
|
||||
|
||||
#include <SDL_platform.h>
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#include <Windows.h>
|
||||
#include <Shlwapi.h>
|
||||
#elif defined(__LINUX__)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#error "Unsupported platform."
|
||||
#endif
|
||||
|
||||
#ifndef SDL_visualtest_process_h_
|
||||
#define SDL_visualtest_process_h_
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Struct to store a platform specific handle to a process.
|
||||
*/
|
||||
typedef struct SDL_ProcessInfo
|
||||
{
|
||||
//#if defined(_WIN32) || defined(__WIN32__)
|
||||
#if defined(__WIN32__)
|
||||
PROCESS_INFORMATION pi;
|
||||
//#elif defined(__linux__)
|
||||
#elif defined(__LINUX__)
|
||||
int pid;
|
||||
#endif
|
||||
} SDL_ProcessInfo;
|
||||
|
||||
/**
|
||||
* This structure stores the exit status (value returned by main()) and
|
||||
* whether the process exited sucessfully or not.
|
||||
*/
|
||||
typedef struct SDL_ProcessExitStatus
|
||||
{
|
||||
int exit_success; /*!< Zero if the process exited successfully */
|
||||
int exit_status; /*!< The exit status of the process. 8-bit value. */
|
||||
} SDL_ProcessExitStatus;
|
||||
|
||||
/**
|
||||
* Launches a process with the given commandline arguments.
|
||||
*
|
||||
* \param file The path to the executable to be launched.
|
||||
* \param args The command line arguments to be passed to the process.
|
||||
* \param pinfo Pointer to an SDL_ProcessInfo object to be populated with
|
||||
* platform specific information about the launched process.
|
||||
*
|
||||
* \return Non-zero on success, zero on failure.
|
||||
*/
|
||||
int SDL_LaunchProcess(char* file, char* args, SDL_ProcessInfo* pinfo);
|
||||
|
||||
/**
|
||||
* Checks if a process is running or not.
|
||||
*
|
||||
* \param pinfo Pointer to SDL_ProcessInfo object of the process that needs to be
|
||||
* checked.
|
||||
*
|
||||
* \return 1 if the process is still running; zero if it is not and -1 if the
|
||||
* status could not be retrieved.
|
||||
*/
|
||||
int SDL_IsProcessRunning(SDL_ProcessInfo* pinfo);
|
||||
|
||||
/**
|
||||
* Kills a currently running process.
|
||||
*
|
||||
* \param pinfo Pointer to a SDL_ProcessInfo object of the process to be terminated.
|
||||
* \param ps Pointer to a SDL_ProcessExitStatus object which will be populated
|
||||
* with the exit status.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDL_KillProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps);
|
||||
|
||||
/**
|
||||
* Cleanly exits the process represented by \c pinfo and stores the exit status
|
||||
* in the exit status object pointed to by \c ps.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDL_QuitProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps);
|
||||
|
||||
/**
|
||||
* Gets the exit status of a process. If the exit status is -1, the process is
|
||||
* still running.
|
||||
*
|
||||
* \param pinfo Pointer to a SDL_ProcessInfo object of the process to be checked.
|
||||
* \param ps Pointer to a SDL_ProcessExitStatus object which will be populated
|
||||
* with the exit status.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDL_GetProcessExitStatus(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_process_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,61 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_random_variator.h
|
||||
*
|
||||
* Header for the random variator.
|
||||
*/
|
||||
|
||||
#include "SDL_visualtest_harness_argparser.h"
|
||||
#include "SDL_visualtest_variator_common.h"
|
||||
|
||||
#ifndef SDL_visualtest_random_variator_h_
|
||||
#define SDL_visualtest_random_variator_h_
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Struct for the variator that randomly generates variations of command line
|
||||
* arguments to the SUT.
|
||||
*/
|
||||
typedef struct SDLVisualTest_RandomVariator
|
||||
{
|
||||
/*! The current variation. */
|
||||
SDLVisualTest_Variation variation;
|
||||
/*! Configuration object for the SUT that the variator is running for. */
|
||||
SDLVisualTest_SUTConfig config;
|
||||
/*! Buffer to store the arguments string built from the variation */
|
||||
char buffer[MAX_SUT_ARGS_LEN];
|
||||
} SDLVisualTest_RandomVariator;
|
||||
|
||||
/**
|
||||
* Initializes the variator.
|
||||
*
|
||||
* \return 1 on success, 0 on failure
|
||||
*/
|
||||
int SDLVisualTest_InitRandomVariator(SDLVisualTest_RandomVariator* variator,
|
||||
SDLVisualTest_SUTConfig* config, Uint64 seed);
|
||||
|
||||
/**
|
||||
* Generates a new random variation.
|
||||
*
|
||||
* \return The arguments string representing the random variation on success, and
|
||||
* NULL on failure. The pointer returned should not be freed.
|
||||
*/
|
||||
char* SDLVisualTest_GetNextRandomVariation(SDLVisualTest_RandomVariator* variator);
|
||||
|
||||
/**
|
||||
* Frees any resources associated with the variator.
|
||||
*/
|
||||
void SDLVisualTest_FreeRandomVariator(SDLVisualTest_RandomVariator* variator);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_random_variator_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,87 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file rwhelper.c
|
||||
*
|
||||
* Header file with some helper functions for working with SDL_RWops.
|
||||
*/
|
||||
|
||||
#include <SDL_rwops.h>
|
||||
|
||||
#ifndef SDL_visualtest_rwhelper_h_
|
||||
#define SDL_visualtest_rwhelper_h_
|
||||
|
||||
/** Length of the buffer in SDLVisualTest_RWHelperBuffer */
|
||||
#define RWOPS_BUFFER_LEN 256
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Struct that is used as a buffer by the RW helper functions. Should be initialized by calling
|
||||
* SDLVisualTest_RWHelperResetBuffer() before being used.
|
||||
*/
|
||||
typedef struct SDLVisualTest_RWHelperBuffer
|
||||
{
|
||||
/*! Character buffer that data is read into */
|
||||
char buffer[RWOPS_BUFFER_LEN];
|
||||
/*! buffer[buffer_pos] is the next character to be read from the buffer */
|
||||
int buffer_pos;
|
||||
/*! Number of character read into the buffer */
|
||||
int buffer_width;
|
||||
} SDLVisualTest_RWHelperBuffer;
|
||||
|
||||
/**
|
||||
* Resets the buffer pointed to by \c buffer used by some of the helper functions.
|
||||
* This function should be called when you're using one of the helper functions
|
||||
* with a new SDL_RWops object.
|
||||
*/
|
||||
void SDLVisualTest_RWHelperResetBuffer(SDLVisualTest_RWHelperBuffer* buffer);
|
||||
|
||||
/**
|
||||
* Reads a single character using the SDL_RWops object pointed to by \c rw.
|
||||
* This function reads data in blocks and stores them in the buffer pointed to by
|
||||
* \c buffer, so other SDL_RWops functions should not be used in conjunction
|
||||
* with this function.
|
||||
*
|
||||
* \return The character that was read.
|
||||
*/
|
||||
char SDLVisualTest_RWHelperReadChar(SDL_RWops* rw,
|
||||
SDLVisualTest_RWHelperBuffer* buffer);
|
||||
|
||||
/**
|
||||
* Reads characters using the SDL_RWops object pointed to by \c rw into the
|
||||
* character array pointed to by \c str (of size \c size) until either the
|
||||
* array is full or a new line is encountered. If \c comment_char is encountered,
|
||||
* all characters from that position till the end of the line are ignored. The new line
|
||||
* is not included as part of the buffer. Lines with only whitespace and comments
|
||||
* are ignored. This function reads data in blocks and stores them in the buffer
|
||||
* pointed to by \c buffer, so other SDL_RWops functions should not be used in
|
||||
* conjunction with this function.
|
||||
*
|
||||
* \return pointer to the string on success, NULL on failure or EOF.
|
||||
*/
|
||||
char* SDLVisualTest_RWHelperReadLine(SDL_RWops* rw, char* str, int size,
|
||||
SDLVisualTest_RWHelperBuffer* buffer,
|
||||
char comment_char);
|
||||
|
||||
/**
|
||||
* Counts the number of lines that are not all whitespace and comments using the
|
||||
* SDL_RWops object pointed to by \c rw. \c comment_char indicates the character
|
||||
* used for comments. Uses the buffer pointed to by \c buffer to read data in blocks.
|
||||
*
|
||||
* \return Number of lines on success, -1 on failure.
|
||||
*/
|
||||
int SDLVisualTest_RWHelperCountNonEmptyLines(SDL_RWops* rw,
|
||||
SDLVisualTest_RWHelperBuffer* buffer,
|
||||
char comment_char);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_rwhelper_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,52 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_screenshot.h
|
||||
*
|
||||
* Header for the screenshot API.
|
||||
*/
|
||||
|
||||
#include "SDL_visualtest_process.h"
|
||||
|
||||
#ifndef SDL_visualtest_screenshot_h_
|
||||
#define SDL_visualtest_screenshot_h_
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Takes a screenshot of each window owned by the process \c pinfo and saves
|
||||
* it in a file \c prefix-i.png where \c prefix is the full path to the file
|
||||
* along with a prefix given to each screenshot.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDLVisualTest_ScreenshotProcess(SDL_ProcessInfo* pinfo, char* prefix);
|
||||
|
||||
/**
|
||||
* Takes a screenshot of the desktop and saves it into the file with path
|
||||
* \c filename.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDLVisualTest_ScreenshotDesktop(char* filename);
|
||||
|
||||
/**
|
||||
* Compare a screenshot taken previously with SUT arguments \c args that is
|
||||
* located in \c test_dir with a verification image that is located in
|
||||
* \c verify_dir.
|
||||
*
|
||||
* \return -1 on failure, 0 if the images were not equal, 1 if the images are equal
|
||||
* and 2 if the verification image is not present.
|
||||
*/
|
||||
int SDLVisualTest_VerifyScreenshots(char* args, char* test_dir, char* verify_dir);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_screenshot_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,105 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_sut_configparser.h
|
||||
*
|
||||
* Header for the parser for SUT config files.
|
||||
*/
|
||||
|
||||
#ifndef SDL_visualtest_sut_configparser_h_
|
||||
#define SDL_visualtest_sut_configparser_h_
|
||||
|
||||
/** Maximum length of the name of an SUT option */
|
||||
#define MAX_SUTOPTION_NAME_LEN 100
|
||||
/** Maximum length of the name of a category of an SUT option */
|
||||
#define MAX_SUTOPTION_CATEGORY_LEN 40
|
||||
/** Maximum length of one enum value of an SUT option */
|
||||
#define MAX_SUTOPTION_ENUMVAL_LEN 40
|
||||
/** Maximum length of a line in the paramters file */
|
||||
#define MAX_SUTOPTION_LINE_LENGTH 256
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Describes the different kinds of options to the SUT.
|
||||
*/
|
||||
typedef enum {
|
||||
SDL_SUT_OPTIONTYPE_STRING = 0,
|
||||
SDL_SUT_OPTIONTYPE_INT,
|
||||
SDL_SUT_OPTIONTYPE_ENUM,
|
||||
SDL_SUT_OPTIONTYPE_BOOL
|
||||
} SDLVisualTest_SUTOptionType;
|
||||
|
||||
/**
|
||||
* Represents the range of values an integer option can take.
|
||||
*/
|
||||
typedef struct SDLVisualTest_SUTIntRange {
|
||||
/*! Minimum value of the integer option */
|
||||
int min;
|
||||
/*! Maximum value of the integer option */
|
||||
int max;
|
||||
} SDLVisualTest_SUTIntRange;
|
||||
|
||||
/**
|
||||
* Struct that defines an option to be passed to the SUT.
|
||||
*/
|
||||
typedef struct SDLVisualTest_SUTOption {
|
||||
/*! The name of the option. This is what you would pass in the command line
|
||||
along with two leading hyphens. */
|
||||
char name[MAX_SUTOPTION_NAME_LEN];
|
||||
/*! An array of categories that the option belongs to. The last element is
|
||||
NULL. */
|
||||
char** categories;
|
||||
/*! Type of the option - integer, boolean, etc. */
|
||||
SDLVisualTest_SUTOptionType type;
|
||||
/*! Whether the option is required or not */
|
||||
SDL_bool required;
|
||||
/*! extra data that is required for certain types */
|
||||
union {
|
||||
/*! This field is valid only for integer type options; it defines the
|
||||
valid range for such an option */
|
||||
SDLVisualTest_SUTIntRange range;
|
||||
/*! This field is valid only for enum type options; it holds the list of values
|
||||
that the option can take. The last element is NULL */
|
||||
char** enum_values;
|
||||
} data;
|
||||
} SDLVisualTest_SUTOption;
|
||||
|
||||
/**
|
||||
* Struct to hold all the options to an SUT application.
|
||||
*/
|
||||
typedef struct SDLVisualTest_SUTConfig
|
||||
{
|
||||
/*! Pointer to an array of options */
|
||||
SDLVisualTest_SUTOption* options;
|
||||
/*! Number of options in \c options */
|
||||
int num_options;
|
||||
} SDLVisualTest_SUTConfig;
|
||||
|
||||
/**
|
||||
* Parses a configuration file that describes the command line options an SUT
|
||||
* application will take and populates a SUT config object. All lines in the
|
||||
* config file must be smaller than
|
||||
*
|
||||
* \param file Path to the configuration file.
|
||||
* \param config Pointer to an object that represents an SUT configuration.
|
||||
*
|
||||
* \return zero on failure, non-zero on success
|
||||
*/
|
||||
int SDLVisualTest_ParseSUTConfig(char* file, SDLVisualTest_SUTConfig* config);
|
||||
|
||||
/**
|
||||
* Free any resources associated with the config object pointed to by \c config.
|
||||
*/
|
||||
void SDLVisualTest_FreeSUTConfig(SDLVisualTest_SUTConfig* config);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_sut_configparser_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,122 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_variator_common.h
|
||||
*
|
||||
* Header for common functionality used by variators.
|
||||
*/
|
||||
|
||||
#include <SDL_types.h>
|
||||
#include "SDL_visualtest_sut_configparser.h"
|
||||
|
||||
#ifndef SDL_visualtest_variator_common_h_
|
||||
#define SDL_visualtest_variator_common_h_
|
||||
|
||||
/** The number of variations one integer option would generate */
|
||||
#define SDL_SUT_INTEGER_OPTION_TEST_STEPS 3
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** enum for indicating the type of variator being used */
|
||||
typedef enum SDLVisualTest_VariatorType
|
||||
{
|
||||
SDL_VARIATOR_NONE = 0,
|
||||
SDL_VARIATOR_EXHAUSTIVE,
|
||||
SDL_VARIATOR_RANDOM
|
||||
} SDLVisualTest_VariatorType;
|
||||
|
||||
/**
|
||||
* One possible value for a command line option to the SUT.
|
||||
*/
|
||||
typedef union SDLVisualTest_SUTOptionValue
|
||||
{
|
||||
/*! Value if the option is of type boolean */
|
||||
SDL_bool bool_value;
|
||||
/*! Value if the option is of type integer. If on is true then the option
|
||||
will be passed to the SUT, otherwise it will be ignored. */
|
||||
struct {
|
||||
int value;
|
||||
SDL_bool on;
|
||||
} integer;
|
||||
/*! Index of the string in the enum_values field of the corresponding
|
||||
SDLVisualTest_SUTOption object. If on is true the option will passed
|
||||
to the SUT, otherwise it will be ignored. */
|
||||
struct {
|
||||
int index;
|
||||
SDL_bool on;
|
||||
} enumerated;
|
||||
/*! Value if the option is of type string. If on is true the option will
|
||||
be passed to the SUT, otherwise it will be ignored. */
|
||||
struct {
|
||||
char* value;
|
||||
SDL_bool on;
|
||||
} string;
|
||||
} SDLVisualTest_SUTOptionValue;
|
||||
|
||||
/**
|
||||
* Represents a valid combination of parameters that can be passed to the SUT.
|
||||
* The ordering of the values here is the same as the ordering of the options in
|
||||
* the SDLVisualTest_SUTConfig object for this variation.
|
||||
*/
|
||||
typedef struct SDLVisualTest_Variation
|
||||
{
|
||||
/*! Pointer to array of option values */
|
||||
SDLVisualTest_SUTOptionValue* vars;
|
||||
/*! Number of option values in \c vars */
|
||||
int num_vars;
|
||||
} SDLVisualTest_Variation;
|
||||
|
||||
/**
|
||||
* "Increments" the value of the option by one and returns the carry. We wrap
|
||||
* around to the initial value on overflow which makes the carry one.
|
||||
* For example: "incrementing" an SDL_FALSE option makes it SDL_TRUE with no
|
||||
* carry, and "incrementing" an SDL_TRUE option makes it SDL_FALSE with carry
|
||||
* one. For integers, a random value in the valid range for the option is used.
|
||||
*
|
||||
* \param var Value of the option
|
||||
* \param opt Object with metadata about the option
|
||||
*
|
||||
* \return 1 if there is a carry for enum and bool type options, 0 otherwise.
|
||||
* 1 is always returned for integer and string type options. -1 is
|
||||
* returned on error.
|
||||
*/
|
||||
int SDLVisualTest_NextValue(SDLVisualTest_SUTOptionValue* var,
|
||||
SDLVisualTest_SUTOption* opt);
|
||||
|
||||
/**
|
||||
* Converts a variation object into a string of command line arguments.
|
||||
*
|
||||
* \param variation Variation object to be converted.
|
||||
* \param config Config object for the SUT.
|
||||
* \param buffer Pointer to the buffer the arguments string will be copied into.
|
||||
* \param size Size of the buffer.
|
||||
*
|
||||
* \return 1 on success, 0 on failure
|
||||
*/
|
||||
int SDLVisualTest_MakeStrFromVariation(SDLVisualTest_Variation* variation,
|
||||
SDLVisualTest_SUTConfig* config,
|
||||
char* buffer, int size);
|
||||
|
||||
/**
|
||||
* Initializes the variation using the following rules:
|
||||
* - Boolean options are initialized to SDL_FALSE.
|
||||
* - Integer options are initialized to the minimum valid value they can hold.
|
||||
* - Enum options are initialized to the first element in the list of values they
|
||||
* can take.
|
||||
* - String options are initialized to the name of the option.
|
||||
*
|
||||
* \return 1 on success, 0 on failure.
|
||||
*/
|
||||
int SDLVisualTest_InitVariation(SDLVisualTest_Variation* variation,
|
||||
SDLVisualTest_SUTConfig* config);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_variator_common_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,66 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file SDL_visualtest_variators.h
|
||||
*
|
||||
* Header for all the variators that vary input parameters to a SUT application.
|
||||
*/
|
||||
|
||||
#include "SDL_visualtest_exhaustive_variator.h"
|
||||
#include "SDL_visualtest_random_variator.h"
|
||||
|
||||
#ifndef SDL_visualtest_variators_h_
|
||||
#define SDL_visualtest_variators_h_
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Struct that acts like a wrapper around the different types of variators
|
||||
* available.
|
||||
*/
|
||||
typedef struct SDLVisualTest_Variator
|
||||
{
|
||||
/*! Type of the variator */
|
||||
SDLVisualTest_VariatorType type;
|
||||
/*! union object that stores the variator */
|
||||
union
|
||||
{
|
||||
SDLVisualTest_ExhaustiveVariator exhaustive;
|
||||
SDLVisualTest_RandomVariator random;
|
||||
} data;
|
||||
} SDLVisualTest_Variator;
|
||||
|
||||
/**
|
||||
* Initializes the variator object pointed to by \c variator of type \c type
|
||||
* with information from the config object pointed to by \c config.
|
||||
*
|
||||
* \return 1 on success, 0 on failure
|
||||
*/
|
||||
int SDLVisualTest_InitVariator(SDLVisualTest_Variator* variator,
|
||||
SDLVisualTest_SUTConfig* config,
|
||||
SDLVisualTest_VariatorType type,
|
||||
Uint64 seed);
|
||||
|
||||
/**
|
||||
* Gets the next variation using the variator.
|
||||
*
|
||||
* \return The arguments string representing the variation on success, and
|
||||
* NULL on failure. The pointer returned should not be freed.
|
||||
*/
|
||||
char* SDLVisualTest_GetNextVariation(SDLVisualTest_Variator* variator);
|
||||
|
||||
/**
|
||||
* Frees any resources associated with the variator.
|
||||
*/
|
||||
void SDLVisualTest_FreeVariator(SDLVisualTest_Variator* variator);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_visualtest_variators_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1 +0,0 @@
|
||||
/usr/share/automake-1.11/install-sh
|
||||
@@ -1,2 +0,0 @@
|
||||
start /wait testharness.exe --config testsprite2_crashtest.config > testrun.log 2>&1
|
||||
if %ERRORLEVEL% NEQ 0 echo TEST RUN FAILED (see testrun.log)
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
./testharness.exe --config testsprite2_crashtest.config > testrun.log 2>&1
|
||||
if [ "$?" != "0" ]; then
|
||||
echo TEST RUN FAILED (see testrun.log)
|
||||
# report error code to CI
|
||||
fi
|
||||
@@ -1 +0,0 @@
|
||||
/usr/share/automake-1.11/missing
|
||||
@@ -1,396 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file action_configparser.c
|
||||
*
|
||||
* Source file for the parser for action config files.
|
||||
*/
|
||||
|
||||
#include <SDL_stdinc.h>
|
||||
#include <SDL_test.h>
|
||||
#include <string.h>
|
||||
#include "SDL_visualtest_action_configparser.h"
|
||||
#include "SDL_visualtest_rwhelper.h"
|
||||
#include "SDL_visualtest_parsehelper.h"
|
||||
|
||||
static void
|
||||
FreeAction(SDLVisualTest_Action* action)
|
||||
{
|
||||
if(!action)
|
||||
return;
|
||||
switch(action->type)
|
||||
{
|
||||
case SDL_ACTION_LAUNCH:
|
||||
{
|
||||
char* path;
|
||||
char* args;
|
||||
|
||||
path = action->extra.process.path;
|
||||
args = action->extra.process.args;
|
||||
|
||||
if(path)
|
||||
SDL_free(path);
|
||||
if(args)
|
||||
SDL_free(args);
|
||||
|
||||
action->extra.process.path = NULL;
|
||||
action->extra.process.args = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
SDLVisualTest_EnqueueAction(SDLVisualTest_ActionQueue* queue,
|
||||
SDLVisualTest_Action action)
|
||||
{
|
||||
SDLVisualTest_ActionNode* node;
|
||||
if(!queue)
|
||||
{
|
||||
SDLTest_LogError("queue argument cannot be NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
node = (SDLVisualTest_ActionNode*)SDL_malloc(
|
||||
sizeof(SDLVisualTest_ActionNode));
|
||||
if(!node)
|
||||
{
|
||||
SDLTest_LogError("malloc() failed");
|
||||
return 0;
|
||||
}
|
||||
node->action = action;
|
||||
node->next = NULL;
|
||||
queue->size++;
|
||||
if(!queue->rear)
|
||||
queue->rear = queue->front = node;
|
||||
else
|
||||
{
|
||||
queue->rear->next = node;
|
||||
queue->rear = node;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
SDLVisualTest_DequeueAction(SDLVisualTest_ActionQueue* queue)
|
||||
{
|
||||
SDLVisualTest_ActionNode* node;
|
||||
if(!queue)
|
||||
{
|
||||
SDLTest_LogError("queue argument cannot be NULL");
|
||||
return 0;
|
||||
}
|
||||
if(SDLVisualTest_IsActionQueueEmpty(queue))
|
||||
{
|
||||
SDLTest_LogError("cannot dequeue from empty queue");
|
||||
return 0;
|
||||
}
|
||||
if(queue->front == queue->rear)
|
||||
{
|
||||
FreeAction(&queue->front->action);
|
||||
SDL_free(queue->front);
|
||||
queue->front = queue->rear = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
node = queue->front;
|
||||
queue->front = queue->front->next;
|
||||
FreeAction(&node->action);
|
||||
SDL_free(node);
|
||||
}
|
||||
queue->size--;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
SDLVisualTest_InitActionQueue(SDLVisualTest_ActionQueue* queue)
|
||||
{
|
||||
if(!queue)
|
||||
{
|
||||
SDLTest_LogError("queue argument cannot be NULL");
|
||||
return;
|
||||
}
|
||||
queue->front = NULL;
|
||||
queue->rear = NULL;
|
||||
queue->size = 0;
|
||||
}
|
||||
|
||||
SDLVisualTest_Action*
|
||||
SDLVisualTest_GetQueueFront(SDLVisualTest_ActionQueue* queue)
|
||||
{
|
||||
if(!queue)
|
||||
{
|
||||
SDLTest_LogError("queue argument cannot be NULL");
|
||||
return NULL;
|
||||
}
|
||||
if(!queue->front)
|
||||
{
|
||||
SDLTest_LogError("cannot get front of empty queue");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &queue->front->action;
|
||||
}
|
||||
|
||||
int
|
||||
SDLVisualTest_IsActionQueueEmpty(SDLVisualTest_ActionQueue* queue)
|
||||
{
|
||||
if(!queue)
|
||||
{
|
||||
SDLTest_LogError("queue argument cannot be NULL");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(queue->size > 0)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
SDLVisualTest_EmptyActionQueue(SDLVisualTest_ActionQueue* queue)
|
||||
{
|
||||
if(queue)
|
||||
{
|
||||
while(!SDLVisualTest_IsActionQueueEmpty(queue))
|
||||
SDLVisualTest_DequeueAction(queue);
|
||||
}
|
||||
}
|
||||
|
||||
/* Since the size of the queue is not likely to be larger than 100 elements
|
||||
we can get away with using insertion sort. */
|
||||
static void
|
||||
SortQueue(SDLVisualTest_ActionQueue* queue)
|
||||
{
|
||||
SDLVisualTest_ActionNode* head;
|
||||
SDLVisualTest_ActionNode* tail;
|
||||
|
||||
if(!queue || SDLVisualTest_IsActionQueueEmpty(queue))
|
||||
return;
|
||||
|
||||
head = queue->front;
|
||||
for(tail = head; tail && tail->next;)
|
||||
{
|
||||
SDLVisualTest_ActionNode* pos;
|
||||
SDLVisualTest_ActionNode* element = tail->next;
|
||||
|
||||
if(element->action.time < head->action.time)
|
||||
{
|
||||
tail->next = tail->next->next;
|
||||
element->next = head;
|
||||
head = element;
|
||||
}
|
||||
else if(element->action.time >= tail->action.time)
|
||||
{
|
||||
tail = tail->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(pos = head;
|
||||
(pos->next->action.time < element->action.time);
|
||||
pos = pos->next);
|
||||
tail->next = tail->next->next;
|
||||
element->next = pos->next;
|
||||
pos->next = element;
|
||||
}
|
||||
}
|
||||
|
||||
queue->front = head;
|
||||
queue->rear = tail;
|
||||
}
|
||||
|
||||
int
|
||||
SDLVisualTest_InsertIntoActionQueue(SDLVisualTest_ActionQueue* queue,
|
||||
SDLVisualTest_Action action)
|
||||
{
|
||||
SDLVisualTest_ActionNode* n;
|
||||
SDLVisualTest_ActionNode* prev;
|
||||
SDLVisualTest_ActionNode* newnode;
|
||||
if(!queue)
|
||||
{
|
||||
SDLTest_LogError("queue argument cannot be NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(SDLVisualTest_IsActionQueueEmpty(queue))
|
||||
{
|
||||
if(!SDLVisualTest_EnqueueAction(queue, action))
|
||||
{
|
||||
SDLTest_LogError("SDLVisualTest_EnqueueAction() failed");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
newnode = (SDLVisualTest_ActionNode*)malloc(sizeof(SDLVisualTest_ActionNode));
|
||||
if(!newnode)
|
||||
{
|
||||
SDLTest_LogError("malloc() failed");
|
||||
return 0;
|
||||
}
|
||||
newnode->action = action;
|
||||
|
||||
queue->size++;
|
||||
for(n = queue->front, prev = NULL; n; n = n->next)
|
||||
{
|
||||
if(action.time < n->action.time)
|
||||
{
|
||||
if(prev)
|
||||
{
|
||||
prev->next = newnode;
|
||||
newnode->next = n;
|
||||
}
|
||||
else
|
||||
{
|
||||
newnode->next = queue->front;
|
||||
queue->front = newnode;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
prev = n;
|
||||
}
|
||||
|
||||
queue->rear->next = newnode;
|
||||
newnode->next = NULL;
|
||||
queue->rear = newnode;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
SDLVisualTest_ParseActionConfig(char* file, SDLVisualTest_ActionQueue* queue)
|
||||
{
|
||||
char line[MAX_ACTION_LINE_LENGTH];
|
||||
SDLVisualTest_RWHelperBuffer buffer;
|
||||
char* token_ptr;
|
||||
int linenum;
|
||||
SDL_RWops* rw;
|
||||
|
||||
if(!file)
|
||||
{
|
||||
SDLTest_LogError("file argument cannot be NULL");
|
||||
return 0;
|
||||
}
|
||||
if(!queue)
|
||||
{
|
||||
SDLTest_LogError("queue argument cannot be NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
rw = SDL_RWFromFile(file, "r");
|
||||
if(!rw)
|
||||
{
|
||||
SDLTest_LogError("SDL_RWFromFile() failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDLVisualTest_RWHelperResetBuffer(&buffer);
|
||||
SDLVisualTest_InitActionQueue(queue);
|
||||
linenum = 0;
|
||||
while(SDLVisualTest_RWHelperReadLine(rw, line, MAX_ACTION_LINE_LENGTH,
|
||||
&buffer, '#'))
|
||||
{
|
||||
SDLVisualTest_Action action;
|
||||
int hr, min, sec;
|
||||
|
||||
/* parse time */
|
||||
token_ptr = strtok(line, " ");
|
||||
if(!token_ptr ||
|
||||
(SDL_sscanf(token_ptr, "%d:%d:%d", &hr, &min, &sec) != 3))
|
||||
{
|
||||
SDLTest_LogError("Could not parse time token at line: %d",
|
||||
linenum);
|
||||
SDLVisualTest_EmptyActionQueue(queue);
|
||||
SDL_RWclose(rw);
|
||||
return 0;
|
||||
}
|
||||
action.time = (((hr * 60 + min) * 60) + sec) * 1000;
|
||||
|
||||
/* parse type */
|
||||
token_ptr = strtok(NULL, " ");
|
||||
if(SDL_strcasecmp(token_ptr, "launch") == 0)
|
||||
action.type = SDL_ACTION_LAUNCH;
|
||||
else if(SDL_strcasecmp(token_ptr, "kill") == 0)
|
||||
action.type = SDL_ACTION_KILL;
|
||||
else if(SDL_strcasecmp(token_ptr, "quit") == 0)
|
||||
action.type = SDL_ACTION_QUIT;
|
||||
else if(SDL_strcasecmp(token_ptr, "screenshot") == 0)
|
||||
action.type = SDL_ACTION_SCREENSHOT;
|
||||
else if(SDL_strcasecmp(token_ptr, "verify") == 0)
|
||||
action.type = SDL_ACTION_VERIFY;
|
||||
else
|
||||
{
|
||||
SDLTest_LogError("Could not parse type token at line: %d",
|
||||
linenum);
|
||||
SDLVisualTest_EmptyActionQueue(queue);
|
||||
SDL_RWclose(rw);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* parse the extra field */
|
||||
if(action.type == SDL_ACTION_LAUNCH)
|
||||
{
|
||||
int len;
|
||||
char* args;
|
||||
char* path;
|
||||
token_ptr = strtok(NULL, " ");
|
||||
len = token_ptr ? SDL_strlen(token_ptr) : 0;
|
||||
if(len <= 0)
|
||||
{
|
||||
SDLTest_LogError("Please specify the process to launch at line: %d",
|
||||
linenum);
|
||||
SDLVisualTest_EmptyActionQueue(queue);
|
||||
SDL_RWclose(rw);
|
||||
return 0;
|
||||
}
|
||||
path = (char*)SDL_malloc(sizeof(char) * (len + 1));
|
||||
if(!path)
|
||||
{
|
||||
SDLTest_LogError("malloc() failed");
|
||||
SDLVisualTest_EmptyActionQueue(queue);
|
||||
SDL_RWclose(rw);
|
||||
return 0;
|
||||
}
|
||||
SDL_strlcpy(path, token_ptr, len + 1);
|
||||
|
||||
token_ptr = strtok(NULL, "");
|
||||
len = token_ptr ? SDL_strlen(token_ptr) : 0;
|
||||
if(len > 0)
|
||||
{
|
||||
args = (char*)SDL_malloc(sizeof(char) * (len + 1));
|
||||
if(!args)
|
||||
{
|
||||
SDLTest_LogError("malloc() failed");
|
||||
SDL_free(path);
|
||||
SDLVisualTest_EmptyActionQueue(queue);
|
||||
SDL_RWclose(rw);
|
||||
return 0;
|
||||
}
|
||||
SDL_strlcpy(args, token_ptr, len + 1);
|
||||
}
|
||||
else
|
||||
args = NULL;
|
||||
|
||||
action.extra.process.path = path;
|
||||
action.extra.process.args = args;
|
||||
}
|
||||
|
||||
/* add the action to the queue */
|
||||
if(!SDLVisualTest_EnqueueAction(queue, action))
|
||||
{
|
||||
SDLTest_LogError("SDLVisualTest_EnqueueAction() failed");
|
||||
if(action.type == SDL_ACTION_LAUNCH)
|
||||
{
|
||||
SDL_free(action.extra.process.path);
|
||||
if(action.extra.process.args)
|
||||
SDL_free(action.extra.process.args);
|
||||
}
|
||||
SDLVisualTest_EmptyActionQueue(queue);
|
||||
SDL_RWclose(rw);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* sort the queue of actions */
|
||||
SortQueue(queue);
|
||||
|
||||
SDL_RWclose(rw);
|
||||
return 1;
|
||||
}
|
||||
@@ -1,358 +0,0 @@
|
||||
/* See COPYING.txt for the full license governing this code. */
|
||||
/**
|
||||
* \file harness_argparser.c
|
||||
*
|
||||
* Source file for functions to parse arguments to the test harness.
|
||||
*/
|
||||
|
||||
#include <SDL_test.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "SDL_visualtest_harness_argparser.h"
|
||||
#include "SDL_visualtest_rwhelper.h"
|
||||
|
||||
/** Maximum length of one line in the config file */
|
||||
#define MAX_CONFIG_LINE_LEN 400
|
||||
/** Default value for the timeout after which the SUT is forcefully killed */
|
||||
#define DEFAULT_SUT_TIMEOUT (60 * 1000)
|
||||
|
||||
/* String compare s1 and s2 ignoring leading hyphens */
|
||||
static int
|
||||
StrCaseCmpIgnoreHyphen(char* s1, char* s2)
|
||||
{
|
||||
/* treat NULL pointer as empty strings */
|
||||
if(!s1)
|
||||
s1 = "";
|
||||
if(!s2)
|
||||
s2 = "";
|
||||
|
||||
while(*s1 == '-')
|
||||
s1++;
|
||||
while(*s2 == '-')
|
||||
s2++;
|
||||
|
||||
return SDL_strcasecmp(s1, s2);
|
||||
}
|
||||
|
||||
/* parser an argument, updates the state object and returns the number of
|
||||
arguments processed; returns -1 on failure */
|
||||
static int
|
||||
ParseArg(char** argv, int index, SDLVisualTest_HarnessState* state)
|
||||
{
|
||||
if(!argv || !argv[index] || !state)
|
||||
return 0;
|
||||
|
||||
if(StrCaseCmpIgnoreHyphen("sutapp", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid argument for sutapp.");
|
||||
return -1;
|
||||
}
|
||||
SDL_strlcpy(state->sutapp, argv[index], MAX_PATH_LEN);
|
||||
SDLTest_Log("SUT Application: %s", state->sutapp);
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("output-dir", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid argument for output-dir.");
|
||||
return -1;
|
||||
}
|
||||
SDL_strlcpy(state->output_dir, argv[index], MAX_PATH_LEN);
|
||||
SDLTest_Log("Screenshot Output Directory: %s", state->output_dir);
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("verify-dir", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid argument for verify-dir.");
|
||||
return -1;
|
||||
}
|
||||
SDL_strlcpy(state->verify_dir, argv[index], MAX_PATH_LEN);
|
||||
SDLTest_Log("Screenshot Verification Directory: %s", state->verify_dir);
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("sutargs", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid argument for sutargs.");
|
||||
return -1;
|
||||
}
|
||||
SDL_strlcpy(state->sutargs, argv[index], MAX_SUT_ARGS_LEN);
|
||||
SDLTest_Log("SUT Arguments: %s", state->sutargs);
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("timeout", argv[index]) == 0)
|
||||
{
|
||||
int hr, min, sec;
|
||||
index++;
|
||||
if(!argv[index] || SDL_sscanf(argv[index], "%d:%d:%d", &hr, &min, &sec) != 3)
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid argument for timeout.");
|
||||
return -1;
|
||||
}
|
||||
state->timeout = (((hr * 60) + min) * 60 + sec) * 1000;
|
||||
SDLTest_Log("Maximum Timeout for each SUT run: %d milliseconds",
|
||||
state->timeout);
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("parameter-config", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid argument for parameter-config.");
|
||||
return -1;
|
||||
}
|
||||
SDLTest_Log("SUT Parameters file: %s", argv[index]);
|
||||
SDLVisualTest_FreeSUTConfig(&state->sut_config);
|
||||
if(!SDLVisualTest_ParseSUTConfig(argv[index], &state->sut_config))
|
||||
{
|
||||
SDLTest_LogError("Failed to parse SUT parameters file");
|
||||
return -1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("variator", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid argument for variator.");
|
||||
return -1;
|
||||
}
|
||||
SDLTest_Log("Variator: %s", argv[index]);
|
||||
if(SDL_strcasecmp("exhaustive", argv[index]) == 0)
|
||||
state->variator_type = SDL_VARIATOR_EXHAUSTIVE;
|
||||
else if(SDL_strcasecmp("random", argv[index]) == 0)
|
||||
state->variator_type = SDL_VARIATOR_RANDOM;
|
||||
else
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid variator name.");
|
||||
return -1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("num-variations", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: Invalid argument for num-variations.");
|
||||
return -1;
|
||||
}
|
||||
state->num_variations = SDL_atoi(argv[index]);
|
||||
SDLTest_Log("Number of variations to run: %d", state->num_variations);
|
||||
if(state->num_variations <= 0)
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: num-variations must be positive.");
|
||||
return -1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("no-launch", argv[index]) == 0)
|
||||
{
|
||||
state->no_launch = SDL_TRUE;
|
||||
SDLTest_Log("SUT will not be launched.");
|
||||
return 1;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("action-config", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: invalid argument for action-config");
|
||||
return -1;
|
||||
}
|
||||
SDLTest_Log("Action Config file: %s", argv[index]);
|
||||
SDLVisualTest_EmptyActionQueue(&state->action_queue);
|
||||
if(!SDLVisualTest_ParseActionConfig(argv[index], &state->action_queue))
|
||||
{
|
||||
SDLTest_LogError("SDLVisualTest_ParseActionConfig() failed");
|
||||
return -1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
else if(StrCaseCmpIgnoreHyphen("config", argv[index]) == 0)
|
||||
{
|
||||
index++;
|
||||
if(!argv[index])
|
||||
{
|
||||
SDLTest_LogError("Arguments parsing error: invalid argument for config");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* do nothing, this option has already been handled */
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TODO: Trailing/leading spaces and spaces between equals sign not supported. */
|
||||
static int
|
||||
ParseConfig(char* file, SDLVisualTest_HarnessState* state)
|
||||
{
|
||||
SDL_RWops* rw;
|
||||
SDLVisualTest_RWHelperBuffer buffer;
|
||||
char line[MAX_CONFIG_LINE_LEN];
|
||||
|
||||
rw = SDL_RWFromFile(file, "r");
|
||||
if(!rw)
|
||||
{
|
||||
SDLTest_LogError("SDL_RWFromFile() failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDLVisualTest_RWHelperResetBuffer(&buffer);
|
||||
while(SDLVisualTest_RWHelperReadLine(rw, line, MAX_CONFIG_LINE_LEN,
|
||||
&buffer, '#'))
|
||||
{
|
||||
char** argv;
|
||||
int i, num_params;
|
||||
|
||||
/* count number of parameters and replace the trailing newline with 0 */
|
||||
num_params = 1;
|
||||
for(i = 0; line[i]; i++)
|
||||
{
|
||||
if(line[i] == '=')
|
||||
{
|
||||
num_params = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* populate argv */
|
||||
argv = (char**)SDL_malloc((num_params + 1) * sizeof(char*));
|
||||
if(!argv)
|
||||
{
|
||||
SDLTest_LogError("malloc() failed.");
|
||||
SDL_RWclose(rw);
|
||||
return 0;
|
||||
}
|
||||
|
||||
argv[num_params] = NULL;
|
||||
for(i = 0; i < num_params; i++)
|
||||
{
|
||||
argv[i] = strtok(i == 0 ? line : NULL, "=");
|
||||
}
|
||||
|
||||
if(ParseArg(argv, 0, state) == -1)
|
||||
{
|
||||
SDLTest_LogError("ParseArg() failed");
|
||||
SDL_free(argv);
|
||||
SDL_RWclose(rw);
|
||||
return 0;
|
||||
}
|
||||
SDL_free(argv);
|
||||
}
|
||||
SDL_RWclose(rw);
|
||||
|
||||
if(!state->sutapp[0])
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
SDLVisualTest_ParseHarnessArgs(char** argv, SDLVisualTest_HarnessState* state)
|
||||
{
|
||||
int i;
|
||||
|
||||
SDLTest_Log("Parsing commandline arguments..");
|
||||
|
||||
if(!argv)
|
||||
{
|
||||
SDLTest_LogError("argv is NULL");
|
||||
return 0;
|
||||
}
|
||||
if(!state)
|
||||
{
|
||||
SDLTest_LogError("state is NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* initialize the state object */
|
||||
state->sutargs[0] = '\0';
|
||||
state->sutapp[0] = '\0';
|
||||
state->output_dir[0] = '\0';
|
||||
state->verify_dir[0] = '\0';
|
||||
state->timeout = DEFAULT_SUT_TIMEOUT;
|
||||
SDL_memset(&state->sut_config, 0, sizeof(SDLVisualTest_SUTConfig));
|
||||
SDL_memset(&state->action_queue, 0, sizeof(SDLVisualTest_ActionQueue));
|
||||
state->variator_type = SDL_VARIATOR_RANDOM;
|
||||
state->num_variations = -1;
|
||||
state->no_launch = SDL_FALSE;
|
||||
|
||||
/* parse config file if passed */
|
||||
for(i = 0; argv[i]; i++)
|
||||
{
|
||||
if(StrCaseCmpIgnoreHyphen("config", argv[i]) == 0)
|
||||
{
|
||||
if(!argv[i + 1])
|
||||
{
|
||||
SDLTest_Log("Arguments parsing error: invalid argument for config.");
|
||||
return 0;
|
||||
}
|
||||
if(!ParseConfig(argv[i + 1], state))
|
||||
{
|
||||
SDLTest_LogError("ParseConfig() failed");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* parse the arguments */
|
||||
for(i = 0; argv[i];)
|
||||
{
|
||||
int consumed = ParseArg(argv, i, state);
|
||||
if(consumed == -1 || consumed == 0)
|
||||
{
|
||||
SDLTest_LogError("ParseArg() failed");
|
||||
return 0;
|
||||
}
|
||||
i += consumed;
|
||||
}
|
||||
|
||||
if(state->variator_type == SDL_VARIATOR_RANDOM && state->num_variations == -1)
|
||||
state->num_variations = 1;
|
||||
|
||||
/* check to see if required options have been passed */
|
||||
if(!state->sutapp[0])
|
||||
{
|
||||
SDLTest_LogError("sutapp must be passed.");
|
||||
return 0;
|
||||
}
|
||||
if(!state->sutargs[0] && !state->sut_config.options)
|
||||
{
|
||||
SDLTest_LogError("Either sutargs or parameter-config must be passed.");
|
||||
return 0;
|
||||
}
|
||||
if(!state->output_dir[0])
|
||||
{
|
||||
SDL_strlcpy(state->output_dir, "./output", MAX_PATH_LEN);
|
||||
}
|
||||
if(!state->verify_dir[0])
|
||||
{
|
||||
SDL_strlcpy(state->verify_dir, "./verify", MAX_PATH_LEN);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
SDLVisualTest_FreeHarnessState(SDLVisualTest_HarnessState* state)
|
||||
{
|
||||
if(state)
|
||||
{
|
||||
SDLVisualTest_EmptyActionQueue(&state->action_queue);
|
||||
SDLVisualTest_FreeSUTConfig(&state->sut_config);
|
||||
}
|
||||
}
|
||||