2007-07-21 17:09:01 +00:00
|
|
|
//
|
|
|
|
// MyController.h
|
|
|
|
// SDL Custom Cocoa App
|
|
|
|
//
|
|
|
|
// Created by Darrell Walisser on Fri Jul 18 2003.
|
|
|
|
// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import "SDL.h"
|
|
|
|
|
2007-07-24 18:46:45 +00:00
|
|
|
extern id gController; // instance of this class from nib
|
2007-07-21 17:09:01 +00:00
|
|
|
|
|
|
|
// Declare SDL_QuartzWindowDelegate (defined in SDL.framework)
|
2007-07-25 21:23:28 +00:00
|
|
|
@interface SDL_QuartzWindowDelegate: NSObject @ end @ interface MyController:NSObject
|
|
|
|
{
|
2007-07-21 17:09:01 +00:00
|
|
|
// Interface Builder Outlets
|
2007-07-24 18:46:45 +00:00
|
|
|
IBOutlet id _framesPerSecond;
|
|
|
|
IBOutlet id _numSprites;
|
|
|
|
IBOutlet id _window;
|
|
|
|
IBOutlet id _view;
|
|
|
|
|
2007-07-21 17:09:01 +00:00
|
|
|
// Private instance variables
|
2007-07-24 18:46:45 +00:00
|
|
|
int _nSprites;
|
|
|
|
int _max_speed;
|
|
|
|
int _doFlip;
|
|
|
|
Uint8 *_mem;
|
|
|
|
|
|
|
|
SDL_Surface *_screen;
|
|
|
|
SDL_Surface *_sprite;
|
|
|
|
SDL_Rect *_sprite_rects;
|
|
|
|
SDL_Rect *_positions;
|
|
|
|
SDL_Rect *_velocities;
|
|
|
|
int _sprites_visible;
|
|
|
|
Uint16 _sprite_w, _sprite_h;
|
|
|
|
|
|
|
|
int _mouse_x, _mouse_y;
|
2007-07-21 17:09:01 +00:00
|
|
|
}
|
2007-07-24 18:46:45 +00:00
|
|
|
|
2007-07-21 17:09:01 +00:00
|
|
|
// Interface Builder Actions
|
2007-07-24 18:46:45 +00:00
|
|
|
-(IBAction) changeNumberOfSprites:(id) sender;
|
|
|
|
-(IBAction) selectUpdateMode:(id) sender;
|
2007-07-21 17:09:01 +00:00
|
|
|
@end
|