整合GLEWCore

This commit is contained in:
2018-11-30 16:10:41 +08:00
parent 9c0c1edc62
commit d5450325ba
7 changed files with 39 additions and 15 deletions

View File

@@ -1,17 +1,24 @@
#include<hgl/render/RenderDevice.h>
#include<hgl/render/RenderWindow.h>
#include<iostream>
#include<GLFW/glfw3.h>
#include<GL/glext.h>
#include<GLEWCore/glew.h>
using namespace hgl;
constexpr GLfloat clear_color[4]=
{
77.f/255.f,
78.f/255.f,
83.f/255.f,
1.f
};
constexpr GLfloat clear_depth=1.0f;
void draw()
{
glClearColor(0,0,0,1); //设置清屏颜色
glClear(GL_COLOR_BUFFER_BIT); //清屏
glClearBufferfv(GL_COLOR,0,clear_color);
glClearBufferfv(GL_DEPTH,0,&clear_depth);
}
int main(void)
@@ -32,7 +39,7 @@ int main(void)
WindowSetup ws;
ws.Name=U8_TEXT("Direct OpenGL Render");
ws.Name=U8_TEXT("Direct use \"OpenGL Core API\" Render");
RenderSetup rs;

View File

@@ -2,8 +2,7 @@
#include<hgl/render/RenderWindow.h>
#include<iostream>
#include<string.h>
#include<GLFW/glfw3.h>
#include<GL/glcorearb.h>
#include<GLEWCore/glew.h>
using namespace hgl;
@@ -19,8 +18,6 @@ void output_ogl_info()
std::cout<<"Renderer: "<<glGetString(GL_RENDERER)<<std::endl;
std::cout<<"Version: "<<glGetString(GL_VERSION)<<std::endl;
PFNGLGETSTRINGIPROC glGetStringi = (PFNGLGETSTRINGIPROC)glfwGetProcAddress("glGetStringi");
if(!glGetStringi)
return;
@@ -77,5 +74,3 @@ int main(int argc,char **argv)
return 0;
}