From 2d68ac7735a7089d98771054581b9657547545be Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 27 Nov 2018 21:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90null=20windows=E8=8C=83?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/NullWindow/main.cpp | 67 ++++++++++++----------------------- inc/hgl/render/RenderDevice.h | 22 ++++++------ 2 files changed, 34 insertions(+), 55 deletions(-) diff --git a/example/NullWindow/main.cpp b/example/NullWindow/main.cpp index eceb322b..e6f39628 100644 --- a/example/NullWindow/main.cpp +++ b/example/NullWindow/main.cpp @@ -1,34 +1,10 @@ #include +#include #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;iGetName(); + WindowSetup ws; - std::cout<<"RenderDevice: "<Create(1280,720,&ws,&rs); + + win->Show(); + + glClearColor(0,0,0,1); + + while(win->IsOpen()) + { + win->MakeToCurrent(); + + glClear(GL_COLOR_BUFFER_BIT); + + win->SwapBuffer(); + win->PollEvent(); } - List disp_list; - - device->GetDisplayList(disp_list); - - const int count=disp_list.GetCount(); - - std::cout<<"Device have "<