Subversion Repositories eduke32

Rev

Rev 8776 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 Plagman 1
//-------------------------------------------------------------------------
2
/*
3
Copyright (C) 1996, 2003 - 3D Realms Entertainment
4
 
5
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
6
 
7
Duke Nukem 3D is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; either version 2
10
of the License, or (at your option) any later version.
11
 
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
 
16
See the GNU General Public License for more details.
17
 
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
4541 hendricks2 20
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
5 Plagman 21
 
22
Original Source: 1996 - Todd Replogle
23
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
2456 hendricks2 24
Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
5 Plagman 25
*/
26
//-------------------------------------------------------------------------
27
 
5662 terminx 28
#pragma once
29
 
4747 terminx 30
#ifndef mouse_h_
31
#define mouse_h_
8105 terminx 32
 
33
#include "baselayer.h"
34
 
4766 hendricks2 35
#ifdef __cplusplus
36
extern "C" {
5 Plagman 37
#endif
38
 
6018 terminx 39
#define LEFT_MOUSE      1
40
#define RIGHT_MOUSE     2
41
#define MIDDLE_MOUSE    4
42
#define THUMB_MOUSE     8
43
#define WHEELUP_MOUSE   16
44
#define WHEELDOWN_MOUSE 32
5 Plagman 45
 
6018 terminx 46
#define LEFT_MOUSE_PRESSED(button)      (((button)&LEFT_MOUSE) != 0)
47
#define RIGHT_MOUSE_PRESSED(button)     (((button)&RIGHT_MOUSE) != 0)
48
#define MIDDLE_MOUSE_PRESSED(button)    (((button)&MIDDLE_MOUSE) != 0)
49
 
8776 terminx 50
extern int32_t CONTROL_MouseAxesScale[2];
51
extern float   CONTROL_MouseSensitivity;
6018 terminx 52
 
8777 terminx 53
static inline bool MOUSE_Startup(void)
6018 terminx 54
{
6827 terminx 55
    mouseInit();
6018 terminx 56
    return ((inputdevices & 2) == 2);
57
}
58
 
6827 terminx 59
static inline void MOUSE_Shutdown(void) { mouseUninit(); }
7181 terminx 60
static inline int32_t MOUSE_GetButtons(void) { return mouseReadButtons(); }
61
static inline void MOUSE_ClearButton(int32_t b) { g_mouseBits &= ~b; }
62
static inline void MOUSE_ClearAllButtons(void) { g_mouseBits = 0; }
6018 terminx 63
 
4766 hendricks2 64
#ifdef __cplusplus
65
}
5 Plagman 66
#endif
67
#endif /* __mouse_h */