include/SDL_syswm.h
author Ryan C. Gordon <icculus@icculus.org>
Thu, 08 Sep 2005 06:16:14 +0000
changeset 1133 609c060fd2a2
parent 1035 974ba6ae0fa3
child 1312 c9b51268668f
permissions -rw-r--r--
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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
/*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     2
    SDL - Simple DirectMedia Layer
769
b8d311d90021 Updated copyright information for 2004 (Happy New Year!)
Sam Lantinga <slouken@libsdl.org>
parents: 630
diff changeset
     3
    Copyright (C) 1997-2004 Sam Lantinga
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     4
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     5
    This library is free software; you can redistribute it and/or
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     6
    modify it under the terms of the GNU Library General Public
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     7
    License as published by the Free Software Foundation; either
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     8
    version 2 of the License, or (at your option) any later version.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     9
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    10
    This library is distributed in the hope that it will be useful,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    13
    Library General Public License for more details.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    14
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    15
    You should have received a copy of the GNU Library General Public
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    16
    License along with this library; if not, write to the Free
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    18
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    19
    Sam Lantinga
251
b8688cfdc232 Updated the headers with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents: 94
diff changeset
    20
    slouken@libsdl.org
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    21
*/
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    22
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    23
#ifdef SAVE_RCSID
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    24
static char rcsid =
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    25
 "@(#) $Id$";
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    26
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    27
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    28
/* Include file for SDL custom system window manager hooks */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
#ifndef _SDL_syswm_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    31
#define _SDL_syswm_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    32
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    33
#include "SDL_version.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    34
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    35
#include "begin_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    36
/* Set up for C function definitions, even when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    37
#ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    38
extern "C" {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    39
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    40
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    41
/* Your application has access to a special type of event 'SDL_SYSWMEVENT',
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    42
   which contains window-manager specific information and arrives whenever
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    43
   an unhandled window event occurs.  This event is ignored by default, but
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    44
   you can enable it with SDL_EventState()
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    45
*/
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    46
#ifdef SDL_PROTOTYPES_ONLY
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    47
struct SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    48
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    49
#else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    50
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    51
#if defined(__APPLE__) && defined(__MACH__)
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    52
// conflicts with Quickdraw.h
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    53
#define Cursor X11Cursor
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    54
#endif
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    55
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    56
/* This is the structure for custom window manager events */
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    57
#if (defined(unix) || defined(__unix__) || defined(_AIX) || \
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    58
         defined(__OpenBSD__) || defined(__NetBSD__) || \
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    59
         (defined(__APPLE__) && defined(__MACH__))) && \
870
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
    60
    (!defined(DISABLE_X11) && !defined(__CYGWIN32__) && !defined(ENABLE_NANOX) && \
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    61
         !defined(__QNXNTO__))
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    62
 /* AIX is unix, of course, but the native compiler CSet doesn't define unix */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    63
#include <X11/Xlib.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    64
#include <X11/Xatom.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    65
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    66
#if defined(__APPLE__) && defined(__MACH__)
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    67
// matches the re-define above
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    68
#undef Cursor
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    69
#endif
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    70
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    71
/* These are the various supported subsystems under UNIX */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    72
typedef enum {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    73
	SDL_SYSWM_X11
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    74
} SDL_SYSWM_TYPE;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    75
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    76
/* The UNIX custom event structure */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    77
struct SDL_SysWMmsg {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    78
	SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    79
	SDL_SYSWM_TYPE subsystem;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    80
	union {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    81
	    XEvent xevent;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    82
	} event;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    83
};
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    84
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    85
/* The UNIX custom window manager information structure.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    86
   When this structure is returned, it holds information about which
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    87
   low level system it is using, and will be one of SDL_SYSWM_TYPE.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    88
 */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
    89
typedef struct SDL_SysWMinfo {
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    90
	SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    91
	SDL_SYSWM_TYPE subsystem;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    92
	union {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    93
	    struct {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    94
	    	Display *display;	/* The X11 display */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    95
	    	Window window;		/* The X11 display window */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    96
		/* These locking functions should be called around
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    97
                   any X11 functions using the display variable.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    98
                   They lock the event thread, so should not be
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    99
		   called around event functions or from event filters.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   100
		 */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   101
		void (*lock_func)(void);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   102
		void (*unlock_func)(void);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   103
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   104
		/* Introduced in SDL 1.0.2 */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   105
	    	Window fswindow;	/* The X11 fullscreen window */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   106
	    	Window wmwindow;	/* The X11 managed input window */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   107
	    } x11;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   108
	} info;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   109
} SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   110
30
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   111
#elif defined(ENABLE_NANOX)
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   112
#include <microwin/nano-X.h>
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   113
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   114
/* The generic custom event structure */
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   115
struct SDL_SysWMmsg {
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   116
	SDL_version version;
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   117
	int data;
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   118
};
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   119
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   120
/* The windows custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
   121
typedef struct SDL_SysWMinfo {
30
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   122
	SDL_version version ;
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   123
	GR_WINDOW_ID window ;	/* The display window */
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   124
} SDL_SysWMinfo;
57bf11a5efd7 Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents: 0
diff changeset
   125
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   126
#elif defined(WIN32)
438
f9c5f135a8b9 Added a way to get the Windows OpenGL context in SDL_syswm.h
Sam Lantinga <slouken@libsdl.org>
parents: 337
diff changeset
   127
