~ubuntu-branches/ubuntu/precise/primrose/precise

« back to all changes in this revision

Viewing changes to tilePlacementGames/game1/gameSource/game.h

  • Committer: Bazaar Package Importer
  • Author(s): Paul Wise
  • Date: 2009-04-06 19:26:56 UTC
  • Revision ID: james.westby@ubuntu.com-20090406192656-cri7503gebyvfl8t
Tags: upstream-5+dfsg1
ImportĀ upstreamĀ versionĀ 5+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// interface for game engine
 
3
 
 
4
// called by GLUT or iPhone app wrapper
 
5
 
 
6
 
 
7
void initFrameDrawer( int inWidth, int inHeight );
 
8
 
 
9
 
 
10
// called at application termination
 
11
// good time to save state for next launch
 
12
void freeFrameDrawer();
 
13
 
 
14
 
 
15
// draw scene into frame using GL function calls
 
16
void drawFrame();
 
17
 
 
18
 
 
19
// start of pointer press
 
20
void pointerDown( float inX, float inY );
 
21
 
 
22
// movement with pointer pressed
 
23
void pointerMove( float inX, float inY );
 
24
 
 
25
// end of pointer press
 
26
void pointerUp( float inX, float inY );
 
27
 
 
28
 
 
29
 
 
30
#include <stdint.h>
 
31
typedef int16_t Sint16;
 
32
typedef uint8_t Uint8;
 
33
 
 
34
// sample rate shared by game engine and sound rendering platform
 
35
//#define gameSoundSampleRate 22050
 
36
//#define gameSoundSampleRate 44100
 
37
#define gameSoundSampleRate 11025
 
38
 
 
39
// gets the next buffer-full of sound samples from the game engine
 
40
// inBuffer should be filled with stereo Sint16 samples, little endian,
 
41
//    left-right left-right ....
 
42
// NOTE:  may not be called by the same thread that calls drawFrame,
 
43
//        depending on platform implementation
 
44
void getSoundSamples( Uint8 *inBuffer, int inLengthToFillInBytes );
 
45
 
 
46
 
 
47
 
 
48
// called BY game engine (implemented by supporting platform)
 
49
 
 
50
// true to start or resume playing
 
51
// false to pause
 
52
void setSoundPlaying( char inPlaying );
 
53
 
 
54
 
 
55
 
 
56
 
 
57
 
 
58