Documentation de la bibliothèque MLV-3.1.0

MLV_mouse.h
Aller à la documentation de ce fichier.
1/*
2 * This file is part of the MLV Library.
3 *
4 * Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
5 *
6 *
7 * This Library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This Library 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. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this Library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
32#ifndef __MLV__MLV_MOUSE_H__
33#define __MLV__MLV_MOUSE_H__
34
35#ifndef MEMORY_DEBUG
36#include <SDL/SDL.h>
37#else
38#include "memory_debug.h"
39#endif
40
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
51typedef enum{
52 MLV_BUTTON_LEFT = SDL_BUTTON_LEFT,
53 MLV_BUTTON_MIDDLE = SDL_BUTTON_MIDDLE,
54 MLV_BUTTON_RIGHT = SDL_BUTTON_RIGHT
56
68void MLV_wait_mouse(int *x, int *y);
69
79
87
95void MLV_get_mouse_position( int* x, int* y );
96
105
106#ifdef __cplusplus
107}
108#endif
109
110#endif
MLV_Button_state
Énumère les différents états possibles d'un bouton.
Definition MLV_device_with_buttons.h:43
Ce fichier définit des énumérations et des prototypes de fonctions pour manipuler des boutons de diff...
void MLV_wait_mouse(int *x, int *y)
Suspend l'exécution jusqu'à ce que l'utilisateur clique sur le bouton gauche de la souris.
MLV_Mouse_button
Énumère les différents bouttons de la souris.
Definition MLV_mouse.h:51
@ MLV_BUTTON_MIDDLE
Definition MLV_mouse.h:53
@ MLV_BUTTON_RIGHT
Definition MLV_mouse.h:54
@ MLV_BUTTON_LEFT
Definition MLV_mouse.h:52
MLV_Mouse_button MLV_convert_string_to_mouse_button(const char *button_string)
Convertit une chaîne de caractères en un code bouton.
const char * MLV_convert_mouse_button_to_string(MLV_Mouse_button button_code)
Convertit le code associé à un boutton de la souris (MLV_Mouse_button) en chaîne de caratères.
void MLV_get_mouse_position(int *x, int *y)
Renvoie la position courante de la souris.
MLV_Button_state MLV_get_mouse_button_state(MLV_Mouse_button mouse_button)
Renvoie l'état (préssé ou relaché) d'un bouton de la souris.