Commit af12b592 authored by Niklas Haas's avatar Niklas Haas
Browse files

demos: reduce verbosity across the board

No reason for this confusing `demo_context()` anyway, just pick a
suitable verbosity level for each demo. In particular, `plplay` was way
too spammy.
parent 1f2f2b6d
......@@ -37,7 +37,11 @@ static void evolve_rgba(float rgba[4], int *pos)
int main(int argc, char **argv)
{
ctx = demo_context();
ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) {
.log_cb = pl_log_color,
.log_level = PL_LOG_DEBUG,
});
win = window_create(ctx, "colors demo", 640, 480, WIN_ALPHA);
if (!win)
uninit(1);
......
......@@ -10,14 +10,3 @@
#include <libplacebo/context.h>
#include <libplacebo/renderer.h>
static inline struct pl_context *demo_context() {
return pl_context_create(PL_API_VER, &(struct pl_context_params) {
.log_cb = isatty(fileno(stdout)) ? pl_log_color : pl_log_simple,
#ifdef NDEBUG
.log_level = PL_LOG_INFO,
#else
.log_level = PL_LOG_DEBUG,
#endif
});
}
......@@ -187,7 +187,11 @@ int main(int argc, char **argv)
const char *file = argv[1];
const char *overlay = argc > 2 ? argv[2] : NULL;
ctx = demo_context();
ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) {
.log_cb = pl_log_color,
.log_level = PL_LOG_INFO,
});
// Load image, do this first so we can use it for the window size
SDL_Surface *img = IMG_Load(file);
......
......@@ -50,7 +50,11 @@ static void uninit(int ret)
int main(int argc, char **argv)
{
ctx = demo_context();
ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) {
.log_cb = pl_log_color,
.log_level = PL_LOG_DEBUG,
});
win = window_create(ctx, "nuklear demo", 640, 480, 0);
ui = win ? ui_create(win->gpu) : NULL;
if (!win || !ui)
......
......@@ -468,7 +468,11 @@ int main(int argc, char **argv)
if (is_file_hdr(p))
flags |= WIN_HDR;
p->ctx = demo_context();
p->ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) {
.log_cb = pl_log_color,
.log_level = PL_LOG_INFO,
});
p->win = window_create(p->ctx, "plplay", par->width, par->height, flags);
if (!p->win)
goto error;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment