# -*- mode: conf -*-
#
# Format of this file:
#
# Anything after # is a comment
#
# use [optional] Function | Function | ... [ifdef SYMBOL]
#
#     Load OpenGL function. Try the listed alternatives if the
#     function is not available. Aliased functions will be tried
#     automatically, no need to list them here. If optional is
#     specified, absence of the function will not be fatal (zero
#     pointer will result). If ifdef SYMBOL is specified, the function
#     will only be loaded if SYMBOL is defined.
#
# require item | item | ...
#
#     Items are OpenGL extension names; the first item can be an
#     OpenGL core version instead. Require that the OpenGL version is
#     at least the specified value or that one of the extensions is
#     present. Extensions needed for functions loaded with "use" will
#     be checked for automatically, no need to add "require" lines for
#     them.
#
# glsl x.y
#
#     Require GLSL version at least x.y.
#
# enum extension
#
#     Emit enum defines for specified extension without requiring the
#     extension to be present.
#
# non-gles ENUM_MEMBER
#
#     Emit the specified enum member even though it's not part of
#     OpenGL ES. The member will be defined as non_gles_GL_ENUM_MEMBER
#     instead of GL_ENUM_MEMBER for extra safety.
#
# typedef Typename [ifdef SYMBOL]
#
#     Emit the specified typedef. If ifdef SYMBOL is specified, the
#     typedef will only be exposed if SYMBOL is defined.

require 1.2
glsl 1.20

# OpenGL 1.0

use BlendFunc
use Clear
use ClearColor
use ClearDepth
use ClearStencil
use ColorMask
use CullFace
use DepthFunc
use DepthMask
use DepthRange
use Disable
use Enable
use Finish
use Flush
use FrontFace
use GetError
use GetFloatv
use GetIntegerv
use GetString
use Hint
use PixelStorei
use ReadPixels
use Scissor
use StencilFunc
use StencilMask
use StencilOp
use GetTexParameteriv
use TexParameteri
use Viewport

# OpenGL 1.1

use BindTexture
use CopyTexSubImage2D
use DeleteTextures
use DrawArrays
use DrawElements
use GenTextures
use PolygonOffset
use TexImage2D
use TexSubImage2D

# OpenGL 1.2

use BlendColor
use BlendEquation

non-gles BGRA

# OpenGL 1.3

use ActiveTexture

require 1.3 | ARB_multisample
require 1.3 | ARB_texture_cube_map

# OpenGL 1.4

use BlendFuncSeparate

require 1.4 | ARB_depth_texture | SGIX_depth_texture
require 1.4 | ARB_texture_mirrored_repeat | IBM_texture_mirrored_repeat
require 1.4 | EXT_stencil_wrap
require 1.4 | SGIS_generate_mipmap

non-gles DEPTH_COMPONENT24

# OpenGL 1.5

use BindBuffer
use BufferData
use BufferSubData
use DeleteBuffers
use GenBuffers

# OpenGL 2.0

require 2.0 | ARB_fragment_shader | ATI_fragment_shader
require 2.0 | ARB_point_sprite | NV_point_sprite
require 2.0 | ARB_shading_language_100
require 2.0 | ARB_texture_non_power_of_two

enum ARB_fragment_program # Some ARB_fragment_program enums are shared with ARB_vertex_program

use AttachShader
use BindAttribLocation
use BlendEquationSeparate
use CompileShader
use CreateProgram
use CreateShader
use DeleteProgram | DeleteObjectARB
use DeleteShader | DeleteObjectARB
use DetachShader
use DisableVertexAttribArray
use EnableVertexAttribArray
use GetActiveAttrib
use GetActiveUniform
use GetAttribLocation
use GetProgramInfoLog | GetInfoLogARB
use GetProgramiv | GetProgramivARB
use GetShaderInfoLog | GetInfoLogARB
use GetShaderiv | GetObjectParameterivARB
use GetUniformLocation
use GetUniformfv
use GetUniformiv
use LinkProgram
use ShaderSource
use StencilFuncSeparate
use StencilOpSeparate
use Uniform1f
use Uniform1fv
use Uniform1i
use Uniform1iv
use Uniform2f
use Uniform2fv
use Uniform2i
use Uniform2iv
use Uniform3f
use Uniform3fv
use Uniform3i
use Uniform3iv
use Uniform4f
use Uniform4fv
use Uniform4i
use Uniform4iv
use UniformMatrix2fv
use UniformMatrix3fv
use UniformMatrix4fv
use UseProgram
use ValidateProgram
use VertexAttrib1f
use VertexAttrib1fv
use VertexAttrib2f
use VertexAttrib2fv
use VertexAttrib3f
use VertexAttrib3fv
use VertexAttrib4f
use VertexAttrib4fv
use VertexAttribPointer

non-gles MAX_FRAGMENT_UNIFORM_COMPONENTS
non-gles MAX_VARYING_FLOATS
non-gles MAX_VERTEX_UNIFORM_COMPONENTS
non-gles POINT_SPRITE
non-gles VERTEX_PROGRAM_POINT_SIZE

# ARB_framebuffer_object

require ARB_framebuffer_object | EXT_packed_depth_stencil

use BindFramebuffer | BindFramebufferEXT   # not aliased in gl.spec for some reason
use BindRenderbuffer | BindRenderbufferEXT # not aliased in gl.spec for some reason
use CheckFramebufferStatus
use DeleteFramebuffers
use DeleteRenderbuffers
use FramebufferRenderbuffer
use FramebufferTexture2D
use GenFramebuffers
use GenRenderbuffers
use GenerateMipmap
use GetRenderbufferParameteriv
use RenderbufferStorage

use optional BlitFramebuffer
use optional RenderbufferStorageMultisample

non-gles DEPTH24_STENCIL8
non-gles DEPTH_STENCIL_ATTACHMENT
non-gles DRAW_FRAMEBUFFER
non-gles MAX_SAMPLES

# ARB_map_buffer_range (included in core 3.0)

enum ARB_map_buffer_range
use optional MapBufferRange
use optional UnmapBuffer

non-gles MAP_WRITE_BIT
non-gles MAP_INVALIDATE_RANGE_BIT
non-gles MAP_UNSYNCHRONIZED_BIT

# ARB_sync (included in core 3.2)

enum ARB_sync
use optional FenceSync
use optional GetSynciv
use optional DeleteSync

non-gles SYNC_GPU_COMMANDS_COMPLETE
non-gles SIGNALED
non-gles SYNC_STATUS

# Miscellaneous

use optional BindFragDataLocationIndexed
use optional StringMarkerGREMEDY ifdef VEGA_ENABLE_PERF_EVENTS

use optional DebugMessageCallbackARB ifdef VEGA_GL_DEBUG_CONTEXT
typedef GLDEBUGPROCARB ifdef VEGA_GL_DEBUG_CONTEXT

# For subpixel blending

non-gles SRC1_COLOR
non-gles SRC1_ALPHA
non-gles ONE_MINUS_SRC1_COLOR
non-gles ONE_MINUS_SRC1_ALPHA
