Merge pull request #36 from rkitover/cmake_xcode_support
fix Xcode project generation via cmake
This commit is contained in:
commit
f0e8c94c9c
|
@ -97,9 +97,6 @@ IF(APPLE)
|
|||
ELSEIF(EXISTS /sw/bin)
|
||||
SET(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};/sw/bin")
|
||||
ENDIF()
|
||||
|
||||
# and compile as Objective-C++ for ObjectiveC #ifdefs
|
||||
SET(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> -x objective-c++ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
ENDIF(APPLE)
|
||||
|
||||
# We do not support amd64 asm yet
|
||||
|
|
|
@ -153,6 +153,10 @@ SET( SRC_WX
|
|||
xrc/vbam.xpm
|
||||
)
|
||||
|
||||
IF(APPLE)
|
||||
SET(SRC_WX ${SRC_WX} macsupport.mm)
|
||||
ENDIF(APPLE)
|
||||
|
||||
SET( HDR_WX
|
||||
wxvbam.h
|
||||
drawing.h
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include "wxvbam.h"
|
||||
|
||||
double HiDPIAware::HiDPIScaleFactor()
|
||||
{
|
||||
if (hidpi_scale_factor == 0) {
|
||||
NSWindow* window = [(NSView*)GetWindow()->GetHandle() window];
|
||||
|
||||
if ([window respondsToSelector:@selector(backingScaleFactor)]) {
|
||||
hidpi_scale_factor = [window backingScaleFactor];
|
||||
}
|
||||
else {
|
||||
hidpi_scale_factor = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
return hidpi_scale_factor;
|
||||
}
|
||||
|
||||
void HiDPIAware::RequestHighResolutionOpenGLSurface()
|
||||
{
|
||||
NSView* view = (NSView*)(GetWindow()->GetHandle());
|
||||
|
||||
if ([view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
|
||||
[view setWantsBestResolutionOpenGLSurface:YES];
|
||||
}
|
||||
}
|
|
@ -1,10 +1,5 @@
|
|||
#include <wx/dcbuffer.h>
|
||||
|
||||
#ifdef __WXMAC__
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
|
||||
#include "../../version.h"
|
||||
#include "../common/ConfigManager.h"
|
||||
#include "../common/Patch.h"
|
||||
|
@ -18,26 +13,6 @@
|
|||
|
||||
int emulating;
|
||||
|
||||
double HiDPIAware::HiDPIScaleFactor()
|
||||
{
|
||||
if (hidpi_scale_factor == 0) {
|
||||
#ifdef __WXMAC__
|
||||
NSWindow* window = [(NSView*)GetWindow()->GetHandle() window];
|
||||
|
||||
if ([window respondsToSelector:@selector(backingScaleFactor)]) {
|
||||
hidpi_scale_factor = [window backingScaleFactor];
|
||||
}
|
||||
else {
|
||||
hidpi_scale_factor = 1.0;
|
||||
}
|
||||
#else
|
||||
hidpi_scale_factor = 1.0;
|
||||
#endif
|
||||
}
|
||||
|
||||
return hidpi_scale_factor;
|
||||
}
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(GameArea, wxPanel)
|
||||
|
||||
GameArea::GameArea()
|
||||
|
@ -2023,13 +1998,7 @@ GLDrawingPanel::GLDrawingPanel(wxWindow* parent, int _width, int _height)
|
|||
wxFULL_REPAINT_ON_RESIZE | wxWANTS_CHARS)
|
||||
, DrawingPanel(_width, _height)
|
||||
{
|
||||
#ifdef __WXMAC__
|
||||
NSView* view = (NSView*)GetHandle();
|
||||
|
||||
if ([view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
|
||||
[view setWantsBestResolutionOpenGLSurface:YES];
|
||||
}
|
||||
#endif
|
||||
RequestHighResolutionOpenGLSurface();
|
||||
#if wxCHECK_VERSION(2, 9, 0)
|
||||
ctx = new wxGLContext(this);
|
||||
SetCurrent(*ctx);
|
||||
|
@ -2479,3 +2448,19 @@ void GameArea::HidePointer()
|
|||
panel->GetWindow()->SetCursor(wxCursor(wxCURSOR_BLANK));
|
||||
}
|
||||
}
|
||||
|
||||
// stub HiDPI methods, see macsupport.mm for the Mac support
|
||||
#ifndef __WXMAC__
|
||||
double HiDPIAware::HiDPIScaleFactor()
|
||||
{
|
||||
if (hidpi_scale_factor == 0) {
|
||||
hidpi_scale_factor = 1.0;
|
||||
}
|
||||
|
||||
return hidpi_scale_factor;
|
||||
}
|
||||
|
||||
void HiDPIAware::RequestHighResolutionOpenGLSurface()
|
||||
{
|
||||
}
|
||||
#endif // HiDPI stubs
|
||||
|
|
|
@ -345,7 +345,8 @@ private:
|
|||
// helper class to add HiDPI awareness (mostly for Mac OS X)
|
||||
class HiDPIAware {
|
||||
public:
|
||||
double HiDPIScaleFactor();
|
||||
virtual double HiDPIScaleFactor();
|
||||
virtual void RequestHighResolutionOpenGLSurface();
|
||||
virtual wxWindow* GetWindow() = 0;
|
||||
private:
|
||||
double hidpi_scale_factor = 0;
|
||||
|
|
Loading…
Reference in New Issue