diff options
| author | raysan5 <[email protected]> | 2014-04-19 16:54:48 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2014-04-19 16:54:48 +0200 |
| commit | f76a00adc1f4bc8c92187bf38fa1183f8626fc46 (patch) | |
| tree | b1acc3d7299bb00a59005304934166b8ba7bf11b /tests/test_texture_mipmaps.c | |
| parent | 1c8874e6d5cc6230e951397057cc5b7765647490 (diff) | |
| download | raylib-f76a00adc1f4bc8c92187bf38fa1183f8626fc46.tar.gz raylib-f76a00adc1f4bc8c92187bf38fa1183f8626fc46.zip | |
Code used to test some features (and resources)
Diffstat (limited to 'tests/test_texture_mipmaps.c')
| -rw-r--r-- | tests/test_texture_mipmaps.c | 59 |
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 |
