adjust file locations to be more portable

This commit is contained in:
jp9000
2013-11-01 14:33:00 -07:00
parent a6a6118c04
commit 8847d11e8e
30 changed files with 340 additions and 53 deletions

View File

@@ -1,12 +1,21 @@
INCLUDES = -iquote$(top_srcdir)/libobs
lib_LTLIBRARIES = libtest-input.la
if OS_WIN
if ARCH_X86
libtestdir = ../../build/plugins/32bit
else
libtestdir = ../../build/plugins/64bit
endif
else
libtestdir = $(libdir)/obs-plugins
endif
pkglib_LTLIBRARIES = libtest-input.la
libtest_input_la_LDFLAGS = -no-undefined
if OS_WIN
libtest_input_la_LDFLAGS += -avoid-version
endif
libtest_input_la_LIBADD = $(top_srcdir)/libobs/libobs.la
libtest_input_la_SOURCES = test-filter.c \
test-input.c \

View File

@@ -3,12 +3,16 @@
struct test_filter *test_create(const char *settings, obs_source_t source)
{
struct test_filter *tf = bmalloc(sizeof(struct test_filter));
char *effect_file;
memset(tf, 0, sizeof(struct test_filter));
gs_entercontext(obs_graphics());
effect_file = obs_find_plugin_file("test-input/test.effect");
tf->source = source;
tf->whatever = gs_create_effect_from_file("test.effect", NULL);
tf->whatever = gs_create_effect_from_file(effect_file, NULL);
bfree(effect_file);
if (!tf->whatever) {
test_destroy(tf);
return NULL;

View File

@@ -5,6 +5,7 @@ struct random_tex *random_create(const char *settings, obs_source_t source)
{
struct random_tex *rt = bmalloc(sizeof(struct random_tex));
uint32_t *pixels = bmalloc(20*20*4);
char *effect_file;
size_t x, y;
memset(rt, 0, sizeof(struct random_tex));
@@ -31,7 +32,10 @@ struct random_tex *random_create(const char *settings, obs_source_t source)
return NULL;
}
rt->whatever = gs_create_effect_from_file("draw.effect", NULL);
effect_file = obs_find_plugin_file("test-input/draw.effect");
rt->whatever = gs_create_effect_from_file(effect_file, NULL);
bfree(effect_file);
if (!rt->whatever) {
random_destroy(rt);
return NULL;

View File

@@ -1,6 +1,8 @@
INCLUDES = -iquote$(top_srcdir)/libobs
AM_CPPFLAGS = -DUNICODE -D_UNICODE
bin_PROGRAMS = test
builddir = ../../build
build_PROGRAMS = test
test_LDADD = $(top_srcdir)/libobs/libobs.la
test_LDFLAGS = -mwindows
test_SOURCES = test.cpp

View File

@@ -84,7 +84,7 @@ static void CreateOBS(HWND hwnd)
gsid.num_backbuffers = 2;
gsid.format = GS_RGBA;
if (!obs_startup("libobs-opengl.dll", &gsid, &vi, NULL))
if (!obs_startup("libobs-opengl", &gsid, &vi, NULL))
throw "Couldn't create OBS";
}
@@ -146,7 +146,7 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine,
/* ------------------------------------------------------ */
/* load module */
if (obs_load_module("test-input.dll") != 0)
if (obs_load_module("test-input") != 0)
throw "Couldn't load module";
/* ------------------------------------------------------ */