feat(client): OsGui functions for linux

This commit is contained in:
superp00t 2024-09-06 23:39:33 -04:00
parent eef37c109d
commit b0566ad8d7
4 changed files with 19 additions and 9 deletions

View File

@ -3,21 +3,21 @@ file(GLOB PRIVATE_SOURCES
"gui/*.cpp"
)
if(WHOA_SYSTEM_WIN)
if (WHOA_SYSTEM_WIN)
file(GLOB WIN_SOURCES
"gui/win/*.cpp"
)
list(APPEND PRIVATE_SOURCES ${WIN_SOURCES})
endif()
if(WHOA_SYSTEM_MAC)
if (WHOA_SYSTEM_MAC)
file(GLOB MAC_SOURCES
"gui/mac/*.cpp"
)
list(APPEND PRIVATE_SOURCES ${MAC_SOURCES})
endif()
if(WHOA_SYSTEM_LINUX)
if (WHOA_SYSTEM_LINUX)
file(GLOB LINUX_SOURCES
"gui/linux/*.cpp"
)

View File

@ -1,6 +1,6 @@
#ifndef CLIENT_GUI_HPP
#define CLIENT_GUI_HPP
#include "gui/OsGui.hpp"
#include "client/gui/OsGui.hpp"
#endif

View File

@ -1,7 +1,14 @@
#include "client/gui/OsGui.hpp"
static void* s_GxDevWindow = nullptr;
void* OsGuiGetWindow(int32_t type) {
return nullptr;
switch (type) {
case 0:
return s_GxDevWindow;
default:
return nullptr;
}
}
bool OsGuiIsModifierKeyDown(int32_t key) {
@ -14,5 +21,5 @@ int32_t OsGuiProcessMessage(void* message) {
}
void OsGuiSetGxWindow(void* window) {
// TODO
s_GxDevWindow = window;
}

View File

@ -1,12 +1,13 @@
#include <unordered_map>
#include <storm/Unicode.hpp>
#include <SDL2/SDL.h>
#include "event/sdl/Input.hpp"
#include "client/gui/OsGui.hpp"
#include "client/Gui.hpp"
#include "gx/Device.hpp"
#include "gx/Window.hpp"
#include <storm/Unicode.hpp>
#include <SDL2/SDL.h>
static const std::unordered_map<SDL_Scancode, KEY> s_keyConversion = {
{ SDL_SCANCODE_LSHIFT, KEY_LSHIFT },
{ SDL_SCANCODE_RSHIFT, KEY_RSHIFT },
@ -287,6 +288,8 @@ int32_t SDLInputGet(OSINPUT* id, int32_t* param0, int32_t* param1, int32_t* para
static_cast<int16_t>(bounds->left + width)
};
SetSavedWindowBounds(newBounds);
break;
}
case SDL_QUIT: {
*id = OS_INPUT_CLOSE;