Skip to content

Instantly share code, notes, and snippets.

View slime73's full-sized avatar

Sasha Szpakowski slime73

View GitHub Profile
@slime73
slime73 / sdl-metal-example.m
Last active September 9, 2021 10:53
SDL + Metal example
/**
* This software is in the public domain. Where that dedication is not recognized,
* you are granted a perpetual, irrevokable license to copy and modify this file
* as you see fit.
*
* Requires SDL 2.0.4.
* Devices that do not support Metal are not handled currently.
**/
#import <UIKit/UIKit.h>
#include <SDL.h>
int PollEvents()
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_WINDOWEVENT:
#include <SDL.h>
int PollEvents()
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{