From d8bc6d3ee87ea106d2e9b951cc2ce1bbdfc325ad Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 27 Nov 2018 16:16:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0RenderDevice=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/NullWindow/CMakeLists.txt | 2 +- example/NullWindow/main.cpp | 37 ++++++++++++++++++++-- inc/hgl/render/device/RenderDevice.h | 29 +++++++++++++++++ src/RenderDevice/GLFW/RenderDeviceGLFW.cpp | 1 + 4 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 inc/hgl/render/device/RenderDevice.h create mode 100644 src/RenderDevice/GLFW/RenderDeviceGLFW.cpp diff --git a/example/NullWindow/CMakeLists.txt b/example/NullWindow/CMakeLists.txt index 1dc10f59..4555d751 100644 --- a/example/NullWindow/CMakeLists.txt +++ b/example/NullWindow/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(NullWindow main.cpp) -target_link_libraries(NullWindow PRIVATE MathGeoLib) +target_link_libraries(NullWindow PRIVATE MathGeoLib glfw GL) diff --git a/example/NullWindow/main.cpp b/example/NullWindow/main.cpp index 5b4229ab..17038080 100644 --- a/example/NullWindow/main.cpp +++ b/example/NullWindow/main.cpp @@ -1,7 +1,38 @@ -#include +#include -int main(int,char **) +int main(void) { - std::cout<<"hello,world!"< +#include + * 该类是程序与操作系统或其它系统库的访问交接模块 + */ + class RenderDevice:public _Object + { + public: + + RenderDevice()=default; + virtual ~RenderDevice()=default; + + public: + + virtual UTF8String ToDebugString() override ///<输出调试用字符串 + { + return UTF8String(U8_TEXT("RenderDevice(),this is BUG,please override this Function.")); + } + };//class RenderDevice + + RenderDevice *CreateRenderDeviceGLFW(); ///<创建一个基于GLFW的渲染设备 +}//namespace hgl +#endif//HGL_RENDER_DEVICE_INCLUDE diff --git a/src/RenderDevice/GLFW/RenderDeviceGLFW.cpp b/src/RenderDevice/GLFW/RenderDeviceGLFW.cpp new file mode 100644 index 00000000..e02abfc9 --- /dev/null +++ b/src/RenderDevice/GLFW/RenderDeviceGLFW.cpp @@ -0,0 +1 @@ +