diff --git a/lib/Ray/CMakeLists.txt b/lib/Ray/CMakeLists.txt index 32e0a5a9..e9ffc25f 100644 --- a/lib/Ray/CMakeLists.txt +++ b/lib/Ray/CMakeLists.txt @@ -18,7 +18,6 @@ set(HEADERS sources/IRessource.hpp sources/Matrix.hpp sources/Mesh.hpp - sources/Model.hpp sources/Window.hpp sources/Audio/IAudio.hpp sources/Audio/Music.hpp @@ -52,11 +51,20 @@ set(HEADERS sources/Drawables/3D/Ray.hpp sources/Drawables/3D/Sphere.hpp sources/Drawables/3D/Triangle.hpp + sources/Model/Model.hpp + sources/Model/ModelAnimation.hpp + sources/Model/ModelAnimations.hpp sources/Vector/Vector2.hpp sources/Vector/Vector3.hpp ) set(SRC + sources/Color.cpp + sources/Font.cpp + sources/Window.cpp + sources/Model/Model.cpp + sources/Model/ModelAnimation.cpp + sources/Model/ModelAnimations.cpp sources/Audio/Music.cpp sources/Audio/Sound.cpp sources/Camera/Camera2D.cpp @@ -86,10 +94,6 @@ set(SRC sources/Drawables/Texture.cpp sources/Vector/Vector2.cpp sources/Vector/Vector3.cpp - sources/Color.cpp - sources/Font.cpp - sources/Model.cpp - sources/Window.cpp ) find_package(raylib QUIET) diff --git a/lib/Ray/sources/Camera/Camera3D.cpp b/lib/Ray/sources/Camera/Camera3D.cpp index 00b5aed3..4d83af40 100644 --- a/lib/Ray/sources/Camera/Camera3D.cpp +++ b/lib/Ray/sources/Camera/Camera3D.cpp @@ -72,6 +72,11 @@ void RAY::Camera::Camera3D::setMode(Mode mode) this->_mode = mode; } +void RAY::Camera::Camera3D::update(void) +{ + UpdateCamera(&this->_camera); +} + RAY::Camera::Camera3D::operator ::Camera3D() const { return this->_camera; diff --git a/lib/Ray/sources/Camera/Camera3D.hpp b/lib/Ray/sources/Camera/Camera3D.hpp index 4edc6bfb..d5864271 100644 --- a/lib/Ray/sources/Camera/Camera3D.hpp +++ b/lib/Ray/sources/Camera/Camera3D.hpp @@ -59,9 +59,12 @@ namespace RAY::Camera { //! @brief Returns camera 3d transform matrix Matrix getMatrix(void) const override; - // Set camera mode (multiple camera modes available) + //! @brief Set camera mode (multiple camera modes available) void setMode(Mode mode); + //! @brief Update camera position for selected mode + void update(void); + //! @brief get camera struct operator ::Camera3D() const; diff --git a/lib/Ray/sources/Drawables/2D/Triangle.cpp b/lib/Ray/sources/Drawables/2D/Triangle.cpp index 3baae3ec..35be178d 100644 --- a/lib/Ray/sources/Drawables/2D/Triangle.cpp +++ b/lib/Ray/sources/Drawables/2D/Triangle.cpp @@ -52,9 +52,8 @@ void RAY::Drawables::Drawables2D::Triangle::drawOn(RAY::Window &) DrawTriangle(this->_position, this->_posB, this->_posC, this->_color); } -void RAY::Drawables::Drawables2D::Triangle::drawOn(RAY::Image &image) +void RAY::Drawables::Drawables2D::Triangle::drawOn(RAY::Image &) { - (void)image; throw std::exception(); } diff --git a/lib/Ray/sources/Drawables/2D/Triangle.hpp b/lib/Ray/sources/Drawables/2D/Triangle.hpp index 61a71615..0fd97d71 100644 --- a/lib/Ray/sources/Drawables/2D/Triangle.hpp +++ b/lib/Ray/sources/Drawables/2D/Triangle.hpp @@ -54,7 +54,7 @@ namespace RAY::Drawables::Drawables2D { //! @brief Draw point on window void drawOn(RAY::Window &) override; - //! @brief Draw point on image + //! @brief A Triangle cannot be drawn on an image, an exception will be thrown void drawOn(RAY::Image &image) override; private: diff --git a/lib/Ray/sources/Drawables/Image.hpp b/lib/Ray/sources/Drawables/Image.hpp index c9f8577d..1c219bf4 100644 --- a/lib/Ray/sources/Drawables/Image.hpp +++ b/lib/Ray/sources/Drawables/Image.hpp @@ -52,7 +52,7 @@ namespace RAY bool exportTo(const std::string &outputPath); //! @brief unload ressources - bool unload() override; + bool unload();; //! @brief get image operator ::Image() const; diff --git a/lib/Ray/sources/Drawables/Texture.hpp b/lib/Ray/sources/Drawables/Texture.hpp index bab0c36f..4cefa47b 100644 --- a/lib/Ray/sources/Drawables/Texture.hpp +++ b/lib/Ray/sources/Drawables/Texture.hpp @@ -43,7 +43,7 @@ namespace RAY bool load(const std::string &filename) override; //! @brief unload ressources - bool unload() override; + bool unload();; //! @return libray Texture struct operator ::Texture() const; diff --git a/lib/Ray/sources/IRessource.hpp b/lib/Ray/sources/IRessource.hpp index 2482cc3c..913640c9 100644 --- a/lib/Ray/sources/IRessource.hpp +++ b/lib/Ray/sources/IRessource.hpp @@ -17,8 +17,6 @@ namespace RAY { virtual ~IRessource() = default; virtual bool load(const std::string &filePath) = 0; - - virtual bool unload() = 0; }; }; diff --git a/lib/Ray/sources/Model.cpp b/lib/Ray/sources/Model.cpp deleted file mode 100644 index da4500a4..00000000 --- a/lib/Ray/sources/Model.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* -** EPITECH PROJECT, 2021 -** Bomberman -** File description: -** Model -*/ - -#include "Model.hpp" - -RAY::Model::Model(const std::string &filename): - _model(LoadModel(filename.c_str())) -{ -} - -RAY::Model::Model(const Mesh &mesh): - _model(LoadModelFromMesh(mesh)) -{ -} - -RAY::Model::~Model() -{ - this->unload(); -} - -bool RAY::Model::load(const std::string &filename) -{ - this->_model = LoadModel(filename.c_str()); - return true; -} - -bool RAY::Model::load(const Mesh &mesh) -{ - this->_model = LoadModelFromMesh(mesh); - return true; -} - -bool RAY::Model::unload() -{ - UnloadModel(_model); - return true; -} - -bool RAY::Model::unloadKeepMeshes() -{ - UnloadModelKeepMeshes(_model); - return true; -} diff --git a/lib/Ray/sources/Model/Model.cpp b/lib/Ray/sources/Model/Model.cpp new file mode 100644 index 00000000..6be81120 --- /dev/null +++ b/lib/Ray/sources/Model/Model.cpp @@ -0,0 +1,65 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** Model +*/ + +#include "Model/Model.hpp" + +RAY::Model::Model(const std::string &filename): + _model(LoadModel(filename.c_str())) +{ +} + +RAY::Model::Model(const Mesh &mesh): + _model(LoadModelFromMesh(mesh)) +{ +} + +RAY::Model::~Model() +{ + UnloadModel(this->_model); +} + +bool RAY::Model::load(const std::string &filename) +{ + this->_model = LoadModel(filename.c_str()); + return true; +} + +bool RAY::Model::load(const Mesh &mesh) +{ + this->_model = LoadModelFromMesh(mesh); + return true; +} + +bool RAY::Model::unloadKeepMeshes() +{ + UnloadModelKeepMeshes(_model); + return true; +} + +bool RAY::Model::setAnimation(const RAY::ModelAnimation &animation) +{ + if (!IsModelAnimationValid(this->_model, animation)) + return false; + UpdateModelAnimation(this->_model, animation, animation.getFrameCounter()); + return true; +} + +bool RAY::Model::setTextureToMaterial(RAY::Model::MaterialType materialType, const RAY::Texture &texture) +{ + SetMaterialTexture(&this->_model.materials[materialType], materialType, texture); + return true; +} + +RAY::Model::operator ::Model() const +{ + return this->_model; +} + +int RAY::Model::getBoneCount() const +{ + return this->_model.boneCount; +} \ No newline at end of file diff --git a/lib/Ray/sources/Model.hpp b/lib/Ray/sources/Model/Model.hpp similarity index 52% rename from lib/Ray/sources/Model.hpp rename to lib/Ray/sources/Model/Model.hpp index 715296a9..67a846c1 100644 --- a/lib/Ray/sources/Model.hpp +++ b/lib/Ray/sources/Model/Model.hpp @@ -9,12 +9,19 @@ #define MODEL_HPP_ #include "IRessource.hpp" +#include "Drawables/Texture.hpp" +#include "Drawables/IDrawable.hpp" +#include "Model/ModelAnimation.hpp" #include +#include namespace RAY { - //! @brief Basic 3d Model type + //! @brief Basic 3D Model type class Model: public IRessource { public: + + typedef ::MaterialMapIndex MaterialType; + //! @brief Create an model, loading a file //! @param filePath: path to file to load Model(const std::string &filePath); @@ -29,6 +36,7 @@ namespace RAY { //! @brief A model is assignable Model& operator=(const Model &model) = default; + //! @brief Model destructor, unloads all related data ~Model(); //! @brief Load model from file (meshes and materials) @@ -37,13 +45,27 @@ namespace RAY { //! @brief Load model from mesh (default materials) bool load(const Mesh &mesh); - //! @brief Unload model (including meshes) from memory (RAM and/or VRAM) - bool unload(); - //! @brief Unload model (excluding meshes) from memory (RAM and/or VRAM) bool unloadKeepMeshes(); + + //! @brief Update model animation pose + //! @return false if animation is not compatible + bool setAnimation(const RAY::ModelAnimation &animation); + + //! @brief Sets a texture to the Nth material + //! @param materielIndex The type of material to apply the texture to (serves as an index) + //! @param texture the texture to apply + bool setTextureToMaterial(MaterialType materialType, const RAY::Texture &texture); + + //! @brief A RAY Model is cast-able in libray's model + operator ::Model() const; + + //! @return The number of bones in the model + int getBoneCount() const; private: + //! @brief Raw data from raylib ::Model _model; + }; }; #endif /* !Model_HPP_ */ diff --git a/lib/Ray/sources/Model/ModelAnimation.cpp b/lib/Ray/sources/Model/ModelAnimation.cpp new file mode 100644 index 00000000..8569c6dd --- /dev/null +++ b/lib/Ray/sources/Model/ModelAnimation.cpp @@ -0,0 +1,46 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** ModelAnimation +*/ + +#include "Model/ModelAnimation.hpp" + +RAY::ModelAnimation::ModelAnimation(::ModelAnimation &animation): + _animation(animation), _frameCounter(0) +{ +} + +size_t RAY::ModelAnimation::getFrameCounter() const +{ + return this->_frameCounter; +} + +size_t RAY::ModelAnimation::getFrameCount() const +{ + return this->_animation.frameCount; +} + +RAY::ModelAnimation &RAY::ModelAnimation::setFrameCounter(size_t frameCounter) +{ + this->_frameCounter = frameCounter % this->_animation.frameCount; + return *this; +} + +RAY::ModelAnimation &RAY::ModelAnimation::incrementFrameCounter() +{ + this->_frameCounter = (this->_frameCounter + 1) % this->_animation.frameCount; + return *this; +} + + +RAY::ModelAnimation::operator ::ModelAnimation() const +{ + return this->_animation; +} + +RAY::ModelAnimation::operator ::ModelAnimation *() +{ + return &this->_animation; +} \ No newline at end of file diff --git a/lib/Ray/sources/Model/ModelAnimation.hpp b/lib/Ray/sources/Model/ModelAnimation.hpp new file mode 100644 index 00000000..74febf0b --- /dev/null +++ b/lib/Ray/sources/Model/ModelAnimation.hpp @@ -0,0 +1,57 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** ModelAnimation +*/ + +#ifndef MODELANIMATION_HPP_ +#define MODELANIMATION_HPP_ + +#include +#include + +namespace RAY { + //! @brief A Holder for Model Animations + class ModelAnimation { + public: + //! @brief A Model animation constructor + //! @param animationPtr an animation pointer, returned by the nimation-loading function + ModelAnimation(::ModelAnimation &animationPtr); + + //! @brief A default copy-constructor + ModelAnimation(const ModelAnimation &) = default; + + //! @brief A model animation is assignable + ModelAnimation &operator=(const ModelAnimation &) = default; + + //! @brief Castin Object to raw model animation pointer + operator ::ModelAnimation *(); + + //! @brief Castin Object to raw model animation pointer + operator ::ModelAnimation() const; + + //! @brief Returns the current frame the animation is at + size_t getFrameCounter() const; + + //! @brief Returns the number of frame in the animation + size_t getFrameCount() const; + + //! @brief Set the frame the position is at + ModelAnimation &setFrameCounter(size_t frameCounter); + + //! @brief Increment the frame counter + ModelAnimation &incrementFrameCounter(); + + //! @brief Default destructor + ~ModelAnimation() = default; + + private: + ::ModelAnimation &_animation; + + size_t _frameCounter; + }; +} + + +#endif /* !MODELANIMATION_HPP_ */ diff --git a/lib/Ray/sources/Model/ModelAnimations.cpp b/lib/Ray/sources/Model/ModelAnimations.cpp new file mode 100644 index 00000000..08973e42 --- /dev/null +++ b/lib/Ray/sources/Model/ModelAnimations.cpp @@ -0,0 +1,32 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** ModelAnimations +*/ + +#include "Model/ModelAnimations.hpp" + +RAY::ModelAnimations::ModelAnimations(const std::string &filePath): + _animationsPtr(LoadModelAnimations(filePath.c_str(), &this->_animationCount)) +{ + ::ModelAnimation *ptr = this->_animationsPtr.get(); + for (int i = 0; i < this->_animationCount; i++) + this->_animations.push_back(RAY::ModelAnimation(ptr[i])); +} + +RAY::ModelAnimations::~ModelAnimations() +{ + UnloadModelAnimations(this->_animationsPtr.release(), this->_animationCount); +} + +RAY::ModelAnimation &RAY::ModelAnimations::operator[](int index) +{ + return this->_animations[index]; +} + +size_t RAY::ModelAnimations::getAnimationsCount() const +{ + return this->_animationCount; +} + diff --git a/lib/Ray/sources/Model/ModelAnimations.hpp b/lib/Ray/sources/Model/ModelAnimations.hpp new file mode 100644 index 00000000..12f177f1 --- /dev/null +++ b/lib/Ray/sources/Model/ModelAnimations.hpp @@ -0,0 +1,49 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** ModelAnimations +*/ + +#ifndef MODELANIMATIONS_HPP_ +#define MODELANIMATIONS_HPP_ + +#include "Model/ModelAnimation.hpp" +#include + +namespace RAY { + //! @brief A Holder for Model Animations + class ModelAnimations { + public: + //! @brief A Model animation constructor + //! @param filePath an animation pointer, returned by the nimation-loading function + ModelAnimations(const std::string &filePath); + + //! @brief Only single entity can hold these animations pointers + ModelAnimations(const ModelAnimations &) = delete; + + //! @brief Unloads all animations + ~ModelAnimations(); + + //! @brief Only single entity can hold these animations pointers + ModelAnimations &operator=(const ModelAnimations &) = delete; + + //! @brief Castin Object to raw model animation pointer + ModelAnimation &operator[](int index); + + //! @return the number of loaded animations + size_t getAnimationsCount() const; + + private: + //! @brief Holds the pointer returned by the loading function + std::unique_ptr<::ModelAnimation> _animationsPtr; + + //! @brief A holder for animations + std::vector _animations; + + //! @brief the number of loaded animations + int _animationCount; + }; +} + +#endif /* !MODELANIMATIONS_HPP_ */ diff --git a/lib/Ray/sources/Window.cpp b/lib/Ray/sources/Window.cpp index de8f08da..89c776f4 100644 --- a/lib/Ray/sources/Window.cpp +++ b/lib/Ray/sources/Window.cpp @@ -158,6 +158,11 @@ void RAY::Window::draw(const Mesh &mesh, const Material &material, const Matrix DrawMesh(mesh, material, transform); } +void RAY::Window::draw(const RAY::Model &model, const RAY::Vector3 &position, const RAY::Vector3 &rotationAxis, float rotationAngle, const RAY::Vector3 &scale, const RAY::Color &tint) +{ + DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint); +} + void RAY::Window::setIcon(RAY::Image &img) { SetWindowIcon(img); diff --git a/lib/Ray/sources/Window.hpp b/lib/Ray/sources/Window.hpp index a612070b..568bebb3 100644 --- a/lib/Ray/sources/Window.hpp +++ b/lib/Ray/sources/Window.hpp @@ -10,7 +10,8 @@ #include #include -#include +#include "Vector/Vector2.hpp" +#include "Vector/Vector3.hpp" #include "Controllers/Keyboard.hpp" #include "Camera/Camera2D.hpp" #include "Camera/Camera3D.hpp" @@ -18,8 +19,10 @@ #include "Canvas.hpp" #include "Drawables/IDrawable.hpp" #include "Drawables/Texture.hpp" +#include "Model/Model.hpp" namespace RAY { + class Model; //! @brief Window manager class Window: public Canvas { public: @@ -116,11 +119,15 @@ namespace RAY { //! @param texture The object to render //! @param position The position of the texture relative to the top left window corner //! @param tint - void draw(const RAY::Texture &texture, const Vector2 &position, const Color &tint); + void draw(const Texture &texture, const Vector2 &position, const Color &tint); //! @brief Draw a 3d mesh with material and transform void draw(const Mesh &mesh, const Material &material, const Matrix &transform); + //! @brief Draw a model + void draw(const Model &model, const Vector3 &position, const Vector3 &rotationAxis = Vector3(0, 0, 0), + float rotationAngle = 0, const Vector3 &scale = Vector3(1, 1, 1), const Color &tint = WHITE); + private: //! @brief Creates window, and opens it if openNow is set to true diff --git a/ressources/guy.iqm b/ressources/guy.iqm new file mode 100644 index 00000000..36bed5e0 Binary files /dev/null and b/ressources/guy.iqm differ diff --git a/ressources/guytex.png b/ressources/guytex.png new file mode 100644 index 00000000..05a58eea Binary files /dev/null and b/ressources/guytex.png differ diff --git a/sources/Util/vector.cpp b/sources/Util/vector.cpp index 294f9d55..ff4c15e9 100644 --- a/sources/Util/vector.cpp +++ b/sources/Util/vector.cpp @@ -10,5 +10,5 @@ RAY::Vector3 toRAY(const WAL::Vector3f &wal) { - return RAY::Vector3(wal.x, wal.y, wal.y); + return RAY::Vector3(wal.x, wal.y, wal.y); } \ No newline at end of file diff --git a/sources/main.cpp b/sources/main.cpp index 9b3272fa..1c2c67fd 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -6,98 +6,75 @@ */ -#include -#include "Window.hpp" -#include "Drawables/2D/Text.hpp" -#include "Drawables/2D/Circle.hpp" -#include "Controllers/Keyboard.hpp" -#include "Camera/Camera3D.hpp" -#include "Drawables/3D/Grid.hpp" -#include "Drawables/3D/Cube.hpp" -#include #include "Wal.hpp" +#include "Camera/Camera3D.hpp" +#include "Controllers/Keyboard.hpp" +#include "Drawables/2D/Text.hpp" +#include "Drawables/3D/Grid.hpp" +#include "Drawables/Texture.hpp" +#include "Model/Model.hpp" +#include "Model/ModelAnimations.hpp" +#include "Vector/Vector3.hpp" +#include "Window.hpp" int main() { WAL::Wal wal; - SetTraceLogLevel(LOG_WARNING); + + // Initialization //-------------------------------------------------------------------------------------- const int screenWidth = 800; const int screenHeight = 450; + RAY::Window &window = RAY::Window::getInstance(screenWidth, screenHeight, "Bidibidibop", FLAG_WINDOW_RESIZABLE); + RAY::Camera::Camera3D camera(RAY::Vector3(10.0f, 10.0f, 10.0f), + RAY::Vector3(0.0f, 0.0f, 0.0f), + RAY::Vector3(0.0f, 1.0f, 0.0f), + 45.0f, CAMERA_PERSPECTIVE + ); + RAY::Model model("guy.iqm"); + RAY::Texture texture("guytex.png"); + RAY::ModelAnimations animations("guy.iqm"); + RAY::Drawables::Drawables3D::Grid grid(10, 1.0f); + RAY::Drawables::Drawables2D::Text instructionText("PRESS SPACE to PLAY MODEL ANIMATION", 10, {10, 20} , MAROON); + model.setTextureToMaterial(MAP_DIFFUSE, texture); - RAY::Vector2 ballPosition = {(float)screenWidth / 2, (float)screenHeight / 2}; - RAY::Window &window = RAY::Window::getInstance(screenWidth, screenHeight, "Ta mère en slip", FLAG_WINDOW_RESIZABLE); - RAY::Camera::Camera3D camera(RAY::Vector3{30.0f, 20.0f, 30.0f}, - RAY::Vector3{0.0f, 0.0f, 0.0f}, - RAY::Vector3{0.0f, 1.0f, 0.0f}, - 70.0, - CAMERA_PERSPECTIVE); - RAY::Drawables::Drawables3D::Grid grid(10, 5.0f); - RAY::Drawables::Drawables3D::Cube cube(RAY::Vector3(0, 0, 0), - RAY::Vector3(0, 0, 0), - RAY::Color(0, 0, 0, 0)); + RAY::Vector3 position(0.0f, 0.0f, 0.0f); // Set model position - // Specify the amount of blocks in each direction - const int numBlocks = 15; + camera.setMode(CAMERA_FREE); // Set free camera mode - window.setFPS(60); + window.setFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- // Main game loop - while (!window.shouldClose()) // Detect window close button or ESC key + while (!window.shouldClose()) // Detect window close button or ESC key { // Update //---------------------------------------------------------------------------------- - double time = GetTime(); + camera.update(); - // Calculate time scale for cube position and size - float scale = (2.0f + (float)sin(time)) * 0.7f; - - // Move camera around the scene - double cameraTime = time * 0.3; - camera.setPosition({(float)cos(cameraTime) * 40.0f, 20.0f, (float)sin(cameraTime) * 40.0f}); + // Play animation when spacebar is held down + if (RAY::Controller::Keyboard::isDown(KEY_SPACE)) + { + animations[0].incrementFrameCounter(); + model.setAnimation(animations[0]); + } //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- window.setDrawingState(RAY::Window::DRAWING); - window.clear(RAYWHITE); + window.clear(); - window.useCamera(camera); + window.useCamera(camera); - window.draw(grid); + window.draw(model, position, RAY::Vector3(1.0f, 0.0f, 0.0f), -90.0f, RAY::Vector3( 1.0f, 1.0f, 1.0f )); - for (int x = 0; x < numBlocks; x++) { - for (int y = 0; y < numBlocks; y++) { - for (int z = 0; z < numBlocks; z++) { - // Scale of the blocks depends on x/y/z positions - float blockScale = (x + y + z) / 30.0f; + window.draw(grid); - // Scatter makes the waving effect by adding blockScale over time - float scatter = sinf(blockScale * 20.0f + (float)(time * 4.0f)); + window.unuseCamera(); - // Calculate the cube position - cube.setPosition(RAY::Vector3{ - static_cast(x - numBlocks / 2) * (scale * 3.0f) + scatter, - static_cast(y - numBlocks / 2) * (scale * 2.0f) + scatter, - static_cast(z - numBlocks / 2) * (scale * 3.0f) + scatter - }); - - // Pick a color with a hue depending on cube position for the rainbow color effect - cube.setColor(RAY::Color(static_cast(((x + y + z) * 18) % 360), 0.75f, 0.9f)); - - // Calculate cube size - float cubeSize = (2.4f - scale) * blockScale; - cube.setDimensions({cubeSize, cubeSize, cubeSize}); - - // And finally, draw the cube! - window.draw(cube); - } - } - } - - window.unuseCamera(); + window.draw(instructionText); window.setDrawingState(RAY::Window::IDLE); //---------------------------------------------------------------------------------- @@ -105,7 +82,8 @@ int main() // De-Initialization //-------------------------------------------------------------------------------------- - window.close(); // Close window and OpenGL context + + window.close(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0;