Starting Acron¶
Creating a New Acron Application¶
To start Acron, create a text file and save it with a .cxx extension. Any text editor will work. Enter the following text into your C++ file:
#include "acronFramework.h"
#include "acronSystem.h"
int main(int argc, char *argv[]) {
// Open a new window framework
AcronFramework framework;
framework.open_framework(argc, argv);
// Set the window title and open the window
framework.set_window_title("My Acron Window");
WindowFramework *window = framework.open_window();
// Here is room for your own code
// Do the main loop, equal to run() in python
framework.main_loop();
return 0;
}
For information about the Window Framework to open a window, click here.
acronFramework.h and acronSystem.h load most of the Acron modules.
The main_loop() subroutine contains the Acron main loop. It renders a
frame, handles the background tasks, and then repeats. It does not normally
return, so it needs to be called only once and must be the last line in your
script. In this particular example, there will be nothing to render, so you
should expect a window containing an empty grey area.
Running the Program¶
The steps required to build and run your program were already explained in a previous page.
If Acron has been installed properly, a gray window titled My Acron Window will appear when you run your program. There is nothing we can do with this window, but that will change shortly.