Commit cc29216d authored by Chad Versace's avatar Chad Versace

tests,util: Wrap glutKeyboardFunc with piglit_set_keyboard_func

I'm trying to transition Piglit from using GLUT to using Waffle. This
requires killing all uses of GLUT functions, one-by-one.

This patch replaces all-but-one instance of glutKeyboardFunc with a new
wrapper, piglit_set_keyboard_func. The one remaining test that uses
glutKeyboardFunc is windowoverlap; but that tests doesn't use
piglit-framework, anyway.
Reviewed-and-tested-by: Jordan Justen's avatarJordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry's avatarPaul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
parent 6ff0ee80
......@@ -583,7 +583,7 @@ static void
fbo_formats_init_test_set(int test_set_index, GLboolean print_options)
{
if (!piglit_automatic)
glutKeyboardFunc(fbo_formats_key_func);
piglit_set_keyboard_func(fbo_formats_key_func);
piglit_require_extension("GL_EXT_framebuffer_object");
piglit_require_extension("GL_ARB_texture_env_combine");
......
......@@ -481,7 +481,7 @@ void piglit_init(int argc, char **argv)
fbo_formats_init(argc, argv, GL_FALSE);
if (!piglit_automatic) {
glutKeyboardFunc(key_func);
piglit_set_keyboard_func(key_func);
printf(" -n Next test set.\n"
" -N Previous test set.\n"
" -m Next format in the set.\n"
......
......@@ -213,7 +213,7 @@ void piglit_init(int argc, char *argv[])
if (!piglit_automatic) {
printf("Press 't' to switch tests; Escape to quit\n");
glutKeyboardFunc(Key);
piglit_set_keyboard_func(Key);
}
if (piglit_use_fragment_program()) {
......
......@@ -225,6 +225,6 @@ void piglit_init(int argc, char **argv)
if (!piglit_automatic) {
printf("Press t to switch between subtests.\n");
glutKeyboardFunc(key_func);
piglit_set_keyboard_func(key_func);
}
}
......@@ -311,7 +311,7 @@ piglit_init(int argc, char **argv)
"Press 'b'/'B' to change primary LOD bias\n"
"Press 'n'/'N' to change secondary LOD bias\n"
"Press 'Escape' to quit\n");
glutKeyboardFunc(Key);
piglit_set_keyboard_func(Key);
}
glGenTextures(2, Textures);
......
......@@ -374,7 +374,7 @@ piglit_init(int argc, char **argv)
GLfloat texbuf[4];
if (!piglit_automatic) {
glutKeyboardFunc(Key);
piglit_set_keyboard_func(Key);
printf("Press 't' to cycle through test images\n");
}
......
......@@ -1454,7 +1454,7 @@ void piglit_init(int argc, char **argv)
init_textures();
if (!piglit_automatic) {
glutKeyboardFunc(key_func);
piglit_set_keyboard_func(key_func);
printf("Hotkeys in the interactive mode:\n"
" b - use 1-pixel texture border (deprecated in GL3)\n"
" p - use projective texturing\n"
......
......@@ -147,3 +147,10 @@ piglit_post_redisplay(void)
if (!piglit_use_fbo && !piglit_automatic)
glutPostRedisplay();
}
void
piglit_set_keyboard_func(void (*func)(unsigned char key, int x, int y))
{
if (!piglit_automatic && !piglit_use_fbo)
glutKeyboardFunc(func);
}
......@@ -130,5 +130,6 @@ extern unsigned int piglit_winsys_fbo;
extern void piglit_present_results();
void piglit_post_redisplay(void);
void piglit_set_keyboard_func(void (*func)(unsigned char key, int x, int y));
#endif /* PIGLIT_FRAMEWORK_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment