src/joystick/darwin/SDL_sysjoystick_c.h
author Sam Lantinga
Fri, 27 Jan 2017 21:23:27 -0800
changeset 10861 71d8f9afb690
parent 10737 3406a0f8b041
child 11811 5d94cb6b24d3
permissions -rw-r--r--
Fixed bug 3569 - GL_UpdateViewport leaves PROJECTION matrix selected

Tom Seddon

GL_ActivateRenderer may call GL_UpdateViewport, which leaves the GL_PROJECTION matrix selected. But after GL_ResetState, the GL_MODELVIEW matrix is selected, suggesting that's the intended default state.

It seems at least like these should be consistent. Presumably GL_UpdateViewport should be doing a glMatrixMode(GL_MODELVIEW) before it finishes.
slouken@2713
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@10737
     3
  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
slouken@2713
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@2713
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@2713
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@2713
    20
*/
icculus@8093
    21
#include "../../SDL_internal.h"
slouken@2713
    22
slouken@2713
    23
#ifndef SDL_JOYSTICK_IOKIT_H
slime73@9864
    24
#define SDL_JOYSTICK_IOKIT_H
slouken@2713
    25
slouken@2713
    26
#include <IOKit/hid/IOHIDLib.h>
slouken@2713
    27
slouken@2713
    28
struct recElement
slouken@2713
    29
{
icculus@8230
    30
    IOHIDElementRef elementRef;
icculus@8242
    31
    IOHIDElementCookie cookie;
icculus@8230
    32
    uint32_t usagePage, usage;      /* HID usage */
icculus@8230
    33
    SInt32 min;                   /* reported min value possible */
icculus@8230
    34
    SInt32 max;                   /* reported max value possible */
slouken@2713
    35
slouken@2713
    36
    /* runtime variables used for auto-calibration */
icculus@8230
    37
    SInt32 minReport;             /* min returned value */
icculus@8230
    38
    SInt32 maxReport;             /* max returned value */
slouken@2713
    39
slouken@2713
    40
    struct recElement *pNext;   /* next element in list */
slouken@2713
    41
};
slouken@2713
    42
typedef struct recElement recElement;
slouken@2713
    43
slouken@2713
    44
struct joystick_hwdata
slouken@2713
    45
{
icculus@8230
    46
    IOHIDDeviceRef deviceRef;   /* HIDManager device handle */
slouken@2713
    47
    io_service_t ffservice;     /* Interface for force feedback, 0 = no ff */
slouken@7191
    48
slouken@2713
    49
    char product[256];          /* name of product */
icculus@8230
    50
    uint32_t usage;                 /* usage page from IOUSBHID Parser.h which defines general usage */
icculus@8230
    51
    uint32_t usagePage;             /* usage within above page from IOUSBHID Parser.h which defines specific usage */
slouken@2713
    52
icculus@8230
    53
    int axes;                  /* number of axis (calculated, not reported by device) */
icculus@8230
    54
    int buttons;               /* number of buttons (calculated, not reported by device) */
icculus@8230
    55
    int hats;                  /* number of hat switches (calculated, not reported by device) */
icculus@8230
    56
    int elements;              /* number of total elements (should be total of above) (calculated, not reported by device) */
slouken@2713
    57
slouken@2713
    58
    recElement *firstAxis;
slouken@2713
    59
    recElement *firstButton;
slouken@2713
    60
    recElement *firstHat;
slouken@2713
    61
icculus@9433
    62
    SDL_bool removed;
slouken@7191
    63
slouken@7191
    64
    int instance_id;
slouken@7191
    65
    SDL_JoystickGUID guid;
slouken@2713
    66
slouken@2713
    67
    struct joystick_hwdata *pNext;      /* next device */
slouken@2713
    68
};
slouken@2713
    69
typedef struct joystick_hwdata recDevice;
slouken@2713
    70
slouken@10595
    71
#endif /* SDL_JOYSTICK_IOKIT_H */
slouken@2713
    72
slouken@10595
    73
/* vi: set ts=4 sw=4 expandtab: */