summaryrefslogtreecommitdiff
path: root/include/waffle/waffle_enum.h
blob: 0854b9b3b126c329a20d9ac7d80e53802054b922 (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
// Copyright 2012 Intel Corporation
//
// 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.

#pragma once

#include <stddef.h>
#include <stdint.h>

#include "waffle_visibility.h"

#ifdef __cplusplus
extern "C" {
#endif

/// @brief Convert a waffle_enum to a string.
///
/// For example, convert @c WAFFLE_OPENGL to @c "WAFFLE_OPENGL" .
///
/// @return null if enum is invalid.
WAFFLE_API const char*
waffle_enum_to_string(int32_t e);

/// @brief All non-error enums used by waffle.
///
/// All enums are placed in one list so that each has a distinct value. This
/// enables better error detection at API entry points.
enum waffle_enum {
    WAFFLE_LIST_END                     = 0x0000,
    WAFFLE_DONT_CARE                    = 0x0001,

    /// @defgroup enums for waffle_init()
    /// @{

    WAFFLE_PLATFORM                     = 0x0010,
        WAFFLE_PLATFORM_ANDROID         = 0x0011,
        WAFFLE_PLATFORM_COCOA           = 0x0012,
        WAFFLE_PLATFORM_GLX             = 0x0013,
        WAFFLE_PLATFORM_WAYLAND         = 0x0014,
        WAFFLE_PLATFORM_X11_EGL         = 0x0015,

    WAFFLE_OPENGL_API                   = 0x0100,
        WAFFLE_OPENGL                   = 0x0101,
        WAFFLE_OPENGL_ES1               = 0x0102,
        WAFFLE_OPENGL_ES2               = 0x0103,

    /// @}
    /// @defgroup enums for waffle_config_choose()
    ///
    /// Choices for @c WAFFLE_DOUBLE_BUFFERED are 0 and 1; the default is 1.
    /// For all other attributes, the default is 0.
    /// @{

    WAFFLE_RED_SIZE                     = 0x0201,
    WAFFLE_GREEN_SIZE                   = 0x0202,
    WAFFLE_BLUE_SIZE                    = 0x0203,
    WAFFLE_ALPHA_SIZE                   = 0x0204,

    WAFFLE_DEPTH_SIZE                   = 0x0205,
    WAFFLE_STENCIL_SIZE                 = 0x0206,

    WAFFLE_SAMPLE_BUFFERS               = 0x0207,
    WAFFLE_SAMPLES                      = 0x0208,

    WAFFLE_DOUBLE_BUFFERED              = 0x0209,

    /// @}
};

#ifdef __cplusplus
} // end extern "C"
#endif