0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

updated obs platform files

This commit is contained in:
Palana 2013-12-16 16:04:51 +01:00
parent 3d88a43520
commit 8c19ad4b14
4 changed files with 13 additions and 3 deletions

View File

@ -34,7 +34,7 @@ if(WIN32)
platform-windows.cpp)
elseif(APPLE)
set(obs_platform_src
platform-osx.cpp)
platform-osx.mm)
elseif(UNIX)
set(obs_platform_src
platform-nix.cpp)

View File

@ -26,7 +26,7 @@ obs_SOURCES += platform-windows.cpp
endif
if OS_OSX
obs_SOURCES += platform-osx.cpp
obs_SOURCES += platform-osx.mm
endif
if OS_NIX

View File

@ -20,6 +20,8 @@
#include <unistd.h>
#import <AppKit/AppKit.h>
bool GetDataFilePath(const char *data, string &output)
{
stringstream str;
@ -31,5 +33,10 @@ bool GetDataFilePath(const char *data, string &output)
void GetMonitors(vector<MonitorInfo> &monitors)
{
monitors.clear();
// TODO
for(NSScreen *screen : [NSScreen screens])
{
NSRect frame = [screen convertRectToBacking:[screen frame]];
monitors.emplace_back(frame.origin.x, frame.origin.y,
frame.size.width, frame.size.height);
}
}

View File

@ -26,6 +26,9 @@ using namespace std;
struct MonitorInfo {
int32_t x, y;
uint32_t cx, cy;
MonitorInfo(int32_t x, int32_t y, uint32_t cx, uint32_t cy)
: x(x), y(y), cx(cx), cy(cy)
{}
};
/* Gets the path of obs-studio specific data files (such as locale) */