Update test programs and filters
The test program and test filter wasn't working properly because the ID for it had actually changed. The test programs also weren't updated for the new main render callbacks which must be used when making a program.
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user