glx-multithread-texture: Avoid front-buffer rendering.
[piglit.git] / tests / util / piglit-framework-gl / piglit_gl_framework.h
blobaad565e06970e7dfe7bd4ab14154407aa66552c4
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
25 #ifndef PIGLIT_GL_FRAMEWORK_H
26 #define PIGLIT_GL_FRAMEWORK_H
28 #include <stdbool.h>
30 #include "piglit-framework-gl.h"
32 /**
33 * Abstract class. Use piglit_gl_framework_factory to create a concrete
34 * instance.
36 struct piglit_gl_framework {
37 const struct piglit_gl_test_config *test_config;
39 /**
40 * Does not return.
42 void
43 (*run_test)(struct piglit_gl_framework *gl_fw,
44 int argc, char *argv[]);
46 /**
47 * Analogous to glutSwapBuffers(). May be null.
49 void
50 (*swap_buffers)(struct piglit_gl_framework *gl_fw);
52 /**
53 * Analogous to glutKeyboardFunc(). May be null.
55 void
56 (*set_keyboard_func)(struct piglit_gl_framework *gl_fw,
57 void (*func)(unsigned char key, int x, int y));
59 /**
60 * Analogous to glutReshapeFunc(). May be null.
62 void
63 (*set_reshape_func)(struct piglit_gl_framework *gl_fw,
64 void (*func)(int w, int h));
66 /**
67 * Analogous to glutPostRedisplay(). May be null.
69 void
70 (*post_redisplay)(struct piglit_gl_framework *gl_fw);
72 void
73 (*destroy)(struct piglit_gl_framework *gl_fw);
75 enum piglit_result
76 (*create_dma_buf)(unsigned w, unsigned h, unsigned fourcc,
77 const void *src_data, struct piglit_dma_buf **buf);
79 void
80 (*destroy_dma_buf)(struct piglit_dma_buf *buf);
83 struct piglit_gl_framework*
84 piglit_gl_framework_factory(const struct piglit_gl_test_config *test_config);
86 bool
87 piglit_gl_framework_init(struct piglit_gl_framework *gl_fw,
88 const struct piglit_gl_test_config *test_config);
90 void
91 piglit_gl_framework_teardown(struct piglit_gl_framework *gl_fw);
93 #endif /* PIGLIT_GL_FRAMEWORK_H */