How to use the raylib.CloseWindow function in raylib

To help you get started, we’ve selected a few raylib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RobLoach / node-raylib / examples / core / core_2d_camera.js View on Github external
r.DrawRectangle( 10, 10, 250, 113, r.Fade(r.SKYBLUE, 0.5));
    r.DrawRectangleLines( 10, 10, 250, 113, r.BLUE);

    r.DrawText("Free 2d camera controls:", 20, 20, 10, r.BLACK);
    r.DrawText("- Right/Left to move Offset", 40, 40, 10, r.DARKGRAY);
    r.DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, r.DARKGRAY);
    r.DrawText("- A / S to Rotate", 40, 80, 10, r.DARKGRAY);
    r.DrawText("- R to reset Zoom and Rotation", 40, 100, 10, r.DARKGRAY);

  r.EndDrawing();
  //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.CloseWindow();        // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / examples / core / core_random_values.js View on Github external
//----------------------------------------------------------------------------------
    r.BeginDrawing()

        r.ClearBackground(r.RAYWHITE)

        r.DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, r.MAROON)

        r.DrawText(r.FormatText("%i", randValue), 360, 180, 80, r.LIGHTGRAY)

    r.EndDrawing()
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.CloseWindow()        // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / examples / textures / textures_logo_raylib.js View on Github external
r.ClearBackground(r.RAYWHITE)

        r.DrawTexture(texture, screenWidth / 2 - texture.width / 2, screenHeight / 2 - texture.height / 2, r.WHITE)

        r.DrawText("this IS a texture!", 360, 370, 10, r.GRAY)

    r.EndDrawing()
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.UnloadTexture(texture)       // Texture unloading

r.CloseWindow()                // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / examples / core / core_input_mouse.js View on Github external
//----------------------------------------------------------------------------------
    r.BeginDrawing()

        r.ClearBackground(r.RAYWHITE)

        r.DrawCircleV(ballPosition, 40, ballColor)

        r.DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, r.DARKGRAY)

    r.EndDrawing()
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.CloseWindow()        // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / templates / simple_game / simple_game.js View on Github external
r.DrawText("ENDING SCREEN", 20, 20, 40, r.DARKBLUE);
                r.DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, r.DARKBLUE);

            } break
        }

    r.EndDrawing()
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------

// TODO: Unload all loaded data (textures, fonts, audio) here!

r.CloseWindow()        // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / examples / audio / audio_sound_loading.js View on Github external
r.DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, r.LIGHTGRAY)
        r.DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, r.LIGHTGRAY)

    r.EndDrawing()
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.UnloadSound(fxWav)     // Unload sound data
r.UnloadSound(fxOgg)     // Unload sound data

r.CloseAudioDevice()     // Close audio device

r.CloseWindow()          // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / examples / core / core_world_screen.js View on Github external
r.DrawCubeWires(cubePosition, 2, 2, 2, r.MAROON);

            r.DrawGrid(10, 1);

        r.EndMode3D();

        r.DrawText("Enemy: 100 / 100", cubeScreenPosition.x - r.MeasureText("Enemy: 100 / 100", 20) / 2, cubeScreenPosition.y, 20, r.BLACK);
        r.DrawText("Text is always on top of the cube", (screenWidth - r.MeasureText("Text is always on top of the cube", 20)) / 2, 25, 20, r.GRAY);

    r.EndDrawing();
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.CloseWindow();        // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / examples / shapes / shapes_basic_shapes.js View on Github external
// NOTE: We draw all LINES based shapes together to optimize internal drawing,
        // this way, all LINES are rendered in a single draw pass
        DrawLine(18, 42, screenWidth - 18, 42, BLACK);
        DrawCircleLines(screenWidth/4, 340, 80, DARKBLUE);
        DrawTriangleLines((Vector2){screenWidth/4*3, 160},
                          (Vector2){screenWidth/4*3 - 20, 230},
                          (Vector2){screenWidth/4*3 + 20, 230}, DARKBLUE);
        */
    r.EndDrawing();
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.CloseWindow();        // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / examples / textures / textures_image_loading.js View on Github external
r.ClearBackground(r.RAYWHITE);

        r.DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, r.WHITE);

        r.DrawText("this IS a texture loaded from an image!", 300, 370, 10, r.GRAY);

    r.EndDrawing();
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.UnloadTexture(texture);       // Texture unloading

r.CloseWindow();                // Close window and OpenGL context
//--------------------------------------------------------------------------------------
github RobLoach / node-raylib / examples / core / core_3d_camera_first_person.js View on Github external
r.EndMode3D();

        r.DrawRectangle( 10, 10, 220, 70, r.Fade(r.SKYBLUE, 0.5));
        r.DrawRectangleLines( 10, 10, 220, 70, r.BLUE);

        r.DrawText("First person camera default controls:", 20, 20, 10, r.BLACK);
        r.DrawText("- Move with keys: W, A, S, D", 40, 40, 10, r.DARKGRAY);
        r.DrawText("- Mouse move to look around", 40, 60, 10, r.DARKGRAY);

    r.EndDrawing();
    //----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
r.CloseWindow();        // Close window and OpenGL context
//--------------------------------------------------------------------------------------