test/testnative.h
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 17 Aug 2016 21:04:50 +0200
changeset 10275 ba7dc3ebb81e
parent 9998 f67cf37e9cd4
permissions -rw-r--r--
Emscripten: Fixed opening previously closed joystick.
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