增加显示器尺寸输出

This commit is contained in:
hyzboy 2018-11-27 20:26:11 +08:00
parent b7248b3e97
commit 696b1f9e7d

View File

@ -1,5 +1,6 @@
#include<hgl/render/device/RenderDevice.h>
#include<iostream>
#include<math.h>
using namespace hgl;
@ -10,7 +11,9 @@ void put(const struct VideoMode *vm)
void put(const struct Display *disp)
{
std::cout<<"["<<disp->name.c_str()<<"]["<<disp->width<<"x"<<disp->height<<"]["<<disp->x<<","<<disp->y<<"]"<<std::endl;
const int inch=sqrt((disp->width*disp->width)+(disp->height*disp->height))*0.03937008;
std::cout<<"["<<disp->name.c_str()<<"]["<<disp->width<<"x"<<disp->height<<" mm,"<<inch<<" inch][offset "<<disp->x<<","<<disp->y<<"]"<<std::endl;
std::cout<<"\tcurrent video mode: ";
put(disp->GetCurVideoMode());