aboutsummaryrefslogtreecommitdiff
path: root/examples/audio_module_playing.lua
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-11-24 17:26:07 +0100
committerGitHub <noreply@github.com>2016-11-24 17:26:07 +0100
commit17f09cb03484a408cdd50a3d2e4d6604bb1f4c70 (patch)
tree51e909c419de9625f1beaaca44696857a600e8d5 /examples/audio_module_playing.lua
parent05f68c22d5c8d8f7c4254ae47700318e21709887 (diff)
parenta81dfabf863c512044b246e23aaf43489d2fa1ac (diff)
downloadraylib-17f09cb03484a408cdd50a3d2e4d6604bb1f4c70.tar.gz
raylib-17f09cb03484a408cdd50a3d2e4d6604bb1f4c70.zip
Merge pull request #198 from raysan5/develop
Develop branch integration
Diffstat (limited to 'examples/audio_module_playing.lua')
-rw-r--r--examples/audio_module_playing.lua31
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)