@@ -491,6 +491,7 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c | |||||
float stackh = (nimages/2) * (thumb+10) + 10; | float stackh = (nimages/2) * (thumb+10) + 10; | ||||
int i; | int i; | ||||
float u = (1+cosf(t*0.5f))*0.5f; | float u = (1+cosf(t*0.5f))*0.5f; | ||||
float scrollh; | |||||
nvgSave(vg); | nvgSave(vg); | ||||
// nvgClearState(vg); | // nvgClearState(vg); | ||||
@@ -578,7 +579,7 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c | |||||
// nvgFillColor(vg, nvgRGBA(255,0,0,128)); | // nvgFillColor(vg, nvgRGBA(255,0,0,128)); | ||||
nvgFill(vg); | nvgFill(vg); | ||||
float scrollh = (h/stackh) * (h-8); | |||||
scrollh = (h/stackh) * (h-8); | |||||
shadowPaint = nvgBoxGradient(vg, x+w-12-1,y+4+(h-8-scrollh)*u-1, 8,scrollh, 3,4, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255)); | shadowPaint = nvgBoxGradient(vg, x+w-12-1,y+4+(h-8-scrollh)*u-1, 8,scrollh, 3,4, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255)); | ||||
nvgBeginPath(vg); | nvgBeginPath(vg); | ||||
nvgRoundedRect(vg, x+w-12+1,y+4+1 + (h-8-scrollh)*u, 8-2,scrollh-2, 2); | nvgRoundedRect(vg, x+w-12+1,y+4+1 + (h-8-scrollh)*u, 8-2,scrollh-2, 2); | ||||
@@ -116,17 +116,19 @@ void renderGraph(struct NVGcontext* vg, float x, float y, struct PerfGraph* fps) | |||||
if (fps->style == GRAPH_RENDER_FPS) { | if (fps->style == GRAPH_RENDER_FPS) { | ||||
for (i = 0; i < GRAPH_HISTORY_COUNT; i++) { | for (i = 0; i < GRAPH_HISTORY_COUNT; i++) { | ||||
float v = 1.0f / (0.00001f + fps->values[(fps->head+i) % GRAPH_HISTORY_COUNT]); | float v = 1.0f / (0.00001f + fps->values[(fps->head+i) % GRAPH_HISTORY_COUNT]); | ||||
float vx, vy; | |||||
if (v > 80.0f) v = 80.0f; | if (v > 80.0f) v = 80.0f; | ||||
float vx = x + ((float)i/(GRAPH_HISTORY_COUNT-1)) * w; | |||||
float vy = y + h - ((v / 80.0f) * h); | |||||
vx = x + ((float)i/(GRAPH_HISTORY_COUNT-1)) * w; | |||||
vy = y + h - ((v / 80.0f) * h); | |||||
nvgLineTo(vg, vx, vy); | nvgLineTo(vg, vx, vy); | ||||
} | } | ||||
} else { | } else { | ||||
for (i = 0; i < GRAPH_HISTORY_COUNT; i++) { | for (i = 0; i < GRAPH_HISTORY_COUNT; i++) { | ||||
float v = fps->values[(fps->head+i) % GRAPH_HISTORY_COUNT] * 1000.0f; | float v = fps->values[(fps->head+i) % GRAPH_HISTORY_COUNT] * 1000.0f; | ||||
float vx, vy; | |||||
if (v > 20.0f) v = 20.0f; | if (v > 20.0f) v = 20.0f; | ||||
float vx = x + ((float)i/(GRAPH_HISTORY_COUNT-1)) * w; | |||||
float vy = y + h - ((v / 20.0f) * h); | |||||
vx = x + ((float)i/(GRAPH_HISTORY_COUNT-1)) * w; | |||||
vy = y + h - ((v / 20.0f) * h); | |||||
nvgLineTo(vg, vx, vy); | nvgLineTo(vg, vx, vy); | ||||
} | } | ||||
} | } | ||||
@@ -720,6 +720,10 @@ static void glnvg__renderFill(void* uptr, struct NVGpaint* paint, struct NVGscis | |||||
glDisableVertexAttribArray(1); | glDisableVertexAttribArray(1); | ||||
} else { | } else { | ||||
float quad[6*2] = { | |||||
bounds[0], bounds[3], bounds[2], bounds[3], bounds[2], bounds[1], | |||||
bounds[0], bounds[3], bounds[2], bounds[1], bounds[0], bounds[1], | |||||
}; | |||||
glEnable(GL_CULL_FACE); | glEnable(GL_CULL_FACE); | ||||
@@ -782,10 +786,6 @@ static void glnvg__renderFill(void* uptr, struct NVGpaint* paint, struct NVGscis | |||||
glDisableVertexAttribArray(1); | glDisableVertexAttribArray(1); | ||||
float quad[6*2] = { | |||||
bounds[0], bounds[3], bounds[2], bounds[3], bounds[2], bounds[1], | |||||
bounds[0], bounds[3], bounds[2], bounds[1], bounds[0], bounds[1], | |||||
}; | |||||
glBufferSubData(GL_ARRAY_BUFFER, 0, 6 * 2*sizeof(float), quad); | glBufferSubData(GL_ARRAY_BUFFER, 0, 6 * 2*sizeof(float), quad); | ||||
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2*sizeof(float), (const GLvoid*)0); | glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2*sizeof(float), (const GLvoid*)0); | ||||
glVertexAttrib2f(1, 0.5f, 1.0f); | glVertexAttrib2f(1, 0.5f, 1.0f); | ||||