Skip to content

Commit

Permalink
Merge branch 'dev' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
larc committed Nov 27, 2023
2 parents 79dd1e6 + 6ec3ac2 commit cec473c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/gproshan/app_viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class app_viewer : public viewer
double time;

public:
app_viewer() = default;
app_viewer(const char * title = "gproshan", const int & width = 1600, const int & height = 900);
virtual ~app_viewer();

int main(int nargs, const char ** args);
Expand Down
4 changes: 2 additions & 2 deletions include/gproshan/viewer/viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class viewer
char status_message[1024] = {};

public:
viewer(const int & width = 1600, const int & height = 900);
viewer(const char * title = "gproshan", const int & width = 1600, const int & height = 900);
virtual ~viewer();

che_viewer & selected_mesh();
Expand All @@ -120,7 +120,7 @@ class viewer
virtual bool run();

void info_gl();
void init_gl();
void init_gl(const char * title);
void init_imgui();
void init_menus();
void init_glsl();
Expand Down
2 changes: 2 additions & 0 deletions src/gproshan/app_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ using namespace gproshan::mdict;
namespace gproshan {


app_viewer::app_viewer(const char * title, const int & width, const int & height): viewer(title, width, height) {}

app_viewer::~app_viewer()
{
for(auto & m: meshes)
Expand Down
2 changes: 1 addition & 1 deletion src/gproshan/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ size_t partitions::size(const index_t & i) const

partitions::part partitions::operator () (const index_t & i) const
{
assert(i > 0 && i < size(splits));
assert(i > 0 && i < std::size(splits));
return {splits[i], splits[i + 1], sorted};
}

Expand Down
8 changes: 4 additions & 4 deletions src/gproshan/viewer/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ const size_t viewer::max_meshes = size(m_window_split) - 1;

che_sphere viewer::sphere_data{0.01};

viewer::viewer(const int & width, const int & height)
viewer::viewer(const char * title, const int & width, const int & height)
{
window_width = width;
window_height = height;

init_gl();
init_gl(title);
init_glsl();
init_imgui();
init_menus();
Expand Down Expand Up @@ -398,7 +398,7 @@ void error_callback(int error, const char* description)
fprintf(stderr, "Error %d: %s\n", error, description);
}

void viewer::init_gl()
void viewer::init_gl(const char * title)
{
glfwSetErrorCallback(error_callback);

Expand All @@ -413,7 +413,7 @@ void viewer::init_gl()

gproshan_log_var(window_width);
gproshan_log_var(window_height);
window = glfwCreateWindow(window_width, window_height, "gproshan", NULL, NULL);
window = glfwCreateWindow(window_width, window_height, title, NULL, NULL);

glfwSetWindowUserPointer(window, this);

Expand Down

0 comments on commit cec473c

Please sign in to comment.