Files
EVEngine/src/modules/mouse/Mouse.cpp
T
sunxfancyandCursor 097cc3835b feat: add demo module and enhance asset synchronization for Android
- Introduced a new optional demo module that includes procedural sound effects and planet texture generation.
- Updated the build system to support the demo module with the `EVENGINE_BUILD_DEMO` option.
- Enhanced the Makefile to synchronize game assets into the APK during the build process.
- Modified the AndroidManifest to set the screen orientation to portrait for better compatibility.
- Improved documentation to reflect the new demo features and asset synchronization process.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 17:38:56 +08:00

31 lines
900 B
C++

#include "mouse/Mouse.h"
#include "mouse/sdl/Mouse.h"
#include <simplesquirrel/simplesquirrel.hpp>
#include <vector>
namespace eve::mouse {
Module_IMPL(Mouse, new sdl::Mouse());
Mouse::~Mouse() {}
void Mouse::expose(ssq::Table& table) {
auto cls = table.addClass(name, Mouse::create, false);
expose(cls);
}
void Mouse::expose(ssq::Class& cls) {
cls.addFunc("getName", &Mouse::getName);
// Bind as float: SSQ/Squirrel treat C++ double as userdata, which breaks script arith.
cls.addFunc("getX", [](Mouse *m) -> float { return m ? float(m->getX()) : 0.f; });
cls.addFunc("getY", [](Mouse *m) -> float { return m ? float(m->getY()) : 0.f; });
cls.addFunc("isDown", [](Mouse *m, int button) -> bool {
if (!m) return false;
return m->isDown(std::vector<int>{button});
});
cls.addFunc("isVisible", &Mouse::isVisible);
}
} // namespace eve::mouse