src/joystick/emscripten/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.
icculus@9278
     1
/*
philipp@10064
     2
  Simple DirectMedia Layer
slouken@10737
     3
  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
icculus@9278
     4
philipp@10064
     5
  This software is provided 'as-is', without any express or implied
philipp@10064
     6
  warranty.  In no event will the authors be held liable for any damages
philipp@10064
     7
  arising from the use of this software.
icculus@9278
     8
philipp@10064
     9
  Permission is granted to anyone to use this software for any purpose,
philipp@10064
    10
  including commercial applications, and to alter it and redistribute it
philipp@10064
    11
  freely, subject to the following restrictions:
icculus@9278
    12
philipp@10064
    13
  1. The origin of this software must not be misrepresented; you must not
philipp@10064
    14
     claim that you wrote the original software. If you use this software
philipp@10064
    15
     in a product, an acknowledgment in the product documentation would be
philipp@10064
    16
     appreciated but is not required.
philipp@10064
    17
  2. Altered source versions must be plainly marked as such, and must not be
philipp@10064
    18
     misrepresented as being the original software.
philipp@10064
    19
  3. This notice may not be removed or altered from any source distribution.
philipp@10064
    20
*/
icculus@9278
    21
philipp@9343
    22
#include "../../SDL_internal.h"
icculus@9278
    23
icculus@9278
    24
#ifdef SDL_JOYSTICK_EMSCRIPTEN
icculus@9278
    25
#include "../SDL_sysjoystick.h"
icculus@9278
    26
icculus@9278
    27
icculus@9278
    28
#include <emscripten/html5.h>
icculus@9278
    29
icculus@9278
    30
/* A linked list of available joysticks */
icculus@9278
    31
typedef struct SDL_joylist_item
icculus@9278
    32
{
icculus@9278
    33
  int index;
icculus@9278
    34
  char *name;
icculus@9278
    35
  char *mapping;
icculus@9278
    36
  SDL_JoystickID device_instance;
icculus@9278
    37
  SDL_Joystick *joystick;
icculus@9278
    38
  int nbuttons;
icculus@9278
    39
  int naxes;
icculus@9278
    40
  double timestamp;
icculus@9278
    41
  double axis[64];
icculus@9278
    42
  double analogButton[64];
icculus@9278
    43
  EM_BOOL digitalButton[64];
icculus@9278
    44
icculus@9278
    45
  struct SDL_joylist_item *next;
icculus@9278
    46
} SDL_joylist_item;
icculus@9278
    47
icculus@9278
    48
typedef SDL_joylist_item joystick_hwdata;
icculus@9278
    49
icculus@9278
    50
#endif /* SDL_JOYSTICK_EMSCRIPTEN */
icculus@9278
    51
icculus@9278
    52
/* vi: set ts=4 sw=4 expandtab: */