This example just create a window and clear a canvas with color. Tools: VS2015, GLFW, OpenGL, C++. All libraries are included in the project. You can just download and run it. But you need to set your Visual Studio version in the project settings, Platform Toolset, see the screenshot below:
Visual Studio Project: EmptyWindow_GlfwOpenGL31Cpp.zip
main.cpp
#include <glad/glad.h>
#include <GLFW/glfw3.h>
// Create a window with GLFW library
int main()
{
// Initialization
glfwInit(); // Initialize the GLFW library
// Create a window
GLFWwindow *window = glfwCreateWindow(256, 256, "Empty Window", nullptr, nullptr);
glfwMakeContextCurrent(window); // Create OpenGL context for drawing
gladLoadGL(); // Initialize the GLAD library
glClearColor(0.2f, 0.3f, 0.3f, 1.0f); // Set a color for clearing a canvas
// Main Loop of Application
// Should the window be closed?
while (!glfwWindowShouldClose(window))
{
// Check if any events have been activated
// (key pressed, mouse moved etc.) and call
// corresponding response functions
glfwPollEvents();
glClear(GL_COLOR_BUFFER_BIT); // Clear canvas with previously specified color
glfwSwapBuffers(window); // Swap the front and back buffers when rendering
}
// Clean up resources
// Clean up GLFW Library Resources
glfwTerminate();
return 0;
}
DRAKON-flowchart Sandbox
If you do not know what is DRAKON-flowchart, you can watch this short video that I found in Youtube:
Really cool, thanks for sharing. I'll look into DRAKON-flowchart to play around in it.