Now lets build a small demo game!
This commit is contained in:
parent
be6832cd24
commit
d21f526290
4 changed files with 22 additions and 34 deletions
|
@ -23,17 +23,18 @@
|
|||
#ifndef PARADISO_CONTEXT_HPP
|
||||
#define PARADISO_CONTEXT_HPP
|
||||
|
||||
#include <paradiso/globals.hpp>
|
||||
#include <paradiso/geometry.hpp>
|
||||
#include <paradiso/globals.hpp>
|
||||
#include <paradiso/rgba.hpp>
|
||||
|
||||
|
||||
namespace paradiso {
|
||||
|
||||
struct Context final {
|
||||
|
||||
Context();
|
||||
~Context();
|
||||
Context(const Context&) = delete;
|
||||
Context(Context&&) = default;
|
||||
|
||||
Context& set_blend();
|
||||
Context& set_depth();
|
||||
|
@ -51,9 +52,8 @@ struct Context final {
|
|||
|
||||
uint32_t get_error() const;
|
||||
|
||||
struct impl;
|
||||
|
||||
private:
|
||||
struct impl;
|
||||
std::unique_ptr<impl> impl_;
|
||||
};
|
||||
|
||||
|
|
|
@ -49,19 +49,16 @@ struct RGBA final {
|
|||
rgba_f[3] = static_cast<float>(this->alpha()) / 0xFF;
|
||||
}
|
||||
|
||||
constexpr uint8_t red() const noexcept {
|
||||
return (pixel & 0xFF000000) >> 24;
|
||||
}
|
||||
constexpr uint8_t red() const noexcept { return uint8_t(pixel & 0xFF); }
|
||||
constexpr uint8_t green() const noexcept {
|
||||
return uint8_t((pixel & 0xFF0000) >> 16);
|
||||
}
|
||||
constexpr uint8_t blue() const noexcept {
|
||||
return uint8_t((pixel & 0xFF00) >> 8);
|
||||
}
|
||||
constexpr uint8_t alpha() const noexcept {
|
||||
return uint8_t(pixel & 0xFF);
|
||||
constexpr uint8_t blue() const noexcept {
|
||||
return uint8_t((pixel & 0xFF0000) >> 16);
|
||||
}
|
||||
constexpr uint8_t alpha() const noexcept {
|
||||
return (pixel & 0xFF000000) >> 24;
|
||||
}
|
||||
|
||||
|
||||
constexpr RGBA& set_red(uint8_t v) noexcept {
|
||||
pixel = (pixel & 0x00FFFFFF) | (v << 24);
|
||||
|
|
|
@ -246,8 +246,6 @@ struct Window::impl {
|
|||
|
||||
glfwSetWindowMonitor(window_, nullptr, x, y, w, h, 0);
|
||||
}
|
||||
|
||||
// glfwSetWindow
|
||||
}
|
||||
|
||||
bool fullscreen() const { return glfwGetWindowMonitor(window_) != nullptr; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue