mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-15 11:58:12 +00:00
[client] imgui: make graph y-axis configurable
The default of [0, 50] makes sense for FPS/UPS graphs, but does not for things like the import graph. The latter should not take more than 5 ms for sure. This commit allows the min/max y-axis value to be specified when registering the graph.
This commit is contained in:
@@ -39,6 +39,8 @@ struct OverlayGraph
|
||||
const char * name;
|
||||
RingBuffer buffer;
|
||||
bool enabled;
|
||||
float min;
|
||||
float max;
|
||||
};
|
||||
|
||||
static bool graphs_init(void ** udata, void * params)
|
||||
@@ -135,8 +137,8 @@ static int graphs_render(void * udata, bool interactive,
|
||||
ringbuffer_getLength(graph->buffer),
|
||||
ringbuffer_getStart (graph->buffer),
|
||||
title,
|
||||
0.0f,
|
||||
50.0f,
|
||||
graph->min,
|
||||
graph->max,
|
||||
size,
|
||||
sizeof(float));
|
||||
};
|
||||
@@ -154,12 +156,14 @@ struct LG_OverlayOps LGOverlayGraphs =
|
||||
.render = graphs_render
|
||||
};
|
||||
|
||||
GraphHandle overlayGraph_register(const char * name, RingBuffer buffer)
|
||||
GraphHandle overlayGraph_register(const char * name, RingBuffer buffer, float min, float max)
|
||||
{
|
||||
struct OverlayGraph * graph = malloc(sizeof(struct OverlayGraph));
|
||||
graph->name = name;
|
||||
graph->buffer = buffer;
|
||||
graph->enabled = true;
|
||||
graph->min = min;
|
||||
graph->max = max;
|
||||
ll_push(gs.graphs, graph);
|
||||
return graph;
|
||||
}
|
||||
|
Reference in New Issue
Block a user