mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Merge pull request #9798 from libretro/kivutar/makeosx
[WIP] Allow building using make on OSX
This commit is contained in:
commit
c1a2dd81c7
@ -58,6 +58,12 @@ matrix:
|
||||
env: CXX_BUILD=1 CC=clang-6.0 CXX=clang++-6.0
|
||||
- os: osx
|
||||
env: CC=clang CXX=clang++
|
||||
- name: OSX OpenGL Make
|
||||
os: osx
|
||||
osx_image: xcode11.2
|
||||
script:
|
||||
- ./configure --enable-opengl --disable-metal
|
||||
- make
|
||||
- os: osx
|
||||
osx_image: xcode8
|
||||
script:
|
||||
|
@ -40,33 +40,6 @@ extern MTLPixelFormat SelectOptimalPixelFormat(MTLPixelFormat fmt);
|
||||
@interface MetalView : MTKView
|
||||
@end
|
||||
|
||||
#ifdef HAVE_COCOA_METAL
|
||||
|
||||
@protocol ApplePlatform
|
||||
|
||||
/*! @brief renderView returns the current render view based on the viewType */
|
||||
@property (readonly) id renderView;
|
||||
|
||||
/*! @brief isActive returns true if the application has focus */
|
||||
@property (readonly) bool hasFocus;
|
||||
|
||||
@property (readwrite) apple_view_type_t viewType;
|
||||
|
||||
/*! @brief setVideoMode adjusts the video display to the specified mode */
|
||||
- (void)setVideoMode:(gfx_ctx_mode_t)mode;
|
||||
|
||||
/*! @brief setCursorVisible specifies whether the cursor is visible */
|
||||
- (void)setCursorVisible:(bool)v;
|
||||
|
||||
/*! @brief controls whether the screen saver should be disabled and
|
||||
* the displays should not sleep.
|
||||
*/
|
||||
- (bool)setDisableDisplaySleep:(bool)disable;
|
||||
@end
|
||||
|
||||
extern id<ApplePlatform> apple_platform;
|
||||
#endif
|
||||
|
||||
@interface FrameView : NSObject
|
||||
|
||||
@property(nonatomic, readonly) RPixelFormat format;
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
#include "../../ui/drivers/ui_cocoa.h"
|
||||
#include "../../ui/drivers/cocoa/cocoa_common.h"
|
||||
#include "../../ui/drivers/cocoa/apple_platform.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
@ -12,25 +12,43 @@
|
||||
|
||||
/* Similarly to SDL, we'll respond to key events by doing nothing so we don't beep.
|
||||
*/
|
||||
- (void)flagsChanged:(NSEvent *)event
|
||||
{
|
||||
- (void)flagsChanged:(NSEvent *)event {
|
||||
}
|
||||
|
||||
- (void)keyDown:(NSEvent *)event
|
||||
{
|
||||
- (void)keyDown:(NSEvent *)event {
|
||||
}
|
||||
|
||||
- (void)keyUp:(NSEvent *)event
|
||||
{
|
||||
- (void)keyUp:(NSEvent *)event {
|
||||
}
|
||||
|
||||
@end
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
@protocol ApplePlatform
|
||||
|
||||
/*! @brief renderView returns the current render view based on the viewType */
|
||||
@property(readonly) id renderView;
|
||||
|
||||
/*! @brief isActive returns true if the application has focus */
|
||||
@property(readonly) bool hasFocus;
|
||||
|
||||
@property(readwrite) apple_view_type_t viewType;
|
||||
|
||||
/*! @brief setVideoMode adjusts the video display to the specified mode */
|
||||
- (void)setVideoMode:(gfx_ctx_mode_t)mode;
|
||||
|
||||
/*! @brief setCursorVisible specifies whether the cursor is visible */
|
||||
- (void)setCursorVisible:(bool)v;
|
||||
|
||||
/*! @brief controls whether the screen saver should be disabled and
|
||||
* the displays should not sleep.
|
||||
*/
|
||||
- (bool)setDisableDisplaySleep:(bool)disable;
|
||||
@end
|
||||
|
||||
extern id<ApplePlatform> apple_platform;
|
||||
|
||||
id<ApplePlatform> apple_platform;
|
||||
@interface RetroArch_OSX : NSObject <ApplePlatform, NSApplicationDelegate>
|
||||
{
|
||||
@interface RetroArch_OSX : NSObject<ApplePlatform, NSApplicationDelegate> {
|
||||
NSWindow *_window;
|
||||
apple_view_type_t _vt;
|
||||
NSView *_renderView;
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "cocoa/cocoa_defines.h"
|
||||
#include "cocoa/cocoa_common.h"
|
||||
#include "cocoa/apple_platform.h"
|
||||
#include "../ui_companion_driver.h"
|
||||
#include "../../input/drivers/cocoa_input.h"
|
||||
#include "../../input/drivers_keyboard/keyboard_event_apple.h"
|
||||
@ -40,55 +41,6 @@
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
#include ".././verbosity.h"
|
||||
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
#import <Metal/Metal.h>
|
||||
#import <MetalKit/MetalKit.h>
|
||||
|
||||
@interface WindowListener : NSResponder<NSWindowDelegate>
|
||||
@end
|
||||
|
||||
@implementation WindowListener
|
||||
|
||||
/* Similarly to SDL, we'll respond to key events by doing nothing so we don't beep.
|
||||
*/
|
||||
- (void)flagsChanged:(NSEvent *)event
|
||||
{}
|
||||
|
||||
- (void)keyDown:(NSEvent *)event
|
||||
{}
|
||||
|
||||
- (void)keyUp:(NSEvent *)event
|
||||
{}
|
||||
|
||||
@end
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
id<ApplePlatform> apple_platform;
|
||||
@interface RetroArch_OSX : NSObject <ApplePlatform, NSApplicationDelegate>
|
||||
{
|
||||
NSWindow* _window;
|
||||
apple_view_type_t _vt;
|
||||
NSView* _renderView;
|
||||
id _sleepActivity;
|
||||
WindowListener *_listener;
|
||||
}
|
||||
#elif defined(HAVE_COCOA)
|
||||
id apple_platform;
|
||||
#if (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
|
||||
@interface RetroArch_OSX : NSObject
|
||||
#else
|
||||
@interface RetroArch_OSX : NSObject <NSApplicationDelegate>
|
||||
#endif
|
||||
{
|
||||
NSWindow* _window;
|
||||
}
|
||||
#endif
|
||||
|
||||
@property (nonatomic, retain) NSWindow IBOutlet* window;
|
||||
|
||||
@end
|
||||
|
||||
static void app_terminate(void)
|
||||
{
|
||||
[[NSApplication sharedApplication] terminate:nil];
|
||||
|
Loading…
x
Reference in New Issue
Block a user