RetroArch
Functions | Variables
metal.m File Reference
#import <Metal/Metal.h>
#import <MetalKit/MetalKit.h>
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <compat/strl.h>
#include <gfx/scaler/scaler.h>
#include <gfx/video_frame.h>
#include <formats/image.h>
#include <retro_inline.h>
#include <retro_miscellaneous.h>
#include <retro_math.h>
#include <retro_assert.h>
#include <libretro.h>
#import "../font_driver.h"
#import "../common/metal_common.h"
#import "../../driver.h"
#import "../../configuration.h"
#import "../../record/record_driver.h"
#import "../../retroarch.h"
#import "../../verbosity.h"
#import "../video_coord_array.h"
Include dependency graph for metal.m:

Functions

static bool metal_set_shader (void *data, enum rarch_shader_type type, const char *path)
 
static voidmetal_init (const video_info_t *video, const input_driver_t **input, void **input_data)
 
static bool metal_frame (void *data, const void *frame, unsigned frame_width, unsigned frame_height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
 
static void metal_set_nonblock_state (void *data, bool non_block)
 
static bool metal_alive (void *data)
 
static bool metal_has_windowed (void *data)
 
static bool metal_focus (void *data)
 
static bool metal_suppress_screensaver (void *data, bool disable)
 
static void metal_free (void *data)
 
static void metal_set_viewport (void *data, unsigned viewport_width, unsigned viewport_height, bool force_full, bool allow_rotate)
 
static void metal_set_rotation (void *data, unsigned rotation)
 
static void metal_viewport_info (void *data, struct video_viewport *vp)
 
static bool metal_read_viewport (void *data, uint8_t *buffer, bool is_idle)
 
static uintptr_t metal_load_texture (void *video_data, void *data, bool threaded, enum texture_filter_type filter_type)
 
static void metal_unload_texture (void *data, uintptr_t handle)
 
static void metal_set_video_mode (void *data, unsigned width, unsigned height, bool fullscreen)
 
static float metal_get_refresh_rate (void *data)
 
static void metal_set_filtering (void *data, unsigned index, bool smooth)
 
static void metal_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
 
static void metal_apply_state_changes (void *data)
 
static void metal_set_texture_frame (void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
 
static void metal_set_texture_enable (void *data, bool state, bool full_screen)
 
static void metal_set_osd_msg (void *data, video_frame_info_t *video_info, const char *msg, const void *params, void *font)
 
static void metal_show_mouse (void *data, bool state)
 
static struct video_shadermetal_get_current_shader (void *data)
 
static uint32_t metal_get_flags (void *data)
 
static void metal_get_poke_interface (void *data, const video_poke_interface_t **iface)
 

Variables

static const video_poke_interface_t metal_poke_interface
 
video_driver_t video_metal
 

Function Documentation

◆ metal_alive()

static bool metal_alive ( void data)
static

◆ metal_apply_state_changes()

static void metal_apply_state_changes ( void data)
static
Here is the call graph for this function:

◆ metal_focus()

static bool metal_focus ( void data)
static

◆ metal_frame()

static bool metal_frame ( void data,
const void frame,
unsigned  frame_width,
unsigned  frame_height,
uint64_t  frame_count,
unsigned  pitch,
const char *  msg,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:

◆ metal_free()

static void metal_free ( void data)
static

◆ metal_get_current_shader()

static struct video_shader* metal_get_current_shader ( void data)
static

◆ metal_get_flags()

static uint32_t metal_get_flags ( void data)
static

◆ metal_get_poke_interface()

static void metal_get_poke_interface ( void data,
const video_poke_interface_t **  iface 
)
static
Here is the call graph for this function:

◆ metal_get_refresh_rate()

static float metal_get_refresh_rate ( void data)
static
Here is the call graph for this function:

◆ metal_has_windowed()

static bool metal_has_windowed ( void data)
static

◆ metal_init()

static void* metal_init ( const video_info_t video,
const input_driver_t **  input,
void **  input_data 
)
static
Here is the call graph for this function:

◆ metal_load_texture()

static uintptr_t metal_load_texture ( void video_data,
void data,
bool  threaded,
enum texture_filter_type  filter_type 
)
static

◆ metal_read_viewport()

static bool metal_read_viewport ( void data,
uint8_t buffer,
bool  is_idle 
)
static

◆ metal_set_aspect_ratio()

static void metal_set_aspect_ratio ( void data,
unsigned  aspect_ratio_idx 
)
static
Here is the call graph for this function:

◆ metal_set_filtering()

static void metal_set_filtering ( void data,
unsigned  index,
bool  smooth 
)
static

◆ metal_set_nonblock_state()

static void metal_set_nonblock_state ( void data,
bool  non_block 
)
static

◆ metal_set_osd_msg()

static void metal_set_osd_msg ( void data,
video_frame_info_t video_info,
const char *  msg,
const void params,
void font 
)
static
Here is the call graph for this function:

◆ metal_set_rotation()

static void metal_set_rotation ( void data,
unsigned  rotation 
)
static
Here is the call graph for this function:

◆ metal_set_shader()

static bool metal_set_shader ( void data,
enum rarch_shader_type  type,
const char *  path 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ metal_set_texture_enable()

static void metal_set_texture_enable ( void data,
bool  state,
bool  full_screen 
)
static

◆ metal_set_texture_frame()

static void metal_set_texture_frame ( void data,
const void frame,
bool  rgb32,
unsigned  width,
unsigned  height,
float  alpha 
)
static
Here is the call graph for this function:

◆ metal_set_video_mode()

static void metal_set_video_mode ( void data,
unsigned  width,
unsigned  height,
bool  fullscreen 
)
static
Here is the call graph for this function:

◆ metal_set_viewport()

static void metal_set_viewport ( void data,
unsigned  viewport_width,
unsigned  viewport_height,
bool  force_full,
bool  allow_rotate 
)
static
Here is the call graph for this function:

◆ metal_show_mouse()

static void metal_show_mouse ( void data,
bool  state 
)
static

◆ metal_suppress_screensaver()

static bool metal_suppress_screensaver ( void data,
bool  disable 
)
static
Here is the call graph for this function:

◆ metal_unload_texture()

static void metal_unload_texture ( void data,
uintptr_t  handle 
)
static

◆ metal_viewport_info()

static void metal_viewport_info ( void data,
struct video_viewport vp 
)
static

Variable Documentation

◆ metal_poke_interface

const video_poke_interface_t metal_poke_interface
static
Initial value:
= {
.get_flags = metal_get_flags,
.load_texture = metal_load_texture,
.unload_texture = metal_unload_texture,
.set_video_mode = metal_set_video_mode,
.get_refresh_rate = metal_get_refresh_rate,
.set_filtering = metal_set_filtering,
.set_aspect_ratio = metal_set_aspect_ratio,
.apply_state_changes = metal_apply_state_changes,
.set_texture_frame = metal_set_texture_frame,
.set_texture_enable = metal_set_texture_enable,
.set_osd_msg = metal_set_osd_msg,
.show_mouse = metal_show_mouse,
.get_current_shader = metal_get_current_shader,
}
static void metal_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
Definition: metal.m:265
static uintptr_t metal_load_texture(void *video_data, void *data, bool threaded, enum texture_filter_type filter_type)
Definition: metal.m:184
static void metal_set_texture_enable(void *data, bool state, bool full_screen)
Definition: metal.m:280
static void metal_unload_texture(void *data, uintptr_t handle)
Definition: metal.m:197
static void metal_set_filtering(void *data, unsigned index, bool smooth)
Definition: metal.m:224
static uint32_t metal_get_flags(void *data)
Definition: metal.m:315
static void metal_apply_state_changes(void *data)
Definition: metal.m:259
static void metal_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen)
Definition: metal.m:207
static void metal_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
Definition: metal.m:230
static void metal_set_osd_msg(void *data, video_frame_info_t *video_info, const char *msg, const void *params, void *font)
Definition: metal.m:292
static struct video_shader * metal_get_current_shader(void *data)
Definition: metal.m:305
static float metal_get_refresh_rate(void *data)
Definition: metal.m:216
static void metal_show_mouse(void *data, bool state)
Definition: metal.m:300

◆ video_metal

video_driver_t video_metal
Initial value:
= {
.init = metal_init,
.frame = metal_frame,
.set_nonblock_state = metal_set_nonblock_state,
.alive = metal_alive,
.has_windowed = metal_has_windowed,
.focus = metal_focus,
.suppress_screensaver = metal_suppress_screensaver,
.set_shader = metal_set_shader,
.free = metal_free,
.ident = "metal",
.set_viewport = metal_set_viewport,
.set_rotation = metal_set_rotation,
.viewport_info = metal_viewport_info,
.read_viewport = metal_read_viewport,
.poke_interface = metal_get_poke_interface,
}
static bool metal_has_windowed(void *data)
Definition: metal.m:107
static bool metal_frame(void *data, const void *frame, unsigned frame_width, unsigned frame_height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
Definition: metal.m:81
static void metal_set_viewport(void *data, unsigned viewport_width, unsigned viewport_height, bool force_full, bool allow_rotate)
Definition: metal.m:151
static void metal_free(void *data)
Definition: metal.m:145
static bool metal_read_viewport(void *data, uint8_t *buffer, bool is_idle)
Definition: metal.m:178
static void metal_set_nonblock_state(void *data, bool non_block)
Definition: metal.m:96
static void metal_viewport_info(void *data, struct video_viewport *vp)
Definition: metal.m:172
static bool metal_alive(void *data)
Definition: metal.m:102
static bool metal_suppress_screensaver(void *data, bool disable)
Definition: metal.m:117
static void metal_set_rotation(void *data, unsigned rotation)
Definition: metal.m:162
static bool metal_focus(void *data)
Definition: metal.m:112
static void * metal_init(const video_info_t *video, const input_driver_t **input, void **input_data)
Definition: metal.m:58
static bool metal_set_shader(void *data, enum rarch_shader_type type, const char *path)
Definition: metal.m:123
static void metal_get_poke_interface(void *data, const video_poke_interface_t **iface)
Definition: metal.m:342