diff --git a/build/data/obs-plugins/test-input/test.effect b/build/data/obs-plugins/test-input/test.effect index 7f99ac928..e78040417 100644 --- a/build/data/obs-plugins/test-input/test.effect +++ b/build/data/obs-plugins/test-input/test.effect @@ -1,5 +1,5 @@ uniform float4x4 ViewProj; -uniform texture2d diffuse; +uniform texture2d image; uniform float4 color = {0.0, 1.0, 0.0, 1.0}; @@ -24,10 +24,10 @@ VertexInOut VShader(VertexInOut vert_in) float4 PShader(VertexInOut fragment_in) : TARGET { - return diffuse.Sample(texSampler, fragment_in.uv) * color; + return image.Sample(texSampler, fragment_in.uv) * color; } -technique DrawRGB +technique Draw { pass { diff --git a/test/osx/test.mm b/test/osx/test.mm index d2abfc925..352cb0acf 100644 --- a/test/osx/test.mm +++ b/test/osx/test.mm @@ -133,6 +133,19 @@ static NSWindow *CreateTestWindow() return win; } +/* --------------------------------------------------- */ + +static void RenderWindow(void *data, uint32_t cx, uint32_t cy) +{ + obs_render_main_view(); + + UNUSED_PARAMETER(data); + UNUSED_PARAMETER(cx); + UNUSED_PARAMETER(cy); +} + +/* --------------------------------------------------- */ + static void test() { try { @@ -157,7 +170,7 @@ static void test() /* ------------------------------------------------------ */ /* create filter */ SourceContext filter{obs_source_create(OBS_SOURCE_TYPE_FILTER, - "test", "a test filter", NULL)}; + "test_filter", "a test filter", NULL)}; if (!filter) throw "Couldn't create test filter"; obs_source_filter_add(source, filter); @@ -174,6 +187,10 @@ static void test() /* set the scene as the primary draw source and go */ obs_set_output_source(0, obs_scene_getsource(scene)); + /* ------------------------------------------------------ */ + /* set the main output render callback */ + obs_add_draw_callback(RenderWindow, nullptr); + [NSApp run]; obs_set_output_source(0, NULL); diff --git a/test/win/test.cpp b/test/win/test.cpp index 25a04998e..031c0503a 100644 --- a/test/win/test.cpp +++ b/test/win/test.cpp @@ -120,6 +120,17 @@ static HWND CreateTestWindow(HINSTANCE instance) /* --------------------------------------------------- */ +static void RenderWindow(void *data, uint32_t cx, uint32_t cy) +{ + obs_render_main_view(); + + UNUSED_PARAMETER(data); + UNUSED_PARAMETER(cx); + UNUSED_PARAMETER(cy); +} + +/* --------------------------------------------------- */ + int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine, int numCmd) { @@ -150,7 +161,7 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine, /* ------------------------------------------------------ */ /* create filter */ SourceContext filter = obs_source_create(OBS_SOURCE_TYPE_FILTER, - "test", "a nice little green filter", NULL); + "test_filter", "a nice green filter", NULL); if (!filter) throw "Couldn't create test filter"; obs_source_filter_add(source, filter); @@ -167,6 +178,10 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine, /* set the scene as the primary draw source and go */ obs_set_output_source(0, source); + /* ------------------------------------------------------ */ + /* set the main output render callback */ + obs_add_draw_callback(RenderWindow, nullptr); + MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg);