Add support for editor under GCC/Linux
This commit is contained in:
parent
3e4cf70c8e
commit
c37a8471c9
2 changed files with 8 additions and 1 deletions
|
@ -22,6 +22,8 @@ Display *dpy = nullptr;
|
||||||
int mouse_x = -1, mouse_y = -1;
|
int mouse_x = -1, mouse_y = -1;
|
||||||
bool mouse_down[2] = {false, false};
|
bool mouse_down[2] = {false, false};
|
||||||
|
|
||||||
|
int window_width = -1, window_height = -1;
|
||||||
|
|
||||||
xcb_connection_t* connection = nullptr;
|
xcb_connection_t* connection = nullptr;
|
||||||
xcb_screen_t* screen = nullptr;
|
xcb_screen_t* screen = nullptr;
|
||||||
|
|
||||||
|
@ -101,6 +103,9 @@ int platform::open_window(const std::string_view title, const prism::Rectangle r
|
||||||
xcb_map_window(connection, win.window);
|
xcb_map_window(connection, win.window);
|
||||||
xcb_flush(connection);
|
xcb_flush(connection);
|
||||||
|
|
||||||
|
window_width = rect.extent.width;
|
||||||
|
window_height = rect.extent.height;
|
||||||
|
|
||||||
engine->add_window((void*)&win, 0, rect.extent);
|
engine->add_window((void*)&win, 0, rect.extent);
|
||||||
app->initialize_render();
|
app->initialize_render();
|
||||||
|
|
||||||
|
@ -131,9 +136,11 @@ prism::Offset platform::get_window_position(const int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
prism::Extent platform::get_window_size(const int index) {
|
prism::Extent platform::get_window_size(const int index) {
|
||||||
|
return {window_width, window_height};
|
||||||
}
|
}
|
||||||
|
|
||||||
prism::Extent platform::get_window_drawable_size(const int index) {
|
prism::Extent platform::get_window_drawable_size(const int index) {
|
||||||
|
return {window_width, window_height};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool platform::is_window_focused(const int index) {
|
bool platform::is_window_focused(const int index) {
|
||||||
|
|
|
@ -845,7 +845,7 @@ GFXTexture* CommonEditor::get_mesh_preview(Mesh& mesh) {
|
||||||
for(const auto& part : scene.get<Renderable>(mesh_obj).mesh->parts) {
|
for(const auto& part : scene.get<Renderable>(mesh_obj).mesh->parts) {
|
||||||
const auto find_biggest_component = [&biggest_component](const Vector3 vec) {
|
const auto find_biggest_component = [&biggest_component](const Vector3 vec) {
|
||||||
for(auto& component : vec.data) {
|
for(auto& component : vec.data) {
|
||||||
if(std::fabsf(component) > biggest_component)
|
if(std::fabs(component) > biggest_component)
|
||||||
biggest_component = component;
|
biggest_component = component;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue