Xcode/TemplatesForProjectBuilder/SDL Custom Cocoa Application/MyController.h
author Bob Pendleton <bob@pendleton.com>
Tue, 24 Jul 2007 18:46:45 +0000
changeset 2213 59a667370c57
parent 2207 d63e9f5944ae
child 2215 23a2cb765052
permissions -rw-r--r--
make indent
slouken@2207
     1
//
slouken@2207
     2
//  MyController.h
slouken@2207
     3
//  SDL Custom Cocoa App
slouken@2207
     4
//
slouken@2207
     5
//  Created by Darrell Walisser on Fri Jul 18 2003.
slouken@2207
     6
//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
slouken@2207
     7
//
slouken@2207
     8
slouken@2207
     9
#import <Cocoa/Cocoa.h>
slouken@2207
    10
#import "SDL.h"
slouken@2207
    11
bob@2213
    12
extern id gController;          // instance of this class from nib
slouken@2207
    13
slouken@2207
    14
// Declare SDL_QuartzWindowDelegate (defined in SDL.framework)
bob@2213
    15
@interface SDL_QuartzWindowDelegate: NSObject @ end @ interface MyController:NSObject {
bob@2213
    16
    // Interface Builder Outlets
bob@2213
    17
    IBOutlet id _framesPerSecond;
bob@2213
    18
    IBOutlet id _numSprites;
bob@2213
    19
    IBOutlet id _window;
bob@2213
    20
    IBOutlet id _view;
bob@2213
    21
bob@2213
    22
    // Private instance variables
bob@2213
    23
    int _nSprites;
bob@2213
    24
    int _max_speed;
bob@2213
    25
    int _doFlip;
bob@2213
    26
    Uint8 *_mem;
bob@2213
    27
bob@2213
    28
    SDL_Surface *_screen;
bob@2213
    29
    SDL_Surface *_sprite;
bob@2213
    30
    SDL_Rect *_sprite_rects;
bob@2213
    31
    SDL_Rect *_positions;
bob@2213
    32
    SDL_Rect *_velocities;
bob@2213
    33
    int _sprites_visible;
bob@2213
    34
    Uint16 _sprite_w, _sprite_h;
bob@2213
    35
bob@2213
    36
    int _mouse_x, _mouse_y;
bob@2213
    37
}
bob@2213
    38
bob@2213
    39
// Interface Builder Actions
bob@2213
    40
-(IBAction) changeNumberOfSprites:(id) sender;
bob@2213
    41
-(IBAction) selectUpdateMode:(id) sender;
slouken@2207
    42
@end