Commit 9b315c4c authored by Sam Lantinga's avatar Sam Lantinga

Date: Sat, 2 Aug 2003 16:22:51 +0300

From: "Mike Gorchak"
Subject: New patches for QNX6

Here my patches for the SDL/QNX:

QNXSDL.diff - diff to non-QNX related sources:

- updated BUGS file, I think QNX6 is now will be officially supported
- configure.in - added shared library support for QNX, and removed dependency between the ALSA and QNX6.
- SDL_audio.c - added QNX NTO sound bootstrap insted of ALSA's.
- SDL_sysaudio.h - the same.
- SDL_nto_audio.c - the same.
- SDL_video.c - right now, QNX doesn't offer any method to obtain pointers to the OpenGL functions by function name, so they must be hardcoded in library, otherwise OpenGL will not be supported.
- testsprite.c - fixed: do not draw vertical red line if we are in non-double-buffered mode.

sdlqnxph.tar.gz - archive of the ./src/video/photon/* . Too many changes in code to make diffs :) :

+ Added stub for support hide/unhide window event
+ Added full YUV overlays support.
+ Added window maximize support.
+ Added mouse wheel events.
+ Added support for some specific key codes in Unicode mode (like ESC).
+ Added more checks to the all memory allocation code.
+ Added SDL_DOUBLEBUF support in all fullscreen modes.
+ Added fallback to window mode, if desired fullscreen mode is not supported.
+ Added stub support for the GL_LoadLibrary and GL_GetProcAddress functions.
+ Added resizable window support without caption.
! Fixed bug in the Ph_EV_EXPOSE event handler, when rectangles to update is 0 and when width or height of the rectangle is 0.
! Fixed bug in the event handler code. Events has not been passed to the window widget handler.
! Fixed codes for Win keys (Super/Hyper/Menu).
! Fixed memory leak, when deallocation palette.
! Fixed palette emulation code bugs.
! Fixed fullscreen and hwsurface handling.
! Fixed CLOSE button bug. First event was passed to the handler, but second terminated the application. Now all events passed to the application correctly.
- Removed all printfs in code, now SDL_SetError used instead of them.
- Disabled ToggleFullScreen function.

README.QNX - updated README.QNX file. Added much more issues.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40664
parent 21c236f4
...@@ -141,6 +141,10 @@ EPOC: ...@@ -141,6 +141,10 @@ EPOC:
No console output screen. Printing to stdout do not have any effect. No console output screen. Printing to stdout do not have any effect.
QNX:
Fullscreen switch doesn't work correctly.
OpenBSD: -= NOT YET SUPPORTED =- OpenBSD: -= NOT YET SUPPORTED =-
This is reported to work, but I haven't verified this. This is reported to work, but I haven't verified this.
...@@ -183,13 +187,6 @@ AIX: -= NOT YET SUPPORTED =- ...@@ -183,13 +187,6 @@ AIX: -= NOT YET SUPPORTED =-
More information on this port is available at: More information on this port is available at:
http://www.kom.e-technik.tu-darmstadt.de/~griff/SDL/ http://www.kom.e-technik.tu-darmstadt.de/~griff/SDL/
QNX: -= NOT YET SUPPORTED =-
Only static libraries are being made, no shared ones.
The only hardware surface is the primary view surface.
Fullscreen doesn't display correctly.
AmigaOS: -= NOT YET SUPPORTED =- AmigaOS: -= NOT YET SUPPORTED =-
The OpenGL support isn't implemented yet. The OpenGL support isn't implemented yet.
......
README by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua> README by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua>
Last changed at 29 Jul 2003.
=========================================================================
OpenGL:
OpenGL in window mode works well and stable, in fullscreen OpenGL in window mode works well and stable, in fullscreen
mode too, but fullscreen mode has not been heavily tested. mode too, but fullscreen mode has not been heavily tested yet.
If you have QNX RtP 6.1.0 w/ or w/o Patch A you must download If you have QNX RtP version 6.1.0 and above you must download
new Photon3D runtime from http://developers.qnx.com. The versions new Photon3D runtime from http://developers.qnx.com or install it
of OS before 6.1.0 are not supported. from public repository or from public CD, available with QNX. The
versions of OS before 6.1.0 are not supported.
Problems: While creating OpenGL context software renderer mode is
1. While creating OpenGL context software renderer mode is artificially selected (QSSL made acceleration only for Voodoo
artificially selected (QSSL made acceleration only for Voodoo boards in fullscreen mode, sorry but I don't have this board to
boards in fullscreen mode, sorry but I don't have this board, test OpenGL - maybe it work or maybe not :)). If you want accele-
if you want acceleration - you may remove some line in source ration - you may remove some line in source code: find the file
code). SDL_ph_video.c and remove the following
2. Photon has some errors in detecting how much bits per pixel
videomode has. OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW;
3. No shared libraries yet. We need manually set flag to
'configure' --disable-shared. line in the ph_SetupOpenGLContext() function or change argument
4. Due to Photon API limitation, flag SDL_HWSURFACE supported on- to the PHOGL_ATTRIB_FORCE_HW or PHOGL_ATTRIB_FAVOR_HW.
ly in case of desktop bpp is equal requested bpp in window mo-
de. =========================================================================
Wheel and multibutton mouses:
Photon emitting keyboard events (key up and down) when moved
mouse wheel. But key_scan field appears valid according to flags,
and it contain zero. It is base method of detecting mouse wheel
events under photon. It looks like a hack, but it works for me :)
on different PC configurations.
I'm tested it on:
1. Genius Optical NetScroll/+ (1 wheel)
2. A4Tech Optical GreatEye WheelMouse, model: WOP-35. (2 wheels +
2 additional buttons). Wheel for vertical scrolling works as
usual, but second wheel for horizontal scrolling emitting two
consequented events up or down, so it can provide more fast
scrolling then the first wheel. Additional buttons doesn't
emitting any events, but its look like handled by photon in
unusual way - like click to front, but works not with any win-
dow, looks like bug-o-feature :).
=========================================================================
CDROM handling issues:
Access to CDROM can be provided only with 'root' previleges.
I can't do anything with this fact. /dev/cd0 have the brw-------
flags and root:root rights.
=========================================================================
Video Overlays:
Overlays can flickering during the window movement, resizing,
etc. It happens because photon driver updates the real window
contents behind the overlay, then draws the temporary chroma key
color over window contents. It can be done without the chroma key
using but it cause overlay will be always on top. So flickering
during the movement much better in that case.
Double buffering code temporary disabled in the photon driver
code, beacuse on my GF2-MX it cause accidently buffer switch,
which going to the old frame showing. S3 Savage3D have the same
problem, but ATI Rage 128 has not this problem. I think it can be
fixed later. Current code works very fine, so maybe double buffe-
ring is not needed right now.
Something strange appears when you tried to move window with
overlay beyond the left border of the screen. Overlay trying to
stay at position x=0, but when tried to move it a bit more it
jumps at posituin x=-60. Really strange, looks like overlay
doesn't love the negotive coordinates.
=========================================================================
Shared library building:
Shared library can be built, but before running autogen.sh
script you need manually delete the libtool m4 stuff from
the acinclude.m4 file (it comes after ESD detection code up to
end of the file). Because libtool stuff in the acinclude.m4 file
very old and doesn't know anything about the QNX. Just remove it
and run autogen.sh script.
=========================================================================
Some building issues: Some building issues:
Feel free to not pass --disable-shared option to configure,
if you read comment above about 'Shared library building'. Other-
wise this option is strongly recomended, because the sdl-config
script will be unfunctional.
Run configure script without x11 support, e.g.: Run configure script without x11 support, e.g.:
a) for OpenGL support: a) for OpenGL support:
...@@ -42,3 +109,4 @@ support, e.g.: ...@@ -42,3 +109,4 @@ support, e.g.:
--with-sdl-exec-prefix=/usr/local \ --with-sdl-exec-prefix=/usr/local \
--prefix=/usr/local --without-x --prefix=/usr/local --without-x
...@@ -2531,6 +2531,9 @@ case "$ARCH" in ...@@ -2531,6 +2531,9 @@ case "$ARCH" in
openbsd | netbsd | bsdi) openbsd | netbsd | bsdi)
SHARED_SYSTEM_LIBS="$SYSTEM_LIBS" SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
;; ;;
qnx)
SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
;;
macosx) macosx)
SHARED_SYSTEM_LIBS="-framework Cocoa" SHARED_SYSTEM_LIBS="-framework Cocoa"
if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
......
...@@ -50,6 +50,9 @@ static AudioBootStrap *bootstrap[] = { ...@@ -50,6 +50,9 @@ static AudioBootStrap *bootstrap[] = {
#ifdef ALSA_SUPPORT #ifdef ALSA_SUPPORT
&ALSA_bootstrap, &ALSA_bootstrap,
#endif #endif
#ifdef QNXNTOAUDIO_SUPPORT
&QNXNTOAUDIO_bootstrap,
#endif
#ifdef SUNAUDIO_SUPPORT #ifdef SUNAUDIO_SUPPORT
&SUNAUDIO_bootstrap, &SUNAUDIO_bootstrap,
#endif #endif
......
...@@ -114,6 +114,9 @@ extern AudioBootStrap DMA_bootstrap; ...@@ -114,6 +114,9 @@ extern AudioBootStrap DMA_bootstrap;
#ifdef ALSA_SUPPORT #ifdef ALSA_SUPPORT
extern AudioBootStrap ALSA_bootstrap; extern AudioBootStrap ALSA_bootstrap;
#endif #endif
#ifdef QNXNTOAUDIO_SUPPORT
extern AudioBootStrap QNXNTOAUDIO_bootstrap;
#endif
#ifdef SUNAUDIO_SUPPORT #ifdef SUNAUDIO_SUPPORT
extern AudioBootStrap SUNAUDIO_bootstrap; extern AudioBootStrap SUNAUDIO_bootstrap;
#endif #endif
......
...@@ -163,9 +163,8 @@ static SDL_AudioDevice *Audio_CreateDevice(int devindex) ...@@ -163,9 +163,8 @@ static SDL_AudioDevice *Audio_CreateDevice(int devindex)
return this; return this;
} }
/* Don't change the name from "ALSA_bootstrap" - that's how it's called */ AudioBootStrap QNXNTOAUDIO_bootstrap = {
AudioBootStrap ALSA_bootstrap = { DRIVER_NAME, "QNX6 NTO PCM audio",
DRIVER_NAME, "Neutrino PCM audio",
Audio_Available, Audio_CreateDevice Audio_Available, Audio_CreateDevice
}; };
...@@ -489,4 +488,3 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -489,4 +488,3 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
/* We're ready to rock and roll. :-) */ /* We're ready to rock and roll. :-) */
return(0); return(0);
} }
...@@ -727,6 +727,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) ...@@ -727,6 +727,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
/* Load GL symbols (before MakeCurrent, where we need glGetString). */ /* Load GL symbols (before MakeCurrent, where we need glGetString). */
if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) { if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) {
#ifndef __QNXNTO__
#define SDL_PROC(ret,func,params) \ #define SDL_PROC(ret,func,params) \
do { \ do { \
video->func = SDL_GL_GetProcAddress(#func); \ video->func = SDL_GL_GetProcAddress(#func); \
...@@ -735,6 +736,9 @@ do { \ ...@@ -735,6 +736,9 @@ do { \
return(NULL); \ return(NULL); \
} \ } \
} while ( 0 ); } while ( 0 );
#else
#define SDL_PROC(ret,func,params) video->func=func;
#endif /* __QNXNTO__ */
#include "SDL_glfuncs.h" #include "SDL_glfuncs.h"
#undef SDL_PROC #undef SDL_PROC
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -39,4 +39,5 @@ extern int ph_FlipHWSurface(_THIS, SDL_Surface *surface); ...@@ -39,4 +39,5 @@ extern int ph_FlipHWSurface(_THIS, SDL_Surface *surface);
extern void ph_NormalUpdate(_THIS, int numrects, SDL_Rect *rects); extern void ph_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
extern void ph_OCUpdate(_THIS, int numrects, SDL_Rect *rects); extern void ph_OCUpdate(_THIS, int numrects, SDL_Rect *rects);
extern void ph_OCDCUpdate(_THIS, int numrects, SDL_Rect *rects);
extern void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect *rects); extern void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect *rects);
This diff is collapsed.
...@@ -36,9 +36,9 @@ static char rcsid = ...@@ -36,9 +36,9 @@ static char rcsid =
extern SDL_Rect **ph_ListModes(_THIS,SDL_PixelFormat *format, Uint32 flags); extern SDL_Rect **ph_ListModes(_THIS,SDL_PixelFormat *format, Uint32 flags);
extern void ph_FreeVideoModes(_THIS); extern void ph_FreeVideoModes(_THIS);
extern int ph_ResizeFullScreen(_THIS); extern int ph_ResizeFullScreen(_THIS);
extern int ph_EnterFullScreen(_THIS); extern int ph_EnterFullScreen(_THIS, SDL_Surface* screen);
extern int ph_LeaveFullScreen(_THIS); extern int ph_LeaveFullScreen(_THIS);
extern int get_mode(int width, int height, int bpp); extern int ph_GetVideoMode(int width, int height, int bpp);
extern int get_mode_any_format(int width, int height, int bpp); extern int get_mode_any_format(int width, int height, int bpp);
extern int ph_ToggleFullScreen(_THIS, int on); extern int ph_ToggleFullScreen(_THIS, int on);
......
...@@ -46,19 +46,18 @@ void ph_FreeWMCursor(_THIS, WMcursor *cursor) ...@@ -46,19 +46,18 @@ void ph_FreeWMCursor(_THIS, WMcursor *cursor)
{ {
SDL_Lock_EventThread(); SDL_Lock_EventThread();
if (PtSetResource( window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_INHERIT, 0) < 0) if (PtSetResource(window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_INHERIT, 0) < 0)
{ {
/* TODO: output error msg */ /* TODO: output error msg */
} }
SDL_Unlock_EventThread(); SDL_Unlock_EventThread();
} }
/* free(cursor->ph_cursor.images); */
free(cursor); free(cursor);
} }
WMcursor *ph_CreateWMCursor(_THIS, WMcursor *ph_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
{ {
WMcursor* cursor; WMcursor* cursor;
int clen, i; int clen, i;
...@@ -73,8 +72,12 @@ WMcursor *ph_CreateWMCursor(_THIS, ...@@ -73,8 +72,12 @@ WMcursor *ph_CreateWMCursor(_THIS,
memset(cursor,0,sizeof(WMcursor)); memset(cursor,0,sizeof(WMcursor));
cursor->ph_cursor = (PhCursorDef_t *) malloc(sizeof(PhCursorDef_t) + 32*4*2); cursor->ph_cursor = (PhCursorDef_t *) malloc(sizeof(PhCursorDef_t) + 32*4*2);
if (cursor->ph_cursor == NULL) if (cursor->ph_cursor == NULL)
printf("cursor malloc failed\n"); {
SDL_SetError("ph_CreateWMCursor(): cursor malloc failed !\n");
return NULL;
}
memset(cursor->ph_cursor,0,(sizeof(PhCursorDef_t) + 32*4*2)); memset(cursor->ph_cursor,0,(sizeof(PhCursorDef_t) + 32*4*2));
...@@ -137,7 +140,7 @@ int ph_ShowWMCursor(_THIS, WMcursor *cursor) ...@@ -137,7 +140,7 @@ int ph_ShowWMCursor(_THIS, WMcursor *cursor)
return (0); return (0);
} }
/* Set the photon cursor cursor, or blank if cursor is NULL */ /* Set the photon cursor, or blank if cursor is NULL */
if (cursor!=NULL) if (cursor!=NULL)
{ {
PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, 0); PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, 0);
...@@ -148,7 +151,7 @@ int ph_ShowWMCursor(_THIS, WMcursor *cursor) ...@@ -148,7 +151,7 @@ int ph_ShowWMCursor(_THIS, WMcursor *cursor)
} }
else /* Ph_CURSOR_NONE */ else /* Ph_CURSOR_NONE */
{ {
PtSetArg( &args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE, 0); PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE, 0);
nargs = 1; nargs = 1;
} }
......
This diff is collapsed.
...@@ -20,22 +20,23 @@ ...@@ -20,22 +20,23 @@
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_ph_video_h #ifndef __SDL_PH_VIDEO_H__
#define _SDL_ph_video_h #define __SDL_PH_VIDEO_H__
#include "SDL_mouse.h" #include "SDL_mouse.h"
#include "SDL_sysvideo.h" #include "SDL_sysvideo.h"
#include "Ph.h" #include <Ph.h>
#include "Pt.h" #include <Pt.h>
#include <photon/Pg.h> #include <photon/Pg.h>
#include <photon/PdDirect.h> #include <photon/PdDirect.h>
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
#include <photon/PdGL.h> #include <photon/PdGL.h>
#endif /* HAVE_OPENGL */ #endif /* HAVE_OPENGL */
/* Hidden "this" pointer for the video functions */ /* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this #define _THIS SDL_VideoDevice* this
#define PH_OGL_MAX_ATTRIBS 32 #define PH_OGL_MAX_ATTRIBS 32
...@@ -43,18 +44,23 @@ ...@@ -43,18 +44,23 @@
#define SDLPH_PAL_EMULATE 0x00000001L #define SDLPH_PAL_EMULATE 0x00000001L
#define SDLPH_PAL_SYSTEM 0x00000002L #define SDLPH_PAL_SYSTEM 0x00000002L
typedef union vidptr{ typedef struct
uint8_t* volatile ptr8; {
uint16_t* volatile ptr16;
uint32_t* volatile ptr32;
} VidPtr_t;
typedef struct {
unsigned char* Y; unsigned char* Y;
unsigned char* V; unsigned char* V;
unsigned char* U; unsigned char* U;
} FRAMEDATA; } FRAMEDATA;
/* Mask values for SDL_ReallocFormat() */
struct ColourMasks
{
Uint32 red;
Uint32 green;
Uint32 blue;
Uint32 alpha;
Uint32 bpp;
};
/* Private display data */ /* Private display data */
struct SDL_PrivateVideoData { struct SDL_PrivateVideoData {
PgDisplaySettings_t mode_settings; PgDisplaySettings_t mode_settings;
...@@ -69,8 +75,9 @@ struct SDL_PrivateVideoData { ...@@ -69,8 +75,9 @@ struct SDL_PrivateVideoData {
struct { struct {
PdDirectContext_t* direct_context; PdDirectContext_t* direct_context;
PdOffscreenContext_t* offscreen_context; PdOffscreenContext_t* offscreen_context;
PdOffscreenContext_t* offscreen_backcontext;
PhDrawContext_t* oldDC; PhDrawContext_t* oldDC;
VidPtr_t dc_ptr; uint8_t* dc_ptr;
unsigned char* CurrentFrameData; unsigned char* CurrentFrameData;
unsigned char* FrameData0; unsigned char* FrameData0;
unsigned char* FrameData1; unsigned char* FrameData1;
...@@ -85,13 +92,15 @@ struct SDL_PrivateVideoData { ...@@ -85,13 +92,15 @@ struct SDL_PrivateVideoData {
int mouse_relative; int mouse_relative;
WMcursor* BlankCursor; WMcursor* BlankCursor;
int depth; /* current visual depth (not bpp) */ int depth; /* current visual depth (not bpp) */
int desktopbpp; /* bpp of desktop at the moment of start */ int desktopbpp; /* bpp of desktop at the moment of start */
int desktoppal; /* palette mode emulation or system */ int desktoppal; /* palette mode emulation or system */
int currently_fullscreen; int currently_fullscreen;
int currently_hided; /* 1 - window hided (minimazed), 0 - normal */
PhEvent_t* event; PhEvent_t* event;
SDL_Overlay* overlay;
}; };
#define mode_settings (this->hidden->mode_settings) #define mode_settings (this->hidden->mode_settings)
...@@ -106,11 +115,13 @@ struct SDL_PrivateVideoData { ...@@ -106,11 +115,13 @@ struct SDL_PrivateVideoData {
#define desktoppal (this->hidden->desktoppal) #define desktoppal (this->hidden->desktoppal)
#define savedpal (this->hidden->savedpal) #define savedpal (this->hidden->savedpal)
#define syspalph (this->hidden->syspalph) #define syspalph (this->hidden->syspalph)
#define currently_fullscreen (this->hidden->currently_fullscreen)
#define currently_hided (this->hidden->currently_hided)
#define event (this->hidden->event)
#define current_overlay (this->hidden->overlay)
/* Old variable names */ /* Old variable names */
#define mouse_relative (this->hidden->mouse_relative) #define mouse_relative (this->hidden->mouse_relative)
#define currently_fullscreen (this->hidden->currently_fullscreen)
#define event (this->hidden->event)
#define SDL_BlankCursor (this->hidden->BlankCursor) #define SDL_BlankCursor (this->hidden->BlankCursor)
#endif /* _SDL_x11video_h */ #endif /* __SDL_PH_VIDEO_H__ */
...@@ -75,8 +75,9 @@ int ph_IconifyWindow(_THIS) ...@@ -75,8 +75,9 @@ int ph_IconifyWindow(_THIS)
memset( &windowevent, 0, sizeof (event) ); memset( &windowevent, 0, sizeof (event) );
windowevent.event_f = Ph_WM_HIDE; windowevent.event_f = Ph_WM_HIDE;
windowevent.event_state = Ph_WM_EVSTATE_HIDE; windowevent.event_state = Ph_WM_EVSTATE_HIDE;
windowevent.rid = PtWidgetRid( window ); windowevent.rid = PtWidgetRid(window);
PtForwardWindowEvent( &windowevent ); PtForwardWindowEvent(&windowevent);
SDL_Unlock_EventThread(); SDL_Unlock_EventThread();
return 0; return 0;
......
This diff is collapsed.
...@@ -25,13 +25,37 @@ static char rcsid = ...@@ -25,13 +25,37 @@ static char rcsid =
"@(#) $Id$"; "@(#) $Id$";
#endif #endif
/* This is the XFree86 Xv extension implementation of YUV video overlays */ /* This is the photon implementation of YUV video overlays */
#include "SDL_video.h" #include "SDL_video.h"
#include "SDL_ph_video.h" #include "SDL_ph_video.h"
extern SDL_Overlay *ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); struct private_yuvhwdata
extern int ph_LockYUVOverlay(_THIS, SDL_Overlay *overlay); {
extern void ph_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay); FRAMEDATA* CurrentFrameData;
extern int ph_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect); FRAMEDATA* FrameData0;
extern void ph_FreeYUVOverlay(_THIS, SDL_Overlay *overlay); FRAMEDATA* FrameData1;
PgScalerProps_t props;
PgScalerCaps_t caps;
PgVideoChannel_t* channel;
PhArea_t CurrentViewPort;
PhPoint_t CurrentWindowPos;
long format;
int scaler_on;
int current;
long YStride;
long VStride;
long UStride;
int ischromakey;
long chromakey;
int forcedredraw;
unsigned long State;
long flags;
int locked;
};
extern SDL_Overlay* ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display);
extern int ph_LockYUVOverlay(_THIS, SDL_Overlay* overlay);
extern void ph_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay);
extern int ph_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* dstrect);
extern void ph_FreeYUVOverlay(_THIS, SDL_Overlay* overlay);
...@@ -54,10 +54,6 @@ int LoadSprite(SDL_Surface *screen, char *file) ...@@ -54,10 +54,6 @@ int LoadSprite(SDL_Surface *screen, char *file)
void MoveSprites(SDL_Surface *screen, Uint32 background) void MoveSprites(SDL_Surface *screen, Uint32 background)
{ {
#if DEBUG_FLIP
static int t = 0;
#endif
int i, nupdates; int i, nupdates;
SDL_Rect area, *position, *velocity; SDL_Rect area, *position, *velocity;
...@@ -90,15 +86,19 @@ void MoveSprites(SDL_Surface *screen, Uint32 background) ...@@ -90,15 +86,19 @@ void MoveSprites(SDL_Surface *screen, Uint32 background)
#if DEBUG_FLIP #if DEBUG_FLIP
{ {
Uint32 color = SDL_MapRGB (screen->format, 255, 0, 0); if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
SDL_Rect r; static int t = 0;
r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20);
r.y = 0; Uint32 color = SDL_MapRGB (screen->format, 255, 0, 0);
r.w = 20; SDL_Rect r;
r.h = screen->h; r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20);
r.y = 0;
r.w = 20;
r.h = screen->h;
SDL_FillRect (screen, &r, color); SDL_FillRect (screen, &r, color);
t+=2; t+=2;
}
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment