

wxGLCanvas is the wxWidgets class that displays OpenGL graphics. We will add two new classes, called TriangleWindow and TriangleCanvas. If you have followed the steps above, you have a very simple program that simply displays an empty window. The code shown in this article can then be modified to use shaders. We will not be using shaders this article simply draws a white triangle on a black background. The Drawing polygons page shows how to draw a triangle and then colour the triangle using vertex shaders and fragment shaders. In the tutorials on that website, the Context creation page shows how to set up an OpenGL program using SFML, SDL, and GLFW. This article will follow along with the tutorials at open.gl. Once this is done, we have all of the parts needed to begin coding HelloTriangle. Installing re is discussed in Visual Studio, wxWidgets, and OpenGL. Alternatively, you could simply install GLEW on your system and use that.

HelloTriangle will be developed using Visual Studio 2017, wxWidgets, and OpenGL. I will develop HelloTriangle in this article. In OpenGL, about the simplest program you can write is HelloTriangle which displays a white triangle on a black background there is no text.

The articles Creating wxWidgets Programs with Visual Studio 2017 – Part 1 and Creating wxWidgets Programs with Visual Studio 2017 – Part 2 give an example using wxWidgets. When you graduate to using a windowing toolkit, the Hello World program displays a window with “Hello World!” in it. The first program that you typically write in any programming language is HelloWorld, where you simply print out the words: “Hello World!” to the console. In this article, I will use Visual Studio, the NuGet package re, and wxWidgets to create the OpenGL equivalent of a HelloWorld program. In a previous article, I wrote about the various toolkits and libraries that could be used to create an OpenGL application.
