GLBasic
Encyclopedia
GLBasic is a commercial BASIC programming language, that can compile to various platforms, including Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

 as well as Handhelds like Apple iPhone
IPhone
The iPhone is a line of Internet and multimedia-enabled smartphones marketed by Apple Inc. The first iPhone was unveiled by Steve Jobs, then CEO of Apple, on January 9, 2007, and released on June 29, 2007...

, Apple iPad and iPod Touch
IPod Touch
The iPod Touch is a portable media player, personal digital assistant, handheld game console, and Wi-Fi mobile device designed and marketed by Apple Inc. The iPod Touch adds the multi-touch graphical user interface to the iPod line...

, HP WebOS devices like Palm Pre
Palm Pre
The Palm Pre is a multimedia smartphone designed and marketed by Palm with a multi-touch screen and a sliding keyboard. The smartphone was the first to use Palm's Linux based mobile operating system, webOS...

 and HP TouchPad
HP TouchPad
The HP TouchPad is a tablet computer which was developed and designed by Hewlett-Packard. The HP TouchPad was launched on July 1, 2011, in the United States; July 15 in Canada, United Kingdom, France, Germany; and August 15 in Australia....

. It also supports some geek devices like Pocket PC
Pocket PC
A Pocket PC is also known by Microsoft as a 'Windows Mobile Classic device'. It is a hardware specification for a handheld-sized computer, personal digital assistant , that runs the Microsoft 'Windows Mobile Classic' operating system...

, GP2X
GP2X
The GP2X is an open-source, Linux-based handheld video game console and portable media player developed by South Korean company GamePark Holdings. It was released on November 10, 2005, in South Korea only....

, GP2X Wiz
GP2X Wiz
The GP2X Wiz is an open-source, Linux-based handheld video game console and portable media player developed by South Korean company GamePark Holdings. It was released on May 12, 2009, and was also the first console from both Game Park and Game Park Holdings to be also released outside South Korea...

 as well as the Pandora Console. The language is designed to be simple and intuitive.

Overview

GLBasic started as an interpreted Language with 2D commands but now uses the GCC
GNU Compiler Collection
The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain...

 compiler for many different platforms to achieve fast, native code results. The GLBasic precompiler "GPC" converts the simple BASIC language into C++ code and compiles that later. Thus, the user can extend GLBasic using the INLINE command to mix C/C++ code directly with GLBasic source code. Due to this, GLBasic can easily access third-party dynamic libraries on all platforms.
The GLBasic SDK comes with an IDE, debugger and a graphics engine built on OpenGL (or OpenGL|ES) for the platforms Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

, iOS
IOS
iOS is an operating system for iPad, iPhone, iPod Touch, and Apple TV.IOS may also refer to:-Companies and organisations:* Illinois Ornithological Society, American state-based bird club...

 and WebOS. For handheld devices ( Windows Mobile
Windows Mobile
Windows Mobile is a mobile operating system developed by Microsoft that was used in smartphones and Pocket PCs, but by 2011 was rarely supplied on new phones. The last version is "Windows Mobile 6.5.5"; it is superseded by Windows Phone, which does not run Windows Mobile software.Windows Mobile is...

, GP2X
GP2X
The GP2X is an open-source, Linux-based handheld video game console and portable media player developed by South Korean company GamePark Holdings. It was released on November 10, 2005, in South Korea only....

 and GP2X Wiz
GP2X Wiz
The GP2X Wiz is an open-source, Linux-based handheld video game console and portable media player developed by South Korean company GamePark Holdings. It was released on May 12, 2009, and was also the first console from both Game Park and Game Park Holdings to be also released outside South Korea...

), GLBasic uses its own close-to-hardware routines for fast graphics.

