revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / gallium / include / state_tracker / graw.h
blob217fa31ba198d16c265bd4c776ad34d3b3619331
1 /**************************************************************************
3 * Copyright 2010 VMware, Inc.
4 * All Rights Reserved.
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
16 * of the Software.
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 **************************************************************************/
28 #ifndef GALLIUM_RAW_H
29 #define GALLIUM_RAW_H
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"
47 struct pipe_context;
48 struct pipe_screen;
49 struct pipe_surface;
51 /* Returns a handle to be used with flush_frontbuffer()/present().
53 * Query format support with screen::is_format_supported and usage
54 * XXX.
56 PUBLIC struct pipe_screen *graw_create_window_and_screen( int x,
57 int y,
58 unsigned width,
59 unsigned height,
60 enum pipe_format format,
61 void **handle);
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,
67 const char *text );
69 PUBLIC void *graw_parse_vertex_shader( struct pipe_context *pipe,
70 const char *text );
72 PUBLIC void *graw_parse_fragment_shader( struct pipe_context *pipe,
73 const char *text );
75 /* Parse a single command-line option, if any. Options include:
77 * -o <filename>
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
88 * will not be saved.
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);
96 #endif