Fully Deprecate GLM
This commit is contained in:
@@ -47,6 +47,8 @@ add_library(ReWindowLibrary SHARED ${SOURCES}
|
||||
include/rewindow/data/X11Scancodes.h
|
||||
include/rewindow/types/key.h
|
||||
include/rewindow/data/WindowsScancodes.h
|
||||
src/rewindow/types/key.cpp
|
||||
src/rewindow/types/window.cpp
|
||||
)
|
||||
# Why god???
|
||||
set_target_properties(ReWindowLibrary PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
@@ -4,14 +4,6 @@
|
||||
#include <functional>
|
||||
|
||||
|
||||
#if __linux__
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
//This is also the x11 scancodes.
|
||||
|
||||
template <typename ... Args>
|
||||
class Event;
|
||||
|
||||
|
@@ -2,8 +2,16 @@
|
||||
// ~DAWSH
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <J3ML/LinearAlgebra/Vector2.h>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#if __linux__
|
||||
#include <X11/X.h>
|
||||
#endif
|
||||
|
||||
#include "rewindow/data/X11Scancodes.h"
|
||||
#include "rewindow/data/WindowsScancodes.h"
|
||||
|
||||
|
@@ -162,6 +162,9 @@ namespace ReWindow
|
||||
virtual void OnMouseButtonDown(const MouseButtonDownEvent&) {}
|
||||
virtual void OnMouseButtonUp(const MouseButtonUpEvent&) {}
|
||||
|
||||
|
||||
RWindow();
|
||||
|
||||
// TODO: Must be implemented from scratch as a Motif Window in x11
|
||||
void MessageBox();
|
||||
|
||||
@@ -214,7 +217,17 @@ namespace ReWindow
|
||||
|
||||
static void glSwapBuffers();
|
||||
//Initialize to false because it's not guaranteed that they will be cleared first
|
||||
RWindow();
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
class WindowsImplementationRWindow : public RWindow
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class X11ImplementationRWindow : public RWindow
|
||||
{
|
||||
|
||||
};
|
||||
}
|
1
main.cpp
1
main.cpp
@@ -11,7 +11,6 @@ void KeyDown(const ReWindow::WindowEvents::KeyDownEvent& e)
|
||||
|
||||
Vector2 mouse_pos;
|
||||
|
||||
// TODO: Move to J3ML::LinearAlgebra::Vector2
|
||||
std::ostream& operator<<(std::ostream& os, const Vector2& v)
|
||||
{
|
||||
return os << "{" << v.x << ", " << v.y << "}";
|
||||
|
@@ -6,11 +6,14 @@
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <thread>
|
||||
|
||||
// TODO: Move all "global" members to be instantiated class members of Window
|
||||
// Doing this would break the intended "Platform-Specific" Encapsulation
|
||||
// So should we do derived platform-specific subclasses?
|
||||
// The intended goal of the ReWindow class is a one-stop object that handles window management on **ALL** platforms
|
||||
|
||||
Window window;
|
||||
XEvent xev;
|
||||
Display* display = XOpenDisplay(nullptr);
|
||||
@@ -22,31 +25,12 @@ Atom wmDeleteWindow;
|
||||
XSizeHints hints;
|
||||
GLXContext glContext;
|
||||
|
||||
std::vector<Key> Key::keyboard = {};
|
||||
|
||||
std::vector<Key> Key::GetKeyboard() { return keyboard; }
|
||||
|
||||
Key::Key() {
|
||||
|
||||
keyboard.push_back(*this);
|
||||
}
|
||||
|
||||
Key::Key(char charcode, X11Scancode scancode, WindowsScancode sc)
|
||||
: CharCode(charcode), x11ScanCode(scancode), winScanCode(sc)
|
||||
{
|
||||
keyboard.push_back(*this);
|
||||
}
|
||||
|
||||
bool Key::operator==(const Key &rhs) const {
|
||||
return (this->CharCode == rhs.CharCode);
|
||||
}
|
||||
|
||||
bool Key::operator<(const Key &rhs) const {
|
||||
return (this->CharCode < rhs.CharCode);
|
||||
}
|
||||
|
||||
namespace ReWindow {
|
||||
|
||||
RWindow::RWindow() : flags(false,false,false,false) {
|
||||
|
||||
}
|
||||
|
||||
void RWindow::raise() const { XRaiseWindow(display, window); }
|
||||
void RWindow::lower() const { XLowerWindow(display, window); }
|
||||
|
||||
@@ -272,7 +256,7 @@ namespace ReWindow {
|
||||
this->setFlag(RWindowFlags::RESIZABLE, resizable);
|
||||
}
|
||||
|
||||
RWindow::RWindow() : flags(false,false,false,false) {}
|
||||
|
||||
|
||||
void RWindow::setFullscreen(bool fs) {
|
||||
if (fs)
|
||||
@@ -325,4 +309,6 @@ namespace ReWindow {
|
||||
glXSwapIntervalEXT(display, None, b);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
24
src/rewindow/types/key.cpp
Normal file
24
src/rewindow/types/key.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <rewindow/types/key.h>
|
||||
|
||||
std::vector<Key> Key::keyboard = {};
|
||||
|
||||
std::vector<Key> Key::GetKeyboard() { return keyboard; }
|
||||
|
||||
Key::Key() {
|
||||
|
||||
keyboard.push_back(*this);
|
||||
}
|
||||
|
||||
Key::Key(char charcode, X11Scancode scancode, WindowsScancode sc)
|
||||
: CharCode(charcode), x11ScanCode(scancode), winScanCode(sc)
|
||||
{
|
||||
keyboard.push_back(*this);
|
||||
}
|
||||
|
||||
bool Key::operator==(const Key &rhs) const {
|
||||
return (this->CharCode == rhs.CharCode);
|
||||
}
|
||||
|
||||
bool Key::operator<(const Key &rhs) const {
|
||||
return (this->CharCode < rhs.CharCode);
|
||||
}
|
Reference in New Issue
Block a user