egl_g3d.h revision 6c7e0b95a4a16d268aa3ca74c5c8407779533314
1/* 2 * Mesa 3-D graphics library 3 * Version: 7.8 4 * 5 * Copyright (C) 2009-2010 Chia-I Wu <olv@0xlab.org> 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the "Software"), 9 * to deal in the Software without restriction, including without limitation 10 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * and/or sell copies of the Software, and to permit persons to whom the 12 * Software is furnished to do so, subject to the following conditions: 13 * 14 * The above copyright notice and this permission notice shall be included 15 * in all copies or substantial portions of the Software. 16 * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 * DEALINGS IN THE SOFTWARE. 24 */ 25 26#ifndef _EGL_G3D_H_ 27#define _EGL_G3D_H_ 28 29#include "pipe/p_compiler.h" 30#include "pipe/p_screen.h" 31#include "pipe/p_context.h" 32#include "pipe/p_format.h" 33#include "egldriver.h" 34#include "egldisplay.h" 35#include "eglcontext.h" 36#include "eglsurface.h" 37#include "eglconfig.h" 38#include "eglimage.h" 39#include "eglscreen.h" 40#include "eglmode.h" 41 42#include "native.h" 43#include "egl_g3d_st.h" 44#include "egl_g3d_loader.h" 45 46struct egl_g3d_driver { 47 _EGLDriver base; 48 const struct egl_g3d_loader *loader; 49 const struct native_platform *platforms[_EGL_NUM_PLATFORMS]; 50}; 51 52struct egl_g3d_display { 53 struct native_display *native; 54 55 const struct egl_g3d_loader *loader; 56 struct st_manager *smapi; 57 struct pipe_context *pipe; 58}; 59 60struct egl_g3d_context { 61 _EGLContext base; 62 63 struct st_api *stapi; 64 65 struct st_context_iface *stctxi; 66}; 67 68struct egl_g3d_surface { 69 _EGLSurface base; 70 71 struct st_visual stvis; 72 struct st_framebuffer_iface *stfbi; 73 74 /* the native surface; NULL for pbuffers */ 75 struct native_surface *native; 76 struct pipe_resource *render_texture; 77 78 EGLenum client_buffer_type; 79 EGLClientBuffer client_buffer; 80 81 unsigned int sequence_number; 82}; 83 84struct egl_g3d_config { 85 _EGLConfig base; 86 const struct native_config *native; 87 struct st_visual stvis; 88}; 89 90struct egl_g3d_image { 91 _EGLImage base; 92 struct pipe_resource *texture; 93 unsigned face; 94 unsigned level; 95 unsigned zslice; 96}; 97 98/* standard typecasts */ 99_EGL_DRIVER_STANDARD_TYPECASTS(egl_g3d) 100_EGL_DRIVER_TYPECAST(egl_g3d_image, _EGLImage, obj) 101 102#ifdef EGL_MESA_screen_surface 103 104struct egl_g3d_screen { 105 _EGLScreen base; 106 const struct native_connector *native; 107 const struct native_mode **native_modes; 108}; 109_EGL_DRIVER_TYPECAST(egl_g3d_screen, _EGLScreen, obj) 110 111#endif /* EGL_MESA_screen_surface */ 112 113#endif /* _EGL_G3D_H_ */ 114