home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / exampleCode / opengl / GLR / glrduck / glrduck.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-11  |  3.2 KB  |  140 lines

  1.  
  2. //////////////////////////////////////////////////////////////////////
  3. // iglrduck.C
  4. //
  5. // This is a subclass of VkApp generated by RapidApp 
  6. // 
  7. // This class instantiates all window classes and serves as a
  8. // central focal point for application-wide data and services
  9. //
  10. //////////////////////////////////////////////////////////////////////
  11. #include "glrduck.h"
  12. #include "glrduckMainWindow.h"
  13.  
  14.  
  15. //---- Start editable code block: headers and declarations
  16.  
  17.  
  18. //---- End editable code block: headers and declarations
  19.  
  20.  
  21. // Describe how to parse command line arguments. Edit to add
  22. // arguments as demonstrated by the entry in comments. See the 
  23. // man page for XrmOptionDescRec for syntax and details
  24.  
  25. XrmOptionDescRec glrduck::cmdLineOptions[] = {
  26.  {
  27.  
  28.   //---- Start editable code block: option description
  29.  
  30.   //  "-flag", "*resourceName", XrmoptionNoArg, "TRUE",
  31.  
  32.   //---- End editable code block: option description
  33.  
  34.  },
  35. };
  36.  
  37.  
  38. // Describe any resources to be retrieved and used to initialize data
  39. // members. Edit to add arguments as demonstrated by the entry in comments. 
  40. // See the ViewKit Programmer's Guide for details
  41.  
  42. XtResource glrduck::_resources [] = {
  43.  {
  44.  
  45.   //---- Start editable code block: resource description
  46.  
  47.   //     "resourceName",
  48.   //     "resourceClass",
  49.   //     XmRBoolean,              // Example type
  50.   //     sizeof ( Boolean ),      // Example type size
  51.   //     XtOffset ( glrduck*, _dataMember ), // Example data member
  52.   //     XmRString,               // Type of default value 
  53.   //     (XtPointer) "FALSE",     // Example default value
  54.  
  55.   //---- End editable code block: resource description
  56.  
  57.  },
  58. };
  59.  
  60.  
  61. ///////////
  62. // glrduck constructor
  63. //
  64. // The constructor just parses command line options and initializes
  65. // data members from the resource data base. Add any other initialization
  66. // at the end.
  67.  
  68. glrduck::glrduck ( char *appClassName,
  69.                       int              *arg_c, 
  70.                       char            **arg_v,
  71.                       XrmOptionDescRec *optionList,
  72.                       int               sizeOfOptionList) : 
  73.         VkApp(appClassName, arg_c, arg_v, optionList, sizeOfOptionList)
  74. {
  75.     // Parse any command line arguments
  76.  
  77.     *arg_c = parseCommandLine(cmdLineOptions, XtNumber(cmdLineOptions));
  78.  
  79.     // Retrieve resources to initialize class data members
  80.  
  81.     getResources ( _resources, XtNumber(_resources) );
  82.  
  83.  
  84.     //---- Start editable code block:  constructor
  85.  
  86.  
  87.     //---- End editable code block:  constructor
  88.  
  89.  
  90. } // End glrduck constructor
  91.  
  92.  
  93.  
  94.  
  95. // glrduck destructor
  96.  
  97. glrduck::~glrduck()
  98. {
  99.  
  100.     //---- Start editable code block:  destructor
  101.  
  102.  
  103.     //---- End editable code block:  destructor
  104.  
  105.  
  106. } // End glrduck destructor
  107.  
  108.  
  109.  
  110.  
  111. ///////////
  112. // createWindows()
  113. //
  114. // The createWindows() member function instantiates the application's
  115. // top-level windows. This function is called from main()
  116.  
  117.  
  118. void glrduck::createWindows()
  119. {
  120.     _vkwindow = new glrduckMainWindow( "igrlduckwindow" );
  121.     _vkwindow->show();
  122.  
  123.  
  124.     //---- Start editable code block:  createWindows
  125.  
  126.  
  127.     //---- End editable code block:  createWindows
  128.  
  129.  
  130.  
  131. } // End glrduck::createWindows
  132.  
  133.  
  134. //---- Start editable code block: End of generated code
  135.  
  136.  
  137. //---- End editable code block: End of generated code
  138.  
  139.  
  140.