Implement GetMouseCount() to query the number of mice on the system.legacy
| @@ -10,6 +10,7 @@ liblol_a_SOURCES = \ | |||||
| world.cpp world.h sample.cpp sample.h sampler.cpp sampler.h \ | world.cpp world.h sample.cpp sample.h sampler.cpp sampler.h \ | ||||
| text.cpp text.h emitter.cpp emitter.h numeric.h hash.cpp hash.h \ | text.cpp text.h emitter.cpp emitter.h numeric.h hash.cpp hash.h \ | ||||
| worldentity.cpp worldentity.h shader.cpp shader.h image.cpp image.h \ | worldentity.cpp worldentity.h shader.cpp shader.h image.cpp image.h \ | ||||
| platform.cpp platform.h \ | |||||
| \ | \ | ||||
| sdlapp.cpp sdlapp.h sdlinput.cpp sdlinput.h \ | sdlapp.cpp sdlapp.h sdlinput.cpp sdlinput.h \ | ||||
| \ | \ | ||||
| @@ -23,6 +23,7 @@ | |||||
| // Static classes | // Static classes | ||||
| #include "log.h" | #include "log.h" | ||||
| #include "platform.h" | |||||
| #include "video.h" | #include "video.h" | ||||
| #include "audio.h" | #include "audio.h" | ||||
| #include "scene.h" | #include "scene.h" | ||||
| @@ -0,0 +1,36 @@ | |||||
| // | |||||
| // Lol Engine | |||||
| // | |||||
| // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net> | |||||
| // This program is free software; you can redistribute it and/or | |||||
| // modify it under the terms of the Do What The Fuck You Want To | |||||
| // Public License, Version 2, as published by Sam Hocevar. See | |||||
| // http://sam.zoy.org/projects/COPYING.WTFPL for more details. | |||||
| // | |||||
| #if defined HAVE_CONFIG_H | |||||
| # include "config.h" | |||||
| #endif | |||||
| #include <cmath> | |||||
| #include "core.h" | |||||
| namespace lol | |||||
| { | |||||
| /* | |||||
| * Public Platform class | |||||
| */ | |||||
| int Platform::GetMouseCount() | |||||
| { | |||||
| #if defined ANDROID_NDK | |||||
| /* Assume Android devices are touch devices that don't have a mouse */ | |||||
| return 0; | |||||
| #endif | |||||
| return 1; | |||||
| } | |||||
| } /* namespace lol */ | |||||
| @@ -0,0 +1,34 @@ | |||||
| // | |||||
| // Lol Engine | |||||
| // | |||||
| // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net> | |||||
| // This program is free software; you can redistribute it and/or | |||||
| // modify it under the terms of the Do What The Fuck You Want To | |||||
| // Public License, Version 2, as published by Sam Hocevar. See | |||||
| // http://sam.zoy.org/projects/COPYING.WTFPL for more details. | |||||
| // | |||||
| // | |||||
| // The Platform interface | |||||
| // ---------------------- | |||||
| // Helper functions to set up the platform. | |||||
| // | |||||
| #if !defined __LOL_PLATFORM_H__ | |||||
| #define __LOL_PLATFORM_H__ | |||||
| #include <stdint.h> | |||||
| namespace lol | |||||
| { | |||||
| class Platform | |||||
| { | |||||
| public: | |||||
| static int GetMouseCount(); | |||||
| }; | |||||
| } /* namespace lol */ | |||||
| #endif // __LOL_PLATFORM_H__ | |||||