/[hegemonie]/hegemonie/Interface/UiInterface.m
ViewVC logotype

Diff of /hegemonie/Interface/UiInterface.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by zaral, Thu May 22 08:46:31 2003 UTC revision 1.2 by zaral, Wed Jun 4 16:52:28 2003 UTC
# Line 22  Line 22 
22   */   */
23    
24  #include <Foundation/NSException.h>  #include <Foundation/NSException.h>
25  //#include <SDL/SDL.h>  
26    #include <GL/gl.h>
27    #include <GL/glu.h>
28    
29  #include "Interface/UiInterface.h"  #include "Interface/UiInterface.h"
30    
# Line 31  Line 33 
33   */   */
34  @implementation UiInterface  @implementation UiInterface
35    
 /* private functions */  
 // - (void) glInit  
 // {  
   
 // }  
   
 // - (void) sdlInit  
 // {  
 //   if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {  
 //     fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError());  
 //     exit(1);  
 //   }  
   
 //   if ( SDL_SetVideoMode(640, 480, 0, SDL_OPENGL) == NULL ) {  
 //     fprintf(stderr, "Unable to create OpenGL screen: %s\n", SDL_GetError());  
 //     SDL_Quit();  
 //     exit(2);  
 //   }  
     
 //   [self glInit];  
     
 // }  
   
 /**  
  * UiInterface initialisation  
  */  
36  - (id) init  - (id) init
37  {  {
38    self = [super init];    self = [super init];
# Line 67  Line 43 
43      }      }
44        
45    return self;    return self;
46                }  }
47    
48  /**  /**
49   * add a frame to the interface   * call the frame to be displayed on the screen, it sets _currentFrame
50     * to frame
51   * @param (UiFrame *) frame a non-nil frame   * @param (UiFrame *) frame a non-nil frame
52   */   */
53  - (void) addFrame: (UiFrame *) frame  - (void) display
54  {  {
55    NSParameterAssert(frame);    NSParameterAssert(_currentFrame);
56    
57      glMatrixMode (GL_PROJECTION);
58      gluOrtho2D (0.0, 1024.0, 0.0, 768.0);
59    
60      glMatrixMode (GL_MODELVIEW);
61      glLoadIdentity ();
62        
63    [_frames addObject: frame];    [_currentFrame display];
64  }  }
65    
66  /**  /**
67   * call the frame to be displayed on the screen, it sets _currentFrame   * add a frame to the interface
  * to frame  
68   * @param (UiFrame *) frame a non-nil frame   * @param (UiFrame *) frame a non-nil frame
69   */   */
70  - (void) showFrame: (UiFrame *) frame  - (void) addFrame: (UiFrame *) frame
71  {  {
72    NSParameterAssert(frame);    NSParameterAssert(frame);
73        
74    [self setCurrentFrame: frame];    [_frames addObject: frame];
75    //  [frame display];    if (!_currentFrame)
76        [self setCurrentFrame: frame];
77  }  }
78    
79  /**  /**

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26