You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(1) |
2
|
|
3
|
4
(3) |
5
|
6
|
7
|
8
|
9
(12) |
|
10
|
11
(4) |
12
(18) |
13
(2) |
14
(1) |
15
|
16
|
|
17
(1) |
18
(2) |
19
(1) |
20
|
21
|
22
|
23
|
|
24
|
25
(2) |
26
|
27
(2) |
28
(7) |
29
(2) |
30
(1) |
|
From: Brian M. <ma...@us...> - 2005-04-12 18:52:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15587 Added Files: fmoddyn_mac.h Log Message: fake "dynamic" header for MacOSX, which uses a static lib *grumble* --- NEW FILE: fmoddyn_mac.h --- #include "fmod.h" #ifndef _LWJGL_FMOD_DYN_H_ #define _LWJGL_FMOD_DYN_H_ typedef struct { void *module; signed char (F_API *FSOUND_SetOutput)(int outputtype); signed char (F_API *FSOUND_SetDriver)(int driver); signed char (F_API *FSOUND_SetMixer)(int mixer); signed char (F_API *FSOUND_SetBufferSize)(int len_ms); signed char (F_API *FSOUND_SetHWND)(void *hwnd); signed char (F_API *FSOUND_SetMinHardwareChannels)(int min); signed char (F_API *FSOUND_SetMaxHardwareChannels)(int max); signed char (F_API *FSOUND_SetMemorySystem)(void *pool, int poollen, FSOUND_ALLOCCALLBACK useralloc, FSOUND_REALLOCCALLBACK userrealloc, FSOUND_FREECALLBACK userfree); signed char (F_API *FSOUND_Init)(int mixrate, int maxsoftwarechannels, unsigned int flags); void (F_API *FSOUND_Close)(); void (F_API *FSOUND_Update)(); /* you must call this once a frame */ void (F_API *FSOUND_SetSpeakerMode)(unsigned int speakermode); void (F_API *FSOUND_SetSFXMasterVolume)(int volume); void (F_API *FSOUND_SetPanSeperation)(float pansep); void (F_API *FSOUND_File_SetCallbacks)(FSOUND_OPENCALLBACK useropen, FSOUND_CLOSECALLBACK userclose, FSOUND_READCALLBACK userread, FSOUND_SEEKCALLBACK userseek, FSOUND_TELLCALLBACK usertell); int (F_API *FSOUND_GetError)(); float (F_API *FSOUND_GetVersion)(); int (F_API *FSOUND_GetOutput)(); void * (F_API *FSOUND_GetOutputHandle)(); int (F_API *FSOUND_GetDriver)(); int (F_API *FSOUND_GetMixer)(); int (F_API *FSOUND_GetNumDrivers)(); const char * (F_API *FSOUND_GetDriverName)(int id); signed char (F_API *FSOUND_GetDriverCaps)(int id, unsigned int *caps); int (F_API *FSOUND_GetOutputRate)(); int (F_API *FSOUND_GetMaxChannels)(); int (F_API *FSOUND_GetMaxSamples)(); int (F_API *FSOUND_GetSFXMasterVolume)(); signed char (F_API *FSOUND_GetNumHWChannels)(int *num2d, int *num3d, int *total); int (F_API *FSOUND_GetChannelsPlaying)(); float (F_API *FSOUND_GetCPUUsage)(); void (F_API *FSOUND_GetMemoryStats)(unsigned int *currentalloced, unsigned int *maxalloced); FSOUND_SAMPLE * (F_API *FSOUND_Sample_Load)(int index, const char *name_or_data, unsigned int mode, int offset, int length); FSOUND_SAMPLE * (F_API *FSOUND_Sample_Alloc)(int index, int length, unsigned int mode, int deffreq, int defvol, int defpan, int defpri); void (F_API *FSOUND_Sample_Free)(FSOUND_SAMPLE *sptr); signed char (F_API *FSOUND_Sample_Upload)(FSOUND_SAMPLE *sptr, void *srcdata, unsigned int mode); signed char (F_API *FSOUND_Sample_Lock)(FSOUND_SAMPLE *sptr, int offset, int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2); signed char (F_API *FSOUND_Sample_Unlock)(FSOUND_SAMPLE *sptr, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2); signed char (F_API *FSOUND_Sample_SetMode)(FSOUND_SAMPLE *sptr, unsigned int mode); signed char (F_API *FSOUND_Sample_SetLoopPoints)(FSOUND_SAMPLE *sptr, int loopstart, int loopend); signed char (F_API *FSOUND_Sample_SetDefaults)(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri); signed char (F_API *FSOUND_Sample_SetDefaultsEx)(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri, int varfreq, int varvol, int varpan); signed char (F_API *FSOUND_Sample_SetMinMaxDistance)(FSOUND_SAMPLE *sptr, float min, float max); signed char (F_API *FSOUND_Sample_SetMaxPlaybacks)(FSOUND_SAMPLE *sptr, int max); FSOUND_SAMPLE * (F_API *FSOUND_Sample_Get)(int sampno); const char * (F_API *FSOUND_Sample_GetName)(FSOUND_SAMPLE *sptr); unsigned int (F_API *FSOUND_Sample_GetLength)(FSOUND_SAMPLE *sptr); signed char (F_API *FSOUND_Sample_GetLoopPoints)(FSOUND_SAMPLE *sptr, int *loopstart, int *loopend); signed char (F_API *FSOUND_Sample_GetDefaults)(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri); signed char (F_API *FSOUND_Sample_GetDefaultsEx)(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri, int *varfreq, int *varvol, int *varpan); unsigned int (F_API *FSOUND_Sample_GetMode)(FSOUND_SAMPLE *sptr); signed char (F_API *FSOUND_Sample_GetMinMaxDistance)(FSOUND_SAMPLE *sptr, float *min, float *max); int (F_API *FSOUND_PlaySound)(int channel, FSOUND_SAMPLE *sptr); int (F_API *FSOUND_PlaySoundEx)(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); signed char (F_API *FSOUND_StopSound)(int channel); signed char (F_API *FSOUND_SetFrequency)(int channel, int freq); signed char (F_API *FSOUND_SetVolume)(int channel, int vol); signed char (F_API *FSOUND_SetVolumeAbsolute)(int channel, int vol); signed char (F_API *FSOUND_SetPan)(int channel, int pan); signed char (F_API *FSOUND_SetSurround)(int channel, signed char surround); signed char (F_API *FSOUND_SetMute)(int channel, signed char mute); signed char (F_API *FSOUND_SetPriority)(int channel, int priority); signed char (F_API *FSOUND_SetReserved)(int channel, signed char reserved); signed char (F_API *FSOUND_SetPaused)(int channel, signed char paused); signed char (F_API *FSOUND_SetLoopMode)(int channel, unsigned int loopmode); signed char (F_API *FSOUND_SetCurrentPosition)(int channel, unsigned int offset); signed char (F_API *FSOUND_3D_SetAttributes)(int channel, const float *pos, const float *vel); signed char (F_API *FSOUND_3D_SetMinMaxDistance)(int channel, float min, float max); signed char (F_API *FSOUND_IsPlaying)(int channel); int (F_API *FSOUND_GetFrequency)(int channel); int (F_API *FSOUND_GetVolume)(int channel); int (F_API *FSOUND_GetAmplitude)(int channel); int (F_API *FSOUND_GetPan)(int channel); signed char (F_API *FSOUND_GetSurround)(int channel); signed char (F_API *FSOUND_GetMute)(int channel); int (F_API *FSOUND_GetPriority)(int channel); signed char (F_API *FSOUND_GetReserved)(int channel); signed char (F_API *FSOUND_GetPaused)(int channel); unsigned int (F_API *FSOUND_GetLoopMode)(int channel); unsigned int (F_API *FSOUND_GetCurrentPosition)(int channel); FSOUND_SAMPLE * (F_API *FSOUND_GetCurrentSample)(int channel); signed char (F_API *FSOUND_GetCurrentLevels)(int channel, float *l, float *r); int (F_API *FSOUND_GetNumSubChannels)(int channel); int (F_API *FSOUND_GetSubChannel)(int channel, int subchannel); signed char (F_API *FSOUND_3D_GetAttributes)(int channel, float *pos, float *vel); signed char (F_API *FSOUND_3D_GetMinMaxDistance)(int channel, float *min, float *max); void (F_API *FSOUND_3D_SetDopplerFactor)(float scale); void (F_API *FSOUND_3D_SetDistanceFactor)(float scale); void (F_API *FSOUND_3D_SetRolloffFactor)(float scale); void (F_API *FSOUND_3D_Listener_SetCurrent)(int current, int numlisteners); /* use this if you use multiple listeners / splitscreen */ void (F_API *FSOUND_3D_Listener_SetAttributes)(const float *pos, const float *vel, float fx, float fy, float fz, float tx, float ty, float tz); void (F_API *FSOUND_3D_Listener_GetAttributes)(float *pos, float *vel, float *fx, float *fy, float *fz, float *tx, float *ty, float *tz); int (F_API *FSOUND_FX_Enable)(int channel, unsigned int fx); /* See FSOUND_FX_MODES */ signed char (F_API *FSOUND_FX_Disable)(int channel); signed char (F_API *FSOUND_FX_SetChorus)(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase); signed char (F_API *FSOUND_FX_SetCompressor)(int fxid, float Gain, float Attack, float Release, float Threshold, float Ratio, float Predelay); signed char (F_API *FSOUND_FX_SetDistortion)(int fxid, float Gain, float Edge, float PostEQCenterFrequency, float PostEQBandwidth, float PreLowpassCutoff); signed char (F_API *FSOUND_FX_SetEcho)(int fxid, float WetDryMix, float Feedback, float LeftDelay, float RightDelay, int PanDelay); signed char (F_API *FSOUND_FX_SetFlanger)(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase); signed char (F_API *FSOUND_FX_SetGargle)(int fxid, int RateHz, int WaveShape); signed char (F_API *FSOUND_FX_SetI3DL2Reverb)(int fxid, int Room, int RoomHF, float RoomRolloffFactor, float DecayTime, float DecayHFRatio, int Reflections, float ReflectionsDelay, int Reverb, float ReverbDelay, float Diffusion, float Density, float HFReference); signed char (F_API *FSOUND_FX_SetParamEQ)(int fxid, float Center, float Bandwidth, float Gain); signed char (F_API *FSOUND_FX_SetWavesReverb)(int fxid, float InGain, float ReverbMix, float ReverbTime, float HighFreqRTRatio); signed char (F_API *FSOUND_Stream_SetBufferSize)(int ms); /* call this before opening streams, not after */ FSOUND_STREAM * (F_API *FSOUND_Stream_Open)(const char *name_or_data, unsigned int mode, int offset, int length); FSOUND_STREAM * (F_API *FSOUND_Stream_Create)(FSOUND_STREAMCALLBACK callback, int length, unsigned int mode, int samplerate, void *userdata); signed char (F_API *FSOUND_Stream_Close)(FSOUND_STREAM *stream); int (F_API *FSOUND_Stream_Play)(int channel, FSOUND_STREAM *stream); int (F_API *FSOUND_Stream_PlayEx)(int channel, FSOUND_STREAM *stream, FSOUND_DSPUNIT *dsp, signed char startpaused); signed char (F_API *FSOUND_Stream_Stop)(FSOUND_STREAM *stream); signed char (F_API *FSOUND_Stream_SetPosition)(FSOUND_STREAM *stream, unsigned int position); unsigned int (F_API *FSOUND_Stream_GetPosition)(FSOUND_STREAM *stream); signed char (F_API *FSOUND_Stream_SetTime)(FSOUND_STREAM *stream, int ms); int (F_API *FSOUND_Stream_GetTime)(FSOUND_STREAM *stream); int (F_API *FSOUND_Stream_GetLength)(FSOUND_STREAM *stream); int (F_API *FSOUND_Stream_GetLengthMs)(FSOUND_STREAM *stream); signed char (F_API *FSOUND_Stream_SetMode)(FSOUND_STREAM *stream, unsigned int mode); unsigned int (F_API *FSOUND_Stream_GetMode)(FSOUND_STREAM *stream); signed char (F_API *FSOUND_Stream_SetLoopPoints)(FSOUND_STREAM *stream, unsigned int loopstartpcm, unsigned int loopendpcm); signed char (F_API *FSOUND_Stream_SetLoopCount)(FSOUND_STREAM *stream, int count); int (F_API *FSOUND_Stream_GetOpenState)(FSOUND_STREAM *stream); FSOUND_SAMPLE * (F_API *FSOUND_Stream_GetSample)(FSOUND_STREAM *stream); /* every stream contains a sample to playback on */ FSOUND_DSPUNIT * (F_API *FSOUND_Stream_CreateDSP)(FSOUND_STREAM *stream, FSOUND_DSPCALLBACK callback, int priority, void *userdata); signed char (F_API *FSOUND_Stream_SetEndCallback)(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, void *userdata); signed char (F_API *FSOUND_Stream_SetSyncCallback)(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, void *userdata); FSOUND_SYNCPOINT *(F_API *FSOUND_Stream_AddSyncPoint)(FSOUND_STREAM *stream, unsigned int pcmoffset, const char *name); signed char (F_API *FSOUND_Stream_DeleteSyncPoint)(FSOUND_SYNCPOINT *point); int (F_API *FSOUND_Stream_GetNumSyncPoints)(FSOUND_STREAM *stream); FSOUND_SYNCPOINT *(F_API *FSOUND_Stream_GetSyncPoint)(FSOUND_STREAM *stream, int index); char * (F_API *FSOUND_Stream_GetSyncPointInfo)(FSOUND_SYNCPOINT *point, unsigned int *pcmoffset); signed char (F_API *FSOUND_Stream_SetSubStream)(FSOUND_STREAM *stream, int index); int (F_API *FSOUND_Stream_GetNumSubStreams)(FSOUND_STREAM *stream); signed char (F_API *FSOUND_Stream_SetSubStreamSentence)(FSOUND_STREAM *stream, const int *sentencelist, int numitems); signed char (F_API *FSOUND_Stream_GetNumTagFields)(FSOUND_STREAM *stream, int *num); signed char (F_API *FSOUND_Stream_GetTagField)(FSOUND_STREAM *stream, int num, int *type, char **name, void **value, int *length); signed char (F_API *FSOUND_Stream_FindTagField)(FSOUND_STREAM *stream, int type, const char *name, void **value, int *length); signed char (F_API *FSOUND_Stream_Net_SetProxy)(const char *proxy); char * (F_API *FSOUND_Stream_Net_GetLastServerStatus)(); signed char (F_API *FSOUND_Stream_Net_SetBufferProperties)(int buffersize, int prebuffer_percent, int rebuffer_percent); signed char (F_API *FSOUND_Stream_Net_GetBufferProperties)(int *buffersize, int *prebuffer_percent, int *rebuffer_percent); signed char (F_API *FSOUND_Stream_Net_SetMetadataCallback)(FSOUND_STREAM *stream, FSOUND_METADATACALLBACK callback, void *userdata); signed char (F_API *FSOUND_Stream_Net_GetStatus)(FSOUND_STREAM *stream, int *status, int *bufferpercentused, int *bitrate, unsigned int *flags); signed char (F_API *FSOUND_CD_Play)(char drive, int track); void (F_API *FSOUND_CD_SetPlayMode)(char drive, signed char mode); signed char (F_API *FSOUND_CD_Stop)(char drive); signed char (F_API *FSOUND_CD_SetPaused)(char drive, signed char paused); signed char (F_API *FSOUND_CD_SetVolume)(char drive, int volume); signed char (F_API *FSOUND_CD_SetTrackTime)(char drive, unsigned int ms); // Not available on Mac //signed char (F_API *FSOUND_CD_OpenTray)(char drive, signed char open); signed char (F_API *FSOUND_CD_GetPaused)(char drive); int (F_API *FSOUND_CD_GetTrack)(char drive); int (F_API *FSOUND_CD_GetNumTracks)(char drive); int (F_API *FSOUND_CD_GetVolume)(char drive); int (F_API *FSOUND_CD_GetTrackLength)(char drive, int track); int (F_API *FSOUND_CD_GetTrackTime)(char drive); FSOUND_DSPUNIT * (F_API *FSOUND_DSP_Create)(FSOUND_DSPCALLBACK callback, int priority, void *userdata); void (F_API *FSOUND_DSP_Free)(FSOUND_DSPUNIT *unit); void (F_API *FSOUND_DSP_SetPriority)(FSOUND_DSPUNIT *unit, int priority); int (F_API *FSOUND_DSP_GetPriority)(FSOUND_DSPUNIT *unit); void (F_API *FSOUND_DSP_SetActive)(FSOUND_DSPUNIT *unit, signed char active); signed char (F_API *FSOUND_DSP_GetActive)(FSOUND_DSPUNIT *unit); FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetClearUnit)(); FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetSFXUnit)(); FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetMusicUnit)(); FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetFFTUnit)(); FSOUND_DSPUNIT * (F_API *FSOUND_DSP_GetClipAndCopyUnit)(); signed char (F_API *FSOUND_DSP_MixBuffers)(void *destbuffer, void *srcbuffer, int len, int freq, int vol, int pan, unsigned int mode); void (F_API *FSOUND_DSP_ClearMixBuffer)(); int (F_API *FSOUND_DSP_GetBufferLength)(); /* Length of each DSP update */ int (F_API *FSOUND_DSP_GetBufferLengthTotal)(); /* Total buffer length due to FSOUND_SetBufferSize */ float * (F_API *FSOUND_DSP_GetSpectrum)(); /* Array of 512 floats - call FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE)) for this to work. */ signed char (F_API *FSOUND_Reverb_SetProperties)(const FSOUND_REVERB_PROPERTIES *prop); signed char (F_API *FSOUND_Reverb_GetProperties)(FSOUND_REVERB_PROPERTIES *prop); signed char (F_API *FSOUND_Reverb_SetChannelProperties)(int channel, const FSOUND_REVERB_CHANNELPROPERTIES *prop); signed char (F_API *FSOUND_Reverb_GetChannelProperties)(int channel, FSOUND_REVERB_CHANNELPROPERTIES *prop); signed char (F_API *FSOUND_Record_SetDriver)(int outputtype); int (F_API *FSOUND_Record_GetNumDrivers)(); const char * (F_API *FSOUND_Record_GetDriverName)(int id); int (F_API *FSOUND_Record_GetDriver)(); signed char (F_API *FSOUND_Record_StartSample)(FSOUND_SAMPLE *sptr, signed char loop); signed char (F_API *FSOUND_Record_Stop)(); int (F_API *FSOUND_Record_GetPosition)(); FMUSIC_MODULE * (F_API *FMUSIC_LoadSong)(const char *name); FMUSIC_MODULE * (F_API *FMUSIC_LoadSongEx)(const char *name_or_data, int offset, int length, unsigned int mode, const int *samplelist, int samplelistnum); int (F_API *FMUSIC_GetOpenState)(FMUSIC_MODULE *mod); signed char (F_API *FMUSIC_FreeSong)(FMUSIC_MODULE *mod); signed char (F_API *FMUSIC_PlaySong)(FMUSIC_MODULE *mod); signed char (F_API *FMUSIC_StopSong)(FMUSIC_MODULE *mod); void (F_API *FMUSIC_StopAllSongs)(); signed char (F_API *FMUSIC_SetZxxCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback); signed char (F_API *FMUSIC_SetRowCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int rowstep); signed char (F_API *FMUSIC_SetOrderCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int orderstep); signed char (F_API *FMUSIC_SetInstCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int instrument); signed char (F_API *FMUSIC_SetSample)(FMUSIC_MODULE *mod, int sampno, FSOUND_SAMPLE *sptr); signed char (F_API *FMUSIC_SetUserData)(FMUSIC_MODULE *mod, void *userdata); signed char (F_API *FMUSIC_OptimizeChannels)(FMUSIC_MODULE *mod, int maxchannels, int minvolume); signed char (F_API *FMUSIC_SetReverb)(signed char reverb); /* MIDI only */ signed char (F_API *FMUSIC_SetLooping)(FMUSIC_MODULE *mod, signed char looping); signed char (F_API *FMUSIC_SetOrder)(FMUSIC_MODULE *mod, int order); signed char (F_API *FMUSIC_SetPaused)(FMUSIC_MODULE *mod, signed char pause); signed char (F_API *FMUSIC_SetMasterVolume)(FMUSIC_MODULE *mod, int volume); signed char (F_API *FMUSIC_SetMasterSpeed)(FMUSIC_MODULE *mode, float speed); signed char (F_API *FMUSIC_SetPanSeperation)(FMUSIC_MODULE *mod, float pansep); const char * (F_API *FMUSIC_GetName)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetType)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetNumOrders)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetNumPatterns)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetNumInstruments)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetNumSamples)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetNumChannels)(FMUSIC_MODULE *mod); FSOUND_SAMPLE * (F_API *FMUSIC_GetSample)(FMUSIC_MODULE *mod, int sampno); int (F_API *FMUSIC_GetPatternLength)(FMUSIC_MODULE *mod, int orderno); signed char (F_API *FMUSIC_IsFinished)(FMUSIC_MODULE *mod); signed char (F_API *FMUSIC_IsPlaying)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetMasterVolume)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetGlobalVolume)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetOrder)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetPattern)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetSpeed)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetBPM)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetRow)(FMUSIC_MODULE *mod); signed char (F_API *FMUSIC_GetPaused)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetTime)(FMUSIC_MODULE *mod); int (F_API *FMUSIC_GetRealChannel)(FMUSIC_MODULE *mod, int modchannel); void* (F_API *FMUSIC_GetUserData)(FMUSIC_MODULE *mod); } FMOD_INSTANCE; static FMOD_INSTANCE *FMOD_CreateInstance(char *dllName) { FMOD_INSTANCE *instance; instance = (FMOD_INSTANCE *)calloc(sizeof(FMOD_INSTANCE), 1); if(instance) { instance->FSOUND_SetOutput = &FSOUND_SetOutput; instance->FSOUND_SetDriver = &FSOUND_SetDriver; instance->FSOUND_SetMixer = &FSOUND_SetMixer; instance->FSOUND_SetBufferSize = &FSOUND_SetBufferSize; instance->FSOUND_SetHWND = &FSOUND_SetHWND; instance->FSOUND_SetMinHardwareChannels = &FSOUND_SetMinHardwareChannels; instance->FSOUND_SetMaxHardwareChannels = &FSOUND_SetMaxHardwareChannels; instance->FSOUND_SetMemorySystem = &FSOUND_SetMemorySystem; instance->FSOUND_Init = &FSOUND_Init; instance->FSOUND_Close = &FSOUND_Close; instance->FSOUND_Update = &FSOUND_Update; instance->FSOUND_SetSpeakerMode = &FSOUND_SetSpeakerMode; instance->FSOUND_SetSFXMasterVolume = &FSOUND_SetSFXMasterVolume; instance->FSOUND_SetPanSeperation = &FSOUND_SetPanSeperation; instance->FSOUND_File_SetCallbacks = &FSOUND_File_SetCallbacks; instance->FSOUND_GetError = &FSOUND_GetError; instance->FSOUND_GetVersion = &FSOUND_GetVersion; instance->FSOUND_GetOutput = &FSOUND_GetOutput; instance->FSOUND_GetOutputHandle = &FSOUND_GetOutputHandle; instance->FSOUND_GetDriver = &FSOUND_GetDriver; instance->FSOUND_GetMixer = &FSOUND_GetMixer; instance->FSOUND_GetNumDrivers = &FSOUND_GetNumDrivers; instance->FSOUND_GetDriverName = &FSOUND_GetDriverName; instance->FSOUND_GetDriverCaps = &FSOUND_GetDriverCaps; instance->FSOUND_GetOutputRate = &FSOUND_GetOutputRate; instance->FSOUND_GetMaxChannels = &FSOUND_GetMaxChannels; instance->FSOUND_GetMaxSamples = &FSOUND_GetMaxSamples; instance->FSOUND_GetSFXMasterVolume = &FSOUND_GetSFXMasterVolume; instance->FSOUND_GetNumHWChannels = &FSOUND_GetNumHWChannels; instance->FSOUND_GetChannelsPlaying = &FSOUND_GetChannelsPlaying; instance->FSOUND_GetCPUUsage = &FSOUND_GetCPUUsage; instance->FSOUND_GetMemoryStats = &FSOUND_GetMemoryStats; instance->FSOUND_Sample_Load = &FSOUND_Sample_Load; instance->FSOUND_Sample_Alloc = &FSOUND_Sample_Alloc; instance->FSOUND_Sample_Free = &FSOUND_Sample_Free; instance->FSOUND_Sample_Upload = &FSOUND_Sample_Upload; instance->FSOUND_Sample_Lock = &FSOUND_Sample_Lock; instance->FSOUND_Sample_Unlock = &FSOUND_Sample_Unlock; instance->FSOUND_Sample_SetMode = &FSOUND_Sample_SetMode; instance->FSOUND_Sample_SetLoopPoints = &FSOUND_Sample_SetLoopPoints; instance->FSOUND_Sample_SetDefaults = &FSOUND_Sample_SetDefaults; instance->FSOUND_Sample_SetDefaultsEx = &FSOUND_Sample_SetDefaultsEx; instance->FSOUND_Sample_SetMinMaxDistance = &FSOUND_Sample_SetMinMaxDistance; instance->FSOUND_Sample_SetMaxPlaybacks = &FSOUND_Sample_SetMaxPlaybacks; instance->FSOUND_Sample_Get = &FSOUND_Sample_Get; instance->FSOUND_Sample_GetName = &FSOUND_Sample_GetName; instance->FSOUND_Sample_GetLength = &FSOUND_Sample_GetLength; instance->FSOUND_Sample_GetLoopPoints = &FSOUND_Sample_GetLoopPoints; instance->FSOUND_Sample_GetDefaults = &FSOUND_Sample_GetDefaults; instance->FSOUND_Sample_GetDefaultsEx = &FSOUND_Sample_GetDefaultsEx; instance->FSOUND_Sample_GetMode = &FSOUND_Sample_GetMode; instance->FSOUND_Sample_GetMinMaxDistance = &FSOUND_Sample_GetMinMaxDistance; instance->FSOUND_PlaySound = &FSOUND_PlaySound; instance->FSOUND_PlaySoundEx = &FSOUND_PlaySoundEx; instance->FSOUND_StopSound = &FSOUND_StopSound; instance->FSOUND_SetFrequency = &FSOUND_SetFrequency; instance->FSOUND_SetVolume = &FSOUND_SetVolume; instance->FSOUND_SetVolumeAbsolute = &FSOUND_SetVolumeAbsolute; instance->FSOUND_SetPan = &FSOUND_SetPan; instance->FSOUND_SetSurround = &FSOUND_SetSurround; instance->FSOUND_SetMute = &FSOUND_SetMute; instance->FSOUND_SetPriority = &FSOUND_SetPriority; instance->FSOUND_SetReserved = &FSOUND_SetReserved; instance->FSOUND_SetPaused = &FSOUND_SetPaused; instance->FSOUND_SetLoopMode = &FSOUND_SetLoopMode; instance->FSOUND_SetCurrentPosition = &FSOUND_SetCurrentPosition; instance->FSOUND_3D_SetAttributes = &FSOUND_3D_SetAttributes; instance->FSOUND_3D_SetMinMaxDistance = &FSOUND_3D_SetMinMaxDistance; instance->FSOUND_IsPlaying = &FSOUND_IsPlaying; instance->FSOUND_GetFrequency = &FSOUND_GetFrequency; instance->FSOUND_GetVolume = &FSOUND_GetVolume; instance->FSOUND_GetAmplitude = &FSOUND_GetAmplitude; instance->FSOUND_GetPan = &FSOUND_GetPan; instance->FSOUND_GetSurround = &FSOUND_GetSurround; instance->FSOUND_GetMute = &FSOUND_GetMute; instance->FSOUND_GetPriority = &FSOUND_GetPriority; instance->FSOUND_GetReserved = &FSOUND_GetReserved; instance->FSOUND_GetPaused = &FSOUND_GetPaused; instance->FSOUND_GetLoopMode = &FSOUND_GetLoopMode; instance->FSOUND_GetCurrentPosition = &FSOUND_GetCurrentPosition; instance->FSOUND_GetCurrentSample = &FSOUND_GetCurrentSample; instance->FSOUND_GetCurrentLevels = &FSOUND_GetCurrentLevels; instance->FSOUND_GetNumSubChannels = &FSOUND_GetNumSubChannels; instance->FSOUND_GetSubChannel = &FSOUND_GetSubChannel; instance->FSOUND_3D_GetAttributes = &FSOUND_3D_GetAttributes; instance->FSOUND_3D_GetMinMaxDistance = &FSOUND_3D_GetMinMaxDistance; instance->FSOUND_3D_SetDopplerFactor = &FSOUND_3D_SetDopplerFactor; instance->FSOUND_3D_SetDistanceFactor = &FSOUND_3D_SetDistanceFactor; instance->FSOUND_3D_SetRolloffFactor = &FSOUND_3D_SetRolloffFactor; instance->FSOUND_3D_Listener_SetCurrent = &FSOUND_3D_Listener_SetCurrent; instance->FSOUND_3D_Listener_SetAttributes = &FSOUND_3D_Listener_SetAttributes; instance->FSOUND_3D_Listener_GetAttributes = &FSOUND_3D_Listener_GetAttributes; instance->FSOUND_FX_Enable = &FSOUND_FX_Enable; instance->FSOUND_FX_Disable = &FSOUND_FX_Disable; instance->FSOUND_FX_SetChorus = &FSOUND_FX_SetChorus; instance->FSOUND_FX_SetCompressor = &FSOUND_FX_SetCompressor; instance->FSOUND_FX_SetDistortion = &FSOUND_FX_SetDistortion; instance->FSOUND_FX_SetEcho = &FSOUND_FX_SetEcho; instance->FSOUND_FX_SetFlanger = &FSOUND_FX_SetFlanger; instance->FSOUND_FX_SetGargle = &FSOUND_FX_SetGargle; instance->FSOUND_FX_SetI3DL2Reverb = &FSOUND_FX_SetI3DL2Reverb; instance->FSOUND_FX_SetParamEQ = &FSOUND_FX_SetParamEQ; instance->FSOUND_FX_SetWavesReverb = &FSOUND_FX_SetWavesReverb; instance->FSOUND_Stream_SetBufferSize = &FSOUND_Stream_SetBufferSize; instance->FSOUND_Stream_Open = &FSOUND_Stream_Open; instance->FSOUND_Stream_Create = &FSOUND_Stream_Create; instance->FSOUND_Stream_Close = &FSOUND_Stream_Close; instance->FSOUND_Stream_Play = &FSOUND_Stream_Play; instance->FSOUND_Stream_PlayEx = &FSOUND_Stream_PlayEx; instance->FSOUND_Stream_Stop = &FSOUND_Stream_Stop; instance->FSOUND_Stream_SetPosition = &FSOUND_Stream_SetPosition; instance->FSOUND_Stream_GetPosition = &FSOUND_Stream_GetPosition; instance->FSOUND_Stream_SetTime = &FSOUND_Stream_SetTime; instance->FSOUND_Stream_GetTime = &FSOUND_Stream_GetTime; instance->FSOUND_Stream_GetLength = &FSOUND_Stream_GetLength; instance->FSOUND_Stream_GetLengthMs = &FSOUND_Stream_GetLengthMs; instance->FSOUND_Stream_SetMode = &FSOUND_Stream_SetMode; instance->FSOUND_Stream_GetMode = &FSOUND_Stream_GetMode; instance->FSOUND_Stream_SetLoopPoints = &FSOUND_Stream_SetLoopPoints; instance->FSOUND_Stream_SetLoopCount = &FSOUND_Stream_SetLoopCount; instance->FSOUND_Stream_GetOpenState = &FSOUND_Stream_GetOpenState; instance->FSOUND_Stream_GetSample = &FSOUND_Stream_GetSample; instance->FSOUND_Stream_CreateDSP = &FSOUND_Stream_CreateDSP; instance->FSOUND_Stream_SetEndCallback = &FSOUND_Stream_SetEndCallback; instance->FSOUND_Stream_SetSyncCallback = &FSOUND_Stream_SetSyncCallback; instance->FSOUND_Stream_AddSyncPoint = &FSOUND_Stream_AddSyncPoint; instance->FSOUND_Stream_DeleteSyncPoint = &FSOUND_Stream_DeleteSyncPoint; instance->FSOUND_Stream_GetNumSyncPoints = &FSOUND_Stream_GetNumSyncPoints; instance->FSOUND_Stream_GetSyncPoint = &FSOUND_Stream_GetSyncPoint; instance->FSOUND_Stream_GetSyncPointInfo = &FSOUND_Stream_GetSyncPointInfo; instance->FSOUND_Stream_SetSubStream = &FSOUND_Stream_SetSubStream; instance->FSOUND_Stream_GetNumSubStreams = &FSOUND_Stream_GetNumSubStreams; instance->FSOUND_Stream_SetSubStreamSentence = &FSOUND_Stream_SetSubStreamSentence; instance->FSOUND_Stream_GetNumTagFields = &FSOUND_Stream_GetNumTagFields; instance->FSOUND_Stream_GetTagField = &FSOUND_Stream_GetTagField; instance->FSOUND_Stream_FindTagField = &FSOUND_Stream_FindTagField; instance->FSOUND_Stream_Net_SetProxy = &FSOUND_Stream_Net_SetProxy; instance->FSOUND_Stream_Net_GetLastServerStatus = &FSOUND_Stream_Net_GetLastServerStatus; instance->FSOUND_Stream_Net_SetBufferProperties = &FSOUND_Stream_Net_SetBufferProperties; instance->FSOUND_Stream_Net_GetBufferProperties = &FSOUND_Stream_Net_GetBufferProperties; instance->FSOUND_Stream_Net_SetMetadataCallback = &FSOUND_Stream_Net_SetMetadataCallback; instance->FSOUND_Stream_Net_GetStatus = &FSOUND_Stream_Net_GetStatus; instance->FSOUND_CD_Play = &FSOUND_CD_Play; instance->FSOUND_CD_SetPlayMode = &FSOUND_CD_SetPlayMode; instance->FSOUND_CD_Stop = &FSOUND_CD_Stop; instance->FSOUND_CD_SetPaused = &FSOUND_CD_SetPaused; instance->FSOUND_CD_SetVolume = &FSOUND_CD_SetVolume; instance->FSOUND_CD_SetTrackTime = &FSOUND_CD_SetTrackTime; // Not available on mac //instance->FSOUND_CD_OpenTray = &FSOUND_CD_OpenTray_noop; instance->FSOUND_CD_GetPaused = &FSOUND_CD_GetPaused; instance->FSOUND_CD_GetTrack = &FSOUND_CD_GetTrack; instance->FSOUND_CD_GetNumTracks = &FSOUND_CD_GetNumTracks; instance->FSOUND_CD_GetVolume = &FSOUND_CD_GetVolume; instance->FSOUND_CD_GetTrackLength = &FSOUND_CD_GetTrackLength; instance->FSOUND_CD_GetTrackTime = &FSOUND_CD_GetTrackTime; instance->FSOUND_DSP_Create = &FSOUND_DSP_Create; instance->FSOUND_DSP_Free = &FSOUND_DSP_Free; instance->FSOUND_DSP_SetPriority = &FSOUND_DSP_SetPriority; instance->FSOUND_DSP_GetPriority = &FSOUND_DSP_GetPriority; instance->FSOUND_DSP_SetActive = &FSOUND_DSP_SetActive; instance->FSOUND_DSP_GetActive = &FSOUND_DSP_GetActive; instance->FSOUND_DSP_GetClearUnit = &FSOUND_DSP_GetClearUnit; instance->FSOUND_DSP_GetSFXUnit = &FSOUND_DSP_GetSFXUnit; instance->FSOUND_DSP_GetMusicUnit = &FSOUND_DSP_GetMusicUnit; instance->FSOUND_DSP_GetFFTUnit = &FSOUND_DSP_GetFFTUnit; instance->FSOUND_DSP_GetClipAndCopyUnit = &FSOUND_DSP_GetClipAndCopyUnit; instance->FSOUND_DSP_MixBuffers = &FSOUND_DSP_MixBuffers; instance->FSOUND_DSP_ClearMixBuffer = &FSOUND_DSP_ClearMixBuffer; instance->FSOUND_DSP_GetBufferLength = &FSOUND_DSP_GetBufferLength; instance->FSOUND_DSP_GetBufferLengthTotal = &FSOUND_DSP_GetBufferLengthTotal; instance->FSOUND_DSP_GetSpectrum = &FSOUND_DSP_GetSpectrum; instance->FSOUND_Reverb_SetProperties = &FSOUND_Reverb_SetProperties; instance->FSOUND_Reverb_GetProperties = &FSOUND_Reverb_GetProperties; instance->FSOUND_Reverb_SetChannelProperties = &FSOUND_Reverb_SetChannelProperties; instance->FSOUND_Reverb_GetChannelProperties = &FSOUND_Reverb_GetChannelProperties; instance->FSOUND_Record_SetDriver = &FSOUND_Record_SetDriver; instance->FSOUND_Record_GetNumDrivers = &FSOUND_Record_GetNumDrivers; instance->FSOUND_Record_GetDriverName = &FSOUND_Record_GetDriverName; instance->FSOUND_Record_GetDriver = &FSOUND_Record_GetDriver; instance->FSOUND_Record_StartSample = &FSOUND_Record_StartSample; instance->FSOUND_Record_Stop = &FSOUND_Record_Stop; instance->FSOUND_Record_GetPosition = &FSOUND_Record_GetPosition; instance->FMUSIC_LoadSong = &FMUSIC_LoadSong; instance->FMUSIC_LoadSongEx = &FMUSIC_LoadSongEx; instance->FMUSIC_GetOpenState = &FMUSIC_GetOpenState; instance->FMUSIC_FreeSong = &FMUSIC_FreeSong; instance->FMUSIC_PlaySong = &FMUSIC_PlaySong; instance->FMUSIC_StopSong = &FMUSIC_StopSong; instance->FMUSIC_StopAllSongs = &FMUSIC_StopAllSongs; instance->FMUSIC_SetZxxCallback = &FMUSIC_SetZxxCallback; instance->FMUSIC_SetRowCallback = &FMUSIC_SetRowCallback; instance->FMUSIC_SetOrderCallback = &FMUSIC_SetOrderCallback; instance->FMUSIC_SetInstCallback = &FMUSIC_SetInstCallback; instance->FMUSIC_SetSample = &FMUSIC_SetSample; instance->FMUSIC_SetUserData = &FMUSIC_SetUserData; instance->FMUSIC_OptimizeChannels = &FMUSIC_OptimizeChannels; instance->FMUSIC_SetReverb = &FMUSIC_SetReverb; instance->FMUSIC_SetLooping = &FMUSIC_SetLooping; instance->FMUSIC_SetOrder = &FMUSIC_SetOrder; instance->FMUSIC_SetPaused = &FMUSIC_SetPaused; instance->FMUSIC_SetMasterVolume = &FMUSIC_SetMasterVolume; instance->FMUSIC_SetMasterSpeed = &FMUSIC_SetMasterSpeed; instance->FMUSIC_SetPanSeperation = &FMUSIC_SetPanSeperation; instance->FMUSIC_GetName = &FMUSIC_GetName; instance->FMUSIC_GetType = &FMUSIC_GetType; instance->FMUSIC_GetNumOrders = &FMUSIC_GetNumOrders; instance->FMUSIC_GetNumPatterns = &FMUSIC_GetNumPatterns; instance->FMUSIC_GetNumInstruments = &FMUSIC_GetNumInstruments; instance->FMUSIC_GetNumSamples = &FMUSIC_GetNumSamples; instance->FMUSIC_GetNumChannels = &FMUSIC_GetNumChannels; instance->FMUSIC_GetSample = &FMUSIC_GetSample; instance->FMUSIC_GetPatternLength = &FMUSIC_GetPatternLength; instance->FMUSIC_IsFinished = &FMUSIC_IsFinished; instance->FMUSIC_IsPlaying = &FMUSIC_IsPlaying; instance->FMUSIC_GetMasterVolume = &FMUSIC_GetMasterVolume; instance->FMUSIC_GetGlobalVolume = &FMUSIC_GetGlobalVolume; instance->FMUSIC_GetOrder = &FMUSIC_GetOrder; instance->FMUSIC_GetPattern = &FMUSIC_GetPattern; instance->FMUSIC_GetSpeed = &FMUSIC_GetSpeed; instance->FMUSIC_GetBPM = &FMUSIC_GetBPM; instance->FMUSIC_GetRow = &FMUSIC_GetRow; instance->FMUSIC_GetPaused = &FMUSIC_GetPaused; instance->FMUSIC_GetTime = &FMUSIC_GetTime; instance->FMUSIC_GetRealChannel = &FMUSIC_GetRealChannel; instance->FMUSIC_GetUserData = &FMUSIC_GetUserData; } return instance; } static void FMOD_FreeInstance(FMOD_INSTANCE *instance) { if (instance) { free(instance); instance = NULL; } } #endif |
|
From: Brian M. <ma...@us...> - 2005-04-12 18:50:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14733 Added Files: Makefile.macosx Log Message: Makefile for mac fmod --- NEW FILE: Makefile.macosx --- CC=gcc LINKER=gcc STRIP=strip CFLAGS_LINK=-dynamiclib -framework JavaVM -framework Carbon STATIC_LIBS=${FMOD}/api/lib/libfmod.a CFLAGS_O=-fPIC -O2 -D_MACOSX -Wall -c -I.. -I${FMOD}/api/inc -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers SRC=$(wildcard *.c) ../common_tools.c OBJECTS=$(subst .c,.o,$(SRC)) LIBRARY=liblwjgl-fmod3.jnilib $(LIBRARY): $(OBJECTS) $(LINKER) $(CFLAGS_LINK) -o $@ $(OBJECTS) $(STATIC_LIBS) $(STRIP) -S -X $@ .c.o: $(CC) $(CFLAGS_O) $< -o $@ clean: rm -f $(OBJECTS) $(LIBRARY) |
|
From: Brian M. <ma...@us...> - 2005-04-12 18:48:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14045 Modified Files: org_lwjgl_fmod3_FSound.c Log Message: don't call OpenTray on mac Index: org_lwjgl_fmod3_FSound.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_fmod3_FSound.c 14 Nov 2004 10:42:18 -0000 1.7 +++ org_lwjgl_fmod3_FSound.c 12 Apr 2005 18:48:40 -0000 1.8 @@ -1391,7 +1391,11 @@ * Signature: (C)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_1CD_1OpenTray(JNIEnv * env, jclass clazz, jchar drive, jboolean open) { +#ifdef _MACOSX + return false; +#else return fmod_instance->FSOUND_CD_OpenTray(drive, open); +#endif } /* |
|
From: Elias N. <eli...@us...> - 2005-04-12 12:05:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9564/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: Win32: Implemented Mouse.setCursorPosition() Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_input_Mouse.c 12 Apr 2005 09:53:18 -0000 1.11 +++ org_lwjgl_input_Mouse.c 12 Apr 2005 12:04:36 -0000 1.12 @@ -352,6 +352,20 @@ UpdateMouseFields(env, coord_buffer_obj, button_buffer_obj); } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_setCursorPosition +(JNIEnv * env, jobject self, jint x, jint y) { + int transformed_x, transformed_y; + RECT window_rect; + if (!GetWindowRect(getCurrentHWND(), &window_rect)) { + printfDebugJava(env, "GetWindowRect failed"); + return; + } + transformed_x = window_rect.left + x; + transformed_y = window_rect.bottom - y; + if (!SetCursorPos(transformed_x, transformed_y)) + printfDebugJava(env, "SetCursorPos failed"); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_grabMouse (JNIEnv * env, jobject self, jboolean grab) { HRESULT di_res; |
|
From: Elias N. <eli...@us...> - 2005-04-12 11:57:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5484/src/java/org/lwjgl/input Modified Files: Mouse.java Log Message: Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- Mouse.java 12 Apr 2005 11:45:05 -0000 1.77 +++ Mouse.java 12 Apr 2005 11:56:59 -0000 1.78 @@ -185,6 +185,10 @@ public static void setCursorPosition(int x, int y) { if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0) throw new IllegalStateException("Mouse doesn't support native cursors"); + if (isGrabbed()) + throw new IllegalStateException("Cursor is grabbed"); + if (!isCreated()) + throw new IllegalStateException("Mouse is not created"); Display.getImplementation().setCursorPosition(x, y); } @@ -211,6 +215,7 @@ x = width / 2; y = height / 2; readBuffer.clear(); + if (!isGrabbed() && (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0) setCursorPosition(x, y); } |
|
From: Elias N. <eli...@us...> - 2005-04-12 11:45:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31729/src/native/linux Modified Files: org_lwjgl_input_Mouse.c Log Message: Added Mouse.setCursorPosition(x, y) Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- org_lwjgl_input_Mouse.c 20 Feb 2005 11:24:22 -0000 1.34 +++ org_lwjgl_input_Mouse.c 12 Apr 2005 11:45:06 -0000 1.35 @@ -342,6 +342,17 @@ return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size); } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetCursorPosition(JNIEnv * env, jclass clazz, jint x, jint y) { + XWindowAttributes attributes; + if (!XGetWindowAttributes(getDisplay(), getCurrentWindow(), &attributes)) { + printfDebugJava(env, "XGetWindowAttributes failed"); + return; + } + int transformed_x = attributes.x + x; + int transformed_y = attributes.y + transformY(y); + XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, transformed_x, transformed_y); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabMouse(JNIEnv * env, jclass clazz, jboolean new_grab) { Window root_return, child_return; int root_x, root_y, win_x, win_y; |
|
From: Elias N. <eli...@us...> - 2005-04-12 11:45:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31729/src/java/org/lwjgl/input Modified Files: Mouse.java Log Message: Added Mouse.setCursorPosition(x, y) Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- Mouse.java 9 Apr 2005 17:35:37 -0000 1.76 +++ Mouse.java 12 Apr 2005 11:45:05 -0000 1.77 @@ -152,10 +152,6 @@ * * NOTE: The native cursor is not constrained to the window, but * relative events will not be generated if the cursor is outside. - * The initial position of the cursor is the middle of the window, - * that is, {window_width/2, window_height/2}. - * The cursor will be moved to this origin when a - * native cursor is set and the previous cursor is null. * * @param cursor the native cursor object to bind. May be null. * @return The previous Cursor object set, or null. @@ -178,6 +174,21 @@ } /** + * Set the position of the native cursor. This method is only valid when + * the cursor is not grabbed and native cursors are supported. + * + * @param x The x coordinate of the new cursor position in OpenGL coordinates relative + * to the window origin. + * @param y The y coordinate of the new cursor position in OpenGL coordinates relative + * to the window origin. + */ + public static void setCursorPosition(int x, int y) { + if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0) + throw new IllegalStateException("Mouse doesn't support native cursors"); + Display.getImplementation().setCursorPosition(x, y); + } + + /** * Static initialization */ private static void initialize() { @@ -200,6 +211,7 @@ x = width / 2; y = height / 2; readBuffer.clear(); + setCursorPosition(x, y); } /** |
|
From: Elias N. <eli...@us...> - 2005-04-12 11:45:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31729/src/java/org/lwjgl/opengl Modified Files: DisplayImplementation.java LinuxDisplay.java MacOSXDisplay.java Win32Display.java Log Message: Added Mouse.setCursorPosition(x, y) Index: Win32Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Win32Display.java 29 Mar 2005 18:09:30 -0000 1.16 +++ Win32Display.java 12 Apr 2005 11:45:06 -0000 1.17 @@ -106,6 +106,7 @@ return Cursor.CURSOR_ONE_BIT_TRANSPARENCY; } + public native void setCursorPosition(int x, int y); public native void setNativeCursor(Object handle) throws LWJGLException; public native int getMinCursorSize(); public native int getMaxCursorSize(); Index: DisplayImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- DisplayImplementation.java 23 Feb 2005 11:11:07 -0000 1.11 +++ DisplayImplementation.java 12 Apr 2005 11:45:06 -0000 1.12 @@ -162,6 +162,9 @@ */ int getNativeCursorCapabilities(); + /** Method to set the native cursor position */ + void setCursorPosition(int x, int y); + /** Method to set the native cursor */ void setNativeCursor(Object handle) throws LWJGLException; Index: MacOSXDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- MacOSXDisplay.java 29 Mar 2005 18:09:30 -0000 1.26 +++ MacOSXDisplay.java 12 Apr 2005 11:45:06 -0000 1.27 @@ -306,6 +306,10 @@ return 0; } + public void setCursorPosition(int x, int y) { + throw new UnsupportedOperationException(); + } + public void setNativeCursor(Object handle) throws LWJGLException { Cursor awt_cursor = (Cursor)handle; frame.setCursor(awt_cursor); Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- LinuxDisplay.java 29 Mar 2005 18:09:30 -0000 1.22 +++ LinuxDisplay.java 12 Apr 2005 11:45:06 -0000 1.23 @@ -268,6 +268,13 @@ } private static native int nReadMouse(IntBuffer buffer, int buffer_position); + public void setCursorPosition(int x, int y) { + lockAWT(); + nSetCursorPosition(x, y); + unlockAWT(); + } + private native void nSetCursorPosition(int x, int y); + public void grabMouse(boolean grab) { lockAWT(); nGrabMouse(grab); |
|
From: Elias N. <eli...@us...> - 2005-04-12 10:55:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7405/src/native/common Modified Files: org_lwjgl_openal_AL.c org_lwjgl_openal_AL10.c org_lwjgl_openal_ALC.c Removed Files: checkALerror.h Log Message: Moved ALC error check to java. Fix linux type cast warnings Index: org_lwjgl_openal_AL10.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_AL10.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_openal_AL10.c 15 Feb 2005 11:05:14 -0000 1.6 +++ org_lwjgl_openal_AL10.c 12 Apr 2005 10:55:23 -0000 1.7 @@ -1,7 +1,6 @@ /* MACHINE GENERATED FILE, DO NOT EDIT */ #include <jni.h> -#include "checkALerror.h" #include "extal.h" typedef ALvoid (ALAPIENTRY *alDopplerVelocityPROC) (ALfloat value); Index: org_lwjgl_openal_AL.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_AL.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_AL.c 10 Sep 2004 08:13:48 -0000 1.1 +++ org_lwjgl_openal_AL.c 12 Apr 2005 10:55:23 -0000 1.2 @@ -33,7 +33,6 @@ #include "org_lwjgl_openal_AL.h" /* OpenAL includes */ -#include "checkALerror.h" #include "extal.h" JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreate (JNIEnv *env, jclass clazz, jobjectArray oalPaths) { --- checkALerror.h DELETED --- Index: org_lwjgl_openal_ALC.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_openal_ALC.c 12 Apr 2005 10:30:05 -0000 1.7 +++ org_lwjgl_openal_ALC.c 12 Apr 2005 10:55:23 -0000 1.8 @@ -40,7 +40,6 @@ */ /* OpenAL includes */ -#include "checkALerror.h" #include "extal.h" //alc @@ -82,7 +81,7 @@ * ALubyte * alcGetString(ALCdevice *device, ALenum token); */ static jstring JNICALL Java_org_lwjgl_openal_ALC_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) { - const char* alcString = (const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token); + const char* alcString = (const char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token); jstring string; if(alcString == NULL) { @@ -91,7 +90,6 @@ string = NewStringNative(env, alcString); - CHECK_ALC_ERROR return string; } @@ -102,12 +100,11 @@ * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest); */ static void JNICALL Java_org_lwjgl_openal_ALC_nalcGetIntegerv (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token, jint size, jobject dest, jint offset) { - ALint* address = NULL; - if (dest != NULL) { - address = offset + (ALint*) (*env)->GetDirectBufferAddress(env, dest); - } - alcGetIntegerv((ALCdevice*) deviceaddress, (ALenum) token, (ALsizei) size, address); - CHECK_ALC_ERROR + ALint* address = NULL; + if (dest != NULL) { + address = offset + (ALint*) (*env)->GetDirectBufferAddress(env, dest); + } + alcGetIntegerv((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token, (ALsizei) size, address); } /** @@ -146,7 +143,7 @@ alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(J)V"); /* create instance */ - alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (jlong) device); + alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (jlong)((intptr_t)device)); /* clean up */ if (tokenstring != NULL) @@ -162,7 +159,7 @@ * void alcCloseDevice( ALCdevice *dev ); */ static void JNICALL Java_org_lwjgl_openal_ALC_alcCloseDevice (JNIEnv *env, jclass clazz, jlong deviceaddress) { - alcCloseDevice((ALCdevice*) deviceaddress); + alcCloseDevice((ALCdevice*)((intptr_t)deviceaddress)); } /** @@ -171,7 +168,7 @@ * C Specification: * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist ); */ -static jobject JNICALL Java_org_lwjgl_openal_ALC_alcCreateContext (JNIEnv *env, jclass clazz, jlong deviceaddress, jobject attrlist) { +static jobject JNICALL Java_org_lwjgl_openal_ALC_nalcCreateContext (JNIEnv *env, jclass clazz, jlong deviceaddress, jobject attrlist) { ALint* address = NULL; ALCcontext* context; /* get ready to create ALCcontext instance */ @@ -182,7 +179,7 @@ if (attrlist != NULL) { address = (ALint*) (*env)->GetDirectBufferAddress(env, attrlist); } - context = alcCreateContext((ALCdevice*) deviceaddress, address); + context = alcCreateContext((ALCdevice*)((intptr_t)deviceaddress), address); /* if error - get out */ if(context == NULL) { @@ -194,9 +191,8 @@ alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(J)V"); /* create instance */ - alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (jlong)context); + alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (jlong)((intptr_t)context)); - CHECK_ALC_ERROR return alcContext_object; } @@ -207,7 +203,7 @@ * ALCboolean alcMakeContextCurrent(ALCcontext *context); */ static jint JNICALL Java_org_lwjgl_openal_ALC_alcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) { - ALCcontext* context = (ALCcontext*) contextaddress; + ALCcontext* context = (ALCcontext*)((intptr_t)contextaddress); ALCenum result; if(context == NULL) { result = alcMakeContextCurrent(NULL); @@ -224,7 +220,7 @@ * void alcProcessContext(ALCcontext *context); */ static void JNICALL Java_org_lwjgl_openal_ALC_nalcProcessContext (JNIEnv *env, jclass clazz, jlong contextaddress) { - alcProcessContext((ALCcontext*) contextaddress); + alcProcessContext((ALCcontext*)((intptr_t)contextaddress)); } /** @@ -249,7 +245,7 @@ alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(J)V"); /* create instance */ - alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (jlong) context); + alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (jlong)((intptr_t)context)); return alcContext_object; } @@ -261,8 +257,7 @@ * ALCdevice* alcGetContextsDevice(ALCcontext *context); */ static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetContextsDevice (JNIEnv *env, jclass clazz, jlong contextaddress) { - - ALCdevice* device = alcGetContextsDevice((ALCcontext*) contextaddress); + ALCdevice* device = alcGetContextsDevice((ALCcontext*)((intptr_t)contextaddress)); /* get ready to create ALCdevice instance */ jobject alcDevice_object = NULL; jclass alcDevice_class = NULL; @@ -277,7 +272,7 @@ alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(J)V"); /* create instance */ - alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (jlong) device); + alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (jlong)((intptr_t)device)); return alcDevice_object; } @@ -289,7 +284,7 @@ * void alcSuspendContext(ALCcontext *context); */ static void JNICALL Java_org_lwjgl_openal_ALC_nalcSuspendContext (JNIEnv *env, jclass clazz, jlong contextaddress) { - alcSuspendContext((ALCcontext*) contextaddress); + alcSuspendContext((ALCcontext*)((intptr_t)contextaddress)); } /** @@ -299,7 +294,7 @@ * void alcDestroyContext(ALCcontext *context); */ static void JNICALL Java_org_lwjgl_openal_ALC_alcDestroyContext (JNIEnv *env, jclass clazz, jlong contextaddress) { - alcDestroyContext((ALCcontext*) contextaddress); + alcDestroyContext((ALCcontext*)((intptr_t)contextaddress)); } /** @@ -309,8 +304,7 @@ * ALCenum alcGetError(ALCdevice *device); */ static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetError (JNIEnv *env, jclass clazz, jlong deviceaddress) { - jint result = alcGetError((ALCdevice*) deviceaddress); - CHECK_ALC_ERROR + jint result = alcGetError((ALCdevice*)((intptr_t)deviceaddress)); return result; } @@ -324,11 +318,10 @@ /* get extension */ ALubyte* functionname = (ALubyte*) GetStringNativeChars(env, extName); - jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*) deviceaddress, functionname); + jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*)((intptr_t)deviceaddress), functionname); free(functionname); - CHECK_ALC_ERROR return result; } @@ -342,11 +335,10 @@ /* get extension */ ALubyte* enumerationname = (ALubyte*) GetStringNativeChars(env, enumName); - jint result = (jint) alcGetEnumValue((ALCdevice*) deviceaddress, enumerationname); + jint result = (jint) alcGetEnumValue((ALCdevice*)((intptr_t)deviceaddress), enumerationname); free(enumerationname); - CHECK_ALC_ERROR return result; } @@ -364,7 +356,7 @@ {"nalcGetIntegerv", "(JIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv}, {"alcOpenDevice", "(Ljava/lang/String;)Lorg/lwjgl/openal/ALCdevice;", (void*)&Java_org_lwjgl_openal_ALC_alcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice}, {"alcCloseDevice", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_alcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice}, - {"alcCreateContext", "(JLjava/nio/IntBuffer;)Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_alcCreateContext, "alcCreateContext", (void*)&alcCreateContext}, + {"nalcCreateContext", "(JLjava/nio/IntBuffer;)Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext}, {"alcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC_alcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent}, {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext}, {"alcGetCurrentContext", "()Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_alcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext}, |
|
From: Elias N. <eli...@us...> - 2005-04-12 10:55:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7405/src/java/org/lwjgl/openal Modified Files: ALC.java Util.java Log Message: Moved ALC error check to java. Fix linux type cast warnings Index: Util.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/Util.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Util.java 15 Feb 2005 11:05:00 -0000 1.1 +++ Util.java 12 Apr 2005 10:55:22 -0000 1.2 @@ -47,6 +47,12 @@ private Util() { } + public static void checkALCError() { + int err = ALC.alcGetError(); + if (err != ALC.ALC_NO_ERROR) + throw new OpenALException(ALC.alcGetString(err)); + } + public static void checkALError() { int err = AL10.alGetError(); if (err != AL10.AL_NO_ERROR) Index: ALC.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ALC.java 12 Apr 2005 10:30:03 -0000 1.26 +++ ALC.java 12 Apr 2005 10:55:22 -0000 1.27 @@ -164,10 +164,11 @@ * @return String property from device */ public static String alcGetString(int pname) { - return nalcGetString(AL.device.device, pname); + String result = nalcGetString(AL.device.device, pname); + Util.checkALCError(); + return result; } - - native static String nalcGetString(long device, int pname); + private native static String nalcGetString(long device, int pname); /** * The application can query ALC for information using an integer query function. @@ -192,9 +193,9 @@ public static void alcGetInteger(int pname, IntBuffer integerdata) { BufferChecks.checkDirect(integerdata); nalcGetIntegerv(AL.device.device, pname, integerdata.remaining(), integerdata, integerdata.position()); + Util.checkALCError(); } - - native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset); + private native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset); /** * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to @@ -236,7 +237,12 @@ * @param attrList Buffer to read attributes from * @return New context, or null if creation failed */ - native static ALCcontext alcCreateContext(long device, IntBuffer attrList); + static ALCcontext alcCreateContext(long device, IntBuffer attrList) { + ALCcontext result = nalcCreateContext(device, attrList); + Util.checkALCError(); + return result; + } + private native static ALCcontext nalcCreateContext(long device, IntBuffer attrList); /** * To make a Context current with respect to AL Operation (state changes by issueing @@ -268,8 +274,7 @@ public static void alcProcessContext() { nalcProcessContext(AL.context.context); } - - native static void nalcProcessContext(long context); + private native static void nalcProcessContext(long context); /** * The application can query for, and obtain an handle to, the current context for the @@ -299,10 +304,10 @@ * * @param context address of context to suspend */ - public static void alcSuspendContext() { - nalcSuspendContext(AL.context.context); - } - native static void nalcSuspendContext(long context); + public static void alcSuspendContext() { + nalcSuspendContext(AL.context.context); + } + private native static void nalcSuspendContext(long context); /** * The correct way to destroy a context is to first release it using <code>alcMakeCurrent</code> and @@ -330,8 +335,7 @@ public static int alcGetError() { return nalcGetError(AL.device.device); } - - native static int nalcGetError(long device); + private native static int nalcGetError(long device); /** * Verify that a given extension is available for the current context and the device it @@ -343,10 +347,11 @@ * @return true if extension is available, false if not */ public static boolean alcIsExtensionPresent(String extName) { - return nalcIsExtensionPresent(AL.device.device, extName); + boolean result = nalcIsExtensionPresent(AL.device.device, extName); + Util.checkALCError(); + return result; } - - native static boolean nalcIsExtensionPresent(long device, String extName); + private native static boolean nalcIsExtensionPresent(long device, String extName); /** * Enumeration/token values are device independend, but tokens defined for @@ -359,8 +364,9 @@ * @return value of enumeration */ public static int alcGetEnumValue(String enumName) { - return nalcGetEnumValue(AL.device.device, enumName); + int result = nalcGetEnumValue(AL.device.device, enumName); + Util.checkALCError(); + return result; } - - native static int nalcGetEnumValue(long device, String enumName); + private native static int nalcGetEnumValue(long device, String enumName); } |
|
From: Elias N. <eli...@us...> - 2005-04-12 10:30:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27429/src/native/common Modified Files: org_lwjgl_openal_ALC.c Log Message: Converted ALC pointers from int to long Index: org_lwjgl_openal_ALC.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_openal_ALC.c 28 Jan 2005 21:02:48 -0000 1.6 +++ org_lwjgl_openal_ALC.c 12 Apr 2005 10:30:05 -0000 1.7 @@ -81,7 +81,7 @@ * C Specification: * ALubyte * alcGetString(ALCdevice *device, ALenum token); */ -static jstring JNICALL Java_org_lwjgl_openal_ALC_nalcGetString (JNIEnv *env, jclass clazz, jint deviceaddress, jint token) { +static jstring JNICALL Java_org_lwjgl_openal_ALC_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) { const char* alcString = (const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token); jstring string; @@ -101,7 +101,7 @@ * C Specification: * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest); */ -static void JNICALL Java_org_lwjgl_openal_ALC_nalcGetIntegerv (JNIEnv *env, jclass clazz, jint deviceaddress, jint token, jint size, jobject dest, jint offset) { +static void JNICALL Java_org_lwjgl_openal_ALC_nalcGetIntegerv (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token, jint size, jobject dest, jint offset) { ALint* address = NULL; if (dest != NULL) { address = offset + (ALint*) (*env)->GetDirectBufferAddress(env, dest); @@ -143,10 +143,10 @@ /* find class and constructor */ alcDevice_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCdevice"); - alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(I)V"); + alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(J)V"); /* create instance */ - alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (int) device); + alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (jlong) device); /* clean up */ if (tokenstring != NULL) @@ -161,7 +161,7 @@ * C Specification: * void alcCloseDevice( ALCdevice *dev ); */ -static void JNICALL Java_org_lwjgl_openal_ALC_alcCloseDevice (JNIEnv *env, jclass clazz, jint deviceaddress) { +static void JNICALL Java_org_lwjgl_openal_ALC_alcCloseDevice (JNIEnv *env, jclass clazz, jlong deviceaddress) { alcCloseDevice((ALCdevice*) deviceaddress); } @@ -171,7 +171,7 @@ * C Specification: * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist ); */ -static jobject JNICALL Java_org_lwjgl_openal_ALC_alcCreateContext (JNIEnv *env, jclass clazz, jint deviceaddress, jobject attrlist) { +static jobject JNICALL Java_org_lwjgl_openal_ALC_alcCreateContext (JNIEnv *env, jclass clazz, jlong deviceaddress, jobject attrlist) { ALint* address = NULL; ALCcontext* context; /* get ready to create ALCcontext instance */ @@ -191,10 +191,10 @@ /* find class and constructor */ alcContext_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCcontext"); - alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(I)V"); + alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(J)V"); /* create instance */ - alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (int) context); + alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (jlong)context); CHECK_ALC_ERROR return alcContext_object; @@ -206,7 +206,7 @@ * C Specification: * ALCboolean alcMakeContextCurrent(ALCcontext *context); */ -static jint JNICALL Java_org_lwjgl_openal_ALC_alcMakeContextCurrent (JNIEnv *env, jclass clazz, jint contextaddress) { +static jint JNICALL Java_org_lwjgl_openal_ALC_alcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) { ALCcontext* context = (ALCcontext*) contextaddress; ALCenum result; if(context == NULL) { @@ -223,7 +223,7 @@ * C Specification: * void alcProcessContext(ALCcontext *context); */ -static void JNICALL Java_org_lwjgl_openal_ALC_nalcProcessContext (JNIEnv *env, jclass clazz, jint contextaddress) { +static void JNICALL Java_org_lwjgl_openal_ALC_nalcProcessContext (JNIEnv *env, jclass clazz, jlong contextaddress) { alcProcessContext((ALCcontext*) contextaddress); } @@ -246,10 +246,10 @@ } /* find class and constructor */ alcContext_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCcontext"); - alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(I)V"); + alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(J)V"); /* create instance */ - alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (int) context); + alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (jlong) context); return alcContext_object; } @@ -260,7 +260,7 @@ * C Specification: * ALCdevice* alcGetContextsDevice(ALCcontext *context); */ -static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetContextsDevice (JNIEnv *env, jclass clazz, jint contextaddress) { +static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetContextsDevice (JNIEnv *env, jclass clazz, jlong contextaddress) { ALCdevice* device = alcGetContextsDevice((ALCcontext*) contextaddress); /* get ready to create ALCdevice instance */ @@ -274,10 +274,10 @@ /* find class and constructor */ alcDevice_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCdevice"); - alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(I)V"); + alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(J)V"); /* create instance */ - alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (int) device); + alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (jlong) device); return alcDevice_object; } @@ -288,7 +288,7 @@ * C Specification: * void alcSuspendContext(ALCcontext *context); */ -static void JNICALL Java_org_lwjgl_openal_ALC_nalcSuspendContext (JNIEnv *env, jclass clazz, jint contextaddress) { +static void JNICALL Java_org_lwjgl_openal_ALC_nalcSuspendContext (JNIEnv *env, jclass clazz, jlong contextaddress) { alcSuspendContext((ALCcontext*) contextaddress); } @@ -298,7 +298,7 @@ * C Specification: * void alcDestroyContext(ALCcontext *context); */ -static void JNICALL Java_org_lwjgl_openal_ALC_alcDestroyContext (JNIEnv *env, jclass clazz, jint contextaddress) { +static void JNICALL Java_org_lwjgl_openal_ALC_alcDestroyContext (JNIEnv *env, jclass clazz, jlong contextaddress) { alcDestroyContext((ALCcontext*) contextaddress); } @@ -308,7 +308,7 @@ * C Specification: * ALCenum alcGetError(ALCdevice *device); */ -static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetError (JNIEnv *env, jclass clazz, jint deviceaddress) { +static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetError (JNIEnv *env, jclass clazz, jlong deviceaddress) { jint result = alcGetError((ALCdevice*) deviceaddress); CHECK_ALC_ERROR return result; @@ -320,7 +320,7 @@ * C Specification: * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName); */ -static jboolean JNICALL Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jint deviceaddress, jstring extName) { +static jboolean JNICALL Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring extName) { /* get extension */ ALubyte* functionname = (ALubyte*) GetStringNativeChars(env, extName); @@ -338,7 +338,7 @@ * C Specification: * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName); */ -static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetEnumValue (JNIEnv *env, jclass clazz, jint deviceaddress, jstring enumName) { +static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetEnumValue (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring enumName) { /* get extension */ ALubyte* enumerationname = (ALubyte*) GetStringNativeChars(env, enumName); @@ -360,20 +360,20 @@ #endif JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_initNativeStubs(JNIEnv *env, jclass clazz) { JavaMethodAndExtFunction functions[] = { - {"nalcGetString", "(II)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC_nalcGetString, "alcGetString", (void*)&alcGetString}, - {"nalcGetIntegerv", "(IIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv}, + {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC_nalcGetString, "alcGetString", (void*)&alcGetString}, + {"nalcGetIntegerv", "(JIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv}, {"alcOpenDevice", "(Ljava/lang/String;)Lorg/lwjgl/openal/ALCdevice;", (void*)&Java_org_lwjgl_openal_ALC_alcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice}, - {"alcCloseDevice", "(I)V", (void*)&Java_org_lwjgl_openal_ALC_alcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice}, - {"alcCreateContext", "(ILjava/nio/IntBuffer;)Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_alcCreateContext, "alcCreateContext", (void*)&alcCreateContext}, - {"alcMakeContextCurrent", "(I)I", (void*)&Java_org_lwjgl_openal_ALC_alcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent}, - {"nalcProcessContext", "(I)V", (void*)&Java_org_lwjgl_openal_ALC_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext}, + {"alcCloseDevice", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_alcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice}, + {"alcCreateContext", "(JLjava/nio/IntBuffer;)Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_alcCreateContext, "alcCreateContext", (void*)&alcCreateContext}, + {"alcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC_alcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent}, + {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext}, {"alcGetCurrentContext", "()Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_alcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext}, - {"alcGetContextsDevice", "(I)Lorg/lwjgl/openal/ALCdevice;", (void*)&Java_org_lwjgl_openal_ALC_alcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice}, - {"nalcSuspendContext", "(I)V", (void*)&Java_org_lwjgl_openal_ALC_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext}, - {"alcDestroyContext", "(I)V", (void*)&Java_org_lwjgl_openal_ALC_alcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext}, - {"nalcGetError", "(I)I", (void*)&Java_org_lwjgl_openal_ALC_nalcGetError, "alcGetError", (void*)&alcGetError}, - {"nalcIsExtensionPresent", "(ILjava/lang/String;)Z", (void*)&Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent}, - {"nalcGetEnumValue", "(ILjava/lang/String;)I", (void*)&Java_org_lwjgl_openal_ALC_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue} + {"alcGetContextsDevice", "(J)Lorg/lwjgl/openal/ALCdevice;", (void*)&Java_org_lwjgl_openal_ALC_alcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice}, + {"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext}, + {"alcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_alcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext}, + {"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC_nalcGetError, "alcGetError", (void*)&alcGetError}, + {"nalcIsExtensionPresent", "(JLjava/lang/String;)Z", (void*)&Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent}, + {"nalcGetEnumValue", "(JLjava/lang/String;)I", (void*)&Java_org_lwjgl_openal_ALC_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue} }; int num_functions = NUMFUNCTIONS(functions); extal_InitializeClass(env, clazz, num_functions, functions); |
|
From: Elias N. <eli...@us...> - 2005-04-12 10:30:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27429/src/java/org/lwjgl/openal Modified Files: ALC.java ALCcontext.java ALCdevice.java Log Message: Converted ALC pointers from int to long Index: ALCcontext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ALCcontext.java 20 Aug 2004 06:22:53 -0000 1.12 +++ ALCcontext.java 12 Apr 2005 10:30:03 -0000 1.13 @@ -46,14 +46,14 @@ final class ALCcontext { /** address of actual context */ - final int context; + final long context; /** * Creates a new instance of ALCcontext * * @param context address of actual context */ - ALCcontext(int context) { + ALCcontext(long context) { this.context = context; } Index: ALC.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ALC.java 1 Aug 2004 21:26:25 -0000 1.25 +++ ALC.java 12 Apr 2005 10:30:03 -0000 1.26 @@ -167,7 +167,7 @@ return nalcGetString(AL.device.device, pname); } - native static String nalcGetString(int device, int pname); + native static String nalcGetString(long device, int pname); /** * The application can query ALC for information using an integer query function. @@ -194,7 +194,7 @@ nalcGetIntegerv(AL.device.device, pname, integerdata.remaining(), integerdata, integerdata.position()); } - native static void nalcGetIntegerv(int device, int pname, int size, Buffer integerdata, int offset); + native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset); /** * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to @@ -219,7 +219,7 @@ * * @param device address of native device to close */ - native static void alcCloseDevice(int device); + native static void alcCloseDevice(long device); /** * A context is created using <code>alcCreateContext</code>. The device parameter has to be a valid @@ -236,7 +236,7 @@ * @param attrList Buffer to read attributes from * @return New context, or null if creation failed */ - native static ALCcontext alcCreateContext(int device, IntBuffer attrList); + native static ALCcontext alcCreateContext(long device, IntBuffer attrList); /** * To make a Context current with respect to AL Operation (state changes by issueing @@ -252,7 +252,7 @@ * @param context address of context to make current * @return true if successfull, false if not */ - native static int alcMakeContextCurrent(int context); + native static int alcMakeContextCurrent(long context); /** * The current context is the only context accessible to state changes by AL commands @@ -269,7 +269,7 @@ nalcProcessContext(AL.context.context); } - native static void nalcProcessContext(int context); + native static void nalcProcessContext(long context); /** * The application can query for, and obtain an handle to, the current context for the @@ -285,7 +285,7 @@ * @param context address of context to get device for * @param ALCdevice associated with context */ - native static ALCdevice alcGetContextsDevice(int context); + native static ALCdevice alcGetContextsDevice(long context); /** * The application can suspend any context from processing (including the current @@ -302,7 +302,7 @@ public static void alcSuspendContext() { nalcSuspendContext(AL.context.context); } - native static void nalcSuspendContext(int context); + native static void nalcSuspendContext(long context); /** * The correct way to destroy a context is to first release it using <code>alcMakeCurrent</code> and @@ -310,7 +310,7 @@ * * @param context address of context to Destroy */ - native static void alcDestroyContext(int context); + native static void alcDestroyContext(long context); /** * ALC uses the same conventions and mechanisms as AL for error handling. In @@ -331,7 +331,7 @@ return nalcGetError(AL.device.device); } - native static int nalcGetError(int device); + native static int nalcGetError(long device); /** * Verify that a given extension is available for the current context and the device it @@ -346,7 +346,7 @@ return nalcIsExtensionPresent(AL.device.device, extName); } - native static boolean nalcIsExtensionPresent(int device, String extName); + native static boolean nalcIsExtensionPresent(long device, String extName); /** * Enumeration/token values are device independend, but tokens defined for @@ -362,5 +362,5 @@ return nalcGetEnumValue(AL.device.device, enumName); } - native static int nalcGetEnumValue(int device, String enumName); + native static int nalcGetEnumValue(long device, String enumName); } Index: ALCdevice.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ALCdevice.java 12 Jun 2004 20:28:22 -0000 1.8 +++ ALCdevice.java 12 Apr 2005 10:30:04 -0000 1.9 @@ -42,14 +42,14 @@ final class ALCdevice { /** address of actual device */ - final int device; + final long device; /** * Creates a new instance of ALCdevice * * @param device address of actual device */ - ALCdevice(int device) { + ALCdevice(long device) { this.device = device; } -} \ No newline at end of file +} |
|
From: Elias N. <eli...@us...> - 2005-04-12 09:53:33
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7036/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: Win32: Fixed 64 bit warnings in Mouse.c Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- org_lwjgl_input_Mouse.c 18 Jan 2005 16:42:31 -0000 1.10 +++ org_lwjgl_input_Mouse.c 12 Apr 2005 09:53:18 -0000 1.11 @@ -336,10 +336,10 @@ if (handle_buffer != NULL) { cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer); cursor = *cursor_handle; - SetClassLong(getCurrentHWND(), GCL_HCURSOR, (LONG)cursor); + SetClassLongPtr(getCurrentHWND(), GCL_HCURSOR, (LONG_PTR)cursor); SetCursor(cursor); } else { - SetClassLong(getCurrentHWND(), GCL_HCURSOR, (LONG)NULL); + SetClassLongPtr(getCurrentHWND(), GCL_HCURSOR, (LONG_PTR)NULL); SetCursor(LoadCursor(NULL, IDC_ARROW)); } } |
|
From: Elias N. <eli...@us...> - 2005-04-12 09:11:17
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17261/platform_build/win32_ms_cmdline Modified Files: build.bat Log Message: Win32: Added /Wp64 flag to the cmd line build.bat. It enables 64 bit specific warnings which should be fixed to be ready for 64 bit platforms. Index: build.bat =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline/build.bat,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- build.bat 29 Mar 2005 18:43:49 -0000 1.18 +++ build.bat 12 Apr 2005 09:11:07 -0000 1.19 @@ -5,7 +5,7 @@ if "%CHOME%" == "" goto errorchome if "%ALHOME%" == "" goto erroralhome if "%DXHOME%" == "" goto errordxhome -set COPTIONS=/I"%DXHOME%\include" /I"%CHOME%\include" /I"%PLTSDKHOME%\include" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /I"%ALHOME%\include" /I"..\..\src\native\common" /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LWJGL_EXPORTS" /D "_WINDLL" +set COPTIONS=/Wp64 /I"%DXHOME%\include" /I"%CHOME%\include" /I"%PLTSDKHOME%\include" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /I"%ALHOME%\include" /I"..\..\src\native\common" /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LWJGL_EXPORTS" /D "_WINDLL" rem ************************************************* rem ** Build using free compiler requires jawt.dll ** rem ** and awt.dll in current dir. /delayload ** |
|
From: Elias N. <eli...@us...> - 2005-04-11 12:54:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29265/common Modified Files: extal.c Log Message: Fixed compile warnings Index: extal.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- extal.c 11 Apr 2005 12:38:00 -0000 1.23 +++ extal.c 11 Apr 2005 12:54:12 -0000 1.24 @@ -106,39 +106,48 @@ return p; } -/** - * Loads the OpenAL Library - */ -static bool LoadOpenAL(JNIEnv *env, jobjectArray oalPaths) { - jsize pathcount = (*env)->GetArrayLength(env, oalPaths); - int i; - jstring path; - const char *path_str; - - printfDebug("Found %d OpenAL paths\n", (int)pathcount); - for(i=0;i<pathcount;i++) { - path = (jstring) (*env)->GetObjectArrayElement(env, oalPaths, i); +static void tryLoadLibrary(JNIEnv *env, jstring path) { #ifdef _WIN32 - path_str = GetStringNativeChars(env, path); + char *path_str = GetStringNativeChars(env, path); printfDebug("Testing '%s'\n", path_str); handleOAL = LoadLibrary(path_str); + if (handleOAL != NULL) { + printfDebugJava(env, "Found OpenAL at '%s'\n", path_str); + } free(path_str); #endif #ifdef _X11 - path_str = GetStringNativeChars(env, path); + char *path_str = GetStringNativeChars(env, path); printfDebug("Testing '%s'\n", path_str); handleOAL = dlopen(path_str, RTLD_LAZY); + if (handleOAL != NULL) { + printfDebugJava(env, "Found OpenAL at '%s'\n", path_str); + } free(path_str); #endif #ifdef _MACOSX - path_str = (*env)->GetStringUTFChars(env, path, NULL); + const char *path_str = (*env)->GetStringUTFChars(env, path, NULL); printfDebug("Testing '%s'\n", path_str); handleOAL = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); - (*env)->ReleaseStringUTFChars(env, path, path_str); -#endif if (handleOAL != NULL) { - printfDebug("Found OpenAL at '%s'\n", path_str); + printfDebugJava(env, "Found OpenAL at '%s'\n", path_str); } + (*env)->ReleaseStringUTFChars(env, path, path_str); +#endif +} + +/** + * Loads the OpenAL Library + */ +static bool LoadOpenAL(JNIEnv *env, jobjectArray oalPaths) { + jsize pathcount = (*env)->GetArrayLength(env, oalPaths); + int i; + jstring path; + + printfDebug("Found %d OpenAL paths\n", (int)pathcount); + for(i=0;i<pathcount;i++) { + path = (jstring) (*env)->GetObjectArrayElement(env, oalPaths, i); + tryLoadLibrary(env, path); if (handleOAL != NULL) { return true; } |
|
From: Elias N. <eli...@us...> - 2005-04-11 12:38:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20641/common Modified Files: extal.c Log Message: Mac OS X: Use GetStringUTFChars instead of GetNativeChars to get the openal path Index: extal.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- extal.c 9 Mar 2005 13:06:17 -0000 1.22 +++ extal.c 11 Apr 2005 12:38:00 -0000 1.23 @@ -113,26 +113,32 @@ jsize pathcount = (*env)->GetArrayLength(env, oalPaths); int i; jstring path; - char *path_str; + const char *path_str; printfDebug("Found %d OpenAL paths\n", (int)pathcount); for(i=0;i<pathcount;i++) { path = (jstring) (*env)->GetObjectArrayElement(env, oalPaths, i); +#ifdef _WIN32 path_str = GetStringNativeChars(env, path); printfDebug("Testing '%s'\n", path_str); -#ifdef _WIN32 handleOAL = LoadLibrary(path_str); + free(path_str); #endif #ifdef _X11 + path_str = GetStringNativeChars(env, path); + printfDebug("Testing '%s'\n", path_str); handleOAL = dlopen(path_str, RTLD_LAZY); + free(path_str); #endif #ifdef _MACOSX + path_str = (*env)->GetStringUTFChars(env, path, NULL); + printfDebug("Testing '%s'\n", path_str); handleOAL = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); + (*env)->ReleaseStringUTFChars(env, path, path_str); #endif if (handleOAL != NULL) { printfDebug("Found OpenAL at '%s'\n", path_str); } - free(path_str); if (handleOAL != NULL) { return true; } |
|
From: Elias N. <eli...@us...> - 2005-04-11 10:00:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv485 Modified Files: org_lwjgl_input_Keyboard.c Log Message: Linux: Improved keyboard mapping support Index: org_lwjgl_input_Keyboard.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_input_Keyboard.c 9 Apr 2005 23:26:27 -0000 1.17 +++ org_lwjgl_input_Keyboard.c 11 Apr 2005 10:00:09 -0000 1.18 @@ -57,6 +57,10 @@ #define KEY_EVENT_BACKLOG 40 static unsigned char key_buf[KEYBOARD_SIZE]; +static int numlock_mask; +static int modeswitch_mask; +static int caps_lock_mask; +static int shift_lock_mask; static event_queue_t event_queue; @@ -93,7 +97,7 @@ } } -static void closeUnicodeStructs() { +static void cleanup() { if (iconv_descriptor != (iconv_t)-1) { iconv_close(iconv_descriptor); iconv_descriptor = (iconv_t)-1; @@ -126,7 +130,44 @@ keyboard_grabbed = false; initEventQueue(&event_queue, 3); updateKeyboardGrab(); - + XModifierKeymap *modifier_map = XGetModifierMapping(getDisplay()); + numlock_mask = 0; + modeswitch_mask = 0; + caps_lock_mask = 0; + shift_lock_mask = 0; + if (modifier_map != NULL) { + // Find modifier masks + int i, j; + for (i = 0; i < 8; i++) { + for (j = 0; j < modifier_map->max_keypermod; j++) { + KeyCode key_code = modifier_map->modifiermap[i*modifier_map->max_keypermod + j]; + KeySym key_sym = XKeycodeToKeysym(getDisplay(), key_code, 0); + int mask = 1 << i; + switch (key_sym) { + case XK_Num_Lock: + numlock_mask |= mask; + break; + case XK_Mode_switch: + modeswitch_mask |= mask; + break; + case XK_Caps_Lock: + if (i == LockMapIndex) { + caps_lock_mask = mask; + shift_lock_mask = 0; + } + break; + case XK_Shift_Lock: + if (i == LockMapIndex && caps_lock_mask == 0) + shift_lock_mask = mask; + break; + default: + break; + } + } + } + XFreeModifiermap(modifier_map); + } + // Allocate unicode structures iconv_descriptor = iconv_open("UCS-2", "UTF-8"); if (iconv_descriptor != (iconv_t)-1) { @@ -136,17 +177,17 @@ if (xic != NULL) { setupIMEventMask(); } else { - closeUnicodeStructs(); + cleanup(); } } else - closeUnicodeStructs(); + cleanup(); } } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyKeyboard (JNIEnv * env, jclass clazz) { - closeUnicodeStructs(); + cleanup(); ungrabKeyboard(); created = false; } @@ -394,65 +435,142 @@ case XK_grave: return org_lwjgl_input_Keyboard_KEY_GRAVE; case XK_a: + case XK_A: return org_lwjgl_input_Keyboard_KEY_A; case XK_b: + case XK_B: return org_lwjgl_input_Keyboard_KEY_B; case XK_c: + case XK_C: return org_lwjgl_input_Keyboard_KEY_C; case XK_d: + case XK_D: return org_lwjgl_input_Keyboard_KEY_D; case XK_e: + case XK_E: return org_lwjgl_input_Keyboard_KEY_E; case XK_f: + case XK_F: return org_lwjgl_input_Keyboard_KEY_F; case XK_g: + case XK_G: return org_lwjgl_input_Keyboard_KEY_G; case XK_h: + case XK_H: return org_lwjgl_input_Keyboard_KEY_H; case XK_i: + case XK_I: return org_lwjgl_input_Keyboard_KEY_I; case XK_j: + case XK_J: return org_lwjgl_input_Keyboard_KEY_J; case XK_k: + case XK_K: return org_lwjgl_input_Keyboard_KEY_K; case XK_l: + case XK_L: return org_lwjgl_input_Keyboard_KEY_L; case XK_m: + case XK_M: return org_lwjgl_input_Keyboard_KEY_M; case XK_n: + case XK_N: return org_lwjgl_input_Keyboard_KEY_N; case XK_o: + case XK_O: return org_lwjgl_input_Keyboard_KEY_O; case XK_p: + case XK_P: return org_lwjgl_input_Keyboard_KEY_P; case XK_q: + case XK_Q: return org_lwjgl_input_Keyboard_KEY_Q; case XK_r: + case XK_R: return org_lwjgl_input_Keyboard_KEY_R; case XK_s: + case XK_S: return org_lwjgl_input_Keyboard_KEY_S; case XK_t: + case XK_T: return org_lwjgl_input_Keyboard_KEY_T; case XK_u: + case XK_U: return org_lwjgl_input_Keyboard_KEY_U; case XK_v: + case XK_V: return org_lwjgl_input_Keyboard_KEY_V; case XK_w: + case XK_W: return org_lwjgl_input_Keyboard_KEY_W; case XK_x: + case XK_X: return org_lwjgl_input_Keyboard_KEY_X; case XK_y: + case XK_Y: return org_lwjgl_input_Keyboard_KEY_Y; case XK_z: + case XK_Z: return org_lwjgl_input_Keyboard_KEY_Z; default: return org_lwjgl_input_Keyboard_KEY_NONE; } } +static bool isKeypadKeysym(KeySym keysym) { + return (0xFF80 <= keysym && keysym <= 0xFFBD) || + (0x11000000 <= keysym && keysym <= 0x1100FFFF); +} + +static KeySym getKeySym(XKeyEvent *event, int group, int index) { + KeySym keysym = XLookupKeysym(event, group*2 + index); + if (keysym == NoSymbol && index == 1) + keysym = XLookupKeysym(event, group*2 + 0); + if (keysym == NoSymbol && group == 1) + keysym = getKeySym(event, 0, index); + return keysym; +} + +static KeySym toUpper(KeySym keysym) { + KeySym lower_case, upper_case; + XConvertCase(keysym, &lower_case, &upper_case); + return upper_case; +} + +/* Map an event to a KeySym. Use the rules described in + * http://tronche.com/gui/x/xlib/input/keyboard-encoding.html + */ +static KeySym mapEventToKeySym(XKeyEvent *event) { + int group; + KeySym keysym; + if ((event->state & modeswitch_mask) != 0) + group = 1; + else + group = 0; + if ((event->state & numlock_mask) != 0 && isKeypadKeysym(keysym = getKeySym(event, group, 1))) { + if ((event->state & (ShiftMask | shift_lock_mask)) != 0) { + return getKeySym(event, group, 0); + } else { + return keysym; + } + } else if ((event->state & (ShiftMask | LockMask)) == 0) { + return getKeySym(event, group, 0); + } else if ((event->state & ShiftMask) == 0) { + KeySym keysym = getKeySym(event, group, 0); + if ((event->state & caps_lock_mask) != 0) + keysym = toUpper(keysym); + return keysym; + } else { + KeySym keysym = getKeySym(event, group, 1); + if ((event->state & caps_lock_mask) != 0) + keysym = toUpper(keysym); + return keysym; + } +} + static unsigned char getKeycode(XKeyEvent *event) { - unsigned char keycode = (unsigned char)((event->keycode - 8) & 0xff); - KeySym keysym = XLookupKeysym(event, 0); + unsigned char keycode; + KeySym keysym = mapEventToKeySym(event); keycode = mapKeySymToLWJGLKeyCode(keysym); return keycode; } @@ -543,7 +661,6 @@ static void bufferEvent(XKeyEvent *key_event) { unsigned char keycode = getKeycode(key_event); unsigned char state = eventState(key_event); - //printf("Reading a key %d %d count %d\n", (int)keycode, (int)state, num_events); translateEvent(key_event, keycode, state); } |
|
From: Elias N. <eli...@us...> - 2005-04-11 07:58:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31982/common Modified Files: common_tools.c Log Message: Removed event buffer overflow message Index: common_tools.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- common_tools.c 29 Mar 2005 18:09:33 -0000 1.22 +++ common_tools.c 11 Apr 2005 07:58:10 -0000 1.23 @@ -122,7 +122,6 @@ bool putEvent(event_queue_t *queue, jint *event) { int i; if (getElementCapacity(queue) < queue->event_size) { - printfDebug("Event buffer overflow!\n"); return false; } for (i = 0; i < queue->event_size; i++) { |
|
From: Elias N. <eli...@us...> - 2005-04-09 23:26:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26104 Modified Files: org_lwjgl_input_Keyboard.c Log Message: Linux: Use KeySyms instead of raw key codes to take the keyboard mapping in account Index: org_lwjgl_input_Keyboard.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- org_lwjgl_input_Keyboard.c 20 Feb 2005 11:24:22 -0000 1.16 +++ org_lwjgl_input_Keyboard.c 9 Apr 2005 23:26:27 -0000 1.17 @@ -42,6 +42,7 @@ #include <X11/X.h> #include <X11/Xlib.h> #include <X11/Xutil.h> +#include <X11/keysym.h> #include <string.h> #include <assert.h> #include <iconv.h> @@ -56,7 +57,6 @@ #define KEY_EVENT_BACKLOG 40 static unsigned char key_buf[KEYBOARD_SIZE]; -static unsigned char key_map[KEYBOARD_SIZE]; static event_queue_t event_queue; @@ -64,7 +64,7 @@ static bool created = false; // X input manager values -static iconv_t iconv_descriptor; +static iconv_t iconv_descriptor = (iconv_t)-1; static XIM xim = NULL; static XIC xic = NULL; @@ -121,28 +121,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateKeyboard (JNIEnv * env, jclass clazz) { - int i; - for (i = 0; i < KEYBOARD_SIZE; i++) - key_map[i] = i; - key_map[0x6b] = 0xdb; // Left doze key - key_map[0x6c] = 0xdc; // Right doze key - key_map[0x6d] = 0xdd; // Apps key - key_map[0x5a] = 0xc8; // Up arrow - key_map[0x5c] = 0xcb; // Left arrow - key_map[0x5e] = 0xcd; // Right arrow - key_map[0x60] = 0xd0; // Down arrow - key_map[0x59] = 0xc7; // Home - key_map[0x62] = 0xd2; // Insert - key_map[0x63] = 0xd3; // Delete - key_map[0x5f] = 0xcf; // End - key_map[0x5b] = 0xc9; // Page up - key_map[0x61] = 0xd1; // Page down - key_map[0x67] = 0xb7; // SysRQ - key_map[0x66] = 0xc5; // Pause - key_map[0x64] = 0x9c; // Numpad enter - key_map[0x65] = 0x9d; // Right control - key_map[0x68] = 0xb5; // Numpad divide - memset(key_buf, 0, KEYBOARD_SIZE*sizeof(unsigned char)); created = true; keyboard_grabbed = false; @@ -173,9 +151,309 @@ created = false; } +static unsigned char mapKeySymToLWJGLKeyCode(KeySym keysym) { + switch (keysym) { + case XK_BackSpace: + return org_lwjgl_input_Keyboard_KEY_BACK; + case XK_Tab: + return org_lwjgl_input_Keyboard_KEY_TAB; + case XK_Return: + return org_lwjgl_input_Keyboard_KEY_RETURN; + case XK_Pause: + return org_lwjgl_input_Keyboard_KEY_PAUSE; + case XK_Scroll_Lock: + return org_lwjgl_input_Keyboard_KEY_SCROLL; + case XK_Sys_Req: + return org_lwjgl_input_Keyboard_KEY_SYSRQ; + case XK_Escape: + return org_lwjgl_input_Keyboard_KEY_ESCAPE; + case XK_Delete: + return org_lwjgl_input_Keyboard_KEY_DELETE; + +/* Japanese keyboard support */ + + case XK_Kanji: + return org_lwjgl_input_Keyboard_KEY_KANJI; + +/* Cursor control & motion */ + + case XK_Home: + return org_lwjgl_input_Keyboard_KEY_HOME; + case XK_Left: + return org_lwjgl_input_Keyboard_KEY_LEFT; + case XK_Up: + return org_lwjgl_input_Keyboard_KEY_UP; + case XK_Right: + return org_lwjgl_input_Keyboard_KEY_RIGHT; + case XK_Down: + return org_lwjgl_input_Keyboard_KEY_DOWN; + case XK_Page_Up: + return org_lwjgl_input_Keyboard_KEY_PRIOR; + case XK_Page_Down: + return org_lwjgl_input_Keyboard_KEY_NEXT; + case XK_End: + return org_lwjgl_input_Keyboard_KEY_END; + + +/* Misc Functions */ + + case XK_Break: + return org_lwjgl_input_Keyboard_KEY_PAUSE; + case XK_Insert: + return org_lwjgl_input_Keyboard_KEY_INSERT; + case XK_Num_Lock: + return org_lwjgl_input_Keyboard_KEY_NUMLOCK; + +/* Keypad Functions, keypad numbers cleverly chosen to map to ascii */ + + case XK_KP_Space: + return org_lwjgl_input_Keyboard_KEY_SPACE; + case XK_KP_Tab: + return org_lwjgl_input_Keyboard_KEY_TAB; + case XK_KP_Enter: + return org_lwjgl_input_Keyboard_KEY_NUMPADENTER; + case XK_KP_F1: + return org_lwjgl_input_Keyboard_KEY_F1; + case XK_KP_F2: + return org_lwjgl_input_Keyboard_KEY_F2; + case XK_KP_F3: + return org_lwjgl_input_Keyboard_KEY_F3; + case XK_KP_F4: + return org_lwjgl_input_Keyboard_KEY_F4; + case XK_KP_Home: + return org_lwjgl_input_Keyboard_KEY_HOME; + case XK_KP_Left: + return org_lwjgl_input_Keyboard_KEY_LEFT; + case XK_KP_Up: + return org_lwjgl_input_Keyboard_KEY_UP; + case XK_KP_Right: + return org_lwjgl_input_Keyboard_KEY_RIGHT; + case XK_KP_Down: + return org_lwjgl_input_Keyboard_KEY_DOWN; + case XK_KP_Page_Up: + return org_lwjgl_input_Keyboard_KEY_PRIOR; + case XK_KP_Page_Down: + return org_lwjgl_input_Keyboard_KEY_NEXT; + case XK_KP_End: + return org_lwjgl_input_Keyboard_KEY_END; + case XK_KP_Insert: + return org_lwjgl_input_Keyboard_KEY_INSERT; + case XK_KP_Delete: + return org_lwjgl_input_Keyboard_KEY_DELETE; + case XK_KP_Equal: + return org_lwjgl_input_Keyboard_KEY_NUMPADEQUALS; + case XK_KP_Multiply: + return org_lwjgl_input_Keyboard_KEY_MULTIPLY; + case XK_KP_Add: + return org_lwjgl_input_Keyboard_KEY_ADD; + case XK_KP_Subtract: + return org_lwjgl_input_Keyboard_KEY_SUBTRACT; + case XK_KP_Decimal: + return org_lwjgl_input_Keyboard_KEY_DECIMAL; + case XK_KP_Divide: + return org_lwjgl_input_Keyboard_KEY_DIVIDE; + + case XK_KP_0: + return org_lwjgl_input_Keyboard_KEY_NUMPAD0; + case XK_KP_1: + return org_lwjgl_input_Keyboard_KEY_NUMPAD1; + case XK_KP_2: + return org_lwjgl_input_Keyboard_KEY_NUMPAD2; + case XK_KP_3: + return org_lwjgl_input_Keyboard_KEY_NUMPAD3; + case XK_KP_4: + return org_lwjgl_input_Keyboard_KEY_NUMPAD4; + case XK_KP_5: + return org_lwjgl_input_Keyboard_KEY_NUMPAD5; + case XK_KP_6: + return org_lwjgl_input_Keyboard_KEY_NUMPAD6; + case XK_KP_7: + return org_lwjgl_input_Keyboard_KEY_NUMPAD7; + case XK_KP_8: + return org_lwjgl_input_Keyboard_KEY_NUMPAD8; + case XK_KP_9: + return org_lwjgl_input_Keyboard_KEY_NUMPAD9; + +/* + * Auxilliary Functions; note the duplicate definitions for left and right + * function keys; Sun keyboards and a few other manufactures have such + * function key groups on the left and/or right sides of the keyboard. + * We've not found a keyboard with more than 35 function keys total. + */ + + case XK_F1: + return org_lwjgl_input_Keyboard_KEY_F1; + case XK_F2: + return org_lwjgl_input_Keyboard_KEY_F2; + case XK_F3: + return org_lwjgl_input_Keyboard_KEY_F3; + case XK_F4: + return org_lwjgl_input_Keyboard_KEY_F4; + case XK_F5: + return org_lwjgl_input_Keyboard_KEY_F5; + case XK_F6: + return org_lwjgl_input_Keyboard_KEY_F6; + case XK_F7: + return org_lwjgl_input_Keyboard_KEY_F7; + case XK_F8: + return org_lwjgl_input_Keyboard_KEY_F8; + case XK_F9: + return org_lwjgl_input_Keyboard_KEY_F9; + case XK_F10: + return org_lwjgl_input_Keyboard_KEY_F10; + case XK_F11: + return org_lwjgl_input_Keyboard_KEY_F11; + case XK_F12: + return org_lwjgl_input_Keyboard_KEY_F12; + case XK_F13: + return org_lwjgl_input_Keyboard_KEY_F13; + case XK_F14: + return org_lwjgl_input_Keyboard_KEY_F14; + case XK_F15: + return org_lwjgl_input_Keyboard_KEY_F15; + +/* Modifiers */ + + case XK_Shift_L: + return org_lwjgl_input_Keyboard_KEY_LSHIFT; + case XK_Shift_R: + return org_lwjgl_input_Keyboard_KEY_RSHIFT; + case XK_Control_L: + return org_lwjgl_input_Keyboard_KEY_LCONTROL; + case XK_Control_R: + return org_lwjgl_input_Keyboard_KEY_RCONTROL; + case XK_Caps_Lock: + return org_lwjgl_input_Keyboard_KEY_CAPITAL; + + case XK_Meta_L: + return org_lwjgl_input_Keyboard_KEY_LMENU; + case XK_Meta_R: + return org_lwjgl_input_Keyboard_KEY_RMENU; + case XK_Alt_L: + return org_lwjgl_input_Keyboard_KEY_LMENU; + case XK_Alt_R: + return org_lwjgl_input_Keyboard_KEY_RMENU; + + case XK_dead_grave: + return org_lwjgl_input_Keyboard_KEY_GRAVE; + case XK_dead_circumflex: + return org_lwjgl_input_Keyboard_KEY_CIRCUMFLEX; + + /* + * Latin 1 + * Byte 3 = 0 + */ + case XK_space: + return org_lwjgl_input_Keyboard_KEY_SPACE; + case XK_apostrophe: + return org_lwjgl_input_Keyboard_KEY_APOSTROPHE; + case XK_comma: + return org_lwjgl_input_Keyboard_KEY_COMMA; + case XK_minus: + return org_lwjgl_input_Keyboard_KEY_MINUS; + case XK_period: + return org_lwjgl_input_Keyboard_KEY_PERIOD; + case XK_slash: + return org_lwjgl_input_Keyboard_KEY_SLASH; + case XK_0: + return org_lwjgl_input_Keyboard_KEY_0; + case XK_1: + return org_lwjgl_input_Keyboard_KEY_1; + case XK_2: + return org_lwjgl_input_Keyboard_KEY_2; + case XK_3: + return org_lwjgl_input_Keyboard_KEY_3; + case XK_4: + return org_lwjgl_input_Keyboard_KEY_4; + case XK_5: + return org_lwjgl_input_Keyboard_KEY_5; + case XK_6: + return org_lwjgl_input_Keyboard_KEY_6; + case XK_7: + return org_lwjgl_input_Keyboard_KEY_7; + case XK_8: + return org_lwjgl_input_Keyboard_KEY_8; + case XK_9: + return org_lwjgl_input_Keyboard_KEY_9; + case XK_colon: + return org_lwjgl_input_Keyboard_KEY_COLON; + case XK_semicolon: + return org_lwjgl_input_Keyboard_KEY_SEMICOLON; + case XK_equal: + return org_lwjgl_input_Keyboard_KEY_EQUALS; + case XK_at: + return org_lwjgl_input_Keyboard_KEY_AT; + case XK_bracketleft: + return org_lwjgl_input_Keyboard_KEY_LBRACKET; + case XK_bracketright: + return org_lwjgl_input_Keyboard_KEY_RBRACKET; + case XK_asciicircum: + return org_lwjgl_input_Keyboard_KEY_CIRCUMFLEX; + case XK_underscore: + return org_lwjgl_input_Keyboard_KEY_UNDERLINE; + case XK_grave: + return org_lwjgl_input_Keyboard_KEY_GRAVE; + case XK_a: + return org_lwjgl_input_Keyboard_KEY_A; + case XK_b: + return org_lwjgl_input_Keyboard_KEY_B; + case XK_c: + return org_lwjgl_input_Keyboard_KEY_C; + case XK_d: + return org_lwjgl_input_Keyboard_KEY_D; + case XK_e: + return org_lwjgl_input_Keyboard_KEY_E; + case XK_f: + return org_lwjgl_input_Keyboard_KEY_F; + case XK_g: + return org_lwjgl_input_Keyboard_KEY_G; + case XK_h: + return org_lwjgl_input_Keyboard_KEY_H; + case XK_i: + return org_lwjgl_input_Keyboard_KEY_I; + case XK_j: + return org_lwjgl_input_Keyboard_KEY_J; + case XK_k: + return org_lwjgl_input_Keyboard_KEY_K; + case XK_l: + return org_lwjgl_input_Keyboard_KEY_L; + case XK_m: + return org_lwjgl_input_Keyboard_KEY_M; + case XK_n: + return org_lwjgl_input_Keyboard_KEY_N; + case XK_o: + return org_lwjgl_input_Keyboard_KEY_O; + case XK_p: + return org_lwjgl_input_Keyboard_KEY_P; + case XK_q: + return org_lwjgl_input_Keyboard_KEY_Q; + case XK_r: + return org_lwjgl_input_Keyboard_KEY_R; + case XK_s: + return org_lwjgl_input_Keyboard_KEY_S; + case XK_t: + return org_lwjgl_input_Keyboard_KEY_T; + case XK_u: + return org_lwjgl_input_Keyboard_KEY_U; + case XK_v: + return org_lwjgl_input_Keyboard_KEY_V; + case XK_w: + return org_lwjgl_input_Keyboard_KEY_W; + case XK_x: + return org_lwjgl_input_Keyboard_KEY_X; + case XK_y: + return org_lwjgl_input_Keyboard_KEY_Y; + case XK_z: + return org_lwjgl_input_Keyboard_KEY_Z; + default: + return org_lwjgl_input_Keyboard_KEY_NONE; + } +} + static unsigned char getKeycode(XKeyEvent *event) { unsigned char keycode = (unsigned char)((event->keycode - 8) & 0xff); - keycode = key_map[keycode]; + KeySym keysym = XLookupKeysym(event, 0); + keycode = mapKeySymToLWJGLKeyCode(keysym); return keycode; } |
|
From: Elias N. <eli...@us...> - 2005-04-09 17:35:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25736/src/java/org/lwjgl/opengl Modified Files: AWTGLCanvas.java Context.java Display.java Log Message: Added LWJGLUtil.getPlatform to encapsulate platform detection. Added FreeBSD as an alias to Linux. Index: Context.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Context.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Context.java 29 Mar 2005 18:09:29 -0000 1.4 +++ Context.java 9 Apr 2005 17:35:37 -0000 1.5 @@ -74,15 +74,19 @@ static { Sys.initialize(); String class_name; - String OS_NAME = System.getProperty("os.name"); - if (OS_NAME.startsWith("Linux")) { - class_name = "org.lwjgl.opengl.LinuxContextImplementation"; - } else if (OS_NAME.startsWith("Windows")) { - class_name = "org.lwjgl.opengl.Win32ContextImplementation"; - } else if (OS_NAME.startsWith("Mac")) { - class_name = "org.lwjgl.opengl.MacOSXContextImplementation"; - } else - throw new IllegalStateException("The platform " + OS_NAME + " is not supported"); + switch (LWJGLUtil.getPlatform()) { + case LWJGLUtil.PLATFORM_LINUX: + class_name = "org.lwjgl.opengl.LinuxContextImplementation"; + break; + case LWJGLUtil.PLATFORM_WINDOWS: + class_name = "org.lwjgl.opengl.Win32ContextImplementation"; + break; + case LWJGLUtil.PLATFORM_MACOSX: + class_name = "org.lwjgl.opengl.MacOSXContextImplementation"; + break; + default: + throw new IllegalStateException("Unsupported platform"); + } try { Class impl_class = Class.forName(class_name); implementation = (ContextImplementation)impl_class.newInstance(); Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- Display.java 9 Apr 2005 16:45:14 -0000 1.47 +++ Display.java 9 Apr 2005 17:35:37 -0000 1.48 @@ -127,15 +127,19 @@ private static DisplayImplementation createDisplayImplementation() { String class_name; - String os_name = System.getProperty("os.name"); - if (os_name.startsWith("Linux")) { - class_name = "org.lwjgl.opengl.LinuxDisplay"; - } else if (os_name.startsWith("Windows")) { - class_name = "org.lwjgl.opengl.Win32Display"; - } else if (os_name.startsWith("Mac")) { - class_name = "org.lwjgl.opengl.MacOSXDisplay"; - } else - throw new IllegalStateException("The platform " + os_name + " is not supported"); + switch (LWJGLUtil.getPlatform()) { + case LWJGLUtil.PLATFORM_LINUX: + class_name = "org.lwjgl.opengl.LinuxDisplay"; + break; + case LWJGLUtil.PLATFORM_WINDOWS: + class_name = "org.lwjgl.opengl.Win32Display"; + break; + case LWJGLUtil.PLATFORM_MACOSX: + class_name = "org.lwjgl.opengl.MacOSXDisplay"; + break; + default: + throw new IllegalStateException("Unsupported platform"); + } try { Class display_class = Class.forName(class_name); return (DisplayImplementation)display_class.newInstance(); Index: AWTGLCanvas.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/AWTGLCanvas.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- AWTGLCanvas.java 9 Mar 2005 08:37:05 -0000 1.10 +++ AWTGLCanvas.java 9 Apr 2005 17:35:37 -0000 1.11 @@ -37,6 +37,7 @@ import java.awt.GraphicsEnvironment; import org.lwjgl.LWJGLException; +import org.lwjgl.LWJGLUtil; import org.lwjgl.Sys; import java.awt.Point; @@ -61,15 +62,19 @@ static { Sys.initialize(); String class_name; - String OS_NAME = System.getProperty("os.name"); - if (OS_NAME.startsWith("Linux")) { - class_name = "org.lwjgl.opengl.LinuxCanvasImplementation"; - } else if (OS_NAME.startsWith("Windows")) { - class_name = "org.lwjgl.opengl.Win32CanvasImplementation"; - } else if (OS_NAME.startsWith("Mac")) { - class_name = "org.lwjgl.opengl.MacOSXCanvasImplementation"; - } else - throw new IllegalStateException("The platform " + OS_NAME + " is not supported"); + switch (LWJGLUtil.getPlatform()) { + case LWJGLUtil.PLATFORM_LINUX: + class_name = "org.lwjgl.opengl.LinuxCanvasImplementation"; + break; + case LWJGLUtil.PLATFORM_WINDOWS: + class_name = "org.lwjgl.opengl.Win32CanvasImplementation"; + break; + case LWJGLUtil.PLATFORM_MACOSX: + class_name = "org.lwjgl.opengl.MacOSXCanvasImplementation"; + break; + default: + throw new IllegalStateException("Unsupported platform"); + } try { Class impl_class = Class.forName(class_name); implementation = (AWTCanvasImplementation)impl_class.newInstance(); |
|
From: Elias N. <eli...@us...> - 2005-04-09 17:35:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25736/src/java/org/lwjgl Modified Files: LWJGLUtil.java Sys.java Log Message: Added LWJGLUtil.getPlatform to encapsulate platform detection. Added FreeBSD as an alias to Linux. Index: LWJGLUtil.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/LWJGLUtil.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- LWJGLUtil.java 29 Mar 2005 18:09:26 -0000 1.2 +++ LWJGLUtil.java 9 Apr 2005 17:35:36 -0000 1.3 @@ -49,37 +49,59 @@ * @version $Revision$ */ public class LWJGLUtil { + public static final int PLATFORM_LINUX = 1; + public static final int PLATFORM_MACOSX = 2; + public static final int PLATFORM_WINDOWS = 3; - /** Debug flag. */ + /** Debug flag. */ public static final boolean DEBUG = Boolean.getBoolean("org.lwjgl.util.Debug"); /** - * Locates the paths required by a library. - * - * @param libNames List of library names to look for, in the form of Local Library name, Platform library name. - * At least 6 names must be passed. 2 for each supported platform in the following order: Windows, Linux, MacOSX. - * @param classloader The classloader to ask for librariy paths - * @return Paths to located libraries, if any - */ - public static String[] getLibraryPaths(String[] libNames, ClassLoader classloader) throws LWJGLException { + * Get the current platform + */ + public static int getPlatform() { + String osName = System.getProperty("os.name"); + + if (osName.startsWith("Windows")) { + return PLATFORM_WINDOWS; + } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD")) { + return PLATFORM_LINUX; + } else if (osName.startsWith("Mac OS X")) { + return PLATFORM_MACOSX; + } else { + throw new LinkageError("Unknown platform: " + osName); + } + } + + /** + * Locates the paths required by a library. + * + * @param libNames List of library names to look for, in the form of Local Library name, Platform library name. + * At least 6 names must be passed. 2 for each supported platform in the following order: Windows, Linux, MacOSX. + * @param classloader The classloader to ask for librariy paths + * @return Paths to located libraries, if any + */ + public static String[] getLibraryPaths(String[] libNames, ClassLoader classloader) throws LWJGLException { // need to pass path of possible locations of IL to native side List possible_paths = new ArrayList(); - String osName = System.getProperty("os.name"); - String libname; String platform_lib_name; - if (osName.startsWith("Win")) { - libname = libNames[0]; - platform_lib_name = libNames[1]; - } else if (osName.startsWith("Lin")) { - libname = libNames[2]; - platform_lib_name = libNames[3]; - } else if (osName.startsWith("Mac")) { - libname = libNames[4]; - platform_lib_name = libNames[5]; - } else { - throw new LWJGLException("Unknown platform: " + osName); + switch (getPlatform()) { + case PLATFORM_WINDOWS: + libname = libNames[0]; + platform_lib_name = libNames[1]; + break; + case PLATFORM_LINUX: + libname = libNames[2]; + platform_lib_name = libNames[3]; + break; + case PLATFORM_MACOSX: + libname = libNames[4]; + platform_lib_name = libNames[5]; + break; + default: + throw new LWJGLException("Unknown platform: " + getPlatform()); } // Add all possible paths from java.library.path @@ -95,7 +117,7 @@ possible_paths.add(classloader_path); } - String lwjgl_classloader_path = LWJGLUtil.getPathFromClassLoader("lwjgl", classloader); + String lwjgl_classloader_path = LWJGLUtil.getPathFromClassLoader("lwjgl", classloader); if (lwjgl_classloader_path != null) { LWJGLUtil.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path); possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator)) @@ -120,7 +142,7 @@ * locate it. * * @param libname Name of library to search for - * @param classloader Classloader to use + * @param classloader Classloader to use * @return Absolute path to library if found, otherwise null */ public static String getPathFromClassLoader(String libname, ClassLoader classloader) { Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- Sys.java 29 Mar 2005 18:09:27 -0000 1.84 +++ Sys.java 9 Apr 2005 17:35:36 -0000 1.85 @@ -53,9 +53,6 @@ /** The native library name */ private static final String LIBRARY_NAME = "lwjgl"; - /** OS Name */ - private final static String OS_NAME = System.getProperty("os.name"); - /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; @@ -71,14 +68,19 @@ private static SysImplementation createImplementation() { String class_name; - if (OS_NAME.startsWith("Linux")) { - class_name = "org.lwjgl.LinuxSysImplementation"; - } else if (OS_NAME.startsWith("Windows")) { - class_name = "org.lwjgl.Win32SysImplementation"; - } else if (OS_NAME.startsWith("Mac")) { - class_name = "org.lwjgl.MacOSXSysImplementation"; - } else - throw new IllegalStateException("The platform " + OS_NAME + " is not supported"); + switch (LWJGLUtil.getPlatform()) { + case LWJGLUtil.PLATFORM_LINUX: + class_name = "org.lwjgl.LinuxSysImplementation"; + break; + case LWJGLUtil.PLATFORM_WINDOWS: + class_name = "org.lwjgl.Win32SysImplementation"; + break; + case LWJGLUtil.PLATFORM_MACOSX: + class_name = "org.lwjgl.MacOSXSysImplementation"; + break; + default: + throw new IllegalStateException("Unsupported platform"); + } try { Class impl_class = Class.forName(class_name); return (SysImplementation)impl_class.newInstance(); |
|
From: Elias N. <eli...@us...> - 2005-04-09 17:35:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25736/src/java/org/lwjgl/fmod3 Modified Files: FMOD.java Log Message: Added LWJGLUtil.getPlatform to encapsulate platform detection. Added FreeBSD as an alias to Linux. Index: FMOD.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- FMOD.java 29 Mar 2005 18:09:28 -0000 1.10 +++ FMOD.java 9 Apr 2005 17:35:37 -0000 1.11 @@ -47,360 +47,364 @@ * @version $Revision$ */ public class FMOD { - + /** Array of hashmaps for callbacks */ - private static HashMap[] callbacks = new HashMap[17]; - - /** FMOD System level clear dsp unit */ - static FSoundDSPUnit fmodClearUnit; - - /** FMOD System level clip and copy dsp unit */ - static FSoundDSPUnit fmodClipAndCopyUnit; - - /** FMOD System level music dsp unit */ - static FSoundDSPUnit fmodMusicUnit; - - /** FMOD System level sound effects dsp unit */ - static FSoundDSPUnit fmodSFXUnit; - - /** FMOD System level FFT dsp unit */ - static FSoundDSPUnit fmodFFTUnit; - - /** FMOD System level FFT buffer */ - static FloatBuffer fmodFFTBuffer; - - /** Type defining the music callback entries in callback hashmap array */ - public static final int FMUSIC_INSTCALLBACK = 0; - - /** Type defining the music callback entries in callback hashmap array */ - public static final int FMUSIC_ORDERCALLBACK = 1; - - /** Type defining the music callback entries in callback hashmap array */ - public static final int FMUSIC_ROWCALLBACK = 2; + private static HashMap[] callbacks = new HashMap[17]; - /** Type defining the music callback entries in callback hashmap array */ - public static final int FMUSIC_ZXXCALLBACK = 3; - - - /** Type defining the dsp callback entries in callback hashmap array */ - public static final int FSOUND_DSPCALLBACK = 4; - - /** Type defining the stream callback entries in callback hashmap array */ - public static final int FSOUND_STREAMCALLBACK = 5; - - /** Type defining the alloc callback entries in callback hashmap array */ - public static final int FSOUND_ALLOCCALLBACK = 6; - - /** Type defining the realloc callback entries in callback hashmap array */ - public static final int FSOUND_REALLOCCALLBACK = 7; - - /** Type defining the free callback entries in callback hashmap array */ - public static final int FSOUND_FREECALLBACK = 8; - - /** Type defining the open callback entries in callback hashmap array */ - public static final int FSOUND_OPENCALLBACK = 9; - - /** Type defining the close callback entries in callback hashmap array */ - public static final int FSOUND_CLOSECALLBACK = 10; - - /** Type defining the metadata callback entries in callback hashmap array */ - public static final int FSOUND_METADATACALLBACK = 11; - - /** Type defining the read callback entries in callback hashmap array */ - public static final int FSOUND_READCALLBACK = 12; - - /** Type defining the seek callback entries in callback hashmap array */ - public static final int FSOUND_SEEKCALLBACK = 13; - - /** Type defining the tell callback entries in callback hashmap array */ - public static final int FSOUND_TELLCALLBACK = 14; - - /** Type defining the "end" callback entries in callback hashmap array */ - public static final int FSOUND_ENDCALLBACK = 15; - - /** Type defining the "sync" callback entries in callback hashmap array */ - public static final int FSOUND_SYNCCALLBACK = 16; + /** FMOD System level clear dsp unit */ + static FSoundDSPUnit fmodClearUnit; - /** Have we been created? */ - protected static boolean created; + /** FMOD System level clip and copy dsp unit */ + static FSoundDSPUnit fmodClipAndCopyUnit; - /** No errors */ - public static final int FMOD_ERR_NONE = 0; + /** FMOD System level music dsp unit */ + static FSoundDSPUnit fmodMusicUnit; - /** Cannot call this command after FSOUND_Init. Call FSOUND_Close first. */ - public static final int FMOD_ERR_BUSY = 1; + /** FMOD System level sound effects dsp unit */ + static FSoundDSPUnit fmodSFXUnit; - /** This command failed because FSOUND_Init was not called */ - public static final int FMOD_ERR_UNINITIALIZED = 2; + /** FMOD System level FFT dsp unit */ + static FSoundDSPUnit fmodFFTUnit; - /** Error initializing output device. */ - public static final int FMOD_ERR_INIT = 3; + /** FMOD System level FFT buffer */ + static FloatBuffer fmodFFTBuffer; - /** Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */ - public static final int FMOD_ERR_ALLOCATED = 4; + /** Type defining the music callback entries in callback hashmap array */ + public static final int FMUSIC_INSTCALLBACK = 0; - /** Playing the sound failed. */ - public static final int FMOD_ERR_PLAY = 5; + /** Type defining the music callback entries in callback hashmap array */ + public static final int FMUSIC_ORDERCALLBACK = 1; - /** Soundcard does not support the features needed for this soundsystem (16bit stereo output) */ - public static final int FMOD_ERR_OUTPUT_FORMAT = 6; + /** Type defining the music callback entries in callback hashmap array */ + public static final int FMUSIC_ROWCALLBACK = 2; - /** Error setting cooperative level for hardware. */ - public static final int FMOD_ERR_COOPERATIVELEVEL = 7; + /** Type defining the music callback entries in callback hashmap array */ + public static final int FMUSIC_ZXXCALLBACK = 3; - /** Error creating hardware sound buffer. */ - public static final int FMOD_ERR_CREATEBUFFER = 8; - /** File not found */ - public static final int FMOD_ERR_FILE_NOTFOUND = 9; + /** Type defining the dsp callback entries in callback hashmap array */ + public static final int FSOUND_DSPCALLBACK = 4; - /** Unknown file format */ - public static final int FMOD_ERR_FILE_FORMAT = 10; + /** Type defining the stream callback entries in callback hashmap array */ + public static final int FSOUND_STREAMCALLBACK = 5; - /** Error loading file */ - public static final int FMOD_ERR_FILE_BAD = 11; + /** Type defining the alloc callback entries in callback hashmap array */ + public static final int FSOUND_ALLOCCALLBACK = 6; - /** Not enough memory */ - public static final int FMOD_ERR_MEMORY = 12; + /** Type defining the realloc callback entries in callback hashmap array */ + public static final int FSOUND_REALLOCCALLBACK = 7; - /** The version number of this file format is not supported */ - public static final int FMOD_ERR_VERSION = 13; + /** Type defining the free callback entries in callback hashmap array */ + public static final int FSOUND_FREECALLBACK = 8; - /** An invalid parameter was passed to this function */ - public static final int FMOD_ERR_INVALID_PARAM = 14; + /** Type defining the open callback entries in callback hashmap array */ + public static final int FSOUND_OPENCALLBACK = 9; - /** Tried to use an EAX command on a non EAX enabled channel or output. */ - public static final int FMOD_ERR_NO_EAX = 15; + /** Type defining the close callback entries in callback hashmap array */ + public static final int FSOUND_CLOSECALLBACK = 10; - /** Failed to allocate a new channel */ - public static final int FMOD_ERR_CHANNEL_ALLOC = 17; + /** Type defining the metadata callback entries in callback hashmap array */ + public static final int FSOUND_METADATACALLBACK = 11; - /** Recording is not supported on this machine */ - public static final int FMOD_ERR_RECORD = 18; + /** Type defining the read callback entries in callback hashmap array */ + public static final int FSOUND_READCALLBACK = 12; - /** Required Mediaplayer codec is not installed */ - public static final int FMOD_ERR_MEDIAPLAYER = 19; + /** Type defining the seek callback entries in callback hashmap array */ + public static final int FSOUND_SEEKCALLBACK = 13; - /** An error occured trying to open the specified CD device */ - public static final int FMOD_ERR_CDDEVICE = 20; - - /** Whether we have been initialized */ - private static boolean initialized; - - /** The native JNI library name */ - private static String JNI_LIBRARY_NAME = "lwjgl-fmod3"; - - /** The native library name on win32 */ - private static String FMOD_WIN32_LIBRARY_NAME = "fmod"; - - /** The native library name on win32 */ - private static String FMOD_LINUX_LIBRARY_NAME = "fmod"; + /** Type defining the tell callback entries in callback hashmap array */ + public static final int FSOUND_TELLCALLBACK = 14; - /** The native library name on win32 */ - private static String FMOD_OSX_LIBRARY_NAME = "fmod"; + /** Type defining the "end" callback entries in callback hashmap array */ + public static final int FSOUND_ENDCALLBACK = 15; - /** Version of FMOD */ - public static final String VERSION = "0.96"; - - static { - initialize(); - } - - /** - * Initializes the FMOD binding - */ - static void initialize() { - if (initialized) { - return; - } - initialized = true; - - System.loadLibrary(JNI_LIBRARY_NAME); - - // check for mismatch - String nativeVersion = getNativeLibraryVersion(); - if (!nativeVersion.equals(VERSION)) { - throw new LinkageError( - "Version mismatch: jar version is '" + VERSION + + /** Type defining the "sync" callback entries in callback hashmap array */ + public static final int FSOUND_SYNCCALLBACK = 16; + + /** Have we been created? */ + protected static boolean created; + + /** No errors */ + public static final int FMOD_ERR_NONE = 0; + + /** Cannot call this command after FSOUND_Init. Call FSOUND_Close first. */ + public static final int FMOD_ERR_BUSY = 1; + + /** This command failed because FSOUND_Init was not called */ + public static final int FMOD_ERR_UNINITIALIZED = 2; + + /** Error initializing output device. */ + public static final int FMOD_ERR_INIT = 3; + + /** Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */ + public static final int FMOD_ERR_ALLOCATED = 4; + + /** Playing the sound failed. */ + public static final int FMOD_ERR_PLAY = 5; + + /** Soundcard does not support the features needed for this soundsystem (16bit stereo output) */ + public static final int FMOD_ERR_OUTPUT_FORMAT = 6; + + /** Error setting cooperative level for hardware. */ + public static final int FMOD_ERR_COOPERATIVELEVEL = 7; + + /** Error creating hardware sound buffer. */ + public static final int FMOD_ERR_CREATEBUFFER = 8; + + /** File not found */ + public static final int FMOD_ERR_FILE_NOTFOUND = 9; + + /** Unknown file format */ + public static final int FMOD_ERR_FILE_FORMAT = 10; + + /** Error loading file */ + public static final int FMOD_ERR_FILE_BAD = 11; + + /** Not enough memory */ + public static final int FMOD_ERR_MEMORY = 12; + + /** The version number of this file format is not supported */ + public static final int FMOD_ERR_VERSION = 13; + + /** An invalid parameter was passed to this function */ + public static final int FMOD_ERR_INVALID_PARAM = 14; + + /** Tried to use an EAX command on a non EAX enabled channel or output. */ + public static final int FMOD_ERR_NO_EAX = 15; + + /** Failed to allocate a new channel */ + public static final int FMOD_ERR_CHANNEL_ALLOC = 17; + + /** Recording is not supported on this machine */ + public static final int FMOD_ERR_RECORD = 18; + + /** Required Mediaplayer codec is not installed */ + public static final int FMOD_ERR_MEDIAPLAYER = 19; + + /** An error occured trying to open the specified CD device */ + public static final int FMOD_ERR_CDDEVICE = 20; + + /** Whether we have been initialized */ + private static boolean initialized; + + /** The native JNI library name */ + private static String JNI_LIBRARY_NAME = "lwjgl-fmod3"; + + /** The native library name on win32 */ + private static String FMOD_WIN32_LIBRARY_NAME = "fmod"; + + /** The native library name on win32 */ + private static String FMOD_LINUX_LIBRARY_NAME = "fmod"; + + /** The native library name on win32 */ + private static String FMOD_OSX_LIBRARY_NAME = "fmod"; + + /** Version of FMOD */ + public static final String VERSION = "0.96"; + + static { + initialize(); + } + + /** + * Initializes the FMOD binding + */ + static void initialize() { + if (initialized) { + return; + } + initialized = true; + + System.loadLibrary(JNI_LIBRARY_NAME); + + // check for mismatch + String nativeVersion = getNativeLibraryVersion(); + if (!nativeVersion.equals(VERSION)) { + throw new LinkageError( + "Version mismatch: jar version is '" + VERSION + "', native libary version is '" + nativeVersion + "'"); - } - - // Initialize callback hashmaps - for(int i=0; i<callbacks.length; i++) { - callbacks[i] = new HashMap(); - } - } - - /** - * Return the version of the native library - */ - private static native String getNativeLibraryVersion(); - - /** - * @return true if AL has been created - */ - public static boolean isCreated() { - return created; - } - - /** - * Creates an FMOD instance. - */ - public static void create() throws FMODException { - if (created) { - return; - } - - // create, passing potential locations for native fmod library - nCreate(constructFMODSearchPaths()); - created = true; - } - - /** - * Retrieves an array of strings, with potential locations for - * the native fmod library + } + + // Initialize callback hashmaps + for(int i=0; i<callbacks.length; i++) { + callbacks[i] = new HashMap(); + } + } + + /** + * Return the version of the native library + */ + private static native String getNativeLibraryVersion(); + + /** + * @return true if AL has been created + */ + public static boolean isCreated() { + return created; + } + + /** + * Creates an FMOD instance. + */ + public static void create() throws FMODException { + if (created) { + return; + } + + // create, passing potential locations for native fmod library + nCreate(constructFMODSearchPaths()); + created = true; + } + + /** + * Retrieves an array of strings, with potential locations for + * the native fmod library * @return array of strings, with potential locations for the native fmod library */ private static String[] constructFMODSearchPaths() { - // miscellaneous values - String libpath = System.getProperty("java.library.path"); - String seperator = System.getProperty("path.separator"); - String osName = System.getProperty("os.name"); + // miscellaneous values + String libpath = System.getProperty("java.library.path"); + String seperator = System.getProperty("path.separator"); - // determine os library name - String dllName = FMOD_WIN32_LIBRARY_NAME; - if (osName.startsWith("Mac OS")) { - dllName = FMOD_OSX_LIBRARY_NAME; - } else if (osName.startsWith("Linux")) { - dllName = FMOD_LINUX_LIBRARY_NAME; - } - - String jwsPath = getPathFromJWS(dllName); - LWJGLUtil.log("getPathFromJWS: Paths found: " + jwsPath); - if (jwsPath != null) { - libpath += seperator - + jwsPath.substring(0, jwsPath.lastIndexOf(File.separator)); - } - - // split, and rebuild library path to path + dll - StringTokenizer st = new StringTokenizer(libpath, seperator); - String[] paths = new String[st.countTokens() + 1]; + // determine os library name + String dllName = FMOD_WIN32_LIBRARY_NAME; + switch (LWJGLUtil.getPlatform()) { + case LWJGLUtil.PLATFORM_MACOSX: + dllName = FMOD_OSX_LIBRARY_NAME; + break; + case LWJGLUtil.PLATFORM_LINUX: + dllName = FMOD_LINUX_LIBRARY_NAME; + break; + default: + throw new LinkageError("Unsupported platform"); + } - //build paths - for (int i = 0; i < paths.length - 1; i++) { - paths[i] = st.nextToken() + File.separator; - } - - for(int i=0 ; i<paths.length; i++) { - LWJGLUtil.log("Will search " + paths[i] + " for " + dllName); - } + String jwsPath = getPathFromJWS(dllName); + LWJGLUtil.log("getPathFromJWS: Paths found: " + jwsPath); + if (jwsPath != null) { + libpath += seperator + + jwsPath.substring(0, jwsPath.lastIndexOf(File.separator)); + } - //add cwd path - paths[paths.length - 1] = dllName; + // split, and rebuild library path to path + dll + StringTokenizer st = new StringTokenizer(libpath, seperator); + String[] paths = new String[st.countTokens() + 1]; + + //build paths + for (int i = 0; i < paths.length - 1; i++) { + paths[i] = st.nextToken() + File.separator; + } + + for(int i=0 ; i<paths.length; i++) { + LWJGLUtil.log("Will search " + paths[i] + " for " + dllName); + } + + //add cwd path + paths[paths.length - 1] = dllName; return paths; } /** - * Native method to create FMOD instance - */ - protected static native void nCreate(String[] paths); - - /** - * Exit cleanly by calling destroy. - */ - public static void destroy() { - if(!created) { - return; - } - - created = false; - nDestroy(); - } - - /** - * Tries to locate FMOD from the JWS Library path - * This method exists because FMOD is loaded from native code, and as such - * is exempt from JWS library loading rutines. FMOD therefore always fails. - * We therefore invoke the protected method of the JWS classloader to see if it can - * locate it. - * - * @param libname Name of library to search for - * @return Absolute path to library if found, otherwise null - */ - private static String getPathFromJWS(String libname) { - try { - LWJGLUtil.log("getPathFromJWS: searching for: " + libname); - Object o = FMOD.class.getClassLoader(); - Class c = o.getClass(); - Method findLibrary = - c.getMethod("findLibrary", new Class[] { String.class }); - Object[] arguments = new Object[] { libname }; - return (String) findLibrary.invoke(o, arguments); + * Native method to create FMOD instance + */ + protected static native void nCreate(String[] paths); - } catch (Exception e) { - LWJGLUtil.log("Failure locating FMOD using classloader:" + e); - } - return null; - } + /** + * Exit cleanly by calling destroy. + */ + public static void destroy() { + if(!created) { + return; + } - /** - * Native method the destroy the FMOD - */ - protected static native void nDestroy(); - - /** - * Registers a callback by its handle - * - * @param handle Handle to native object being monitored - * @param callbackHandler Object to register as the call back handler - */ - static void registerCallback(int type, long handle, Object handled, Object callbackHandler) { - Long callbackID = new Long(handle); - ArrayList callbackList = (ArrayList) callbacks[type].get(callbackID); + created = false; + nDestroy(); + } - if (callbackList == null ) { - if (callbackHandler == null) { - LWJGLUtil.log("No callbackhandlers registered for handle: " + handle); - } else { - callbackList = new ArrayList(); - callbacks[type].put(callbackID, callbackList); - } - } - - // are we going to add or remove from the list? - if(callbackHandler == null) { - callbacks[type].remove(callbackID); - } else { - callbackList.add(new FMOD.WrappedCallback(handled, callbackHandler)); - } - } - - /** - * Retrieves a call back handler by its native handle - * @param handle Handle to native object being monitored - * @return Call back handler, or null if no such handler - */ - static ArrayList getCallbacks(int type, long handle) { - return (ArrayList) callbacks[type].get(new Long(handle)); - } + /** + * Tries to locate FMOD from the JWS Library path + * This method exists because FMOD is loaded from native code, and as such + * is exempt from JWS library loading rutines. FMOD therefore always fails. + * We therefore invoke the protected method of the JWS classloader to see if it can + * locate it. + * + * @param libname Name of library to search for + * @return Absolute path to library if found, otherwise null + */ + private static String getPathFromJWS(String libname) { + try { + LWJGLUtil.log("getPathFromJWS: searching for: " + libname); + Object o = FMOD.class.getClassLoader(); + Class c = o.getClass(); + Method findLibrary = + c.getMethod("findLibrary", new Class[] { String.class }); + Object[] arguments = new Object[] { libname }; + return (String) findLibrary.invoke(o, arguments); - /** - * Retrieves the errorcode desription for specified code - * - * @param errorcode errorcode to lookup - * @return Description of errorcode - */ - public static native String FMOD_ErrorString(int errorcode); - - /** - * Wrapper class for a callback handler, and the object associated - */ - static class WrappedCallback { - Object handled; - Object callback; - WrappedCallback(Object handled, Object callback) { - this.handled = handled; - this.callback = callback; - } - } + } catch (Exception e) { + LWJGLUtil.log("Failure locating FMOD using classloader:" + e); + } + return null; + } + + /** + * Native method the destroy the FMOD + */ + protected static native void nDestroy(); + + /** + * Registers a callback by its handle + * + * @param handle Handle to native object being monitored + * @param callbackHandler Object to register as the call back handler + */ + static void registerCallback(int type, long handle, Object handled, Object callbackHandler) { + Long callbackID = new Long(handle); + ArrayList callbackList = (ArrayList) callbacks[type].get(callbackID); + + if (callbackList == null ) { + if (callbackHandler == null) { + LWJGLUtil.log("No callbackhandlers registered for handle: " + handle); + } else { + callbackList = new ArrayList(); + callbacks[type].put(callbackID, callbackList); + } + } + + // are we going to add or remove from the list? + if(callbackHandler == null) { + callbacks[type].remove(callbackID); + } else { + callbackList.add(new FMOD.WrappedCallback(handled, callbackHandler)); + } + } + + /** + * Retrieves a call back handler by its native handle + * @param handle Handle to native object being monitored + * @return Call back handler, or null if no such handler + */ + static ArrayList getCallbacks(int type, long handle) { + return (ArrayList) callbacks[type].get(new Long(handle)); + } + + /** + * Retrieves the errorcode desription for specified code + * + * @param errorcode errorcode to lookup + * @return Description of errorcode + */ + public static native String FMOD_ErrorString(int errorcode); + + /** + * Wrapper class for a callback handler, and the object associated + */ + static class WrappedCallback { + Object handled; + Object callback; + WrappedCallback(Object handled, Object callback) { + this.handled = handled; + this.callback = callback; + } + } } |
|
From: Elias N. <eli...@us...> - 2005-04-09 17:35:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25736/src/java/org/lwjgl/devil Modified Files: IL.java ILU.java ILUT.java Log Message: Added LWJGLUtil.getPlatform to encapsulate platform detection. Added FreeBSD as an alias to Linux. Index: ILUT.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILUT.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ILUT.java 28 Mar 2005 13:08:48 -0000 1.10 +++ ILUT.java 9 Apr 2005 17:35:37 -0000 1.11 @@ -55,146 +55,146 @@ */ public class ILUT { - // Attribute Bits - public static final int ILUT_OPENGL_BIT = 0x00000001; - public static final int ILUT_ALL_ATTRIB_BITS = 0x000FFFFF; + // Attribute Bits + public static final int ILUT_OPENGL_BIT = 0x00000001; + public static final int ILUT_ALL_ATTRIB_BITS = 0x000FFFFF; - // Error Types - public static final int ILUT_INVALID_ENUM = 0x0501; - public static final int ILUT_OUT_OF_MEMORY = 0x0502; - public static final int ILUT_INVALID_VALUE = 0x0505; - public static final int ILUT_ILLEGAL_OPERATION = 0x0506; - public static final int ILUT_INVALID_PARAM = 0x0509; - public static final int ILUT_COULD_NOT_OPEN_FILE = 0x050A; - public static final int ILUT_STACK_OVERFLOW = 0x050E; - public static final int ILUT_STACK_UNDERFLOW = 0x050F; - public static final int ILUT_BAD_DIMENSIONS = 0x0511; - public static final int ILUT_NOT_SUPPORTED = 0x0550; + // Error Types + public static final int ILUT_INVALID_ENUM = 0x0501; + public static final int ILUT_OUT_OF_MEMORY = 0x0502; + public static final int ILUT_INVALID_VALUE = 0x0505; + public static final int ILUT_ILLEGAL_OPERATION = 0x0506; + public static final int ILUT_INVALID_PARAM = 0x0509; + public static final int ILUT_COULD_NOT_OPEN_FILE = 0x050A; + public static final int ILUT_STACK_OVERFLOW = 0x050E; + public static final int ILUT_STACK_UNDERFLOW = 0x050F; + public static final int ILUT_BAD_DIMENSIONS = 0x0511; + public static final int ILUT_NOT_SUPPORTED = 0x0550; - // State Definitions - public static final int ILUT_PALETTE_MODE = 0x0600; - public static final int ILUT_OPENGL_CONV = 0x0610; - public static final int ILUT_MAXTEX_WIDTH = 0x0630; - public static final int ILUT_MAXTEX_HEIGHT = 0x0631; - public static final int ILUT_MAXTEX_DEPTH = 0x0632; - public static final int ILUT_GL_USE_S3TC = 0x0634; - public static final int ILUT_GL_GEN_S3TC = 0x0635; - public static final int ILUT_GL_AUTODETECT_TEXTURE_TARGET = 0x0807; + // State Definitions + public static final int ILUT_PALETTE_MODE = 0x0600; + public static final int ILUT_OPENGL_CONV = 0x0610; + public static final int ILUT_MAXTEX_WIDTH = 0x0630; + public static final int ILUT_MAXTEX_HEIGHT = 0x0631; + public static final int ILUT_MAXTEX_DEPTH = 0x0632; + public static final int ILUT_GL_USE_S3TC = 0x0634; + public static final int ILUT_GL_GEN_S3TC = 0x0635; + public static final int ILUT_GL_AUTODETECT_TEXTURE_TARGET = 0x0807; - // The different rendering api's...more to be added later? - public static final int ILUT_OPENGL = 0; - - public static final int ILUT_VENDOR = IL.IL_VENDOR; - public static final int ILUT_VERSION_NUM = IL.IL_VERSION_NUM; - - /** Have we been created? */ - protected static boolean created; - - public static native boolean ilutRenderer(int renderer); - public static native boolean ilutDisable(int mode); - public static native boolean ilutEnable(int mode); - public static native boolean ilutGetBoolean(int mode); - public static native int ilutGetInteger(int mode); - public static native void ilutGetBooleanv(int mode, ByteBuffer param); - public static native void ilutGetIntegerv(int mode, IntBuffer Param); - public static native String ilutGetString(int stringName); - private static native void ilutInit(); - public static native boolean ilutIsDisabled(int mode); - public static native boolean ilutIsEnabled(int mode); - public static native void ilutPopAttrib(); - public static native void ilutPushAttrib(int bits); - public static native void ilutSetInteger(int Mode, int param); + // The different rendering api's...more to be added later? + public static final int ILUT_OPENGL = 0; + public static final int ILUT_VENDOR = IL.IL_VENDOR; + public static final int ILUT_VERSION_NUM = IL.IL_VERSION_NUM; - // ImageLib Utility Toolkit's OpenGL Functions - public static native int ilutGLBindTexImage(); - public static native int ilutGLBindMipmaps(); - public static native boolean ilutGLBuildMipmaps(); - public static native int ilutGLLoadImage(String fileName); - public static native boolean ilutGLScreen(); - public static native boolean ilutGLScreenie(); - public static native boolean ilutGLSaveImage(String fileName, int texID); - public static native boolean ilutGLSetTex(int texID); - public static native boolean ilutGLTexImage(int level); - - /** - * @return true if ILUT has been created - */ - public static boolean isCreated() { - return created; - } - - /** - * Creates a new instance of ILUT. Cannot be created unless IL has been created. - */ - public static void create() throws LWJGLException { - if(!IL.isCreated()) { - throw new LWJGLException("Cannot create ILUT without having created IL instance"); - } + /** Have we been created? */ + protected static boolean created; - // We need to do nothing when running on mac, since all is loaded in IL - if(System.getProperty("os.name").startsWith("Mac")) { - return; - } + public static native boolean ilutRenderer(int renderer); + public static native boolean ilutDisable(int mode); + public static native boolean ilutEnable(int mode); + public static native boolean ilutGetBoolean(int mode); + public static native int ilutGetInteger(int mode); + public static native void ilutGetBooleanv(int mode, ByteBuffer param); + public static native void ilutGetIntegerv(int mode, IntBuffer Param); + public static native String ilutGetString(int stringName); + private static native void ilutInit(); + public static native boolean ilutIsDisabled(int mode); + public static native boolean ilutIsEnabled(int mode); + public static native void ilutPopAttrib(); + public static native void ilutPushAttrib(int bits); + public static native void ilutSetInteger(int Mode, int param); - String[] ilutPaths = LWJGLUtil.getLibraryPaths(new String[]{ - "ILUT", "ILUT.dll", - "ILUT", "libILUT.so", - "ILUT", "IL"}, ILU.class.getClassLoader()); - nCreate(ilutPaths); - created = true; - try { - ILUT.initNativeStubs(); - ILUT.ilutInit(); - created = true; - } catch (LWJGLException e) { - destroy(); - throw e; - } - } + // ImageLib Utility Toolkit's OpenGL Functions + public static native int ilutGLBindTexImage(); + public static native int ilutGLBindMipmaps(); + public static native boolean ilutGLBuildMipmaps(); + public static native int ilutGLLoadImage(String fileName); + public static native boolean ilutGLScreen(); + public static native boolean ilutGLScreenie(); + public static native boolean ilutGLSaveImage(String fileName, int texID); + public static native boolean ilutGLSetTex(int texID); + public static native boolean ilutGLTexImage(int level); - static native void initNativeStubs() throws LWJGLException; + /** + * @return true if ILUT has been created + */ + public static boolean isCreated() { + return created; + } - static native void resetNativeStubs(Class clazz); + /** + * Creates a new instance of ILUT. Cannot be created unless IL has been created. + */ + public static void create() throws LWJGLException { + if(!IL.isCreated()) { + throw new LWJGLException("Cannot create ILUT without having created IL instance"); + } - /** - * Exit cleanly by calling destroy. - */ - public static void destroy() { + // We need to do nothing when running on mac, since all is loaded in IL + if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { + return; + } - // We need to do nothing when running on mac, since all is destroyed in IL - if(System.getProperty("os.name").startsWith("Mac")) { - return; - } + String[] ilutPaths = LWJGLUtil.getLibraryPaths(new String[]{ + "ILUT", "ILUT.dll", + "ILUT", "libILUT.so", + "ILUT", "IL"}, ILU.class.getClassLoader()); + nCreate(ilutPaths); + created = true; - resetNativeStubs(ILUT.class); - if (created) { - nDestroy(); - } - created = false; + try { + ILUT.initNativeStubs(); + ILUT.ilutInit(); + created = true; + } catch (LWJGLException e) { + destroy(); + throw e; + } + } + + static native void initNativeStubs() throws LWJGLException; + + static native void resetNativeStubs(Class clazz); + + /** + * Exit cleanly by calling destroy. + */ + public static void destroy() { + + // We need to do nothing when running on mac, since all is destroyed in IL + if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { + return; } - /** - * Native method to create ILUT instance - * - * @param ilutPaths Array of strings containing paths to search for ILUT library - */ - protected static native void nCreate(String[] ilutPaths) throws LWJGLException; + resetNativeStubs(ILUT.class); + if (created) { + nDestroy(); + } + created = false; + } - /** - * Native method the destroy the ILUT - */ - protected static native void nDestroy(); + /** + * Native method to create ILUT instance + * + * @param ilutPaths Array of strings containing paths to search for ILUT library + */ + protected static native void nCreate(String[] ilutPaths) throws LWJGLException; - /** - * Forcefully set created. Used internally by mac platform since - * it loads ilu/ilut in IL and needs to mark them as created - * @param created value to set created to - */ - static void setCreated(boolean created) { - ILUT.created = created; - } + /** + * Native method the destroy the ILUT + */ + protected static native void nDestroy(); + + /** + * Forcefully set created. Used internally by mac platform since + * it loads ilu/ilut in IL and needs to mark them as created + * @param created value to set created to + */ + static void setCreated(boolean created) { + ILUT.created = created; + } } Index: IL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/IL.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- IL.java 28 Mar 2005 13:08:33 -0000 1.14 +++ IL.java 9 Apr 2005 17:35:36 -0000 1.15 @@ -300,7 +300,7 @@ public static final int IL_SEEK_CUR = 1; public static final int IL_SEEK_END = 2; public static final int IL_EOF = -1; - + /** Have we been created? */ protected static boolean created; @@ -311,8 +311,8 @@ public static native boolean ilApplyProfile(String InProfile, String OutProfile); public static native void ilBindImage(int image); public static native boolean ilBlit(int Source, int DestX, int DestY, - int DestZ, int SrcX, int SrcY, int SrcZ, - int Width, int Height, int Depth); + int DestZ, int SrcX, int SrcY, int SrcZ, + int Width, int Height, int Depth); public static native void ilClearColour(float Red, float Green, float Blue, float Alpha); public static native boolean ilClearImage(); public static native int ilCloneCurImage(); @@ -321,15 +321,15 @@ public static native boolean ilConvertPal(int DestFormat); public static native boolean ilCopyImage(int Src); public static int ilCopyPixels( int XOff, int YOff, int ZOff, - int Width, int Height, int Depth, - int Format, int Type, ByteBuffer Data) { + int Width, int Height, int Depth, + int Format, int Type, ByteBuffer Data) { BufferChecks.checkDirect(Data); return nilCopyPixels(XOff, YOff, ZOff, Width, Height, Depth, Format, Type, Data, Data.position()); } private static native int nilCopyPixels(int XOff, int YOff, int ZOff, int Width, - int Height, int Depth, int Format, - int Type, ByteBuffer Data, int data_offset); + int Height, int Depth, int Format, + int Type, ByteBuffer Data, int data_offset); public static native int ilCreateSubImage(int Type, int Num); public static native boolean ilDefaultImage(); @@ -352,14 +352,14 @@ public static native void ilModAlpha(int AlphaValue); public static native void ilSetAlpha(int AlphaValue); public static native boolean ilGetBoolean(int Mode); - public static void ilGetBooleanv(int mode, ByteBuffer param) { - nilGetBooleanv(mode, param, param.position()); - } - private static native void nilGetBooleanv(int mode, ByteBuffer param, int position); - public static void ilGetIntegerv(int mode, IntBuffer param) { - nilGetIntegerv(mode, param, param.position()); - } - private static native void nilGetIntegerv(int mode, IntBuffer param, int position); + public static void ilGetBooleanv(int mode, ByteBuffer param) { + nilGetBooleanv(mode, param, param.position()); + } + private static native void nilGetBooleanv(int mode, ByteBuffer param, int position); + public static void ilGetIntegerv(int mode, IntBuffer param) { + nilGetIntegerv(mode, param, param.position()); + } + private static native void nilGetIntegerv(int mode, IntBuffer param, int position); public static native ByteBuffer ilGetData(); public static native int ilGetError(); @@ -416,24 +416,24 @@ public static native boolean ilSetDuration(int Duration); public static native void ilSetInteger(int Mode, int Param); public static void ilSetPixels( int XOff, int YOff, int ZOff, int Width, - int Height, int Depth, int Format, int Type, ByteBuffer Data) { + int Height, int Depth, int Format, int Type, ByteBuffer Data) { BufferChecks.checkDirect(Data); nilSetPixels(XOff, YOff, ZOff, Width, Height, Depth, Format, Type, Data, Data.position()); } private static native void nilSetPixels(int XOff, int YOff, int ZOff, int Width, - int Height, int Depth, int Format, - int Type, ByteBuffer Data, int data_offset); + int Height, int Depth, int Format, + int Type, ByteBuffer Data, int data_offset); public static native void ilSetString(int Mode, String string); public static native void ilShutDown(); public static boolean ilTexImage( int Width, int Height, int Depth, byte Bpp, - int Format, int Type, ByteBuffer Data) { + int Format, int Type, ByteBuffer Data) { BufferChecks.checkDirect(Data); return nilTexImage(Width, Height, Depth, Bpp, Format, Type, Data, Data.position()); } private static native boolean nilTexImage(int Width, int Height, int Depth, byte Bpp, - int Format, int Type, ByteBuffer Data, int data_offset); + int Format, int Type, ByteBuffer Data, int data_offset); public static native boolean ilTypeFunc(int Mode); public static native boolean ilLoadData(String FileName, int Width, int Height, int Depth, byte Bpp); @@ -446,7 +446,7 @@ int Depth, byte Bpp); public static native boolean ilSaveData(String FileName); - + /** * Loads an image from the specified url * @@ -524,12 +524,12 @@ byte[] buffer = new byte[4096]; ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedInputStream buf = new BufferedInputStream(stream); - + try { while((lastRead = buf.read(buffer, 0, buffer.length)) != -1) { baos.write(buffer, 0, lastRead); } - + buffer = baos.toByteArray(); ByteBuffer lump = ByteBuffer.allocateDirect(buffer.length); lump.put(buffer); @@ -542,12 +542,12 @@ return result; } - + // public static native int ilGetDXTCData(ILvoid *Buffer, int BufferSize, int DXTCFormat); // public static native boolean ilIsValidF(int Type, ILHANDLE File); // public static native boolean ilLoadF(int Type, ILHANDLE File); - // public static native boolean ilLoadDataF(ILHANDLE File, int Width, int Height, int Depth, ILubyte Bpp); - // public static native int ilSaveF(int Type, ILHANDLE File); + // public static native boolean ilLoadDataF(ILHANDLE File, int Width, int Height, int Depth, ILubyte Bpp); + // public static native int ilSaveF(int Type, ILHANDLE File); // public static native void ilRegisterFormat(int Format); // public static native boolean ilRegisterLoad(String Ext, IL_LOADPROC Load); // public static native boolean ilRegisterMipNum(int Num); @@ -587,9 +587,9 @@ } String[] illPaths = LWJGLUtil.getLibraryPaths(new String[]{ - "DevIL", "DevIL.dll", - "IL", "libIL.so", - "IL", "IL"}, IL.class.getClassLoader()); + "DevIL", "DevIL.dll", + "IL", "libIL.so", + "IL", "IL"}, IL.class.getClassLoader()); nCreate(illPaths); created = true; @@ -597,14 +597,14 @@ IL.initNativeStubs(); IL.ilInit(); - // We need to initialize everything in one fell swoop on mac - if(System.getProperty("os.name").startsWith("Mac")) { - ILU.initNativeStubs(); - ILU.setCreated(true); + // We need to initialize everything in one fell swoop on mac + if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { + ILU.initNativeStubs(); + ILU.setCreated(true); - ILUT.initNativeStubs(); - ILUT.setCreated(true); - } + ILUT.initNativeStubs(); + ILUT.setCreated(true); + } created = true; } catch (LWJGLException e) { @@ -619,16 +619,16 @@ public static void destroy() { resetNativeStubs(IL.class); - // We need to destroy everything on mac in one go - if(System.getProperty("os.name").startsWith("Mac")) { - ILU.resetNativeStubs(ILU.class); - ILU.nDestroy(); - ILU.setCreated(false); + // We need to destroy everything on mac in one go + if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { + ILU.resetNativeStubs(ILU.class); + ILU.nDestroy(); + ILU.setCreated(false); - ILUT.resetNativeStubs(ILUT.class); - ILUT.nDestroy(); - ILUT.setCreated(false); - } + ILUT.resetNativeStubs(ILUT.class); + ILUT.nDestroy(); + ILUT.setCreated(false); + } if (created) { nDestroy(); Index: ILU.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILU.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ILU.java 28 Mar 2005 13:08:33 -0000 1.10 +++ ILU.java 9 Apr 2005 17:35:37 -0000 1.11 @@ -55,182 +55,182 @@ * @version $Revision$ */ public class ILU { - - public static final int ILU_FILTER = 0x2600; - public static final int ILU_NEAREST = 0x2601; - public static final int ILU_LINEAR = 0x2602; - public static final int ILU_BILINEAR = 0x2603; - public static final int ILU_SCALE_BOX = 0x2604; - public static final int ILU_SCALE_TRIANGLE = 0x2605; - public static final int ILU_SCALE_BELL = 0x2606; - public static final int ILU_SCALE_BSPLINE = 0x2607; - public static final int ILU_SCALE_LANCZOS3 = 0x2608; - public static final int ILU_SCALE_MITCHELL = 0x2609; - // Error types - public static final int ILU_INVALID_ENUM = 0x0501; - public static final int ILU_OUT_OF_MEMORY = 0x0502; - public static final int ILU_INTERNAL_ERROR = 0x0504; - public static final int ILU_INVALID_VALUE = 0x0505; - public static final int ILU_ILLEGAL_OPERATION = 0x0506; - public static final int ILU_INVALID_PARAM = 0x0509; - - // Values - public static final int ILU_PLACEMENT = 0x0700; - public static final int ILU_LOWER_LEFT = 0x0701; - public static final int ILU_LOWER_RIGHT = 0x0702; - public static final int ILU_UPPER_LEFT = 0x0703; - public static final int ILU_UPPER_RIGHT = 0x0704; - public static final int ILU_CENTER = 0x0705; - public static final int ILU_CONVOLUTION_MATRIX = 0x0710; - public static final int ILU_VERSION_NUM = IL.IL_VERSION_NUM; - public static final int ILU_VENDOR = IL.IL_VENDOR; + public static final int ILU_FILTER = 0x2600; + public static final int ILU_NEAREST = 0x2601; + public static final int ILU_LINEAR = 0x2602; + public static final int ILU_BILINEAR = 0x2603; + public static final int ILU_SCALE_BOX = 0x2604; + public static final int ILU_SCALE_TRIANGLE = 0x2605; + public static final int ILU_SCALE_BELL = 0x2606; + public static final int ILU_SCALE_BSPLINE = 0x2607; + public static final int ILU_SCALE_LANCZOS3 = 0x2608; + public static final int ILU_SCALE_MITCHELL = 0x2609; - /** Have we been created? */ - protected static boolean created; + // Error types + public static final int ILU_INVALID_ENUM = 0x0501; + public static final int ILU_OUT_OF_MEMORY = 0x0502; + public static final int ILU_INTERNAL_ERROR = 0x0504; + public static final int ILU_INVALID_VALUE = 0x0505; + public static final int ILU_ILLEGAL_OPERATION = 0x0506; + public static final int ILU_INVALID_PARAM = 0x0509; - /** - * @return true if ILU has been created - */ - public static boolean isCreated() { - return created; - } + // Values + public static final int ILU_PLACEMENT = 0x0700; + public static final int ILU_LOWER_LEFT = 0x0701; + public static final int ILU_LOWER_RIGHT = 0x0702; + public static final int ILU_UPPER_LEFT = 0x0703; + public static final int ILU_UPPER_RIGHT = 0x0704; + public static final int ILU_CENTER = 0x0705; + public static final int ILU_CONVOLUTION_MATRIX = 0x0710; + public static final int ILU_VERSION_NUM = IL.IL_VERSION_NUM; + public static final int ILU_VENDOR = IL.IL_VENDOR; - public static native boolean iluAlienify(); - public static native boolean iluBlurAvg(int iter); - public static native boolean iluBlurGaussian(int iter); - public static native boolean iluBuildMipmaps(); - public static native int iluColoursUsed(); - public static native boolean iluCompareImage(int comp); - public static native boolean iluContrast(float contrast); - public static native boolean iluCrop(int xOff, int yOff, int zOff, int width, int height, int depth); - public static native void iluDeleteImage(int id); - public static native boolean iluEdgeDetectE(); - public static native boolean iluEdgeDetectP(); - public static native boolean iluEdgeDetectS(); - public static native boolean iluEmboss(); - public static native boolean iluEnlargeCanvas(int width, int height, int depth); - public static native boolean iluEnlargeImage(float xDim, float yDim, float zDim); - public static native boolean iluEqualize(); - public static native String iluErrorString(int error); - public static native boolean iluFlipImage(); - public static native boolean iluGammaCorrect(float gamma); - public static native int iluGenImage(); - public static native void iluGetImageInfo(ILinfo info); - public static native int iluGetInteger(int mode); - public static void iluGetIntegerv(int mode, IntBuffer param) { - BufferChecks.checkDirect(param); - niluGetIntegerv(mode, param, param.position()); - } - private static native void niluGetIntegerv(int mode, IntBuffer param, int param_offset); - public static native String iluGetString(int stringName); - public static native void iluImageParameter(int pName, int param); - private static native void iluInit(); - public static native boolean iluInvertAlpha(); - public static native int iluLoadImage(String fileName); - public static native boolean iluMirror(); - public static native boolean iluNegative(); - public static native boolean iluNoisify(float tolerance); - public static native boolean iluPixelize(int pixSize); - public static native boolean iluReplaceColour(byte red, byte green, byte blue, float tolerance); - public static native boolean iluRotate(float angle); - public static native boolean iluSaturate1f(float saturation); - public static native boolean iluSaturate4f(float r, float g, float b, float saturation); - public static native boolean iluScale(int width, int height, int depth); - public static native boolean iluScaleColours(float r, float g, float b); - public static native boolean iluSharpen(float factor, int iter); - public static native boolean iluSwapColours(); - public static native boolean iluWave(float angle); + /** Have we been created? */ + protected static boolean created; - // public static native void iluRegionfv(ILpointf points[], int n); - // public static native void iluRegioniv(ILpointi points[], int n); - // public static native boolean iluRotate3D(float x, float y, float z, float Angle); - - /* DevIL lib allows both spellings of colour. We support that too */ - // ======================================================================== - public static void iluColorsUsed() { - iluColoursUsed(); - } - public static void iluSwapColors() { - iluSwapColours(); - } - public static void iluReplaceColor(byte red, byte green, byte blue, float tolerance) { - iluReplaceColour(red, green, blue, tolerance); - } - public static void iluScaleColors(float r, float g, float b) { - iluScaleColours(r, g, b); - } - // ------------------------------------------------------------------------ - - /** - * Creates a new instance of ILU. Cannot be created unless IL has been created. - */ - public static void create() throws LWJGLException { - if(!IL.isCreated()) { - throw new LWJGLException("Cannot create ILU without having created IL instance"); - } + /** + * @return true if ILU has been created + */ + public static boolean isCreated() { + return created; + } - // We need to do nothing when running on mac, since all is loaded in IL - if(System.getProperty("os.name").startsWith("Mac")) { - return; - } + public static native boolean iluAlienify(); + public static native boolean iluBlurAvg(int iter); + public static native boolean iluBlurGaussian(int iter); + public static native boolean iluBuildMipmaps(); + public static native int iluColoursUsed(); + public static native boolean iluCompareImage(int comp); + public static native boolean iluContrast(float contrast); + public static native boolean iluCrop(int xOff, int yOff, int zOff, int width, int height, int depth); + public static native void iluDeleteImage(int id); + public static native boolean iluEdgeDetectE(); + public static native boolean iluEdgeDetectP(); + public static native boolean iluEdgeDetectS(); + public static native boolean iluEmboss(); + public static native boolean iluEnlargeCanvas(int width, int height, int depth); + public static native boolean iluEnlargeImage(float xDim, float yDim, float zDim); + public static native boolean iluEqualize(); + public static native String iluErrorString(int error); + public static native boolean iluFlipImage(); + public static native boolean iluGammaCorrect(float gamma); + public static native int iluGenImage(); + public static native void iluGetImageInfo(ILinfo info); + public static native int iluGetInteger(int mode); + public static void iluGetIntegerv(int mode, IntBuffer param) { + BufferChecks.checkDirect(param); + niluGetIntegerv(mode, param, param.position()); + } + private static native void niluGetIntegerv(int mode, IntBuffer param, int param_offset); + public static native String iluGetString(int stringName); + public static native void iluImageParameter(int pName, int param); + private static native void iluInit(); + public static native boolean iluInvertAlpha(); + public static native int iluLoadImage(String fileName); + public static native boolean iluMirror(); + public static native boolean iluNegative(); + public static native boolean iluNoisify(float tolerance); + public static native boolean iluPixelize(int pixSize); + public static native boolean iluReplaceColour(byte red, byte green, byte blue, float tolerance); + public static native boolean iluRotate(float angle); + public static native boolean iluSaturate1f(float saturation); + public static native boolean iluSaturate4f(float r, float g, float b, float saturation); + public static native boolean iluScale(int width, int height, int depth); + public static native boolean iluScaleColours(float r, float g, float b); + public static native boolean iluSharpen(float factor, int iter); + public static native boolean iluSwapColours(); + public static native boolean iluWave(float angle); - String[] iluPaths = LWJGLUtil.getLibraryPaths(new String[]{ - "ILU", "ILU.dll", - "ILU", "libILU.so", - "ILU", "ILU"}, ILU.class.getClassLoader()); - nCreate(iluPaths); - created = true; + // public static native void iluRegionfv(ILpointf points[], int n); + // public static native void iluRegioniv(ILpointi points[], int n); + // public static native boolean iluRotate3D(float x, float y, float z, float Angle); - try { - ILU.initNativeStubs(); - ILU.iluInit(); - created = true; - } catch (LWJGLException e) { - destroy(); - throw e; - } - } + /* DevIL lib allows both spellings of colour. We support that too */ + // ======================================================================== + public static void iluColorsUsed() { + iluColoursUsed(); + } + public static void iluSwapColors() { + iluSwapColours(); + } + public static void iluReplaceColor(byte red, byte green, byte blue, float tolerance) { + iluReplaceColour(red, green, blue, tolerance); + } + public static void iluScaleColors(float r, float g, float b) { + iluScaleColours(r, g, b); + } + // ------------------------------------------------------------------------ - static native void initNativeStubs() throws LWJGLException; + /** + * Creates a new instance of ILU. Cannot be created unless IL has been created. + */ + public static void create() throws LWJGLException { + if(!IL.isCreated()) { + throw new LWJGLException("Cannot create ILU without having created IL instance"); + } - static native void resetNativeStubs(Class clazz); + // We need to do nothing when running on mac, since all is loaded in IL + if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { + return; + } - /** - * Exit cleanly by calling destroy. - */ - public static void destroy() { + String[] iluPaths = LWJGLUtil.getLibraryPaths(new String[]{ + "ILU", "ILU.dll", + "ILU", "libILU.so", + "ILU", "ILU"}, ILU.class.getClassLoader()); + nCreate(iluPaths); + created = true; - // We need to do nothing when running on mac, since all is destroyed in IL - if(System.getProperty("os.name").startsWith("Mac")) { - return; - } + try { + ILU.initNativeStubs(); + ILU.iluInit(); + created = true; + } catch (LWJGLException e) { + destroy(); + throw e; + } + } - resetNativeStubs(ILU.class); - if (created) { - nDestroy(); - } - created = false; + static native void initNativeStubs() throws LWJGLException; + + static native void resetNativeStubs(Class clazz); + + /** + * Exit cleanly by calling destroy. + */ + public static void destroy() { + + // We need to do nothing when running on mac, since all is destroyed in IL + if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { + return; } - /** - * Native method to create ILU instance - * - * @param iluPaths Array of strings containing paths to search for ILU library - */ - protected static native void nCreate(String[] iluPaths) throws LWJGLException; + resetNativeStubs(ILU.class); + if (created) { + nDestroy(); + } + created = false; + } - /** - * Native method the destroy the ILU - */ - static native void nDestroy(); + /** + * Native method to create ILU instance + * + * @param iluPaths Array of strings containing paths to search for ILU library + */ + protected static native void nCreate(String[] iluPaths) throws LWJGLException; - /** - * Forcefully set created. Used internally by mac platform since - * it loads ilu/ilut in IL and needs to mark them as created - * @param created value to set created to - */ - static void setCreated(boolean created) { - ILU.created = created; - } + /** + * Native method the destroy the ILU + */ + static native void nDestroy(); + + /** + * Forcefully set created. Used internally by mac platform since + * it loads ilu/ilut in IL and needs to mark them as created + * @param created value to set created to + */ + static void setCreated(boolean created) { + ILU.created = created; + } } |
|
From: Elias N. <eli...@us...> - 2005-04-09 17:35:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25736/src/java/org/lwjgl/input Modified Files: Cursor.java Mouse.java Log Message: Added LWJGLUtil.getPlatform to encapsulate platform detection. Added FreeBSD as an alias to Linux. Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Cursor.java 20 Feb 2005 11:24:16 -0000 1.34 +++ Cursor.java 9 Apr 2005 17:35:37 -0000 1.35 @@ -36,6 +36,7 @@ import org.lwjgl.BufferChecks; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; +import org.lwjgl.LWJGLUtil; import org.lwjgl.Sys; import org.lwjgl.opengl.Display; @@ -155,27 +156,31 @@ // Win32 or X and do accordingly. This hasn't been implemented on Mac, but we // might want to split it into a X/Win/Mac cursor if it gets too cluttered - String osName = System.getProperty("os.name", ""); CursorElement[] cursors; - if (osName.startsWith("Win") || osName.startsWith("Mac")) { - // create our cursor elements - cursors = new CursorElement[numImages]; - for(int i=0; i<numImages; i++) { - Object handle = Display.getImplementation().createCursor(width, height, xHotspot, yHotspot, 1, images_copy, null); - long delay = (delays != null) ? delays.get(i) : 0; - long timeout = System.currentTimeMillis(); - cursors[i] = new CursorElement(handle, delay, timeout); - - // offset to next image - images_copy.position(width*height*(i+1)); - } - } else if (osName.startsWith("Lin")) { - // create our cursor elements - Object handle = Display.getImplementation().createCursor(width, height, xHotspot, yHotspot, numImages, images_copy, delays); - CursorElement cursor_element = new CursorElement(handle, -1, -1); - cursors = new CursorElement[]{cursor_element}; - } else { - throw new RuntimeException("Unknown OS"); + switch (LWJGLUtil.getPlatform()) { + case LWJGLUtil.PLATFORM_MACOSX: + /* Fall through */ + case LWJGLUtil.PLATFORM_WINDOWS: + // create our cursor elements + cursors = new CursorElement[numImages]; + for(int i=0; i<numImages; i++) { + Object handle = Display.getImplementation().createCursor(width, height, xHotspot, yHotspot, 1, images_copy, null); + long delay = (delays != null) ? delays.get(i) : 0; + long timeout = System.currentTimeMillis(); + cursors[i] = new CursorElement(handle, delay, timeout); + + // offset to next image + images_copy.position(width*height*(i+1)); + } + break; + case LWJGLUtil.PLATFORM_LINUX: + // create our cursor elements + Object handle = Display.getImplementation().createCursor(width, height, xHotspot, yHotspot, numImages, images_copy, delays); + CursorElement cursor_element = new CursorElement(handle, -1, -1); + cursors = new CursorElement[]{cursor_element}; + break; + default: + throw new RuntimeException("Unknown OS"); } return cursors; } Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- Mouse.java 29 Mar 2005 18:09:28 -0000 1.75 +++ Mouse.java 9 Apr 2005 17:35:37 -0000 1.76 @@ -129,7 +129,7 @@ private static boolean isGrabbed; /** Whether we're running windows - which need to manually update cursor animation */ - private static final boolean isWindows = System.getProperty("os.name").startsWith("Win"); + private static final boolean isWindows = LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_WINDOWS; /** * Mouse cannot be constructed. |
|
From: Caspian Rychlik-P. <ci...@us...> - 2005-04-09 16:45:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27856/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: Replaced sync() with a method that works, based on sync2() and Thread.sleep(1) Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- Display.java 29 Mar 2005 18:09:29 -0000 1.46 +++ Display.java 9 Apr 2005 16:45:14 -0000 1.47 @@ -326,7 +326,7 @@ * to prevent just missing the frame time if vsync is set. * @param fps The desired frame rate, in frames per second */ - public static void sync(int fps) { + public static void sync3(int fps) { float frameTime = 1.0f / (float) (fps > 1 ? fps - 1 : 1); timeNow = Sys.getTime(); while (timeNow > timeThen && (float) (timeNow - timeThen) / (float) Sys.getTimerResolution() < frameTime) { @@ -362,6 +362,31 @@ } /** + * Best sync method that works reliably. + * + * @param fps The desired frame rate, in frames per second + */ + public static void sync(int fps) { + long gapTo = Sys.getTimerResolution() / fps + timeThen; + timeNow = Sys.getTime(); + + while (gapTo > timeNow + timeLate) { + try { + Thread.sleep(1); + } catch (InterruptedException e) { + } + timeNow = Sys.getTime(); + } + + if (gapTo < timeNow) + timeLate = timeNow - gapTo; + else + timeLate = 0; + + timeThen = timeNow; + } + + /** * @return the X coordinate of the window (always 0 for fullscreen) */ /*public static int getX() { @@ -514,7 +539,7 @@ if (isVisible() || isDirty()) { Util.checkGLError(); try { - context.swapBuffers(); + Context.swapBuffers(); } catch (LWJGLException e) { throw new RuntimeException(e); } @@ -707,7 +732,7 @@ public static void setVSyncEnabled(boolean sync) { vsync = sync; if (isCreated()) - context.setVSync(vsync); + Context.setVSync(vsync); } /** |