mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2025-03-02 02:29: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()
|
void endFrame()
|
||||||
{
|
{
|
||||||
|
if(!globalProfiler) return;
|
||||||
|
|
||||||
while(globalProfilerGuard);
|
while(globalProfilerGuard);
|
||||||
{
|
{
|
||||||
globalProfilerGuard = 1;
|
globalProfilerGuard = 1;
|
||||||
@ -127,7 +129,7 @@ double getTimeSpent(void* func)
|
|||||||
|
|
||||||
void profilePrintResults()
|
void profilePrintResults()
|
||||||
{
|
{
|
||||||
assert(globalProfiler);
|
if(!globalProfiler) return;
|
||||||
|
|
||||||
funcData profileResults[MAX_FUNCTIONS];
|
funcData profileResults[MAX_FUNCTIONS];
|
||||||
memset(profileResults, 0, sizeof(profileResults));
|
memset(profileResults, 0, sizeof(profileResults));
|
||||||
|
@ -42,6 +42,8 @@ void initInputHandler()
|
|||||||
li = libinput_udev_create_context(&interface, NULL, _udev); assert(li);
|
li = libinput_udev_create_context(&interface, NULL, _udev); assert(li);
|
||||||
uint32_t res = libinput_udev_assign_seat(li, "seat0"); assert(res == 0);
|
uint32_t res = libinput_udev_assign_seat(li, "seat0"); assert(res == 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
libinput_dispatch(li);
|
libinput_dispatch(li);
|
||||||
|
|
||||||
//configure devices
|
//configure devices
|
||||||
@ -120,8 +122,18 @@ void handleInput()
|
|||||||
case LIBINPUT_EVENT_POINTER_AXIS:
|
case LIBINPUT_EVENT_POINTER_AXIS:
|
||||||
{
|
{
|
||||||
enum libinput_pointer_axis_source axisSource = libinput_event_pointer_get_axis_source(libinput_event_get_pointer_event(event));
|
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 axisValueVertical = 1, axisValueHorizontal = 0;
|
||||||
double axisValueHorizontal = libinput_event_pointer_get_axis_value(libinput_event_get_pointer_event(event), LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
|
||||||
|
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);
|
printf("Pointer axis source %u, value vertical %lf, value horizontal %lf\n", axisSource, axisValueVertical, axisValueHorizontal);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user