/* Filename: HelloWorld.cpp * * Author: Br. Isidore Minerd * * Date: July 16, 2009 * * Description: This GDK program simply displays several messages on the screen. * The user can press any key to end the program. */ #include "DarkGDK.h" void DarkGDK() { // Give the window a name in the title bar dbSetWindowTitle("Variations on \"Hello, World!\""); // Print at the current cursor location dbPrint("Hello, world!"); dbPrint("Hello, line 2!"); /* Print at a specific offset Note that the coordinates are (x,y) where the upper left corner is (0,0) with x increasing to the right and y increasing as you go downward. Therefore, a value of (50,150) is located 50 pixels to the right and 150 pixels downward. */ dbText(50,150,"Hello, world! -- lower"); // Draw a rectangle with upper left = (200,200) and lower right = (450,450) dbBox(200,200,450,450); /* For now, just rest assured that this is the way to set the color of the text using RGB values. The first being foreground, the second being background */ dbInk(dbRGB(0,0,0),dbRGB(255,255,255)); /* This outputs the given text with its center at the given point (325,325) is the hard-coded value for the center of the rectangle rendered above */ dbCenterText(325,325,"Hello, box!"); // Wait for input from the keyboard dbWaitKey(); }