diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 0b60fbf1..7912cc8d 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1 +1,2 @@ -add_subdirectory(NullWindow) +add_subdirectory(EnumRenderDevice) +add_subdirectory(NullWindow) diff --git a/example/EnumRenderDevice/CMakeLists.txt b/example/EnumRenderDevice/CMakeLists.txt new file mode 100644 index 00000000..14c7de37 --- /dev/null +++ b/example/EnumRenderDevice/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(EnumRenderDevice main.cpp) + +target_link_libraries(EnumRenderDevice PRIVATE MathGeoLib glfw GL ULRE.RenderDevice) diff --git a/example/EnumRenderDevice/main.cpp b/example/EnumRenderDevice/main.cpp new file mode 100644 index 00000000..936a68fe --- /dev/null +++ b/example/EnumRenderDevice/main.cpp @@ -0,0 +1,71 @@ +#include +#include +#include + +using namespace hgl; + +void put(const struct VideoMode *vm) +{ + std::cout<<"\t"<width<<"x"<height<<","<bit<<"bits,"<freq<<"hz"; +} + +void put(const struct Display *disp) +{ + const int inch=sqrt((disp->width*disp->width)+(disp->height*disp->height))*0.03937008; + + std::cout<<"["<name.c_str()<<"]["<width<<"x"<height<<" mm,"<x<<","<y<<"]"<GetCurVideoMode()); + std::cout< &vml=disp->GetVideoModeList(); + + for(int i=0;iInit()) + { + std::cerr<<"Init RenderDevice(GLFW) failed."<GetName(); + + std::cout<<"RenderDevice: "< disp_list; + + device->GetDisplayList(disp_list); + + const int count=disp_list.GetCount(); + + std::cout<<"Device have "<