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
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
25 #ifndef PIGLIT_GL_FRAMEWORK_H
26 #define PIGLIT_GL_FRAMEWORK_H
30 #include "piglit-framework-gl.h"
33 * Abstract class. Use piglit_gl_framework_factory to create a concrete
36 struct piglit_gl_framework
{
37 const struct piglit_gl_test_config
*test_config
;
43 (*run_test
)(struct piglit_gl_framework
*gl_fw
,
44 int argc
, char *argv
[]);
47 * Analogous to glutSwapBuffers(). May be null.
50 (*swap_buffers
)(struct piglit_gl_framework
*gl_fw
);
53 * Analogous to glutKeyboardFunc(). May be null.
56 (*set_keyboard_func
)(struct piglit_gl_framework
*gl_fw
,
57 void (*func
)(unsigned char key
, int x
, int y
));
60 * Analogous to glutReshapeFunc(). May be null.
63 (*set_reshape_func
)(struct piglit_gl_framework
*gl_fw
,
64 void (*func
)(int w
, int h
));
67 * Analogous to glutPostRedisplay(). May be null.
70 (*post_redisplay
)(struct piglit_gl_framework
*gl_fw
);
73 (*destroy
)(struct piglit_gl_framework
*gl_fw
);
76 (*create_dma_buf
)(unsigned w
, unsigned h
, unsigned fourcc
,
77 const void *src_data
, struct piglit_dma_buf
**buf
);
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
);
87 piglit_gl_framework_init(struct piglit_gl_framework
*gl_fw
,
88 const struct piglit_gl_test_config
*test_config
);
91 piglit_gl_framework_teardown(struct piglit_gl_framework
*gl_fw
);
93 #endif /* PIGLIT_GL_FRAMEWORK_H */