diff options
| author | Ray <[email protected]> | 2016-11-22 12:15:58 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2016-11-22 12:15:58 +0100 |
| commit | b8481369f7209804d70220a29ba2efbd6171d7a9 (patch) | |
| tree | f85c9e3f3370f0a25d189f2158f8014d9d6ccaaf /examples/audio_module_playing.lua | |
| parent | f1bcfc1352f73b9da98601f6b67cd15853b1cb8f (diff) | |
| download | raylib-b8481369f7209804d70220a29ba2efbd6171d7a9.tar.gz raylib-b8481369f7209804d70220a29ba2efbd6171d7a9.zip | |
Reviewed some lua examples and added new ones
Diffstat (limited to 'examples/audio_module_playing.lua')
| -rw-r--r-- | examples/audio_module_playing.lua | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/examples/audio_module_playing.lua b/examples/audio_module_playing.lua index 3c5ad641..7c675424 100644 --- a/examples/audio_module_playing.lua +++ b/examples/audio_module_playing.lua @@ -37,13 +37,6 @@ for i = MAX_CIRCLES, 1, -1 do circles[i].color = colors[GetRandomValue(1, 14)] end --- Load postprocessing bloom shader -local shader = LoadShader("resources/shaders/glsl330/base.vs", - "resources/shaders/glsl330/bloom.fs") - --- Create a RenderTexture2D to be used for render to texture -local target = LoadRenderTexture(screenWidth, screenHeight) - local xm = LoadMusicStream("resources/audio/mini1111.xm") PlayMusicStream(xm) @@ -83,22 +76,11 @@ while not WindowShouldClose() do -- Detect window close button or ESC key --------------------------------------------------------------------------------------- BeginDrawing() - ClearBackground(BLACK) - - BeginTextureMode(target) -- Enable drawing to texture - - for i = MAX_CIRCLES, 1, -1 do - DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha)) - end - - EndTextureMode() -- End drawing to texture (now we have a texture available for next passes) + ClearBackground(RAYWHITE) - BeginShaderMode(shader) - - -- NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) - DrawTextureRec(target.texture, Rectangle(0, 0, target.texture.width, -target.texture.height), Vector2(0, 0), WHITE) - - EndShaderMode() + for i = MAX_CIRCLES, 1, -1 do + DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha)) + end -- Draw time bar DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY) @@ -111,10 +93,7 @@ end -- De-Initialization ------------------------------------------------------------------------------------------- -UnloadShader(shader) -- Unload shader -UnloadRenderTexture(target) -- Unload render texture - -UnloadMusicStream(xm) -- Unload music stream buffers from RAM +UnloadMusicStream(xm) -- Unload music stream buffers from RAM CloseAudioDevice() -- Close audio device (music streaming is automatically stopped) |
