diff options
| author | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-06-22 17:41:01 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-06-22 17:41:01 +0200 |
| commit | eaeed7631848eb7885fcb2dc6772bd6a777f101b (patch) | |
| tree | ec79dd7dcadea7cd8d02d4bf5f164de57d2f6b53 /src | |
| parent | 09d17ee1cf95913715b9d96cc14a4ba4ac751947 (diff) | |
work
Diffstat (limited to 'src')
| -rw-r--r-- | src/assets.c | 1 | ||||
| -rw-r--r-- | src/linux/platform.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/assets.c b/src/assets.c index e2452fb..ff71fd5 100644 --- a/src/assets.c +++ b/src/assets.c @@ -179,6 +179,7 @@ bool assets_queue_worker_load_image(image *image) u64 stamp = platform_get_time(TIME_FULL, TIME_US);
#endif
+ //stbi_convert_iphone_png_to_rgb(0);
image->data = stbi_load_from_memory(image->start_addr,
image->end_addr - image->start_addr,
&image->width,
diff --git a/src/linux/platform.c b/src/linux/platform.c index a075d48..f849a79 100644 --- a/src/linux/platform.c +++ b/src/linux/platform.c @@ -750,6 +750,15 @@ void platform_setup_renderer() } } +int _x11_error_handler(Display *display, XErrorEvent *event) +{ + char tmp[2000]; + XGetErrorText(display, event->error_code, tmp, 2000); + printf("X11 ERROR: %s\n", tmp); + + return 0; +} + platform_window platform_open_window_ex(char *name, u16 width, u16 height, u16 max_w, u16 max_h, u16 min_w, u16 min_h, s32 flags) { bool has_max_size = max_w || max_h; @@ -788,6 +797,8 @@ platform_window platform_open_window_ex(char *name, u16 width, u16 height, u16 m window.display = XOpenDisplay(NULL); + XSetErrorHandler(_x11_error_handler); + if(window.display == NULL) { return window; } @@ -846,6 +857,7 @@ platform_window platform_open_window_ex(char *name, u16 width, u16 height, u16 m window.window = XCreateWindow(window.display, window.parent, center_x, center_y, width, height, 0, window.visual_info->depth, InputOutput, window.visual_info->visual, CWColormap | CWEventMask | CWBorderPixel, &window_attributes); + XGCValues values; window.gc = XCreateGC(window.display, window.window, 0, &values); |
