WinDIB fullscreen patch

Hi again

As mentioned in a previous post, there is no fullscreen support in the
WinDIB drivers, or better WAS no support =) You can find a first,
not-well-tested patch for it here:

All changes are made to ‘src/video/windib/SDL_dibvideo.c’

  1. In ‘DIB_SetVideoMode(…)’ insert the following lines right after the
    local variable declarations:


    int x, y;

// start new code {
/* Set the display mode, if we are in fullscreen mode */
if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
DEVMODE dmScreenSettings;
memset(&dmScreenSettings, 0, sizeof(DEVMODE));
dmScreenSettings.dmSize = sizeof(DEVMODE);
dmScreenSettings.dmPelsWidth = width;
dmScreenSettings.dmPelsHeight = height;
dmScreenSettings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
if(ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) !=
DISP_CHANGE_SUCCESSFUL) return NULL;

	/* Change window styles for a fullscreen window */
	SetWindowLong(SDL_Window, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN |

WS_CLIPSIBLINGS | WS_MAXIMIZE);
}
// } end new code

...
  1. In ‘DIB_VideoQuit(…)’ insert the following code as first statement
    in the if(…) clause:


    if ( SDL_Window ) {

// start new code {
/* Reset to original display settings */
ChangeDisplaySettings(0, 0);
// } end new code

...

That’s it!

+Beosil

Hello Guys,

I'm having some problems trying to build any demos from SDL on my MacOS.

I have a G3/333 running MacOS 9, using CWPro 5, SDL 1.0.4.

I've built SDL with success, except the Windows part that came with the

CWPro Project file. But, when I try to build any demos, I get:

(I’m trying to build testwm on this one)

Link Error : undefined ‘SDL_WaitEvent’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_UpdateRect’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_UnlockSurface’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_LockSurface’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetColors’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_EventState’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetEventFilter’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_IconifyWindow’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_WM_GrabInput’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_PeepEvents’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_ShowCursor’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_SetVideoMode’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_GetCaption’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_SetCaption’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_SetIcon’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetColorKey’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_FreeSurface’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_LoadBMP_RW’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_RWFromFile’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_GetError’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_InitQuickDraw’ (code)
Referenced from ‘main’ in SDL_main.c

Link Error : undefined ‘SDL_Quit’ (descriptor)
Referenced from ‘SDL_main’ in testwm.c
Referenced from ‘main’ in SDL_main.c

Link Error : undefined ‘SDL_Init’ (code)
Referenced from ‘SDL_main’ in testwm.c
Referenced from ‘main’ in SDL_main.c

Any ideas? I’ve already fixed the access paths, so CW can fine the
SDLmain.PPC.lib and such…

Thanks for anything, and great work on this library :))

Eduardo B. Fonseca
ebf at cwb.fnn.net

The shared library generation is messed up. If you get info on the shared
library, it should be at least 200k in size. If it is really small, this is
what you have to do:

Project Settting->PPC PEF select the first pull-down menu to “use .exp
file”, then re-link. You will get link errors. Now add these to the target:

MSL C.PPC.lib
MSL RuntimePPC.lib

MathLib
InterfaceLib

if you compiled with HAVE_OPENGL
OpenGLMemoryStub
OpenGLUtilityStub
OpenGLLibraryStub

If you still get link errors, try finding the names in the .exp file and
removing them (I am using a different version of SDL that may contain some
functions yours does not).

Now if you don’t link, yell at me, cause I messed up the directions :wink:

To run the projects, the shared library must be in the same folder as the
program (or in the extensions folder). Also keep in mind that some of the
tests use data files in the “tests” directory.

BTW, expect some updated CW5 projects in the future.> From: “Eduardo B. Fonseca”

Reply-To: sdl at lokigames.com
Date: Sat, 12 Feb 2000 12:43:50 -0200
To:
Subject: [SDL] MacOS Build

Hello Guys,

I’m having some problems trying to build any demos from SDL on my MacOS.
I have a G3/333 running MacOS 9, using CWPro 5, SDL 1.0.4.

I’ve built SDL with success, except the Windows part that came with the
CWPro Project file. But, when I try to build any demos, I get:

(I’m trying to build testwm on this one)

