-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathworkarounds.c
More file actions
33 lines (27 loc) · 899 Bytes
/
workarounds.c
File metadata and controls
33 lines (27 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include "raylib.h"
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#include "cimgui/cimgui.h"
extern void raylib_log(int level, char *text);
void custom_log_callback(int message_type, const char *text, va_list args) {
char buffer[4096];
vsnprintf(buffer, 4096, text, args);
raylib_log(message_type, buffer);
}
void set_raylib_tracelog_callback() {
SetTraceLogCallback(custom_log_callback);
}
typedef struct ImGuiWantsSomething {
bool WantCaptureMouse;
bool WantCaptureKeyboard;
bool WantTextInput;
bool WantSetMousePos;
} ImGuiWantsSomething;
ImGuiWantsSomething get_imgui_wants(ImGuiIO *io) {
return (ImGuiWantsSomething) {
.WantCaptureMouse = io->WantCaptureMouse,
.WantCaptureKeyboard = io->WantCaptureKeyboard,
.WantTextInput = io->WantTextInput,
.WantSetMousePos = io->WantSetMousePos,
};
}