载入中...
搜索中...
未找到
Window.cpp
浏览该文件的文档.
1#include "window/Window.h"
2
3#include <simplesquirrel/simplesquirrel.hpp>
4
5#include "window/sdl/Window.h"
6
7namespace eve {
8
9namespace window {
10
12
13void Window::expose(ssq::Table& table) {
14 auto cls = table.addClass(name, Window::create, false);
15 expose(cls);
16
17 auto settings = table.addClass("WindowSettings", ssq::Class::Ctor<WindowSettings()>());
18 settings.addVar("width", &WindowSettings::width);
19 settings.addVar("height", &WindowSettings::height);
20 settings.addVar("centered", &WindowSettings::centered);
21}
22
23void Window::expose(ssq::Class& cls) {
24 cls.addFunc("getName", &Window::getName);
25 cls.addFunc("setSize", &Window::setSize);
26 cls.addFunc("getWidth", &Window::getWidth);
27 cls.addFunc("getHeight", &Window::getHeight);
28
29 cls.addFunc("setWindowSettings", &Window::setWindowSettings);
30 cls.addFunc("getWindowSettings", &Window::getWindowSettings);
31 cls.addFunc("close", &Window::close);
32}
33
34} // namespace window
35} // namespace eve
HSQOBJECT cls
Definition ECS.cpp:21
#define Module_IMPL(ModuleName, newExpr)
Definition Module.h:24
const char * name
Definition RockMesh.cpp:21
virtual std::string getName() const =0
Platform window interface (SDL implementation on desktop/mobile). Script: win <- eve....
Definition Window.h:46
virtual int getWidth() const =0
virtual bool setWindowSettings(WindowSettings settings)=0
Applies a full WindowSettings struct (recreates the window when needed).
virtual void close()=0
Closes and destroys the underlying window.
virtual WindowSettings getWindowSettings()=0
virtual int getHeight() const =0
virtual void setSize(int width, int height)=0
Requests a new logical window size.
WidgetDesc window(std::string title, std::vector< WidgetDesc > children, std::string id)
Top-level window widget with a title bar.
Definition Widget.cpp:225
Definition Build.cpp:11
Display settings for window creation/resize. width/height == 0 selects the desktop display mode size.
Definition Window.h:17