#define WIN32_LEAN_AND_MEAN
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   128
#include <windows.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   129
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   130
/* The windows custom event structure */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   131
struct SDL_SysWMmsg {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   132
	SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   133
	HWND hwnd;			/* The window for the message */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   134
	UINT msg;			/* The type of message */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   135
	WPARAM wParam;			/* WORD message parameter */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   136
	LPARAM lParam;			/* LONG message parameter */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   137
};
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   138
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   139
/* The windows custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
   140
typedef struct SDL_SysWMinfo {
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   141
	SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   142
	HWND window;			/* The Win32 display window */
438
f9c5f135a8b9 Added a way to get the Windows OpenGL context in SDL_syswm.h
Sam Lantinga <slouken@libsdl.org>
parents: 337
diff changeset
   143
	HGLRC hglrc;			/* The OpenGL context, if any */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   144
} SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   145
630
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   146
#elif defined(__riscos__)
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   147
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   148
/* RISC OS custom event structure */
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   149
struct SDL_SysWMmsg {
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   150
	SDL_version version;
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   151
	int eventCode;		/* The window for the message */
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   152
	int pollBlock[64];
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   153
};
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   154
1035
974ba6ae0fa3 Date: Wed, 26 Jan 2005 13:37:09 GMT
Sam Lantinga <slouken@libsdl.org>
parents: 1026
diff changeset
   155
/* The RISC OS custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
   156
typedef struct SDL_SysWMinfo {
630
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   157
	SDL_version version;
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   158
	int wimpVersion;    /* Wimp version running under */
1035
974ba6ae0fa3 Date: Wed, 26 Jan 2005 13:37:09 GMT
Sam Lantinga <slouken@libsdl.org>
parents: 1026
diff changeset
   159
	int taskHandle;     /* The RISC OS task handle */
974ba6ae0fa3 Date: Wed, 26 Jan 2005 13:37:09 GMT
Sam Lantinga <slouken@libsdl.org>
parents: 1026
diff changeset
   160
	int window;		/* The RISC OS display window */
630
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   161
} SDL_SysWMinfo;
550bccdf04bd Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents: 471
diff changeset
   162
870
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   163
#elif defined(__QNXNTO__)
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   164
#include <sys/neutrino.h>
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   165
#include <Ph.h>
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   166
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   167
/* The QNX custom event structure */
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   168
struct SDL_SysWMmsg {
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   169
	SDL_version version;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   170
	int data;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   171
};
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   172
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   173
/* The QNX custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
   174
typedef struct SDL_SysWMinfo {
870
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   175
	SDL_version version;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   176
	int data;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   177
} SDL_SysWMinfo;
95f22f17e44a Date: Wed, 3 Mar 2004 12:44:21 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   178
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   179
#else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   180
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   181
/* The generic custom event structure */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   182
struct SDL_SysWMmsg {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   183
	SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   184
	int data;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   185
};
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   186
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   187
/* The generic custom window manager information structure */
911
04a403e4ccf5 Date: Mon, 3 May 2004 03:15:01 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 870
diff changeset
   188
typedef struct SDL_SysWMinfo {
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   189
	SDL_version version;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   190
	int data;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   191
} SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   192
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   193
#endif /* OS type */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   194
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   195
#endif /* SDL_PROTOTYPES_ONLY */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   196
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   197
/* Function prototypes */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   198
/*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   199
 * This function gives you custom hooks into the window manager information.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   200
 * It fills the structure pointed to by 'info' with custom information and
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   201
 * returns 1 if the function is implemented.  If it's not implemented, or
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   202
 * the version member of the 'info' structure is invalid, it returns 0. 
999
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
   203
 *
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
   204
 * You typically use this function like this:
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
   205
 * SDL_SysWMInfo info;
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
   206
 * SDL_VERSION(&info.version);
8be85fa59cf3 Added a usage example for SDL_GetWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 911
diff changeset
   207
 * if ( SDL_GetWMInfo(&info) ) { ... }
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   208
 */
337
9154ec9ca3d2 Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents: 297
diff changeset
   209
extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   210
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   211
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   212
/* Ends C function definitions when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   213
#ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   214
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   215
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   216
#include "close_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   217
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   218
#endif /* _SDL_syswm_h */