Home | History | Annotate | Download | only in EGL
      1 /*
      2 * Copyright (C) 2011 The Android Open Source Project
      3 *
      4 * Licensed under the Apache License, Version 2.0 (the "License");
      5 * you may not use this file except in compliance with the License.
      6 * You may obtain a copy of the License at
      7 *
      8 * http://www.apache.org/licenses/LICENSE-2.0
      9 *
     10 * Unless required by applicable law or agreed to in writing, software
     11 * distributed under the License is distributed on an "AS IS" BASIS,
     12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 * See the License for the specific language governing permissions and
     14 * limitations under the License.
     15 */
     16 #ifndef EGL_CONFIG_H
     17 #define EGL_CONFIG_H
     18 
     19 #include<EGL/egl.h>
     20 #include<EGL/eglinternalplatform.h>
     21 
     22 #define MIN_SWAP_INTERVAL 1
     23 #define MAX_SWAP_INTERVAL 10
     24 
     25 
     26 class EglConfig {
     27 public:
     28     bool getConfAttrib(EGLint attrib,EGLint* val) const;
     29     bool operator<(const EglConfig& conf)   const;
     30     bool operator>=(const EglConfig& conf)  const;
     31     bool compitableWith(const EglConfig& conf)  const; //compitability
     32     bool choosen(const EglConfig& dummy);
     33     EGLint surfaceType(){ return m_surface_type;};
     34     EGLint id(){return m_config_id;};
     35     EGLint nativeId(){return m_native_config_id;};
     36     EGLNativePixelFormatType nativeConfig(){ return m_nativeFormat;}
     37 
     38     EglConfig(EGLint red_size,
     39               EGLint green_size,
     40               EGLint blue_size,
     41               EGLint alpha_size,
     42               EGLenum  caveat,
     43               EGLint config_id,
     44               EGLint depth_size,
     45               EGLint frame_buffer_level,
     46               EGLint max_pbuffer_width,
     47               EGLint max_pbuffer_height,
     48               EGLint max_pbuffer_size,
     49               EGLBoolean native_renderable,
     50               EGLint renderable_type,
     51               EGLint native_visual_id,
     52               EGLint native_visual_type,
     53               EGLint samples_per_pixel,
     54               EGLint stencil_size,
     55               EGLint surface_type,
     56               EGLenum transparent_type,
     57               EGLint trans_red_val,
     58               EGLint trans_green_val,
     59               EGLint trans_blue_val,
     60               EGLNativePixelFormatType frmt);
     61 
     62     EglConfig(const EglConfig& conf);
     63 
     64     EglConfig(const EglConfig& conf,
     65               EGLint config_id,
     66               EGLint red_size,
     67               EGLint green_size,
     68               EGLint blue_size,
     69               EGLint alpha_size);
     70 
     71 private:
     72 
     73     const EGLint                    m_buffer_size;
     74     const EGLint                    m_red_size;
     75     const EGLint                    m_green_size;
     76     const EGLint                    m_blue_size;
     77     const EGLint                    m_alpha_size;
     78     const EGLBoolean                m_bind_to_tex_rgb;
     79     const EGLBoolean                m_bind_to_tex_rgba;
     80     const EGLenum                   m_caveat;
     81     const EGLint                    m_config_id;
     82     const EGLint                    m_native_config_id;
     83     const EGLint                    m_frame_buffer_level;
     84     const EGLint                    m_depth_size;
     85     const EGLint                    m_max_pbuffer_width;
     86     const EGLint                    m_max_pbuffer_height;
     87     const EGLint                    m_max_pbuffer_size;
     88     const EGLint                    m_max_swap_interval;
     89     const EGLint                    m_min_swap_interval;
     90     const EGLBoolean                m_native_renderable;
     91     const EGLint                    m_renderable_type;
     92     const EGLint                    m_native_visual_id;
     93     const EGLint                    m_native_visual_type;
     94     const EGLint                    m_sample_buffers_num;
     95     const EGLint                    m_samples_per_pixel;
     96     const EGLint                    m_stencil_size;
     97     const EGLint                    m_surface_type;
     98     const EGLenum                   m_transparent_type;
     99     const EGLint                    m_trans_red_val;
    100     const EGLint                    m_trans_green_val;
    101     const EGLint                    m_trans_blue_val;
    102     const EGLenum                   m_conformant;
    103 
    104     const EGLNativePixelFormatType  m_nativeFormat;
    105 };
    106 
    107 #endif
    108