Skip to content

Instantly share code, notes, and snippets.

@TheOpenDevProject
Created November 4, 2016 07:20
Show Gist options
  • Save TheOpenDevProject/0b5cc2b3b4a40fe2f78b9cec01f1a148 to your computer and use it in GitHub Desktop.
Save TheOpenDevProject/0b5cc2b3b4a40fe2f78b9cec01f1a148 to your computer and use it in GitHub Desktop.
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;
}
@TheOpenDevProject
Copy link
Author

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);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment