Basic4GL - Getting Started

Getting started

24-Apr-2016
Tom Mulgrew

For news and updates, visit http://www.basic4gl.net/

What is Basic4GL?RequirementsGetting startedBasic4GL video modesRunning programsProgram errorsWhere to now?

What is Basic4GL?

Basic4GL is a compiler and virtual machine that allows you to write and run programs written in the Basic4GL programming language, a language based on the traditional BASIC syntax, but updated for modern computers.

Basic4GL has builtin support for OpenGL 1.1. Version 1.1 is a bit less relevant now than in 2003 when Basic4GL was first released - in fact it's one of the versions they now refer to as "legacy" OpenGL - but you may find it useful for learning the fundamentals of 3D graphics programming without the setup hassle of creating your own pixel and vertex shaders etc.

Or you can ignore OpenGL entirely, and use Basic4GL's text, sprite, tile-map and sound libraries to create 2D graphics without writing any OpenGL commands at all.

Basic4GL is designed to be a safe, easy to learn programming environment, suitable for creating games and graphical programs, rapid prototyping, or just learning basic programming.

Requirements

Windows Vista, 7, 8.x or 10.
A 3D accellerated video card.

Getting started

Run Basic4GL.exe. If all goes well, the Basic4GL editor will come up, empty.

Open an existing Basic4GL program:

  1. Click "File" on the menu bar.
  2. Click "Open..." in the drop down menu.
  3. Double click a Basic4GL program, e.g. "CubePyramidDemo.gb"

To run the program, either:

  1. Select "Program|Run! / Stop!" from the main menu, OR
  2. Click the green "Go!" icon on the toolbar, OR
  3. Press F5

The program should run. Press the Escape key to halt it and return to the Basic4GL editor.

Basic4GL video modes

You can set the Basic4GL video modes by clicking "Settings|BASIC runtime settings...".
In the resulting dialog box you can specify how Basic4GL program output will be displayed.

The most significant choice is the "Fullscreen" checkbox.
In fullscreen mode, Basic4GL will switch your monitor to the resolution and colour depth you specify. The Basic4GL program will have control of the entire monitor screen until the program terminates, or you close it by pressing the Escape key.

When not in full screen, the Basic4GL output is displayed in another window.
The width and height that you specify are used as the size of the window, and will use the current colour depth of the desktop.

Running programs

This is fairly simple.

First you put a program into Basic4GL, by either loading one or typing one in. (Select "Program|Open..." to load a program. The demonstration programs are in the "Programs" subfolder.)

Then you run the program by selecting "Program|Run! / Stop!" from the menu or by clicking the green "Go!" icon, or pressing F5.

Program errors

If there's an error in the program, it won't run. Instead, Basic4GL will display the error on the status bar and place the cursor where the problem occurs.

You will need to correct the problem before Basic4GL can run the program.
This may involve obtaining the correct version of the program (if someone else wrote it), or correcting it yourself, or reloading the program (incase you might have accidentally typed something into the program.)

Where to now?

There are a number of resources for learning about the Basic4GL programming language:

These help files are accessible from the Basic4GL "Help" menu:

And of course there's the Basic4GL website, discussion forum, and now a Facebook group.