diff --git a/Makefile.ds b/Makefile.ds index 35d078a0db0b9d0bc9802f4aa3ec86a1e3f630b4..6f9e91837c288402c39757c31a0dafcba3825158 100644 --- a/Makefile.ds +++ b/Makefile.ds @@ -106,6 +106,7 @@ CFILES := \ power/nds/SDL_syspower.c \ render/SDL_render.c \ render/SDL_yuv_sw.c \ + render/nds/SDL_ndsrender.c \ render/software/SDL_blendfillrect.c \ render/software/SDL_blendline.c \ render/software/SDL_blendpoint.c \ @@ -143,16 +144,10 @@ CFILES := \ video/SDL_surface.c \ video/SDL_video.c \ video/nds/SDL_ndsevents.c \ - video/nds/SDL_ndsvideo.c + video/nds/SDL_ndsvideo.c \ + video/nds/SDL_ndswindow.c -ifeq ($(USE_HW_RENDERER),1) -# Ideally we should be able to not include the SW renderer at set -# SDL_NO_COMPAT. However that breaks the build. -CFILES += render/nds/SDL_ndsrender.c -else -endif - #CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) #SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) #BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 871f885af0635110b5615ef9f212a5f458394e9f..88774b25bc4c303f11155b3ec6a4fe155165376f 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1130,10 +1130,6 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) /* Some platforms have OpenGL enabled by default */ #if (SDL_VIDEO_OPENGL && __MACOSX__) || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 flags |= SDL_WINDOW_OPENGL; -#endif -#ifdef __NDS__ - /* Always for Nintendo DS. */ - flags |= SDL_WINDOW_FULLSCREEN; #endif if (flags & SDL_WINDOW_OPENGL) { if (!_this->GL_CreateContext) { diff --git a/src/video/nds/SDL_ndsvideo.c b/src/video/nds/SDL_ndsvideo.c index efb19a0d3daf7f5b8896b4d6c9dd555d1b254fbe..85293c4a718839b2d7ae389c3a8669f07e288ec4 100644 --- a/src/video/nds/SDL_ndsvideo.c +++ b/src/video/nds/SDL_ndsvideo.c @@ -21,12 +21,7 @@ */ #include "SDL_config.h" -/* SDL Nintendo DS video driver implementation - * based on dummy driver: - * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion - * of this was cut-and-pasted from Stephane Peter's work in the AAlib - * SDL video driver. Renamed to "DUMMY" by Sam Lantinga. - */ +/* SDL Nintendo DS video driver implementation */ #include <stdio.h> #include <stdlib.h> @@ -375,12 +370,13 @@ static SDL_VideoDevice *NDS_CreateDevice(int devindex) device->VideoQuit = NDS_VideoQuit; device->GetDisplayModes = NDS_GetDisplayModes; device->SetDisplayMode = NDS_SetDisplayMode; - device->PumpEvents = NDS_PumpEvents; + device->CreateWindow = NDS_CreateWindow; #ifndef USE_HW_RENDERER device->CreateWindowFramebuffer = NDS_CreateWindowFramebuffer; device->UpdateWindowFramebuffer = NDS_UpdateWindowFramebuffer; device->DestroyWindowFramebuffer = NDS_DestroyWindowFramebuffer; #endif + device->PumpEvents = NDS_PumpEvents; device->free = NDS_DeleteDevice; /* Set the debug output. Use only for under an emulator. Will crash the DS. */ diff --git a/src/video/nds/SDL_ndsvideo.h b/src/video/nds/SDL_ndsvideo.h index b79b2addc9d729408dcfaa375bb607e8aac9bd30..d6c6236573c592b4a9bdf8de4571d301e419b15e 100644 --- a/src/video/nds/SDL_ndsvideo.h +++ b/src/video/nds/SDL_ndsvideo.h @@ -26,6 +26,8 @@ #include "../SDL_sysvideo.h" +#include "SDL_ndswindow.h" + #define SCREEN_GAP 92 /* line-equivalent gap between the 2 screens */ /* Per Window information. */ diff --git a/src/video/nds/SDL_ndswindow.c b/src/video/nds/SDL_ndswindow.c new file mode 100644 index 0000000000000000000000000000000000000000..abf6f14a918850fd7bf1bb25b93a0f60a42fb36c --- /dev/null +++ b/src/video/nds/SDL_ndswindow.c @@ -0,0 +1,34 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2011 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#include "SDL_ndsvideo.h" + + +int NDS_CreateWindow(_THIS, SDL_Window * window) +{ + /* Nintendo DS windows are always fullscreen */ + window->flags |= SDL_WINDOW_FULLSCREEN; + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/nds/SDL_ndswindow.h b/src/video/nds/SDL_ndswindow.h new file mode 100644 index 0000000000000000000000000000000000000000..fc42f325baa71e759c6331353e44f802b7cef818 --- /dev/null +++ b/src/video/nds/SDL_ndswindow.h @@ -0,0 +1,31 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2011 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_ndswindow_h +#define _SDL_ndswindow_h + +extern int NDS_CreateWindow(_THIS, SDL_Window * window); + +#endif /* _SDL_ndswindow_h */ + +/* vi: set ts=4 sw=4 expandtab: */