OS/2 port!

This was mostly, if not entirely, written by "Doodle" and "Caetano":
    doodle@scenergy.dfmk.hu
    daniel@caetano.eng.br

--ryan.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401193
This commit is contained in:
Ryan C. Gordon 2005-11-23 07:29:56 +00:00
parent c154edb92f
commit b08452cb40
49 changed files with 6571 additions and 8 deletions

24
src/events/Makefile.wat Normal file
View file

@ -0,0 +1,24 @@
#=============================================================================
# This is a Watcom makefile to build SDL.DLL for OS/2
#
# Makefile for events
#=============================================================================
object_files=SDL_active.obj SDL_events.obj SDL_expose.obj SDL_keyboard.obj SDL_mouse.obj SDL_quit.obj SDL_resize.obj
ExtraCFlags=-dUSE_DOSSETPRIORITY
#
#==============================================================================
#
!include ..\..\Watcom.mif
.before
set include=$(%os2tk)\h;$(%include);../../include;../timer;../joystick;../video;
all : $(object_files)
clean : .SYMBOLIC
@if exist *.obj del *.obj
@if exist *.map del *.map
@if exist *.res del *.res
@if exist *.lst del *.lst

View file

@ -89,9 +89,28 @@ void SDL_Unlock_EventThread(void)
}
}
#ifdef __OS2__
/*
* We'll increase the priority of GobbleEvents thread, so it will process
* events in time for sure! For this, we need the DosSetPriority() API
* from the os2.h include file.
*/
#define INCL_DOSPROCESS
#include <os2.h>
#include <time.h>
#endif
static int SDL_GobbleEvents(void *unused)
{
event_thread = SDL_ThreadID();
#ifdef __OS2__
#ifdef USE_DOSSETPRIORITY
/* Increase thread priority, so it will process events in time for sure! */
DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, +16, 0);
#endif
#endif
while ( SDL_EventQ.active ) {
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;

View file

@ -45,8 +45,11 @@ int SDL_PrivateResize(int w, int h)
SDL_Event events[32];
/* See if this event would change the video surface */
if ( !w || !h ||
((last_resize.w == w) && (last_resize.h == h)) ) {
if ( !w || !h
#ifndef __OS2__
|| ((last_resize.w == w) && (last_resize.h == h))
#endif
) {
return(0);
}
last_resize.w = w;

View file

@ -44,3 +44,7 @@ static char rcsid =
#ifdef macintosh /* MacOS 7/8 don't support preemptive multi-tasking */
#define CANT_THREAD_EVENTS
#endif
#ifdef __OS2__ /* The OS/2 event loop runs in a separate thread */
#define MUST_THREAD_EVENTS
#endif