p_screen.h

Go to the documentation of this file.
00001 /**************************************************************************
00002  * 
00003  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
00004  * All Rights Reserved.
00005  * 
00006  * Permission is hereby granted, free of charge, to any person obtaining a
00007  * copy of this software and associated documentation files (the
00008  * "Software"), to deal in the Software without restriction, including
00009  * without limitation the rights to use, copy, modify, merge, publish,
00010  * distribute, sub license, and/or sell copies of the Software, and to
00011  * permit persons to whom the Software is furnished to do so, subject to
00012  * the following conditions:
00013  * 
00014  * The above copyright notice and this permission notice (including the
00015  * next paragraph) shall be included in all copies or substantial portions
00016  * of the Software.
00017  * 
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00019  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
00021  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
00022  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00023  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00024  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  * 
00026  **************************************************************************/
00027 
00035 #ifndef P_SCREEN_H
00036 #define P_SCREEN_H
00037 
00038 
00039 #include "pipe/p_compiler.h"
00040 #include "pipe/p_state.h"
00041 
00042 
00043 
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047 
00048 
00049 
00055 struct pipe_screen {
00056    struct pipe_winsys *winsys;
00057 
00058    void (*destroy)( struct pipe_screen * );
00059 
00060 
00061    const char *(*get_name)( struct pipe_screen * );
00062 
00063    const char *(*get_vendor)( struct pipe_screen * );
00064 
00069    int (*get_param)( struct pipe_screen *, int param );
00070 
00075    float (*get_paramf)( struct pipe_screen *, int param );
00076 
00083    boolean (*is_format_supported)( struct pipe_screen *,
00084                                    enum pipe_format format,
00085                                    enum pipe_texture_target target,
00086                                    unsigned tex_usage, 
00087                                    unsigned geom_flags );
00088 
00092    struct pipe_texture * (*texture_create)(struct pipe_screen *,
00093                                            const struct pipe_texture *templat);
00094 
00102    struct pipe_texture * (*texture_blanket)(struct pipe_screen *,
00103                                             const struct pipe_texture *templat,
00104                                             const unsigned *pitch,
00105                                             struct pipe_buffer *buffer);
00106 
00107    void (*texture_release)(struct pipe_screen *,
00108                            struct pipe_texture **pt);
00109 
00111    struct pipe_surface *(*get_tex_surface)(struct pipe_screen *,
00112                                            struct pipe_texture *texture,
00113                                            unsigned face, unsigned level,
00114                                            unsigned zslice,
00115                                            unsigned usage );
00116 
00117    /* Surfaces allocated by the above must be released here:
00118     */
00119    void (*tex_surface_release)( struct pipe_screen *,
00120                                 struct pipe_surface ** );
00121    
00122 
00123    void *(*surface_map)( struct pipe_screen *,
00124                          struct pipe_surface *surface,
00125                          unsigned flags );
00126 
00127    void (*surface_unmap)( struct pipe_screen *,
00128                           struct pipe_surface *surface );
00129    
00130 };
00131 
00132 
00133 #ifdef __cplusplus
00134 }
00135 #endif
00136 
00137 #endif /* P_SCREEN_H */

Generated on Tue Sep 29 06:25:17 2009 for Gallium3D by  doxygen 1.5.4