提交 7e89ebce 编写于 作者: J jp9000

add a 'wrapper' file for wx

上级 27be0a51
...@@ -30,6 +30,7 @@ link_libraries(${wxWidgets_LIBRARIES}) ...@@ -30,6 +30,7 @@ link_libraries(${wxWidgets_LIBRARIES})
add_executable(obs add_executable(obs
window-obs-basic.cpp window-obs-basic.cpp
window-subclass.cpp window-subclass.cpp
wx-wrappers.cpp
obs-app.cpp obs-app.cpp
OBSWindows.cpp) OBSWindows.cpp)
......
...@@ -13,4 +13,5 @@ obs_PROGRAMS = obs ...@@ -13,4 +13,5 @@ obs_PROGRAMS = obs
obs_SOURCES = window-obs-basic.cpp \ obs_SOURCES = window-obs-basic.cpp \
window-subclass.cpp \ window-subclass.cpp \
obs-app.cpp \ obs-app.cpp \
wx-wrappers.cpp \
OBSWindows.cpp OBSWindows.cpp
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "obs-app.hpp" #include "obs-app.hpp"
#include "window-obs-basic.hpp" #include "window-obs-basic.hpp"
#include "obs-wrappers.hpp" #include "obs-wrappers.hpp"
#include "wx-wrappers.hpp"
IMPLEMENT_APP(OBSApp) IMPLEMENT_APP(OBSApp)
...@@ -47,12 +48,7 @@ bool OBSApp::OnInit() ...@@ -47,12 +48,7 @@ bool OBSApp::OnInit()
ovi.output_format = VIDEO_FORMAT_RGBA; ovi.output_format = VIDEO_FORMAT_RGBA;
ovi.output_width = rc.width; ovi.output_width = rc.width;
ovi.output_height = rc.height; ovi.output_height = rc.height;
ovi.window = WxToGSWindow(preview);
#ifdef __WXCOCOA__
ovi.window.view = preview->GetHandle();
#elif _WIN32
ovi.window.hwnd = preview->GetHandle();
#endif
if (!obs_reset_video(&ovi)) if (!obs_reset_video(&ovi))
return false; return false;
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#pragma once #pragma once
#include <obs.h>
class OBSSource { class OBSSource {
obs_source_t source; obs_source_t source;
......
/******************************************************************************
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.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 3 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, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include <wx/window.h>
#include <obs.h>
#include "wx-wrappers.hpp"
gs_window WxToGSWindow(const wxWindow *wxwin)
{
gs_window window;
#ifdef __WXCOCOA__
window.view = wxwin->GetHandle();
#elif _WIN32
window.hwnd = wxwin->GetHandle();
#else
/* TODO: linux stuff */
#endif
return window;
}
/******************************************************************************
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.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 3 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, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#pragma once
struct gs_window;
class wxWindow;
gs_window WxToGSWindow(const wxWindow *window);
...@@ -171,6 +171,7 @@ ...@@ -171,6 +171,7 @@
<ClCompile Include="..\..\..\obs\OBSWindows.cpp" /> <ClCompile Include="..\..\..\obs\OBSWindows.cpp" />
<ClCompile Include="..\..\..\obs\window-obs-basic.cpp" /> <ClCompile Include="..\..\..\obs\window-obs-basic.cpp" />
<ClCompile Include="..\..\..\obs\window-subclass.cpp" /> <ClCompile Include="..\..\..\obs\window-subclass.cpp" />
<ClCompile Include="..\..\..\obs\wx-wrappers.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\..\obs\obs-app.hpp" /> <ClInclude Include="..\..\..\obs\obs-app.hpp" />
...@@ -178,6 +179,7 @@ ...@@ -178,6 +179,7 @@
<ClInclude Include="..\..\..\obs\OBSWindows.h" /> <ClInclude Include="..\..\..\obs\OBSWindows.h" />
<ClInclude Include="..\..\..\obs\window-obs-basic.hpp" /> <ClInclude Include="..\..\..\obs\window-obs-basic.hpp" />
<ClInclude Include="..\..\..\obs\window-subclass.hpp" /> <ClInclude Include="..\..\..\obs\window-subclass.hpp" />
<ClInclude Include="..\..\..\obs\wx-wrappers.hpp" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
<ClCompile Include="..\..\..\obs\obs-app.cpp"> <ClCompile Include="..\..\..\obs\obs-app.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\obs\wx-wrappers.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\..\obs\OBSWindows.h"> <ClInclude Include="..\..\..\obs\OBSWindows.h">
...@@ -44,5 +47,8 @@ ...@@ -44,5 +47,8 @@
<ClInclude Include="..\..\..\obs\obs-wrappers.hpp"> <ClInclude Include="..\..\..\obs\obs-wrappers.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\obs\wx-wrappers.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册