Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4ee4cafad7 | ||
|
e1c0cdd1a2 | ||
|
7b149594fe | ||
|
350b12aa6d |
160
CMakeLists.txt
160
CMakeLists.txt
@@ -1,81 +1,81 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(ReWindowLibrary
|
||||
VERSION 1.0
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
message(FATAL_ERROR "In-Source builds are not allowed")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
|
||||
# Enable Package Managers
|
||||
include(cmake/CPM.cmake)
|
||||
|
||||
CPMAddPackage(
|
||||
NAME J3ML
|
||||
URL https://git.redacted.cc/josh/j3ml/archive/Release-3.zip
|
||||
)
|
||||
|
||||
CPMAddPackage(
|
||||
NAME Event
|
||||
URL https://git.redacted.cc/josh/Event/archive/Release-5.zip
|
||||
)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIRS})
|
||||
include_directories(${J3ML_SOURCE_DIR}/include)
|
||||
|
||||
|
||||
file(GLOB_RECURSE HEADERS "include/*.h" "include/*.hpp")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
file(GLOB_RECURSE SOURCES "src/rewindow/*.cpp" "src/linux/*.cpp")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
file(GLOB_RECURSE SOURCES "src/rewindow/*.cpp" "src/windows/*.cpp")
|
||||
endif()
|
||||
|
||||
include_directories("include")
|
||||
|
||||
if(UNIX)
|
||||
add_library(ReWindowLibrary SHARED ${SOURCES})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_library(ReWindowLibrary STATIC ${SOURCES})
|
||||
endif()
|
||||
|
||||
target_include_directories(ReWindowLibrary PUBLIC ${Event_SOURCE_DIR}/include)
|
||||
|
||||
# Why god???
|
||||
set_target_properties(ReWindowLibrary PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC X11)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC ${OPENGL_LIBRARIES})
|
||||
|
||||
target_link_libraries(ReWindowLibrary PUBLIC J3ML)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC Event)
|
||||
|
||||
add_executable(ReWindowLibraryDemo main.cpp)
|
||||
#target_include_directories(ReWindowLibraryDemo PRIVATE ${JGL_SOURCE_DIR}/include)
|
||||
target_link_libraries(ReWindowLibraryDemo PUBLIC ReWindowLibrary)
|
||||
#target_link_libraries(ReWindowLibraryDemo PRIVATE JGL)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
#target_compile_options(ReWindowLibrary PRIVATE -Wno-multichar)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC ${OPENGL_LIBRARIES})
|
||||
target_link_libraries(ReWindowLibrary PUBLIC J3ML)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC Event)
|
||||
|
||||
add_executable(ReWindowLibraryDemo main.cpp)
|
||||
#target_compile_options(ReWindowLibraryDemo PRIVATE)
|
||||
target_link_libraries(ReWindowLibraryDemo PUBLIC ReWindowLibrary)
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(ReWindowLibrary
|
||||
VERSION 1.0
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
message(FATAL_ERROR "In-Source builds are not allowed")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
|
||||
# Enable Package Managers
|
||||
include(cmake/CPM.cmake)
|
||||
|
||||
CPMAddPackage(
|
||||
NAME J3ML
|
||||
URL https://git.redacted.cc/josh/j3ml/archive/Release-5.zip
|
||||
)
|
||||
|
||||
CPMAddPackage(
|
||||
NAME Event
|
||||
URL https://git.redacted.cc/josh/Event/archive/Release-5.zip
|
||||
)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIRS})
|
||||
include_directories(${J3ML_SOURCE_DIR}/include)
|
||||
|
||||
|
||||
file(GLOB_RECURSE HEADERS "include/*.h" "include/*.hpp")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
file(GLOB_RECURSE SOURCES "src/rewindow/*.cpp" "src/linux/*.cpp")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
file(GLOB_RECURSE SOURCES "src/rewindow/*.cpp" "src/windows/*.cpp")
|
||||
endif()
|
||||
|
||||
include_directories("include")
|
||||
|
||||
if(UNIX)
|
||||
add_library(ReWindowLibrary SHARED ${SOURCES})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_library(ReWindowLibrary STATIC ${SOURCES})
|
||||
endif()
|
||||
|
||||
target_include_directories(ReWindowLibrary PUBLIC ${Event_SOURCE_DIR}/include)
|
||||
|
||||
# Why god???
|
||||
set_target_properties(ReWindowLibrary PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC X11)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC ${OPENGL_LIBRARIES})
|
||||
|
||||
target_link_libraries(ReWindowLibrary PUBLIC J3ML)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC Event)
|
||||
|
||||
add_executable(ReWindowLibraryDemo main.cpp)
|
||||
#target_include_directories(ReWindowLibraryDemo PRIVATE ${JGL_SOURCE_DIR}/include)
|
||||
target_link_libraries(ReWindowLibraryDemo PUBLIC ReWindowLibrary)
|
||||
#target_link_libraries(ReWindowLibraryDemo PRIVATE JGL)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
#target_compile_options(ReWindowLibrary PRIVATE -Wno-multichar)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC ${OPENGL_LIBRARIES})
|
||||
target_link_libraries(ReWindowLibrary PUBLIC J3ML)
|
||||
target_link_libraries(ReWindowLibrary PUBLIC Event)
|
||||
|
||||
add_executable(ReWindowLibraryDemo main.cpp)
|
||||
#target_compile_options(ReWindowLibraryDemo PRIVATE)
|
||||
target_link_libraries(ReWindowLibraryDemo PUBLIC ReWindowLibrary)
|
||||
endif()
|
@@ -117,8 +117,8 @@ namespace Keys {
|
||||
static const Key LAlt {'\\', X11Scancode::LEFT_ALT, WindowsScancode::ALT};
|
||||
static const Key RAlt {'\\', X11Scancode::RIGHT_ALT, WindowsScancode::ALT};
|
||||
|
||||
static const Key LShift {'\\', X11Scancode::LEFT, WindowsScancode::LEFT_ARROW};
|
||||
static const Key RShift {'\\', X11Scancode::RIGHT, WindowsScancode::RIGHT_ARROW};
|
||||
static const Key LShift {'\\', X11Scancode::LEFT_SHIFT, WindowsScancode::LEFT_SHIFT};
|
||||
static const Key RShift {'\\', X11Scancode::RIGHT_SHIFT, WindowsScancode::RIGHT_SHIFT};
|
||||
|
||||
// TODO: Get the right character codes for these
|
||||
static const Key UpArrow {'\u000a', X11Scancode::UP, WindowsScancode::UP_ARROW};
|
||||
|
@@ -26,6 +26,9 @@ XVisualInfo* visual;
|
||||
XSetWindowAttributes xSetWindowAttributes;
|
||||
XWindowAttributes windowAttributes;
|
||||
Atom wmDeleteWindow;
|
||||
// Make it start as floating because fuck tiling WMs
|
||||
Atom windowTypeAtom;
|
||||
Atom windowTypeUtilityAtom;
|
||||
XSizeHints hints;
|
||||
GLXContext glContext;
|
||||
|
||||
@@ -351,6 +354,12 @@ namespace ReWindow {
|
||||
window = XCreateWindow(display, RootWindow(display, defaultScreen), 0, 0, width, height, 0, visual->depth,
|
||||
InputOutput, visual->visual, CWBackPixel | CWColormap | CWBorderPixel | NoEventMask,
|
||||
&xSetWindowAttributes);
|
||||
// Set window to floating because fucking tiling WMs
|
||||
windowTypeAtom = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
|
||||
windowTypeUtilityAtom = XInternAtom(display, "_NET_WM_WINDOW_TYPE_UTILITY", False);
|
||||
XChangeProperty(display, window, windowTypeAtom, XA_ATOM, 32, PropModeReplace,
|
||||
(unsigned char *)&windowTypeUtilityAtom, 1);
|
||||
//
|
||||
XSelectInput(display, window,
|
||||
ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
|
||||
PointerMotionMask |
|
||||
@@ -399,4 +408,4 @@ namespace ReWindow {
|
||||
}
|
||||
|
||||
// TODO: Implement ControllerButton map
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user