test/testnative.h
author Ryan C. Gordon <icculus@icculus.org>
Fri, 12 Aug 2016 19:59:00 -0400
changeset 10266 c09f06c4e8c8
parent 9998 f67cf37e9cd4
permissions -rw-r--r--
emscripten: send fake mouse events for touches, like other targets do. (This really should be handled at the higher level and not in the individual targets, but this fixes the immediate bug.)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
     1
/*
9998
f67cf37e9cd4 Updated copyright to 2016
Sam Lantinga <slouken@libsdl.org>
parents: 9619
diff changeset
     2
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
     3
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
     4
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
     5
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
     6
  arising from the use of this software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
     7
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
     8
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
     9
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
    10
  freely.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
    11
*/
3059
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    13
/* Definitions for platform dependent windowing functions to test SDL
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    14
   integration with native windows
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    15
*/
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    16
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    17
#include "SDL.h"
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    18
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    19
/* This header includes all the necessary system headers for native windows */
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
#include "SDL_syswm.h"
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
typedef struct
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
{
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
    const char *tag;
3061
94dd49f6b005 More of the same
Sam Lantinga <slouken@libsdl.org>
parents: 3059
diff changeset
    25
    void *(*CreateNativeWindow) (int w, int h);
94dd49f6b005 More of the same
Sam Lantinga <slouken@libsdl.org>
parents: 3059
diff changeset
    26
    void (*DestroyNativeWindow) (void *window);
3059
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
} NativeWindowFactory;
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 3061
diff changeset
    29
#ifdef SDL_VIDEO_DRIVER_WINDOWS
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 3061
diff changeset
    30
#define TEST_NATIVE_WINDOWS
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 3061
diff changeset
    31
extern NativeWindowFactory WindowsWindowFactory;
3059
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    32
#endif
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    34
#ifdef SDL_VIDEO_DRIVER_X11
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
#define TEST_NATIVE_X11
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
extern NativeWindowFactory X11WindowFactory;
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
#endif
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    38
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
#ifdef SDL_VIDEO_DRIVER_COCOA
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    40
/* Actually, we don't really do this, since it involves adding Objective C
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
   support to the build system, which is a little tricky.  You can uncomment
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    42
   it manually though and link testnativecocoa.m into the test application.
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
*/
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    44
#define TEST_NATIVE_COCOA
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    45
extern NativeWindowFactory CocoaWindowFactory;
79b061c4f316 Whoops, missed a file
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    46
#endif