Subversion Repositories eduke32

Rev

Rev 6018 | Rev 6827 | Go to most recent revision | 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_
4766 hendricks2 32
#ifdef __cplusplus
33
extern "C" {
5 Plagman 34
#endif
35
 
6018 terminx 36
#define LEFT_MOUSE      1
37
#define RIGHT_MOUSE     2
38
#define MIDDLE_MOUSE    4
39
#define THUMB_MOUSE     8
40
#define WHEELUP_MOUSE   16
41
#define WHEELDOWN_MOUSE 32
5 Plagman 42
 
6018 terminx 43
#define LEFT_MOUSE_PRESSED(button)      (((button)&LEFT_MOUSE) != 0)
44
#define RIGHT_MOUSE_PRESSED(button)     (((button)&RIGHT_MOUSE) != 0)
45
#define MIDDLE_MOUSE_PRESSED(button)    (((button)&MIDDLE_MOUSE) != 0)
46
 
47
#include "baselayer.h"
48
 
49
static inline int32_t Mouse_Init(void)
50
{
51
    initmouse();
52
    return ((inputdevices & 2) == 2);
53
}
54
 
55
 
56
static inline void MOUSE_Shutdown(void) { uninitmouse(); }
57
 
58
#if 0
59
static inline void MOUSE_ShowCursor(void) {}
60
static inline void MOUSE_HideCursor(void) {}
61
#endif
62
 
63
static inline int32_t MOUSE_GetButtons(void)
64
{
65
    int32_t buttons;
66
    readmousebstatus(&buttons);
67
    return buttons;
68
}
69
 
70
#define MOUSE_ClearButton(b) (mouseb &= ~b)
3199 terminx 71
#define MOUSE_ClearAllButtons() mouseb = 0
6018 terminx 72
#define MOUSE_GetDelta(x, y) readmousexy(x, y)
5 Plagman 73
 
4766 hendricks2 74
#ifdef __cplusplus
75
}
5 Plagman 76
#endif
77
#endif /* __mouse_h */