Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <X11/Xlib.h>
- #include <stdlib.h>
- #include <stdio.h>
- using namespace std;
- int main(void)
- {
- Display* d = XOpenDisplay(NULL);
- Screen* s = DefaultScreenOfDisplay(d);
- int horizontal = s->height;
- int vertical = s->width;
- cout<<horizontal<<"x"<<vertical<<endl;
- }
- //g++ -g -o Test main.cpp -lX11
- //CMakeLists.txt
- /*cmake_minimum_required(VERSION 2.8.4)
- project(X11test)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- set(SOURCE_FILES main.cpp)
- include_directories(/usr/include/X11)
- add_executable(X11test ${SOURCE_FILES})
- target_link_libraries(X11test X11 )*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement