mirror of
https://github.com/switchbrew/switch-examples.git
synced 2025-07-01 09:12:14 +02:00
sdl2: fix newlines
sdl2: use correct include for SDL header sdl2: use sdl-config in makefile sdl2: move sdl2 sample to root, as it's not only about graphics
This commit is contained in:
parent
9e7e3b1311
commit
d79575ac12
@ -46,14 +46,15 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
|
|||||||
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
||||||
$(ARCH) $(DEFINES)
|
$(ARCH) $(DEFINES)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE) -D__SWITCH__
|
CFLAGS += $(INCLUDE) `$(DEVKITPRO)/portlibs/switch/bin/sdl2-config --cflags`
|
||||||
|
|
||||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||||
|
|
||||||
ASFLAGS := -g $(ARCH)
|
ASFLAGS := -g $(ARCH)
|
||||||
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||||
|
|
||||||
LIBS := -lSDL2 -lglad -lEGL -lglapi -ldrm_nouveau -lnx
|
LIBS := `$(DEVKITPRO)/portlibs/switch/bin/sdl2-config --libs`
|
||||||
|
#-lSDL2 -lglad -lEGL -lglapi -ldrm_nouveau -lnx
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# list of directories containing libraries, this must be the top level containing
|
# list of directories containing libraries, this must be the top level containing
|
@ -2,7 +2,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "SDL2/SDL.h"
|
#include <SDL.h>
|
||||||
|
|
||||||
static SDL_DisplayMode modes[5];
|
static SDL_DisplayMode modes[5];
|
||||||
|
|
||||||
@ -112,11 +112,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
|
|
||||||
while (SDL_PollEvent(&event)) {
|
while (SDL_PollEvent(&event)) {
|
||||||
|
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
|
|
||||||
case SDL_JOYAXISMOTION:
|
case SDL_JOYAXISMOTION:
|
||||||
SDL_Log("Joystick %d axis %d value: %d\n",
|
SDL_Log("Joystick %d axis %d value: %d\n",
|
||||||
event.jaxis.which,
|
event.jaxis.which,
|
Loading…
Reference in New Issue
Block a user