view src/video/Xext/extensions/Xv.h @ 1133:609c060fd2a2

The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails: To: SDL Developers <sdl@libsdl.org> From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se> Date: Mon, 30 May 2005 23:29:04 +0200 Subject: [SDL] Mac OS X Video Drivers [patch] I've updated/added the Carbon and X11 video drivers to the Mac OS X port of SDL 1.2 (the CVS version), and made the Cocoa driver and runtime *optional*. The default is still Cocoa, and the "Quartz" driver. But you can now also use "toolbox" for Carbon, and "x11" for running with Apple's (or other) X11 server: export SDL_VIDEODRIVER=x11 export SDL_VIDEO_GL_DRIVER=/usr/X11R6/lib/libGL.dylib It also checks if the frameworks are available, by a: #include <Carbon/Carbon.h> or #import <Cocoa/Cocoa.h> (this should make it configure on plain Darwin as well?) Here are the new configure targets: --enable-video-cocoa use Cocoa/Quartz video driver default=yes --enable-video-carbon use Carbon/QuickDraw video driver default=yes --enable-video-x11 use X11 video driver default=no ./configure --enable-video-cocoa --enable-video-carbon --enable-video-x11 \ --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib The Carbon version is just an updated version of the old SDL driver for Mac OS 9, and could probably be improved... (but it does work, including the Carbon version of SDLmain) If you disable cocoa, you can run with -framework Carbon only, and the C version of SDL_main.c. And if you disable carbon too, you can still use the X11 version which doesn't require SDLmain. I updated the DrawSprocket version, but did not include it. (no blitters or VRAM GWorlds etc. available on OS X anyway) Besides for Mac OS 9, I don't think there's any use for it ? And note that any performance on Mac OS X equals OpenGL anyway... You can get "fair" software SDL results on captured CG displays, but for decent frame rates you need to be using GL for rendering. Finally, here is the patch itself: http://www.algonet.se/~afb/SDL-12CVS-macvideo.patch --anders PS. It says "video", but as usual it applies to mouse/keyboard too. ------ To: A list for developers using the SDL library <sdl@libsdl.org> From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se> Date: Sun, 4 Sep 2005 10:02:15 +0200 Subject: [SDL] Updated Mac patch Updated the previous Mac patch to disable Carbon by default. Also "fixed" the SDL.spec again, so that it builds on Darwin. http://www.algonet.se/~afb/SDL-1.2.9-mac.patch Also applied fine to SDL12 CVS, when I tried it.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 08 Sep 2005 06:16:14 +0000
parents eadc0746dfaf
children 782fd950bd46
line wrap: on
line source

/***********************************************************
Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/
/* $XFree86: xc/include/extensions/Xv.h,v 1.5 1999/12/11 19:28:48 mvojkovi Exp $ */

#ifndef XV_H
#define XV_H
/*
** File: 
**
**   Xv.h --- Xv shared library and server header file
**
** Author: 
**
**   David Carver (Digital Workstation Engineering/Project Athena)
**
** Revisions:
**
**   05.15.91 Carver
**     - version 2.0 upgrade
**
**   01.24.91 Carver
**     - version 1.4 upgrade
**
*/

#include <X11/X.h>

#define XvName "XVideo"
#define XvVersion 2
#define XvRevision 2

/* Symbols */

typedef XID XvPortID;
typedef XID XvEncodingID;

#define XvNone 0

#define XvInput          0
#define XvOutput         1

#define XvInputMask      (1L<<XvInput)
#define XvOutputMask     (1L<<XvOutput)
#define XvVideoMask	 0x00000004
#define XvStillMask	 0x00000008
#define XvImageMask	 0x00000010

/* These two are not client viewable */
#define XvPixmapMask	 0x00010000
#define XvWindowMask	 0x00020000


#define XvGettable	0x01
#define XvSettable	0x02

#define XvRGB		0
#define XvYUV		1

#define XvPacked	0
#define XvPlanar	1

#define XvTopToBottom	0
#define XvBottomToTop	1


/* Events */

#define XvVideoNotify 0
#define XvPortNotify 1
#define XvNumEvents 2

/* Video Notify Reasons */

#define XvStarted 0
#define XvStopped 1
#define XvBusy 2
#define XvPreempted 3
#define XvHardError 4
#define XvLastReason 4

#define XvNumReasons (XvLastReason + 1)

#define XvStartedMask     (1L<<XvStarted)
#define XvStoppedMask     (1L<<XvStopped)
#define XvBusyMask        (1L<<XvBusy)
#define XvPreemptedMask   (1L<<XvPreempted)
#define XvHardErrorMask   (1L<<XvHardError)

#define XvAnyReasonMask   ((1L<<XvNumReasons) - 1)
#define XvNoReasonMask    0

/* Errors */

#define XvBadPort 0
#define XvBadEncoding 1
#define XvBadControl 2
#define XvNumErrors 3

/* Status */

#define XvBadExtension 1
#define XvAlreadyGrabbed 2
#define XvInvalidTime 3
#define XvBadReply 4
#define XvBadAlloc 5

#endif /* XV_H */