Created
November 4, 2016 07:20
-
-
Save TheOpenDevProject/0b5cc2b3b4a40fe2f78b9cec01f1a148 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char *argv[]) | |
{ | |
DisplayManager dm; | |
//TypeDef of GLFWwindow and a custom deletor to use a std::unique_ptr | |
safeGLFWWindow glWindowContext = dm.createDisplay(); | |
//Make the window context current to the GLFW framework | |
glfwMakeContextCurrent(glWindowContext.get()); | |
//Check if the native close window event has been fired | |
GLEngine gl; | |
std::vector<float> points = {0.0f,0.5f,0.5f, | |
-0.05,-0.5f,-0.5f, | |
0.0f,0.5f,0.5f}; | |
gl.runShaderPipeline(points); | |
while (!glfwWindowShouldClose(glWindowContext.get())) | |
{ | |
double time = glfwGetTime(); | |
glDrawArrays(GL_TRIANGLES,0,1); | |
glfwSwapBuffers(glWindowContext.get()); | |
glfwPollEvents(); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
void GLEngine::runVertexPipeline(std::vector verticies)
{
GLuint vbo;
glGenBuffers(1,&vbo);
glBindBuffer(GL_ARRAY_BUFFER,vbo);
glBufferData(GL_ARRAY_BUFFER,verticies.size(),verticies.data(),GL_STATIC_DRAW);
}