src/glinject/glinject.c
/*
 * Handles buffer swap. This is the method that is called at the end of each
 * frame.
 */
Handles buffer swap. This is the method that is called at the end of each
frame.
Handles buffer swap . This is the method that is called at the end of each frame .
void glinject_handle_buffer_swap(Display* dpy, GLXDrawable drawable) {
	XEvent event;
	while (XCheckIfEvent(dpy, &event, glinject_check_if_event, NULL));
	pthread_mutex_lock(&glinject_mutex);
	lua_getglobal(L, "handle_buffer_swap");
	if (!lua_isfunction(L, -1)) {
		fprintf(stderr, "handle_buffer_swap is not a function!\n");
		return;
	}
	lua_pushlightuserdata(L, dpy);
	lua_pushnumber(L, drawable);
	if (lua_pcall(L, 2, 0, 0) != 0) {
		fprintf(stderr, "error running function: %s\n", lua_tostring(L, -1));
	}
	pthread_mutex_unlock(&glinject_mutex);
}
void glinject_handle_buffer_swap ( Display * dpy , GLXDrawable drawable ) { XEvent event ; while ( XCheckIfEvent ( dpy , & event , glinject_check_if_event , NULL ) ) ; pthread_mutex_lock ( & glinject_mutex ) ; lua_getglobal ( L , " " ) ; if ( ! lua_isfunction ( L , -1 ) ) { fprintf ( stderr , " \n " ) ; return ; } lua_pushlightuserdata ( L , dpy ) ; lua_pushnumber ( L , drawable ) ; if ( lua_pcall ( L , 2 , 0 , 0 ) != 0 ) { fprintf ( stderr , " \n " , lua_tostring ( L , -1 ) ) ; } pthread_mutex_unlock ( & glinject_mutex ) ; }
Handles buffer swap.
Handles buffer swap .