summaryrefslogtreecommitdiffhomepage
path: root/examples/audio_module_playing.c
diff options
context:
space:
mode:
authorRay <[email protected]>2016-11-24 17:26:07 +0100
committerGitHub <[email protected]>2016-11-24 17:26:07 +0100
commit17f09cb03484a408cdd50a3d2e4d6604bb1f4c70 (patch)
tree51e909c419de9625f1beaaca44696857a600e8d5 /examples/audio_module_playing.c
parent05f68c22d5c8d8f7c4254ae47700318e21709887 (diff)
parenta81dfabf863c512044b246e23aaf43489d2fa1ac (diff)
downloadraylib-1.6.0.tar.gz
raylib-1.6.0.zip
Merge pull request #198 from raysan5/develop1.6.0
Develop branch integration
Diffstat (limited to 'examples/audio_module_playing.c')
-rw-r--r--examples/audio_module_playing.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/examples/audio_module_playing.c b/examples/audio_module_playing.c
index 7da3579c..a9ee4619 100644
--- a/examples/audio_module_playing.c
+++ b/examples/audio_module_playing.c
@@ -30,6 +30,8 @@ int main()
int screenWidth = 800;
int screenHeight = 450;
+ SetConfigFlags(FLAG_MSAA_4X_HINT); // NOTE: Try to enable MSAA 4X
+
InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)");
InitAudioDevice(); // Initialize audio device
@@ -49,13 +51,6 @@ int main()
circles[i].speed = (float)GetRandomValue(1, 100)/20000.0f;
circles[i].color = colors[GetRandomValue(0, 13)];
}
-
- // Load postprocessing bloom shader
- Shader shader = LoadShader("resources/shaders/glsl330/base.vs",
- "resources/shaders/glsl330/bloom.fs");
-
- // Create a RenderTexture2D to be used for render to texture
- RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight);
Music xm = LoadMusicStream("resources/audio/mini1111.xm");
@@ -117,28 +112,17 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(BLACK);
+ ClearBackground(WHITE);
- BeginTextureMode(target); // Enable drawing to texture
-
- for (int i = MAX_CIRCLES - 1; i >= 0; i--)
- {
- DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha));
- }
-
- EndTextureMode(); // End drawing to texture (now we have a texture available for next passes)
+ for (int i = MAX_CIRCLES - 1; i >= 0; i--)
+ {
+ DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha));
+ }
- 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();
-
// Draw time bar
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY);
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON);
- DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, WHITE);
+ DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -146,9 +130,6 @@ int main()
// De-Initialization
//--------------------------------------------------------------------------------------
- UnloadShader(shader); // Unload shader
- UnloadRenderTexture(target); // Unload render texture
-
UnloadMusicStream(xm); // Unload music stream buffers from RAM
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)