Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 11 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,51 +102,25 @@ endif
# macOS overrides
ifeq ($(HOST_OS),Darwin)
OSX_BUILD := 1
# Using Homebrew?
ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y)
PLATFORM := $(shell uname -m)
OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
CC := gcc-$(OSX_GCC_VER)
CXX := g++-$(OSX_GCC_VER)
CPP := cpp-$(OSX_GCC_VER) -P
PLATFORM_CFLAGS := -I $(shell brew --prefix)/include
PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib
# Using MacPorts?
ifeq ($(shell test -d /opt/local/lib && echo y),y)
else ifeq ($(shell test -d /opt/local/lib && echo y),y)
OSX_GCC_VER = $(shell find /opt/local/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
CC := gcc-mp-$(OSX_GCC_VER)
CXX := g++-mp-$(OSX_GCC_VER)
CPP := cpp-mp-$(OSX_GCC_VER) -P
PLATFORM_CFLAGS := -I /opt/local/include
PLATFORM_LDFLAGS := -L /opt/local/lib
else
# Using Homebrew?
ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y)
OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
CC := gcc-$(OSX_GCC_VER)
CXX := g++-$(OSX_GCC_VER)
CPP := cpp-$(OSX_GCC_VER) -P
PLATFORM_CFLAGS := -I /usr/local/include
PLATFORM_LDFLAGS := -L /usr/local/lib
else
$(error No suitable macOS toolchain found, have you installed Homebrew?)
endif
endif
endif

# macOS overrides
ifeq ($(HOST_OS),Darwin)
OSX_BUILD := 1
# Using Homebrew?
ifeq ($(shell which brew >/dev/null 2>&1 && echo y),y)
PLATFORM := $(shell uname -m)
OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
CC := gcc-$(OSX_GCC_VER)
CXX := g++-$(OSX_GCC_VER)
CPP := cpp-$(OSX_GCC_VER) -P
PLATFORM_CFLAGS := -I $(shell brew --prefix)/include
PLATFORM_LDFLAGS := -L $(shell brew --prefix)/lib
# Using MacPorts?
else ifeq ($(shell test -d /opt/local/lib && echo y),y)
OSX_GCC_VER = $(shell find /opt/local/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
CC := gcc-mp-$(OSX_GCC_VER)
CXX := g++-mp-$(OSX_GCC_VER)
CPP := cpp-mp-$(OSX_GCC_VER) -P
PLATFORM_CFLAGS := -I /opt/local/include
PLATFORM_LDFLAGS := -L /opt/local/lib
else
$(error No suitable macOS toolchain found, have you installed Homebrew?)
$(error No suitable macOS toolchain found, have you installed Homebrew?)
endif
endif

Expand Down
5 changes: 3 additions & 2 deletions src/pc/gfx/gfx_sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static void gfx_sdl_init(const char *window_title) {
wnd = SDL_CreateWindow(
window_title,
xpos, ypos, configWindow.w, configWindow.h,
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE
SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE
);
ctx = SDL_GL_CreateContext(wnd);

Expand Down Expand Up @@ -270,7 +270,8 @@ static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) {

static void gfx_sdl_get_dimensions(uint32_t *width, uint32_t *height) {
int w, h;
SDL_GetWindowSize(wnd, &w, &h);
SDL_GL_GetDrawableSize(wnd, &w, &h);

if (width) *width = w;
if (height) *height = h;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC ?= gcc
CXX ?= g++
CFLAGS := -I../include -I. -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 -O2 -s
CFLAGS := -I../include -I. -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 -O2 -s -fpermissive
LDFLAGS := -lm
PROGRAMS := n64graphics aifc_decode aiff_extract_codebook mio0 vadpcm_enc tabledesign skyconv

Expand Down