Skip to content
Permalink
Browse files

Date: Sat, 14 Feb 2004 14:52:40 +0200

From: "Mike Gorchak"
Subject: Batch of the QNX6 fixes for the SDL

1.  Updated readme.QNX
2.  Fixed crashes during intensive window updating under fast machines (got over 200 rectangles for update).
3.  Fixed double-buffered fullscreen modes, now it works as needed.
4.  Fixed Photon detection algorithm.
5.  Fixed HWSURFACE update function.
6.  Added SDL_PHOTON_FULLSCREEN_REFRESH environment variable support for control refresh rates under Photon.
7.  Added 640x400 fullscreen mode emulation via 640x480 (if videodriver not supports original 640x400 mode of course) shifted by 40 vertical pixels from begin, to center it. It's needed for some old DOS games which ran in doubled 320x200 mode.
8.  Added available video ram amount support.
8.  Added hardware surface allocation/deallocation support if current videomode and videodriver supports it.
9.  Added hardware filling support.
10. Added hardware blits support (simple and colorkeyed).

And I've added to testvidinfo test color-keyed blits benchmark (maybe need to add alpha blits benchmark too ?). Currently Photon not supporting any alpha hardware blittings (all drivers lack of alpha blitting code support, only software alpha blitting exist in photon, which is hundreds times slowest than the SDL's one). So I've not added the alpha support. I suppose new QNX 6.3 will have the hardware alpha support, so when it will be done, I'll add alpha support.
  • Loading branch information
slouken committed Feb 14, 2004
1 parent 9edb19c commit 0818e1bd6454cfe678298d0312ae30c8c789f59b
@@ -1,5 +1,5 @@
README by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua>
Last changed at 30 Sep 2003.
Last changed at 14 Feb 2004.

======================================================================
Table of Contents:
@@ -13,7 +13,7 @@ Table of Contents:
7. Environment variables.

======================================================================
OpenGL:
1. OpenGL:

OpenGL works well and is stable, but fullscreen mode has not been
heavily tested yet.
@@ -34,7 +34,7 @@ line in the ph_SetupOpenGLContext() function or change the argument to
PHOGL_ATTRIB_FORCE_HW or PHOGL_ATTRIB_FAVOR_HW.

======================================================================
Wheel and multi-button mouses:
2. Wheel and multi-button mouses:

Photon emits keyboard events (key up and down) when the mouse
wheel is moved. The key_scan field appears valid, and it contains zero.
@@ -54,14 +54,14 @@ I've tested it on:
front, but works not with any window, looks like bug-o-feature :).

======================================================================
CDROM handling issues:
3. CDROM handling issues:

Access to CDROM can only be provided with 'root' privileges. I
can't do anything about that, /dev/cd0 has brw------- permissions and
root:root rights.

======================================================================
Hardware video overlays:
4. Hardware video overlays:

Overlays can flicker during window movement, resizing, etc. It
happens because the photon driver updates the real window contents be-
@@ -82,20 +82,20 @@ smaller). It's really strange, looks like the overlay doesn't like
negative coordinates.

=======================================================================
Shared library building:
5. Shared library building:

A shared library can be built, but before running the autogen.sh
script you must manually delete the libtool.m4 stuff from the acinclu-
de.m4 file (it comes after the ESD detection code up to the end of the
file), because the libtool stuff in the acinclude.m4 file is very old
in SDL distribution before the version 1.2.7 and doesn't know anything
file), because the libtool stuff in the acinclude.m4 file was very old
in SDL distribution before the version 1.2.7 and doesn't knew anything
about QNX. SDL 1.2.7 distribution contain the new libtool.m4 script,
but anyway it is broken :), Just remove it, then run "libtoolize
--force --copy", delete the file aclocal.m4 and after that run the
autogen.sh script.

======================================================================
Some building issues:
6. Some building issues:

Feel free to not use the --disable-shared configure option if you'
ve read the above comment about 'Shared library building'. Otherwise
@@ -123,11 +123,16 @@ x11 support, e.g.:
--prefix=/usr --without-x

======================================================================
Environment variables:
7. Environment variables:

Please note that the photon driver is sensible to the following
environmental variables:

