glx-multithread-texture: Avoid front-buffer rendering.
[piglit.git] / tests / util / piglit-framework-gl / piglit_winsys_framework.h
blob3ea9ae4b25b5f4bdda912088746ccb2f9fd0132a
1 /*
2 * Copyright © 2012 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
24 #pragma once
26 #include "piglit_wfl_framework.h"
28 /**
29 * Abstract class. Use winsys_framework_factory() to create a concrete
30 * instance.
32 struct piglit_winsys_framework {
33 struct piglit_wfl_framework wfl_fw;
35 /**
36 * Has the user requested a redisplay with
37 * piglit_gl_framework::post_redisplay?
39 bool need_redisplay;
41 /**
42 * Must be implemented by subclasses.
44 * TODO(chad): This could be removed.
46 void
47 (*show_window)(struct piglit_winsys_framework *winsys_fw);
49 void
50 (*enter_event_loop)(struct piglit_winsys_framework *winsys_fw);
52 /**
53 * Set with piglit_gl_framework::set_keyboard_func. May be null.
55 void
56 (*user_keyboard_func)(unsigned char key, int x, int y);
58 /**
59 * Set with piglit_gl_framework::user_reshape_func. May be null.
61 void
62 (*user_reshape_func)(int width, int height);
65 /**
66 * Typesafe cast.
68 struct piglit_winsys_framework*
69 piglit_winsys_framework(struct piglit_gl_framework *gl_fw);
71 struct piglit_gl_framework*
72 piglit_winsys_framework_factory(const struct piglit_gl_test_config *test_config);
74 /**
75 * @param platform must be one of WAFFLE_PLATFORM_*.
77 bool
78 piglit_winsys_framework_init(struct piglit_winsys_framework *winsys_fw,
79 const struct piglit_gl_test_config *test_config,
80 int32_t platform);
82 void
83 piglit_winsys_framework_teardown(struct piglit_winsys_framework *winsys_fw);