remove unwanted defines + upade encapsulation for window drawing function

This commit is contained in:
arthur.jamet
2021-06-02 17:54:16 +02:00
parent 73c2ec5498
commit 34cbe24c19
8 changed files with 17 additions and 200 deletions
+6 -2
View File
@@ -107,10 +107,14 @@ void RAY::Window::clear(const RAY::Color &color)
ClearBackground(color);
}
void RAY::Window::draw()
void RAY::Window::beginDrawing()
{
BeginDrawing();
}
void RAY::Window::endDrawing()
{
EndDrawing();
BeginDrawing();
}
void RAY::Window::useCamera(RAY::Camera::Camera2D &camera)
+6 -3
View File
@@ -7,7 +7,7 @@
#ifndef WINDOW_HPP_
#define WINDOW_HPP_
#define INTERNAL public
#include <raylib.h>
#include <string>
#include <optional>
@@ -102,8 +102,10 @@ namespace RAY {
NONE,
};
//! @brief Draw the content of the buffer on the screen.
void draw();
//! @brief Setup canvas (framebuffer) to start drawing
void beginDrawing();
//! @brief End canvas drawing and swap buffers (double buffering)
void endDrawing();
//! @brief Initialize 2D mode with custom camera (2D)
void useCamera(Camera::Camera2D &camera);
@@ -131,6 +133,7 @@ namespace RAY {
//! @brief Draw a 3d mesh with material and transform
void draw(const Mesh &mesh, const Material &material, const Matrix &transform);
//! @return true if the window's context has been correctly initialized
bool isReady() const;