mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2024-12-01 13:24:20 +01:00
dont assert if not profiling
This commit is contained in:
parent
112d3e8a7e
commit
a22c31a9d2
@ -101,6 +101,8 @@ void endMeasure(void* func)
|
||||
|
||||
void endFrame()
|
||||
{
|
||||
if(!globalProfiler) return;
|
||||
|
||||
while(globalProfilerGuard);
|
||||
{
|
||||
globalProfilerGuard = 1;
|
||||
@ -127,7 +129,7 @@ double getTimeSpent(void* func)
|
||||
|
||||
void profilePrintResults()
|
||||
{
|
||||
assert(globalProfiler);
|
||||
if(!globalProfiler) return;
|
||||
|
||||
funcData profileResults[MAX_FUNCTIONS];
|
||||
memset(profileResults, 0, sizeof(profileResults));
|
||||
|
@ -42,6 +42,8 @@ void initInputHandler()
|
||||
li = libinput_udev_create_context(&interface, NULL, _udev); assert(li);
|
||||
uint32_t res = libinput_udev_assign_seat(li, "seat0"); assert(res == 0);
|
||||
|
||||
|
||||
|
||||
libinput_dispatch(li);
|
||||
|
||||
//configure devices
|
||||
@ -120,8 +122,18 @@ void handleInput()
|
||||
case LIBINPUT_EVENT_POINTER_AXIS:
|
||||
{
|
||||
enum libinput_pointer_axis_source axisSource = libinput_event_pointer_get_axis_source(libinput_event_get_pointer_event(event));
|
||||
double axisValueVertical = libinput_event_pointer_get_axis_value(libinput_event_get_pointer_event(event), LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||
double axisValueHorizontal = libinput_event_pointer_get_axis_value(libinput_event_get_pointer_event(event), LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
||||
double axisValueVertical = 1, axisValueHorizontal = 0;
|
||||
|
||||
if(libinput_event_pointer_has_axis(event, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))
|
||||
{
|
||||
axisValueVertical = libinput_event_pointer_get_axis_value(libinput_event_get_pointer_event(event), LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||
}
|
||||
|
||||
if(libinput_event_pointer_has_axis(event, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL))
|
||||
{
|
||||
axisValueHorizontal = libinput_event_pointer_get_axis_value(libinput_event_get_pointer_event(event), LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
||||
}
|
||||
|
||||
printf("Pointer axis source %u, value vertical %lf, value horizontal %lf\n", axisSource, axisValueVertical, axisValueHorizontal);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user