3 * - By John Hodge (thePowersGang)
13 #include <acess/sys.h>
14 #include <acess/devices/pty.h>
19 CVideo::CVideo(const CConfigVideo& config):
23 if( _SysIOCtl(m_fd, DRV_IOCTL_TYPE, NULL) != DRV_TYPE_TERMINAL )
24 throw AxWin::InitFailure("stdin isn't a terminal");
26 if( _SysIOCtl(m_fd, PTY_IOCTL_GETDIMS, &dims) == -1 )
27 throw AxWin::InitFailure("Failed to get dimensions from stdin");
30 if( m_width == 0 || m_height == 0 )
31 throw AxWin::InitFailure("Terminal not capable of graphics");
35 void CVideo::BlitLine(const uint32_t* src, unsigned int dst_y, unsigned int dst_x, unsigned int width)
37 //_SysWriteAt(m_fd, (dst_y * m_width + dst_x) * 4, width * 4, src);
38 _SysSeek(m_fd, (dst_y * m_width + dst_x) * 4, SEEK_SET);
39 _SysWrite(m_fd, src, width * 4);