Application << [Table of Contents] >> Events
uni.app.Window
Let's say we want an OpenGL window that updates as often as possible - just add a couple lines.
import uni.group.app; void main() { auto app = new Application; auto win = new OpenGLWindow("UniD OpenGL Window", 640, 480); while(app.interact) { if(win) win.paint(); } }
Any number of windows can be created, and in this example one OpenGL window is made. When creating a window, you can pass a title, width, height, x and y as arguments. In this case, we only pass the title, width and height which will place the window at a default or system-specified position. This also works for width and height. Instead of resting each loop, we are painting the window. We test to see if win is valid, because durring the course of execution (as you will see next) win may be deleted, and painting the window would not be possible. This program will paint the window as often as possible.
