1 /**************************************************************************
3 * Copyright 2010 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
31 /* This is an API for exercising gallium functionality in a
32 * platform-neutral fashion. Whatever platform integration is
33 * necessary to implement this interface is orchestrated by the
34 * individual target building this entity.
36 * For instance, the graw-xlib target includes code to implent these
37 * interfaces on top of the X window system.
39 * Programs using this interface may additionally benefit from some of
40 * the utilities currently in the libgallium.a library, especially
41 * those for parsing text representations of TGSI shaders.
44 #include "pipe/p_compiler.h"
45 #include "pipe/p_format.h"
51 /* Returns a handle to be used with flush_frontbuffer()/present().
53 * Query format support with screen::is_format_supported and usage
56 PUBLIC
struct pipe_screen
*graw_create_window_and_screen( int x
,
60 enum pipe_format format
,
63 PUBLIC
void graw_set_display_func( void (*func
)( void ) );
64 PUBLIC
void graw_main_loop( void );
66 PUBLIC
void *graw_parse_geometry_shader( struct pipe_context
*pipe
,
69 PUBLIC
void *graw_parse_vertex_shader( struct pipe_context
*pipe
,
72 PUBLIC
void *graw_parse_fragment_shader( struct pipe_context
*pipe
,
75 /* Parse a single command-line option, if any. Options include:
79 * If an option has been successfully parsed, argi is updated
80 * to point just after the option and return TRUE.
82 PUBLIC boolean
graw_parse_args(int *argi
, int argc
, char *argv
[]);
84 /* Saves surface contents to a file.
86 * If filename is NULL, the filename provided with the `-o' option
87 * is used. If the option has not been specified, the surface
90 * Returns TRUE if the surface has been saved.
92 PUBLIC boolean
graw_save_surface_to_file(struct pipe_context
*pipe
,
93 struct pipe_surface
*surface
,
94 const char *filename
);