diff options
| author | Ray <[email protected]> | 2019-05-14 17:57:45 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-05-14 17:57:45 +0200 |
| commit | 5a27bcaf7115e46a5123e9857007d940998f0650 (patch) | |
| tree | 7179c6a1b4d700c9685dd51cc76cb2b2c90b9609 /examples/web/core/core_3d_mode.c | |
| parent | 423fdd699225ee9686c44a606bf83272b4c77802 (diff) | |
| download | raylib.com-5a27bcaf7115e46a5123e9857007d940998f0650.tar.gz raylib.com-5a27bcaf7115e46a5123e9857007d940998f0650.zip | |
Review examples collection -WIP-
WARNING: Examples list has been reviewed but examples haven't been recompiled yet... that's not trivial...
Diffstat (limited to 'examples/web/core/core_3d_mode.c')
| -rw-r--r-- | examples/web/core/core_3d_mode.c | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/examples/web/core/core_3d_mode.c b/examples/web/core/core_3d_mode.c deleted file mode 100644 index 38e9272..0000000 --- a/examples/web/core/core_3d_mode.c +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************************* -* -* raylib [core] example - Initialize 3d mode (adapted for HTML5 platform) -* -* This example has been created using raylib 1.3 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Copyright (c) 2015 Ramon Santamaria (@raysan5) -* -********************************************************************************************/ - -#include "raylib.h" - -#if defined(PLATFORM_WEB) - #include <emscripten/emscripten.h> -#endif - -#if defined(PLATFORM_ANDROID) - #include "android_native_app_glue.h" -#endif - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -int screenWidth = 800; -int screenHeight = 450; - -// Define the camera to look into our 3d world -Camera camera; -Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; - -//---------------------------------------------------------------------------------- -// Module Functions Declaration -//---------------------------------------------------------------------------------- -void UpdateDrawFrame(void); // Update and Draw one frame - -//---------------------------------------------------------------------------------- -// Main Enry Point -//---------------------------------------------------------------------------------- -#if defined(PLATFORM_ANDROID) -void android_main(struct android_app *app) -#else -int main(void) -#endif -{ - // Initialization - //-------------------------------------------------------------------------------------- -#if defined(PLATFORM_ANDROID) - InitWindow(screenWidth, screenHeight, app); -#else - InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d mode"); -#endif - - camera.position = (Vector3){ 0.0f, 10.0f, 10.0f }; // Camera position - camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point - camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) - camera.fovy = 45.0f; // Camera field-of-view Y - -#if defined(PLATFORM_WEB) - emscripten_set_main_loop(UpdateDrawFrame, 0, 1); -#else - SetTargetFPS(60); // Set our game to run at 60 frames-per-second - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - UpdateDrawFrame(); - } -#endif - - // De-Initialization - //-------------------------------------------------------------------------------------- - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- -#if !defined(PLATFORM_ANDROID) - return 0; -#endif -} - -//---------------------------------------------------------------------------------- -// Module Functions Definition -//---------------------------------------------------------------------------------- -void UpdateDrawFrame(void) -{ - // Update - //---------------------------------------------------------------------------------- - // TODO: Update your variables here - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - Begin3dMode(camera); - - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); - - DrawGrid(10, 1.0f); - - End3dMode(); - - DrawText("Welcome to the third dimension!", 10, 40, 20, DARKGRAY); - - DrawFPS(10, 10); - - EndDrawing(); - //---------------------------------------------------------------------------------- -}
\ No newline at end of file |