Link Error : undefined ‘SDL_WaitEvent’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_UpdateRect’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_UnlockSurface’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_LockSurface’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetColors’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_EventState’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetEventFilter’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_IconifyWindow’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_WM_GrabInput’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_PeepEvents’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_ShowCursor’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_SetVideoMode’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_GetCaption’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_SetCaption’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_SetIcon’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetColorKey’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_FreeSurface’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_LoadBMP_RW’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_RWFromFile’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_GetError’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_InitQuickDraw’ (code)
Referenced from ‘main’ in SDL_main.c

Link Error : undefined ‘SDL_Quit’ (descriptor)
Referenced from ‘SDL_main’ in testwm.c
Referenced from ‘main’ in SDL_main.c

Link Error : undefined ‘SDL_Init’ (code)
Referenced from ‘SDL_main’ in testwm.c
Referenced from ‘main’ in SDL_main.c

Any ideas? I’ve already fixed the access paths, so CW can fine the
SDLmain.PPC.lib and such…

Thanks for anything, and great work on this library :))

Eduardo B. Fonseca
ebf at cwb.fnn.net

Hi again

As mentioned in a previous post, there is no fullscreen support in the
WinDIB drivers, or better WAS no support =) You can find a first,
not-well-tested patch for it here:

It looks like the only thing left to do is get a list of supported video
modes that can be returned in SDL_SYS_ListModes().

Do you know how to do that?

I’ll be happy to include your changes in SDL 1.1, and implement
SDL_WM_ToggleFullScreen() for the WinDIB driver. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Hi Darrel,

Thanks for all the help :slight_smile:

I almost did it :slight_smile:

Some link errors remained… take a look:

Link Error : undefined ‘WriteCharsToConsole’ (code)
Referenced from ‘__write_console’ in MSL C.PPC.Lib

Link Error : undefined ‘ReadCharsFromConsole’ (code)
Referenced from ‘__read_console’ in MSL C.PPC.Lib

Link Error : undefined ‘RemoveConsole’ (descriptor)
Referenced from ‘check_console’ in MSL C.PPC.Lib

Link Error : undefined ‘InstallConsole’ (code)
Referenced from ‘check_console’ in MSL C.PPC.Lib

Any clues?

Thanks!

Eduardo.> From: Darrell Walisser

Reply-To: sdl at lokigames.com
Date: Sat, 12 Feb 2000 10:26:01 -0600
To:
Subject: Re: [SDL] MacOS Build

The shared library generation is messed up. If you get info on the shared
library, it should be at least 200k in size. If it is really small, this is
what you have to do:

Project Settting->PPC PEF select the first pull-down menu to “use .exp
file”, then re-link. You will get link errors. Now add these to the target:

MSL C.PPC.lib
MSL RuntimePPC.lib

MathLib
InterfaceLib

if you compiled with HAVE_OPENGL
OpenGLMemoryStub
OpenGLUtilityStub
OpenGLLibraryStub

If you still get link errors, try finding the names in the .exp file and
removing them (I am using a different version of SDL that may contain some
functions yours does not).

Now if you don’t link, yell at me, cause I messed up the directions :wink:

To run the projects, the shared library must be in the same folder as the
program (or in the extensions folder). Also keep in mind that some of the
tests use data files in the “tests” directory.

BTW, expect some updated CW5 projects in the future.

From: “Eduardo B. Fonseca”
Reply-To: sdl at lokigames.com
Date: Sat, 12 Feb 2000 12:43:50 -0200
To:
Subject: [SDL] MacOS Build

Hello Guys,

I’m having some problems trying to build any demos from SDL on my MacOS.
I have a G3/333 running MacOS 9, using CWPro 5, SDL 1.0.4.

I’ve built SDL with success, except the Windows part that came with the
CWPro Project file. But, when I try to build any demos, I get:

(I’m trying to build testwm on this one)

Link Error : undefined ‘SDL_WaitEvent’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_UpdateRect’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_UnlockSurface’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_LockSurface’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetColors’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_EventState’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetEventFilter’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_IconifyWindow’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_WM_GrabInput’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_PeepEvents’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_ShowCursor’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_SetVideoMode’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_GetCaption’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_SetCaption’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_SetIcon’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetColorKey’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_FreeSurface’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_LoadBMP_RW’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_RWFromFile’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_GetError’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_InitQuickDraw’ (code)
Referenced from ‘main’ in SDL_main.c

Link Error : undefined ‘SDL_Quit’ (descriptor)
Referenced from ‘SDL_main’ in testwm.c
Referenced from ‘main’ in SDL_main.c

