aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/host/libs/Translator/EGL/EglConfig.h
blob: 3d733f976ad886cdeaa123d96b279c2adca1f13d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef EGL_CONFIG_H
#define EGL_CONFIG_H

#include<EGL/egl.h>
#include<EGL/eglinternalplatform.h>

#define MIN_SWAP_INTERVAL 1
#define MAX_SWAP_INTERVAL 10


class EglConfig {
public:
    bool getConfAttrib(EGLint attrib,EGLint* val) const;
    bool operator<(const EglConfig& conf)   const;
    bool operator>=(const EglConfig& conf)  const;
    bool compitableWith(const EglConfig& conf)  const; //compitability
    bool choosen(const EglConfig& dummy);
    EGLint surfaceType(){ return m_surface_type;};
    EGLint id(){return m_config_id;};
    EGLint nativeId(){return m_native_config_id;};
    EGLNativePixelFormatType nativeConfig(){ return m_nativeFormat;}

    EglConfig(EGLint red_size,
              EGLint green_size,
              EGLint blue_size,
              EGLint alpha_size,
              EGLenum  caveat,
              EGLint config_id,
              EGLint depth_size,
              EGLint frame_buffer_level,
              EGLint max_pbuffer_width,
              EGLint max_pbuffer_height,
              EGLint max_pbuffer_size,
              EGLBoolean native_renderable,
              EGLint renderable_type,
              EGLint native_visual_id,
              EGLint native_visual_type,
              EGLint samples_per_pixel,
              EGLint stencil_size,
              EGLint surface_type,
              EGLenum transparent_type,
              EGLint trans_red_val,
              EGLint trans_green_val,
              EGLint trans_blue_val,
              EGLNativePixelFormatType frmt);

    EglConfig(const EglConfig& conf);

    EglConfig(const EglConfig& conf,
              EGLint config_id,
              EGLint red_size,
              EGLint green_size,
              EGLint blue_size,
              EGLint alpha_size);

private:

    const EGLint                    m_buffer_size;
    const EGLint                    m_red_size;
    const EGLint                    m_green_size;
    const EGLint                    m_blue_size;
    const EGLint                    m_alpha_size;
    const EGLBoolean                m_bind_to_tex_rgb;
    const EGLBoolean                m_bind_to_tex_rgba;
    const EGLenum                   m_caveat;
    const EGLint                    m_config_id;
    const EGLint                    m_native_config_id;
    const EGLint                    m_frame_buffer_level;
    const EGLint                    m_depth_size;
    const EGLint                    m_max_pbuffer_width;
    const EGLint                    m_max_pbuffer_height;
    const EGLint                    m_max_pbuffer_size;
    const EGLint                    m_max_swap_interval;
    const EGLint                    m_min_swap_interval;
    const EGLBoolean                m_native_renderable;
    const EGLint                    m_renderable_type;
    const EGLint                    m_native_visual_id;
    const EGLint                    m_native_visual_type;
    const EGLint                    m_sample_buffers_num;
    const EGLint                    m_samples_per_pixel;
    const EGLint                    m_stencil_size;
    const EGLint                    m_surface_type;
    const EGLenum                   m_transparent_type;
    const EGLint                    m_trans_red_val;
    const EGLint                    m_trans_green_val;
    const EGLint                    m_trans_blue_val;
    const EGLenum                   m_conformant;

    const EGLNativePixelFormatType  m_nativeFormat;
};

#endif