* SDL_PHOTON_FULLSCREEN_REFRESH - this environment variable controls
the refresh rate in all fullscreen modes. Be carefull !!! Photon drivers
usually do not checking the maximum refresh rate, which video adapter or
monitor supports.

* SDL_VIDEO_WINDOW_POS - can be set in the "X,Y" format. If X and Y
coordinates are bigger than the current desktop resolution, then win-
dow positioning across virtual consoles is activated. If X and Y are
@@ -47,17 +47,13 @@ static char rcsid =
#include "SDL_ph_events_c.h"
#include "SDL_phyuv_c.h"



/* The translation tables from a photon keysym to a SDL keysym */
static SDLKey ODD_keymap[256];
static SDLKey MISC_keymap[0xFF + 1];
SDL_keysym *ph_TranslateKey(PhKeyEvent_t *key, SDL_keysym *keysym);

/* Check to see if this is a repeated key.
(idea shamelessly lifted from GII -- thanks guys! :)
*/

(idea shamelessly lifted from GII -- thanks guys! :) */
static int ph_WarpedMotion(_THIS, PhEvent_t *winEvent)
{
PhRect_t *rect = PhGetRects( winEvent );
@@ -117,8 +113,6 @@ static Uint8 ph2sdl_mousebutton(unsigned short button_state)
return (mouse_button);
}

// void* PtAppCreateContext();

static int ph_DispatchEvent(_THIS)
{
int posted;
@@ -127,7 +121,7 @@ static int ph_DispatchEvent(_THIS)
PhKeyEvent_t* keyEvent;
PhWindowEvent_t* winEvent;
int i, buttons;
SDL_Rect sdlrects[50];
SDL_Rect sdlrects[PH_SDL_MAX_RECTS];

posted = 0;

@@ -217,12 +211,12 @@ static int ph_DispatchEvent(_THIS)
set_motion_sensitivity(this, -1);
posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
}
/* quit request */
/* request quit */
else if (winEvent->event_f==Ph_WM_CLOSE)
{
posted = SDL_PrivateQuit();
}
/* hide/unhide request */
/* request hide/unhide */
else if (winEvent->event_f==Ph_WM_HIDE)
{
if (currently_hided)
@@ -287,9 +281,16 @@ static int ph_DispatchEvent(_THIS)
{
if (event->num_rects!=0)
{
int numrects;

if (SDL_VideoSurface)
{
rect = PhGetRects(event);
if (event->num_rects>PH_SDL_MAX_RECTS)
{
/* sorry, buffers underrun, we'll update only first PH_SDL_MAX_RECTS rects */
numrects=PH_SDL_MAX_RECTS;
}

for(i=0; i<event->num_rects; i++)
{
@@ -368,6 +369,32 @@ static int ph_DispatchEvent(_THIS)

case Ph_EV_INFO:
{
if (event->subtype==Ph_OFFSCREEN_INVALID)
{
unsigned long* EvInfoData;

EvInfoData=(unsigned long*)PhGetData(event);

switch (*EvInfoData)
{
case Pg_VIDEO_MODE_SWITCHED:
{
}
break;
case Pg_ENTERED_DIRECT:
{
}
break;
case Pg_EXITED_DIRECT:
{
}
break;
case Pg_DRIVER_STARTED:
{
}
break;
}
}
}
break;
}
@@ -387,10 +414,9 @@ int ph_Pending(_THIS)
{
case Ph_EVENT_MSG:
return 1;
break;
case -1:
perror("ph_Pending(): PhEventNext failed");
break;
SDL_SetError("ph_Pending(): PhEventNext failed.\n");
return 0;
default:
return 0;
}
@@ -30,7 +30,9 @@ static char rcsid =

#include "SDL_ph_video.h"

#define EVENT_SIZE sizeof(PhEvent_t) + 1000
#define PH_SDL_MAX_RECTS 256
#define PH_EVENT_SAFETY_POOL 512
#define EVENT_SIZE (sizeof(PhEvent_t) + 1000 + PH_EVENT_SAFETY_POOL)

/* Functions to be exported */
extern void ph_InitOSKeymap(_THIS);

0 comments on commit 0818e1b

Please sign in to comment.