增加RenderDevice定义
This commit is contained in:
parent
eae5729a6d
commit
d8bc6d3ee8
@ -1,3 +1,3 @@
|
||||
add_executable(NullWindow main.cpp)
|
||||
|
||||
target_link_libraries(NullWindow PRIVATE MathGeoLib)
|
||||
target_link_libraries(NullWindow PRIVATE MathGeoLib glfw GL)
|
||||
|
@ -1,7 +1,38 @@
|
||||
#include<iostream>
|
||||
#include<GLFW/glfw3.h>
|
||||
|
||||
int main(int,char **)
|
||||
int main(void)
|
||||
{
|
||||
std::cout<<"hello,world!"<<std::endl;
|
||||
GLFWwindow* window;
|
||||
|
||||
/* Initialize the library */
|
||||
if (!glfwInit())
|
||||
return -1;
|
||||
|
||||
/* Create a windowed mode window and its OpenGL context */
|
||||
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
|
||||
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Make the window's context current */
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
/* Loop until the user closes the window */
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
/* Render here */
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* Swap front and back buffers */
|
||||
glfwSwapBuffers(window);
|
||||
|
||||
/* Poll for and process events */
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
||||
|
29
inc/hgl/render/device/RenderDevice.h
Normal file
29
inc/hgl/render/device/RenderDevice.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef HGL_RENDER_DEVICE_INCLUDE
|
||||
#define HGL_RENDER_DEVICE_INCLUDE
|
||||
|
||||
#include<hgl/type/_Object.h>
|
||||
#include<hgl/type/BaseString.h?
|
||||
namespace hgl
|
||||
{
|
||||
/**
|
||||
* 渲染设备基础类<br/>
|
||||
* 该类是程序与操作系统或其它系统库的访问交接模块
|
||||
*/
|
||||
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
|
1
src/RenderDevice/GLFW/RenderDeviceGLFW.cpp
Normal file
1
src/RenderDevice/GLFW/RenderDeviceGLFW.cpp
Normal file
@ -0,0 +1 @@
|
||||
|
Loading…
x
Reference in New Issue
Block a user