diff options
Diffstat (limited to 'stdlibsock')
-rw-r--r-- | stdlibsock/gfx/crtwin.c | 28 | ||||
-rw-r--r-- | stdlibsock/gfx/crtwin.cc | 21 | ||||
-rw-r--r-- | stdlibsock/gfx/destwin.c | 2 | ||||
-rw-r--r-- | stdlibsock/gfx/destwin.cc | 2 |
4 files changed, 23 insertions, 30 deletions
diff --git a/stdlibsock/gfx/crtwin.c b/stdlibsock/gfx/crtwin.c deleted file mode 100644 index 4ab2fcf..0000000 --- a/stdlibsock/gfx/crtwin.c +++ /dev/null @@ -1,28 +0,0 @@ -# include <luma/main.h> -# include <stdint.h> -# include <stdio.h> -# include <string.h> -# include <unistd.h> -# include <xcb/xcb.h> -# include <xcb/xcb_atom.h> -uint8_t luma__stdlibsock__gfx__crtwin(char * nm,uint16_t pos_x,uint16_t pos_y,uint16_t res_x,uint16_t res_y,bool flscrn) { - uint32_t retval = 0x0; - if(flscrn) { - printf("Fullscreen is not supported yet!\n"); - } - if(strncmp(luma__dat.dispsrv,"wayland",0x10)) { - - } - else if(strncmp(luma__dat.dispsrv,"x",0x10)) { - luma__initx(&retval); - luma__dat.xscrn = xcb_setup_roots_iterator(xcb_get_setup(luma__dat.xconn)).data; - luma__dat.xwin = xcb_generate_id(luma__dat.xconn); - xcb_create_window(luma__dat.xconn,XCB_COPY_FROM_PARENT,luma__dat.xwin,luma__dat.xscrn->root,pos_y,pos_x,res_x,res_y,0xa,XCB_WINDOW_CLASS_INPUT_OUTPUT,luma__dat.xscrn->root_visual,0x0,NULL); - xcb_change_property(luma__dat.xconn,XCB_PROP_MODE_REPLACE,luma__dat.xwin,XCB_ATOM_WM_NAME,XCB_ATOM_STRING,0x8,strlen(nm),nm); - xcb_map_window(luma__dat.xconn,luma__dat.xwin); - xcb_flush(luma__dat.xconn); - sleep(0x6); - xcb_disconnect(luma__dat.xconn); - } - return 0x0; -} diff --git a/stdlibsock/gfx/crtwin.cc b/stdlibsock/gfx/crtwin.cc new file mode 100644 index 0000000..82f8cdc --- /dev/null +++ b/stdlibsock/gfx/crtwin.cc @@ -0,0 +1,21 @@ +# include <cstdint> +# include <iostream> +# include <luma/main.hh> +# include <string> +# include <unistd.h> +# include <wayland-client.h> +uint8_t luma::stdlibsock::gfx::crtwin(std::basic_string<char>,uint16_t pos_x,uint16_t pos_y,uint16_t res_x,uint16_t res_y,bool flscrn) { + if(flscrn) { + std::cout << "Fullscreen is not supported yet!\n"; + } + luma::dat.wldisp = wl_display_connect(NULL); + if(luma::dat.wldisp == nullptr) { + std::cout << "Unable to make a Wayland connection!\n"; + } + else { + std::cout << "A Wayland connection has been made.\n"; + } + ::sleep(0x6); + ::wl_display_disconnect(luma::dat.wldisp); + return 0x0; +} diff --git a/stdlibsock/gfx/destwin.c b/stdlibsock/gfx/destwin.c deleted file mode 100644 index 4ccc013..0000000 --- a/stdlibsock/gfx/destwin.c +++ /dev/null @@ -1,2 +0,0 @@ -# include <luma/main.h> -void destwin(void); diff --git a/stdlibsock/gfx/destwin.cc b/stdlibsock/gfx/destwin.cc new file mode 100644 index 0000000..3280d55 --- /dev/null +++ b/stdlibsock/gfx/destwin.cc @@ -0,0 +1,2 @@ +# include <luma/main.hh> +void luma::stdlibsock::gfx::destwin(); |