#include <renderive/event/Event.hpp>

#include <gtest/gtest.h>

namespace {

struct Point3 {
    double x{};
    double y{};
    double z{};
};

struct Viewport_Extent {
    int width{};
    int height{};
};

static_assert(renderive::Event_Point<Point3>);
static_assert(renderive::Event_Size<Viewport_Extent>);
static_assert(renderive::Event_Object<renderive::Basic_Pointer_Event<Point3>>);

TEST(RenderiveEvent, SupportsDomainSpecificCoordinateAndSizeTypes) {
    renderive::Basic_Pointer_Event<Point3> pointer(renderive::Event_Type::Pointer_Press);
    pointer.position = {1.0, 2.0, 3.0};
    EXPECT_EQ(pointer.type, renderive::Event_Type::Pointer_Press);
    EXPECT_DOUBLE_EQ(pointer.position.z, 3.0);

    renderive::Basic_Resize_Event<Viewport_Extent> resize;
    resize.old_size = {640, 480};
    resize.new_size = {1280, 720};
    EXPECT_EQ(resize.new_size.width, 1280);
}

} // namespace
