A better way of setting the fullscreen flag for windows on Nintendo DS
authorSam Lantinga <slouken@libsdl.org>
Sun, 06 Mar 2011 21:18:36 -0800
changeset 5428cff5d3cd5777
parent 5427 d9b4fd6fcdc4
child 5429 76329ba1fa5c
A better way of setting the fullscreen flag for windows on Nintendo DS
Makefile.ds
src/video/SDL_video.c
src/video/nds/SDL_ndsvideo.c
src/video/nds/SDL_ndsvideo.h
src/video/nds/SDL_ndswindow.c
src/video/nds/SDL_ndswindow.h
     1.1 --- a/Makefile.ds	Sun Mar 06 21:17:44 2011 -0800
     1.2 +++ b/Makefile.ds	Sun Mar 06 21:18:36 2011 -0800
     1.3 @@ -106,6 +106,7 @@
     1.4  			power/nds/SDL_syspower.c \
     1.5  			render/SDL_render.c \
     1.6  			render/SDL_yuv_sw.c \
     1.7 +			render/nds/SDL_ndsrender.c \
     1.8  			render/software/SDL_blendfillrect.c \
     1.9  			render/software/SDL_blendline.c \
    1.10  			render/software/SDL_blendpoint.c \
    1.11 @@ -143,16 +144,10 @@
    1.12  			video/SDL_surface.c \
    1.13  			video/SDL_video.c \
    1.14  			video/nds/SDL_ndsevents.c \
    1.15 -			video/nds/SDL_ndsvideo.c
    1.16 +			video/nds/SDL_ndsvideo.c \
    1.17 +			video/nds/SDL_ndswindow.c
    1.18  
    1.19  
    1.20 -ifeq ($(USE_HW_RENDERER),1)
    1.21 -# Ideally we should be able to not include the SW renderer at set
    1.22 -# SDL_NO_COMPAT. However that breaks the build.
    1.23 -CFILES +=	render/nds/SDL_ndsrender.c
    1.24 -else
    1.25 -endif
    1.26 -
    1.27  #CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
    1.28  #SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
    1.29  #BINFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
     2.1 --- a/src/video/SDL_video.c	Sun Mar 06 21:17:44 2011 -0800
     2.2 +++ b/src/video/SDL_video.c	Sun Mar 06 21:18:36 2011 -0800
     2.3 @@ -1131,10 +1131,6 @@
     2.4  #if (SDL_VIDEO_OPENGL && __MACOSX__) || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
     2.5      flags |= SDL_WINDOW_OPENGL;
     2.6  #endif
     2.7 -#ifdef __NDS__
     2.8 -	/* Always for Nintendo DS. */
     2.9 -	flags |= SDL_WINDOW_FULLSCREEN;
    2.10 -#endif
    2.11      if (flags & SDL_WINDOW_OPENGL) {
    2.12          if (!_this->GL_CreateContext) {
    2.13              SDL_SetError("No OpenGL support in video driver");
     3.1 --- a/src/video/nds/SDL_ndsvideo.c	Sun Mar 06 21:17:44 2011 -0800
     3.2 +++ b/src/video/nds/SDL_ndsvideo.c	Sun Mar 06 21:18:36 2011 -0800
     3.3 @@ -21,12 +21,7 @@
     3.4  */
     3.5  #include "SDL_config.h"
     3.6  
     3.7 -/* SDL Nintendo DS video driver implementation
     3.8 - * based on dummy driver:
     3.9 - *  Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion
    3.10 - *  of this was cut-and-pasted from Stephane Peter's work in the AAlib
    3.11 - *  SDL video driver.  Renamed to "DUMMY" by Sam Lantinga.
    3.12 - */
    3.13 +/* SDL Nintendo DS video driver implementation */
    3.14  
    3.15  #include <stdio.h>
    3.16  #include <stdlib.h>
    3.17 @@ -375,12 +370,13 @@
    3.18      device->VideoQuit = NDS_VideoQuit;
    3.19  	device->GetDisplayModes = NDS_GetDisplayModes;
    3.20      device->SetDisplayMode = NDS_SetDisplayMode;
    3.21 -    device->PumpEvents = NDS_PumpEvents;
    3.22 +    device->CreateWindow = NDS_CreateWindow;
    3.23  #ifndef USE_HW_RENDERER
    3.24  	device->CreateWindowFramebuffer = NDS_CreateWindowFramebuffer;
    3.25  	device->UpdateWindowFramebuffer = NDS_UpdateWindowFramebuffer;
    3.26  	device->DestroyWindowFramebuffer = NDS_DestroyWindowFramebuffer;
    3.27  #endif
    3.28 +    device->PumpEvents = NDS_PumpEvents;
    3.29      device->free = NDS_DeleteDevice;
    3.30  
    3.31  	/* Set the debug output. Use only for under an emulator. Will crash the DS. */
     4.1 --- a/src/video/nds/SDL_ndsvideo.h	Sun Mar 06 21:17:44 2011 -0800
     4.2 +++ b/src/video/nds/SDL_ndsvideo.h	Sun Mar 06 21:18:36 2011 -0800
     4.3 @@ -26,6 +26,8 @@
     4.4  
     4.5  #include "../SDL_sysvideo.h"
     4.6  
     4.7 +#include "SDL_ndswindow.h"
     4.8 +
     4.9  #define SCREEN_GAP 92			/* line-equivalent gap between the 2 screens  */
    4.10  
    4.11  /* Per Window information. */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/src/video/nds/SDL_ndswindow.c	Sun Mar 06 21:18:36 2011 -0800
     5.3 @@ -0,0 +1,34 @@
     5.4 +/*
     5.5 +    SDL - Simple DirectMedia Layer
     5.6 +    Copyright (C) 1997-2011 Sam Lantinga
     5.7 +
     5.8 +    This library is free software; you can redistribute it and/or
     5.9 +    modify it under the terms of the GNU Lesser General Public
    5.10 +    License as published by the Free Software Foundation; either
    5.11 +    version 2.1 of the License, or (at your option) any later version.
    5.12 +
    5.13 +    This library is distributed in the hope that it will be useful,
    5.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.16 +    Lesser General Public License for more details.
    5.17 +
    5.18 +    You should have received a copy of the GNU Lesser General Public
    5.19 +    License along with this library; if not, write to the Free Software
    5.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    5.21 +
    5.22 +    Sam Lantinga
    5.23 +    slouken@libsdl.org
    5.24 +*/
    5.25 +#include "SDL_config.h"
    5.26 +
    5.27 +#include "SDL_ndsvideo.h"
    5.28 +
    5.29 +
    5.30 +int NDS_CreateWindow(_THIS, SDL_Window * window)
    5.31 +{
    5.32 +    /* Nintendo DS windows are always fullscreen */
    5.33 +    window->flags |= SDL_WINDOW_FULLSCREEN;
    5.34 +    return 0;
    5.35 +}
    5.36 +
    5.37 +/* vi: set ts=4 sw=4 expandtab: */
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/src/video/nds/SDL_ndswindow.h	Sun Mar 06 21:18:36 2011 -0800
     6.3 @@ -0,0 +1,31 @@
     6.4 +/*
     6.5 +    SDL - Simple DirectMedia Layer
     6.6 +    Copyright (C) 1997-2011 Sam Lantinga
     6.7 +
     6.8 +    This library is free software; you can redistribute it and/or
     6.9 +    modify it under the terms of the GNU Lesser General Public
    6.10 +    License as published by the Free Software Foundation; either
    6.11 +    version 2.1 of the License, or (at your option) any later version.
    6.12 +
    6.13 +    This library is distributed in the hope that it will be useful,
    6.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.16 +    Lesser General Public License for more details.
    6.17 +
    6.18 +    You should have received a copy of the GNU Lesser General Public
    6.19 +    License along with this library; if not, write to the Free Software
    6.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    6.21 +
    6.22 +    Sam Lantinga
    6.23 +    slouken@libsdl.org
    6.24 +*/
    6.25 +#include "SDL_config.h"
    6.26 +
    6.27 +#ifndef _SDL_ndswindow_h
    6.28 +#define _SDL_ndswindow_h
    6.29 +
    6.30 +extern int NDS_CreateWindow(_THIS, SDL_Window * window);
    6.31 +
    6.32 +#endif /* _SDL_ndswindow_h */
    6.33 +
    6.34 +/* vi: set ts=4 sw=4 expandtab: */