Archived
1
Fork 0

Add support for editor under GCC/Linux

This commit is contained in:
redstrate 2021-02-15 15:18:21 -05:00
parent 3e4cf70c8e
commit c37a8471c9
2 changed files with 8 additions and 1 deletions

View file

@ -22,6 +22,8 @@ Display *dpy = nullptr;
int mouse_x = -1, mouse_y = -1;
bool mouse_down[2] = {false, false};
int window_width = -1, window_height = -1;
xcb_connection_t* connection = 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_flush(connection);
window_width = rect.extent.width;
window_height = rect.extent.height;
engine->add_window((void*)&win, 0, rect.extent);
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) {
return {window_width, window_height};
}
prism::Extent platform::get_window_drawable_size(const int index) {
return {window_width, window_height};
}
bool platform::is_window_focused(const int index) {

View file

@ -845,7 +845,7 @@ GFXTexture* CommonEditor::get_mesh_preview(Mesh& mesh) {
for(const auto& part : scene.get<Renderable>(mesh_obj).mesh->parts) {
const auto find_biggest_component = [&biggest_component](const Vector3 vec) {
for(auto& component : vec.data) {
if(std::fabsf(component) > biggest_component)
if(std::fabs(component) > biggest_component)
biggest_component = component;
}
};