home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / vopengl / shapes / tglapp.cpp < prev    next >
C/C++ Source or Header  |  1998-06-21  |  3KB  |  103 lines

  1. //=======================================================================
  2. //@V@:Note: This file generated by vgen V1.00 (10:45:41 AM 12 Sep 1996).
  3. //    tglapp.cpp:    Source for testGLApp class
  4. //=======================================================================
  5.  
  6. #include "tglapp.h"        // Header file
  7.  
  8. //=========================>>> testGLApp::testGLApp <<<==========================
  9.   testGLApp::testGLApp(char* name, int sdi, int h, int w) : vApp(name, sdi, h, w)
  10.   {
  11.     // Constructor
  12.  
  13.    _testGLCmdWin = 0;
  14.   }
  15.  
  16. //=========================>>> testGLApp::testGLApp <<<==========================
  17.   testGLApp::~testGLApp()
  18.   {
  19.     // Desstructor
  20.   // if (_testGLCmdWin)
  21.     //    delete _testGLCmdWin;
  22.   }
  23.  
  24. //=====================>>> testGLApp::NewAppWin <<<==========================
  25.   vWindow* testGLApp::NewAppWin(vWindow* win, char* name,
  26.     int h, int w, vAppWinInfo* winInfo)
  27.   {
  28.     vAppWinInfo* awinfo = winInfo;
  29.     char *appname = name;
  30.  
  31.     if (!*name)
  32.       {
  33.      appname = "OpenGL Test";        // Default name
  34.       }
  35.     
  36.     UserDebug1(Build,"testGLApp::NewAppWin(%s)\n",appname);
  37.  
  38.     // Create the first window using provided CmdWindow
  39.  
  40.     _testGLCmdWin = (testGLCmdWindow*) win;
  41.     if (!_testGLCmdWin)
  42.       {
  43.     _testGLCmdWin = new testGLCmdWindow(appname,h, w);
  44.       }
  45.  
  46.     if (!awinfo)
  47.     awinfo = new vAppWinInfo(appname);
  48.  
  49.     return vApp::NewAppWin(_testGLCmdWin, appname, h, w, awinfo);
  50.   }
  51.  
  52. //============================>>> testGLApp::Exit <<<===========================
  53.   void testGLApp::Exit(void)
  54.   {
  55.     // This is called to close all windows.
  56.  
  57.     UserDebug(Build,"testGLApp::Exit()\n");
  58.  
  59.     vApp::Exit();        // Default behavior
  60.   }
  61.  
  62. //======================>>> testGLApp::CloseAppWin <<<===========================
  63.   int testGLApp::CloseAppWin(vWindow* win)
  64.   {
  65.     // This will be called BEFORE a window has been unregistered or
  66.     // closed.  Default behavior: unregister and close the window.
  67.  
  68.     UserDebug(Build,"testGLApp::CloseAppWin()\n");
  69.  
  70.     return vApp::CloseAppWin(win);
  71.   }
  72.  
  73. //=====================>>> testGLApp::AppCommand <<<==============================
  74.   void testGLApp::AppCommand(vWindow* win, ItemVal id, ItemVal val, CmdType cType)
  75.   {
  76.     // Commands not processed by the window will be passed here
  77.  
  78.     UserDebug1(Build,"testGLApp::AppCmd(ID: %d)\n",id);
  79.     vApp::AppCommand(win, id, val, cType);
  80.   }
  81.  
  82. //=========================>>> testGLApp::KeyIn <<<==============================
  83.   void testGLApp::KeyIn(vWindow* win, vKey key, unsigned int shift)
  84.   {
  85.     // Key strokes not processed by the window will be passed here
  86.  
  87.     vApp::KeyIn(win, key, shift);
  88.   }
  89.  
  90. //###########################################################################
  91.  
  92.   static testGLApp testGL_App("OpenGL SHAPES Test",1);    // The instance of the app
  93.  
  94. //============================>>> AppMain <<<==============================
  95.   int AppMain(int argc, char** argv)
  96.   {
  97.     // Use AppMain to create the main window
  98.  
  99.     (void) theApp->NewAppWin(0, "OpenGL SHAPES Test", 400, 400);
  100.  
  101.     return 0;
  102.   }
  103.