summaryrefslogtreecommitdiffhomepage
path: root/tests/test_texture_mipmaps.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_texture_mipmaps.c')
-rw-r--r--tests/test_texture_mipmaps.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/test_texture_mipmaps.c b/tests/test_texture_mipmaps.c
new file mode 100644
index 00000000..7695ba19
--- /dev/null
+++ b/tests/test_texture_mipmaps.c
@@ -0,0 +1,59 @@
+/*******************************************************************************************
+*
+* raylib test - Texture loading with mipmaps, mipmaps generation
+*
+* This test has been created using raylib 1.1 (www.raylib.com)
+* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
+*
+* Copyright (c) 2014 Ramon Santamaria (Ray San - [email protected])
+*
+********************************************************************************************/
+
+#include "raylib.h"
+
+int main()
+{
+ // Initialization
+ //--------------------------------------------------------------------------------------
+ int screenWidth = 800;
+ int screenHeight = 450;
+
+ InitWindow(screenWidth, screenHeight, "raylib test - texture mipmaps");
+
+ Image image = LoadImage("resources/raylib_logo.png");
+ Texture2D texture = CreateTexture(image, true);
+
+ // NOTE: With OpenGL 3.3 mipmaps generation works great (automatic generation)
+ // NOTE: With OpenGL 1.1 mipmaps generation works great too! (manual generation)
+
+ //--------------------------------------------------------------------------------------
+
+ // Main game loop
+ while (!WindowShouldClose()) // Detect window close button or ESC key
+ {
+ // Update
+ //----------------------------------------------------------------------------------
+ // TODO: Update your variables here
+ //----------------------------------------------------------------------------------
+
+ // Draw
+ //----------------------------------------------------------------------------------
+ BeginDrawing();
+
+ ClearBackground(RAYWHITE);
+
+ DrawTexture(texture, 0, 0, WHITE);
+
+ EndDrawing();
+ //----------------------------------------------------------------------------------
+ }
+
+ // De-Initialization
+ //--------------------------------------------------------------------------------------
+ UnloadTexture(texture); // Texture unloading
+
+ CloseWindow(); // Close window and OpenGL context
+ //--------------------------------------------------------------------------------------
+
+ return 0;
+} \ No newline at end of file