更新windows支持,现vs2017已可编译通过
This commit is contained in:
parent
4fb13ced34
commit
623ca91c55
@ -14,6 +14,15 @@ check_system_version()
|
|||||||
set_compiler_param()
|
set_compiler_param()
|
||||||
set_output_directory()
|
set_output_directory()
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
add_subdirectory(3rdpty/glfw)
|
||||||
|
include_directories(3rdpty/glfw/include)
|
||||||
|
|
||||||
|
SET(OPENGL_LIB opengl32)
|
||||||
|
ELSE()
|
||||||
|
SET(OPENGL_LIB GL)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
include_directories(3rdpty/MathGeoLib/src)
|
include_directories(3rdpty/MathGeoLib/src)
|
||||||
include_directories(3rdpty/GLEWCore/inc)
|
include_directories(3rdpty/GLEWCore/inc)
|
||||||
include_directories(inc)
|
include_directories(inc)
|
||||||
@ -27,6 +36,6 @@ SET(ULRE ULRE.RenderDevice
|
|||||||
MathGeoLib
|
MathGeoLib
|
||||||
GLEWCore
|
GLEWCore
|
||||||
glfw
|
glfw
|
||||||
GL)
|
${OPENGL_LIB})
|
||||||
|
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
|
@ -111,7 +111,7 @@ int main(void)
|
|||||||
|
|
||||||
RenderSetup rs;
|
RenderSetup rs;
|
||||||
|
|
||||||
RenderWindow *win=device->CreateWindow(screen_width,screen_height,&ws,&rs);
|
RenderWindow *win=device->Create(screen_width,screen_height,&ws,&rs);
|
||||||
|
|
||||||
win->MakeToCurrent(); //切换当前窗口到前台
|
win->MakeToCurrent(); //切换当前窗口到前台
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ int main(void)
|
|||||||
|
|
||||||
RenderSetup rs;
|
RenderSetup rs;
|
||||||
|
|
||||||
RenderWindow *win=device->CreateWindow(1280,720,&ws,&rs);
|
RenderWindow *win=device->Create(1280,720,&ws,&rs);
|
||||||
|
|
||||||
win->Show();
|
win->Show();
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ int main(int argc,char **argv)
|
|||||||
else
|
else
|
||||||
rs.opengl.core=false;
|
rs.opengl.core=false;
|
||||||
|
|
||||||
RenderWindow *win=device->CreateWindow(1280,720,&ws,&rs);
|
RenderWindow *win=device->Create(1280,720,&ws,&rs);
|
||||||
|
|
||||||
win->MakeToCurrent(); //切换当前窗口到前台
|
win->MakeToCurrent(); //切换当前窗口到前台
|
||||||
|
|
||||||
|
@ -127,8 +127,8 @@ namespace hgl
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual RenderWindow *CreateWindow(int,int,const WindowSetup *,const RenderSetup *)=0; ///<创建一个窗口渲染设备
|
virtual RenderWindow *Create(int,int,const WindowSetup *,const RenderSetup *)=0; ///<创建一个窗口渲染设备
|
||||||
virtual RenderWindow *CreateFullscreen(const Display *,const VideoMode *,const RenderSetup *)=0; ///<创建一个全屏渲染设备
|
virtual RenderWindow *Create(const Display *,const VideoMode *,const RenderSetup *)=0; ///<创建一个全屏渲染设备
|
||||||
};//class RenderDevice
|
};//class RenderDevice
|
||||||
|
|
||||||
RenderDevice *CreateRenderDeviceGLFW(); ///<创建一个基于GLFW的渲染设备
|
RenderDevice *CreateRenderDeviceGLFW(); ///<创建一个基于GLFW的渲染设备
|
||||||
|
@ -12,7 +12,7 @@ namespace hgl
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
OSString caption;
|
UTF8String caption;
|
||||||
bool full_screen;
|
bool full_screen;
|
||||||
|
|
||||||
int width,height;
|
int width,height;
|
||||||
@ -34,8 +34,8 @@ namespace hgl
|
|||||||
virtual void Show()=0; ///<显示窗口
|
virtual void Show()=0; ///<显示窗口
|
||||||
virtual void Hide()=0; ///<隐藏窗口
|
virtual void Hide()=0; ///<隐藏窗口
|
||||||
|
|
||||||
virtual const OSString &GetCaption()const{return caption;}
|
virtual const UTF8String &GetCaption()const{return caption;}
|
||||||
virtual void SetCaption(const OSString &)=0;
|
virtual void SetCaption(const UTF8String &)=0;
|
||||||
|
|
||||||
public: //被实际操作系统接口层所调用的函数,在不了解的情况下请不要使用
|
public: //被实际操作系统接口层所调用的函数,在不了解的情况下请不要使用
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ namespace hgl
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
RenderWindow *CreateWindow(int width,int height,const WindowSetup *ws,const RenderSetup *rs) override
|
RenderWindow *Create(int width,int height,const WindowSetup *ws,const RenderSetup *rs) override
|
||||||
{
|
{
|
||||||
SetGLFWWindowHint(rs);
|
SetGLFWWindowHint(rs);
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ namespace hgl
|
|||||||
return(CreateRenderWindowGLFW(win,false));
|
return(CreateRenderWindowGLFW(win,false));
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderWindow *CreateFullscreen(const Display *disp,const VideoMode *vm,const RenderSetup *rs) override
|
RenderWindow *Create(const Display *disp,const VideoMode *vm,const RenderSetup *rs) override
|
||||||
{
|
{
|
||||||
SetGLFWWindowHint(rs);
|
SetGLFWWindowHint(rs);
|
||||||
|
|
||||||
|
@ -28,13 +28,9 @@ namespace hgl
|
|||||||
void Show()override{glfwShowWindow(glfw_win);}
|
void Show()override{glfwShowWindow(glfw_win);}
|
||||||
void Hide()override{glfwHideWindow(glfw_win);}
|
void Hide()override{glfwHideWindow(glfw_win);}
|
||||||
|
|
||||||
void SetCaption(const OSString &name) override
|
void SetCaption(const UTF8String &name) override
|
||||||
{
|
{
|
||||||
#if HGL_OS == HGL_OS_Windows
|
glfwSetWindowTitle(glfw_win,name.c_str());
|
||||||
glfwSetWindowTitle(glfw_win,to_u8(name));
|
|
||||||
#else
|
|
||||||
glfwSetWindowTitle(glfw_win,name);
|
|
||||||
#endif//
|
|
||||||
this->caption=name;
|
this->caption=name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user