This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *.sln | |
| *.userprefs | |
| *.csproj | |
| *.pidb | |
| *.unityproj | |
| .DS_Store | |
| /Library/FailedAssetImports.txt | |
| /Library/cache/ | |
| /Library/previews/ | |
| /Library/ScriptAssemblies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // C# example. | |
| using UnityEngine; | |
| using UnityEditor; | |
| using System.Collections; | |
| [CustomPropertyDrawer(typeof(ActionInput))] | |
| public class ActionInputDrawer : PropertyDrawer { | |
| public int rows = 1; | |
| // Draw the property inside the given rect | |
| public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Serializable] | |
| public class ActionInput{ | |
| public enum ActionType | |
| { | |
| ENTER_TRIGGER, | |
| EXIT_TRIGGER, | |
| STAY_TRIGGER, | |
| OBJECT_ACTIVE, | |
| PRESS_KEY | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Play this game by pasting the script in http://www.???.com/editor.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void fill_audio(void *udata, Uint8 *stream, int len) | |
| { | |
| int fLen = len/sizeof(float); | |
| /* Mix as much data as possible */ | |
| // copy the output to the stream | |
| for(int i=0;i<fLen;i+=2){ | |
| // ======================= | |
| // | |
| // my c code goes here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import snow.platform.native.audio.openal.SoundStream; | |
| import snow.audio.Audio; | |
| import snow.types.Types; | |
| import snow.io.typedarray.Uint8Array; | |
| import snow.io.typedarray.Float32Array; | |
| import snow.Log; | |
| import luxe.Input; | |
| class Main extends luxe.Game { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import snow.platform.native.audio.openal.SoundStream; | |
| import snow.audio.Audio; | |
| import snow.types.Types; | |
| import snow.io.typedarray.Uint8Array; | |
| import snow.io.typedarray.Uint16Array; | |
| import snow.io.typedarray.Int16Array; | |
| import snow.io.typedarray.Float32Array; | |
| import snow.Log; | |
| import luxe.Rectangle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void lipsynth_module_sine_update(void *self, lipsynth_context *ctx, lipsynth_AudioMemory *outputBuffer){ | |
| lipsynth_module_sine* module = self; | |
| // fill up the output buffer with a sine wave! | |
| for(int i=0;i<ctx->bufferLength/2;i++){ | |
| // must be called before any parameters are read | |
| if(module->_(lipsynth_Module_update_parameters)(self, ctx)){ | |
| if(module->_(lipsynth_Module_has_parameter_value)(self, ctx, NOTE)){ | |
| int noteVal = module->_(lipsynth_Module_get_parameter_value)(self, ctx, NOTE); | |
| module->freqVal = pow(2.0, (noteVal)/12.0f)*440.0f; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "module_sine.h" | |
| typedef enum { | |
| NOTE, | |
| VOL | |
| } lipsynth_sine_params; | |
| int lipsynth_module_sine_destroy(void *self){ | |
| return 1; | |
| } | |
| void lipsynth_module_sine_update(void *self, lipsynth_context *ctx, lipsynth_AudioMemory *outputBuffer){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // types | |
| typedef struct lipsynth_Module lipsynth_Module; | |
| struct lipsynth_Module { | |
| // blah blah a bunch of values and pointers and stuff | |
| // the only one that I am getting confused about | |
| int module_registration; | |
| }; | |