Getting started with Antix Game Player

Home / Support / Tutorials / Getting Started / Getting started with Antix Game Player

Required tools and SDKs

Before you can target the Antix Game Player ("Antix") platform, you need to go through a registration procedure. Once you have been approved, you can download the Antix GDK. This SDK contains all headers and libraries, as well as the various tools needed to build applications. Run the GDK installer to install the contents of the SDK to its default location. To build for this platform, use gcc through the command line or use the EDGELIB Builder tool. We recommend using the EDGELIB Builder tool for building Antix applications. A tutorial on how to set up the EDGELIB Builder tool is available.

Creating a .cpp source code file

Create a new folder: C:\projects\helloworld which will contain all project files. Also create a new folder: C:\projects\helloworld\code to contain the source code. Create a new helloworld.cpp file and edit it with a text editor. Paste the following source code sample and save the source file:

helloworld.cpp (72 lines)
  1. /////////////////////////////////////////////////////////////////////
  2. // Code/helloworld.cpp
  3. // One of the EDGELIB tutorial samples for Antix
  4. //
  5. // Copyright (c) 2011-2017 Elements Interactive Mobile B.V.
  6. // http://www.edgelib.com
  7. //
  8. // Show "hello world" on the screen and exit by hitting a key
  9. /////////////////////////////////////////////////////////////////////
  10.  
  11. /////////////////////////////////////////////////////////////////////
  12. // Include and link the library                                    //
  13. /////////////////////////////////////////////////////////////////////
  14.  
  15. //Include EDGELIB
  16. #include "edgemain.h"
  17.  
  18. /////////////////////////////////////////////////////////////////////
  19. // Class definition                                                //
  20. /////////////////////////////////////////////////////////////////////
  21.  
  22. //The main class
  23. class ClassMain : public ClassEdge
  24. {
  25.     public:
  26.         ClassMain(void);
  27.         ~ClassMain(void);
  28.         ERESULT OnNextFrame(ClassEDisplay *display, unsigned long timedelta);
  29.         void OnButtonDown(unsigned long bnr, EBUTTONLIST *blist);
  30.         void OnStylusDown(POINT pnt);
  31. };
  32.  
  33.  
  34. /////////////////////////////////////////////////////////////////////
  35. // ClassMain: public                                               //
  36. /////////////////////////////////////////////////////////////////////
  37.  
  38. //ClassMain: constructor
  39. ClassMain::ClassMain(void)
  40. {
  41. }
  42.  
  43. //ClassMain: destructor
  44. ClassMain::~ClassMain(void)
  45. {
  46. }
  47.  
  48. //Callback: Called every frame
  49. ERESULT ClassMain::OnNextFrame(ClassEDisplay *display, unsigned long timedelta)
  50. {
  51.     display->buffer.DrawFont(0, 0, &display->fontinternal, "Hello World!");
  52.     return(E_OK);
  53. }
  54.  
  55. //Callback: Called when the user pressed a key or button
  56. void ClassMain::OnButtonDown(unsigned long bnr, EBUTTONLIST *blist)
  57. {
  58.     Quit();
  59. }
  60.  
  61. //Callback: Called when the user points the stylus down or clicks the left mouse button
  62. void ClassMain::OnStylusDown(POINT pnt)
  63. {
  64.     Quit();
  65. }
  66.  
  67.  
  68. /////////////////////////////////////////////////////////////////////
  69. // The program entry point                                         //
  70. /////////////////////////////////////////////////////////////////////
  71.  
  72. ClassEdge *EdgeMain(EDGESTARTUP *data){ return(new ClassMain); }

Set up an Antix EDGELIB Builder project

Open the EDGELIB Builder and select project -> new. Choose a location to save your project. Create a new folder and save it in c:\projects\helloworld\workspace_antix. Click once on "untitled" in the project tree to rename it to Hello World, the name of the project. Then add helloworld.cpp to the source files folder in the project tree. Right click on this folder and select "add files to folder". Browse to helloworld.cpp and open it to add it to the project tree. Save the project file, choose "Antix" as the target platform and click build -> rebuild all.

Signing builds

EDGELIB Builder can create signed Antix components. For this process to work, you will need to sign in to Antix and request a signing package. Put a copy of the downloaded file in tools/edgebuilder/resources/ under the name namestub_keys.zip. The corresponding password can be entered in tools/edgebuilder/platforms/antix.ini

Getting started tutorials

Latest forum posts