Link Error : undefined ‘SDL_Init’ (code)
Referenced from ‘SDL_main’ in testwm.c
Referenced from ‘main’ in SDL_main.c

Any ideas? I’ve already fixed the access paths, so CW can fine the
SDLmain.PPC.lib and such…

Thanks for anything, and great work on this library :))

Eduardo B. Fonseca
ebf at cwb.fnn.net

whoops, you need MSL_SIOUX.PPC.lib> From: “Eduardo B. Fonseca”

Reply-To: sdl at lokigames.com
Date: Sat, 12 Feb 2000 16:56:49 -0200
To:
Subject: Re: [SDL] MacOS Build

Hi Darrel,

Thanks for all the help :slight_smile:

I almost did it :slight_smile:

Some link errors remained… take a look:

Link Error : undefined ‘WriteCharsToConsole’ (code)
Referenced from ‘__write_console’ in MSL C.PPC.Lib

Link Error : undefined ‘ReadCharsFromConsole’ (code)
Referenced from ‘__read_console’ in MSL C.PPC.Lib

Link Error : undefined ‘RemoveConsole’ (descriptor)
Referenced from ‘check_console’ in MSL C.PPC.Lib

Link Error : undefined ‘InstallConsole’ (code)
Referenced from ‘check_console’ in MSL C.PPC.Lib

Any clues?

Thanks!

Eduardo.

From: Darrell Walisser
Reply-To: sdl at lokigames.com
Date: Sat, 12 Feb 2000 10:26:01 -0600
To:
Subject: Re: [SDL] MacOS Build

The shared library generation is messed up. If you get info on the shared
library, it should be at least 200k in size. If it is really small, this is
what you have to do:

Project Settting->PPC PEF select the first pull-down menu to “use .exp
file”, then re-link. You will get link errors. Now add these to the target:

MSL C.PPC.lib
MSL RuntimePPC.lib

MathLib
InterfaceLib

if you compiled with HAVE_OPENGL
OpenGLMemoryStub
OpenGLUtilityStub
OpenGLLibraryStub

If you still get link errors, try finding the names in the .exp file and
removing them (I am using a different version of SDL that may contain some
functions yours does not).

Now if you don’t link, yell at me, cause I messed up the directions :wink:

To run the projects, the shared library must be in the same folder as the
program (or in the extensions folder). Also keep in mind that some of the
tests use data files in the “tests” directory.

BTW, expect some updated CW5 projects in the future.

From: “Eduardo B. Fonseca”
Reply-To: sdl at lokigames.com
Date: Sat, 12 Feb 2000 12:43:50 -0200
To:
Subject: [SDL] MacOS Build

Hello Guys,

I’m having some problems trying to build any demos from SDL on my MacOS.
I have a G3/333 running MacOS 9, using CWPro 5, SDL 1.0.4.

I’ve built SDL with success, except the Windows part that came with the
CWPro Project file. But, when I try to build any demos, I get:

(I’m trying to build testwm on this one)

Link Error : undefined ‘SDL_WaitEvent’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_UpdateRect’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_UnlockSurface’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_LockSurface’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetColors’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_EventState’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetEventFilter’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_IconifyWindow’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_WM_GrabInput’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_PeepEvents’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_ShowCursor’ (code)
Referenced from ‘FilterEvents’ in testwm.c

Link Error : undefined ‘SDL_SetVideoMode’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_GetCaption’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_SetCaption’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_WM_SetIcon’ (code)
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_SetColorKey’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_FreeSurface’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_LoadBMP_RW’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_RWFromFile’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c

Link Error : undefined ‘SDL_GetError’ (code)
Referenced from ‘LoadIconSurface’ in testwm.c
Referenced from ‘SDL_main’ in testwm.c

Link Error : undefined ‘SDL_InitQuickDraw’ (code)
Referenced from ‘main’ in SDL_main.c

Link Error : undefined ‘SDL_Quit’ (descriptor)
Referenced from ‘SDL_main’ in testwm.c
Referenced from ‘main’ in SDL_main.c

Link Error : undefined ‘SDL_Init’ (code)
Referenced from ‘SDL_main’ in testwm.c
Referenced from ‘main’ in SDL_main.c

Any ideas? I’ve already fixed the access paths, so CW can fine the
SDLmain.PPC.lib and such…

Thanks for anything, and great work on this library :))

Eduardo B. Fonseca
ebf at cwb.fnn.net