#include #include static void display(void); struct ExecBase *SysBase; struct Library *TinyGLBase; GLContext *__tglContext; #define __TEXTSECTION__ __attribute__((section(".text"))) /* __abox__ symbol is required or else the binary is loaded as PowerUP app. We use a nice trick here and call the main function __abox__.. saves 4 bytes.. ;-) */ int __abox__(void) { SysBase = *(struct ExecBase **) 4; TinyGLBase = OpenLibrary("tinygl.library", 50); if (TinyGLBase) { __tglContext = GLInit(); if (__tglContext) { glutInit(NULL,NULL);//&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowSize(640, 480); glutFullScreen(); glutCreateWindow(NULL); glClearColor(0.0f, 0.0f, 0.0f, 0.5f); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); gluPerspective(80, 640.0 / 480.0, 1.0, 5000.0); glMatrixMode(GL_MODELVIEW); glutDisplayFunc(display); glutMainLoop(); GLClose(__tglContext); } CloseLibrary(TinyGLBase); } return 0; } static void display(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glutSwapBuffers(); }