To compile for the iPhone or iPad, you will need an iMac (on which to compile the generated code - to comply with Apple's requirements) and the latest version of XCode
Xcode
Xcode is a suite of tools, developed by Apple, for developing software for Mac OS X and iOS. Xcode 4.2, the latest major version, is available on the Mac App Store for free for Mac OS X 10.7 , and on the Apple Developer Connection website for free to registered developers Xcode is a suite of tools,...

, which is a free download from Apple.

To be able to actually run the program on an iPhone or iPad (GLBasic programs will not work on the emulator), you need to be a member of the iPhone Apple Developer Connection
Apple Developer Connection
Apple Developer, formerly Apple Developer Connection or ADC, is Apple Inc.'s developer network. It is designed to make available resources to help software developers write software for the Mac OS X and iOS platforms...

.

Since the release of the 8.054 beta, it became possible to compile for the Open Pandora machine as well. However, with the lack of Windows programming tools half of the compiling process is performed on Windows, and the other half on the actual machine. Since version 10, the IDE directly builds packages on Windows for the Pandora.

Version 8.230 and above can compile for the WebOS devices like the Palm Pre
Palm Pre
The Palm Pre is a multimedia smartphone designed and marketed by Palm with a multi-touch screen and a sliding keyboard. The smartphone was the first to use Palm's Linux based mobile operating system, webOS...

 without additional hardware or developer program membership requirements. Support for the HP TouchPad
HP TouchPad
The HP TouchPad is a tablet computer which was developed and designed by Hewlett-Packard. The HP TouchPad was launched on July 1, 2011, in the United States; July 15 in Canada, United Kingdom, France, Germany; and August 15 in Australia....

 was added in September 2011 via a web-update.

Version 10.057 added support to build application packages running on Android devices.

GLBasic comes with numerous examples.

App Store / Online Shop acceptance

iPhone created programs can be sold perfectly legitimately at the AppStore, with the review process might take up to two weeks.

Palm's WebOS App Catalog does accept GLBasic programs. The review process takes around 5 days.

Google's Android Market
Android Market
Android Market is an online software store developed by Google for Android OS devices. Its gateway is an application program called "Market", preinstalled on most Android devices, allows users to browse and download mobile apps published by third-party developers...

 accepts packages created with GLBasic. There's no review process delay so far.

GLBasic has a wrapper for the Intel AppUp Center SDK as well.

General

  • Programs are written in BASIC
  • String and numbers are automatically converted between types
  • Arrays can be fixed size or dynamic
  • Sound, graphics and data can be compressed into a single file
  • User can define their own types. Types within type and dynamic array
    Dynamic array
    In computer science, a dynamic array, growable array, resizable array, dynamic table, or array list is a random access, variable-size list data structure that allows elements to be added or removed...

    s are allowed
  • C code can be included by putting appropriate code between a starting and ending command, or can be included during compilation. In addition, for Windows, functions within DLLs can be called.
  • A few features are PC format only
  • Programs for the iOS
    IOS
    iOS is an operating system for iPad, iPhone, iPod Touch, and Apple TV.IOS may also refer to:-Companies and organisations:* Illinois Ornithological Society, American state-based bird club...

     can use OpenFeint

3D Features

  • The 3D engine is simple to use and maintains fast processing of objects
  • Objects can be animated
  • Works with most of the common 3D formats
  • Objects can have shadows
  • An Entity System is available as a free open source library package

2D Features

  • Sprites can be rotated and scaled, and take account of blending and teinting values
  • Lines, filled rectangles and other shapes can be drawn

Network Features

  • TCP/IP and UDP/IP sockets are available, as well as a higher-level library built atop the IP-sockets.

Compiler

  • The compiler is cross-platform. You do need an Intel Mac to compile the generated iPhone code though, as per Apple's legal requirements.

IDE

  • The editor is Windows only, but can run at a decent speed in most virtual machines. With WINE
    Wine
    Wine is an alcoholic beverage, made of fermented fruit juice, usually from grapes. The natural chemical balance of grapes lets them ferment without the addition of sugars, acids, enzymes, or other nutrients. Grape wine is produced by fermenting crushed grapes using various types of yeast. Yeast...

     though, you can only compile for windows. Crossover/Mac support is given since version 10
  • A third-party editor for the Mac is being worked on

GUI system

GLBasic comes with the source code to DDgui, an easy-to-use GUI system, allowing all supported platforms to have the same look at feel across all platforms.
For Windows, Linux and Mac GLBasic has ported a TCL/Tk wrapper that offers a native OS look.

Versions

GLBasic has gone through the following revisions :
  • Version 1.2 - The first version of GLBasic (also known as The DiNGS Game Basic sequel)
  • Version 2.4 - This introduced PocketPC support
  • Version 3.0 - (Codename: Behemoth) added TYPEs
  • Version 4.0 - Introduced the ability to interface with Window's DLLs and introduced compiling for the Xbox (if Linux is installed on it). It should also run on standard Linux, although there is no hardware acceleration, so programs run much slower.
  • Version 5.0 - Introduced compiling for the Apple Mac as a Universal application
  • Version 6.0 - Introduced integers into GLBasic for the first time. Previously variables could either be floating-point or strings
  • Version 7.0 - Introduced the ability to compile for Apple iPhone and iPod Touch devices.
  • Version 8.2 - Introduced the ability to compile for Palm Pre and Palm Pixi devices.
  • Version 10.057 - Introduced the ability to compile for Android
  • Version 10.109 - Added support for WebOS pads like the HP TouchPad

Sample code

Hello World
// this is a comment
// Print "Hello World" to the screen position 0,0 (top, left)
PRINT "Hello World", 0,0
// swap backbuffer and visible screen, prepare backbuffer for next rendering
SHOWSCREEN
// wait for a key to be pressed
KEYWAIT

Limited Object Oriented Scope

With Version 8, GLBasic added basic object oriented commands to the TYPE command. This allows structures to access itself (using the 'self' command) and to have functions within TYPEs

Simple OOP Test

TYPE Tvec
x;y;z
FUNCTION null:
self.x = 0; self.y=0; self.z=0
ENDFUNCTION

FUNCTION add: v AS Tvec
INC self.x, v.x
INC self.y, v.y
INC self.z, v.z
ENDFUNCTION
ENDTYPE

LOCAL vec AS Tvec, vec2 AS Tvec

vec.null
vec.x=50
vec2.x = 100
vec.add(vec2)

Version 8 also has the ability to encrypt (using 128-bit Blowfish
Blowfish
The blowfish, or Tetraodontidae, is a fish in the Tetraodontidae family.Blowfish may also refer to:* The Blowfish, a satirical newspaper at Brandeis University* Blowfish , encryption algorithm...

) and decrypt strings.

See also

  • SdlBasic
    SdlBasic
    SdlBasic is a multiplatform interpreter for BASIC, using the SDL libraries. Its interpreter core is based on wxBasic. The interpreter can be very useful for people who are familiar with ANSI-BASIC interpreters and are curious or needing SDL library features on their coding development.- History...

    , an interpreted BASIC for GP2X
  • Fenix Project
    Fenix Project
    Fenix Project is the codename for a GNU project to create a free compiler for a scripting language derived from the one created by Hammer Technologies for the game development suite, DIV Games Studio. However, several features have been added which make it incompatible with most games programmed...

    , an interpreted language intended to be easier to learn than C++
  • DarkBASIC Professional
    DarkBASIC Professional
    DarkBASIC Professional is a BASIC dialect targeted specifically at 2D and 3D game development. It is available from software company The Game Creators and is an offshoot of their original DarkBASIC programming language...

    , a Windows-only BASIC compiler

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK