Xcode/TemplatesForProjectBuilder/SDL Custom Cocoa Application/MyController.h
changeset 2220 4d2d0548f5b2
parent 2215 23a2cb765052
equal deleted inserted replaced
2219:f6099efa3f0b 2220:4d2d0548f5b2
     7 //
     7 //
     8 
     8 
     9 #import <Cocoa/Cocoa.h>
     9 #import <Cocoa/Cocoa.h>
    10 #import "SDL.h"
    10 #import "SDL.h"
    11 
    11 
    12 extern id gController;          // instance of this class from nib
    12 extern id gController; // instance of this class from nib
    13 
    13 
    14 // Declare SDL_QuartzWindowDelegate (defined in SDL.framework)
    14 // Declare SDL_QuartzWindowDelegate (defined in SDL.framework)
    15 @interface SDL_QuartzWindowDelegate: NSObject @ end @ interface MyController:NSObject
    15 @interface SDL_QuartzWindowDelegate : NSObject
       
    16 @end
       
    17 
       
    18 @interface MyController : NSObject
    16 {
    19 {
    17     // Interface Builder Outlets
    20     // Interface Builder Outlets
    18     IBOutlet id _framesPerSecond;
    21     IBOutlet id 	_framesPerSecond;
    19     IBOutlet id _numSprites;
    22     IBOutlet id 	_numSprites;
    20     IBOutlet id _window;
    23     IBOutlet id 	_window;
    21     IBOutlet id _view;
    24     IBOutlet id 	_view;
       
    25     
       
    26     // Private instance variables
       
    27     int          _nSprites;
       
    28     int          _max_speed;
       
    29     int          _doFlip;
       
    30     Uint8*       _mem;
       
    31     
       
    32     SDL_Surface* _screen;
       
    33     SDL_Surface* _sprite;
       
    34     SDL_Rect*    _sprite_rects;
       
    35     SDL_Rect*    _positions;
       
    36     SDL_Rect*    _velocities;
       
    37     int          _sprites_visible;
       
    38     Uint16       _sprite_w, _sprite_h;
       
    39     
       
    40     int 		 _mouse_x, _mouse_y;
       
    41 }
       
    42 // Interface Builder Actions
       
    43 - (IBAction)changeNumberOfSprites:(id)sender;
       
    44 - (IBAction)selectUpdateMode:(id)sender;
       
    45 @end
    22 
    46 
    23     // Private instance variables
       
    24     int _nSprites;
       
    25     int _max_speed;
       
    26     int _doFlip;
       
    27     Uint8 *_mem;
       
    28 
       
    29     SDL_Surface *_screen;
       
    30     SDL_Surface *_sprite;
       
    31     SDL_Rect *_sprite_rects;
       
    32     SDL_Rect *_positions;
       
    33     SDL_Rect *_velocities;
       
    34     int _sprites_visible;
       
    35     Uint16 _sprite_w, _sprite_h;
       
    36 
       
    37     int _mouse_x, _mouse_y;
       
    38 }
       
    39 
       
    40 // Interface Builder Actions
       
    41 -(IBAction) changeNumberOfSprites:(id) sender;
       
    42 -(IBAction) selectUpdateMode:(id) sender;
       
    43 @end