MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / DirectWindow

Method DirectWindow

framework/platform/unix/direct_window.cpp:215–235  ·  view source on GitHub ↗

namespace

Source from the content-addressed store, hash-verified

213
214} // namespace
215DirectWindow::DirectWindow(Platform *platform, const Window::Properties &properties) :
216 Window(properties),
217 platform{platform}
218{
219 // Setup tty for reading keyboard from console
220 if ((tty_fd = open("/dev/tty", O_RDWR | O_NDELAY)) > 0)
221 {
222 tcgetattr(tty_fd, &termio_prev);
223 tcgetattr(tty_fd, &termio);
224 cfmakeraw(&termio);
225 termio.c_lflag |= ISIG;
226 termio.c_oflag |= OPOST | ONLCR;
227 termio.c_cc[VMIN] = 1;
228 termio.c_cc[VTIME] = 0;
229
230 if (tcsetattr(tty_fd, TCSANOW, &termio) == -1)
231 LOGW("Failed to set attribs for '/dev/tty'");
232 }
233
234 platform->set_focus(true);
235}
236
237DirectWindow::~DirectWindow()
238{

Callers

nothing calls this directly

Calls 1

set_focusMethod · 0.80

Tested by

no test coverage detected