1 
2 //          Copyright 2018 - 2021 Michael D. Parker
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          http://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.opengl.bind.gl32;
8 
9 import bindbc.opengl.config;
10 static if(glSupport >= GLSupport.gl32) {
11     import bindbc.loader : SharedLib;
12     import bindbc.opengl.context;
13     import bindbc.opengl.bind.types;
14 
15     enum : uint {
16         GL_CONTEXT_CORE_PROFILE_BIT       = 0x00000001,
17         GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002,
18         GL_LINES_ADJACENCY                = 0x000A,
19         GL_LINE_STRIP_ADJACENCY           = 0x000B,
20         GL_TRIANGLES_ADJACENCY            = 0x000C,
21         GL_TRIANGLE_STRIP_ADJACENCY       = 0x000D,
22         GL_PROGRAM_POINT_SIZE             = 0x8642,
23         GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29,
24         GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7,
25         GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8,
26         GL_GEOMETRY_SHADER                = 0x8DD9,
27         GL_GEOMETRY_VERTICES_OUT          = 0x8916,
28         GL_GEOMETRY_INPUT_TYPE            = 0x8917,
29         GL_GEOMETRY_OUTPUT_TYPE           = 0x8918,
30         GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF,
31         GL_MAX_GEOMETRY_OUTPUT_VERTICES   = 0x8DE0,
32         GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1,
33         GL_MAX_VERTEX_OUTPUT_COMPONENTS   = 0x9122,
34         GL_MAX_GEOMETRY_INPUT_COMPONENTS  = 0x9123,
35         GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124,
36         GL_MAX_FRAGMENT_INPUT_COMPONENTS  = 0x9125,
37         GL_CONTEXT_PROFILE_MASK           = 0x9126,
38     }
39 
40     extern(System) @nogc nothrow {
41         alias pglGetInteger64i_v = void function(GLenum,GLuint,GLint64*);
42         alias pglGetBufferParameteri64v = void function(GLenum,GLenum,GLint64*);
43         alias pglFramebufferTexture = void function(GLenum,GLenum,GLuint,GLint);
44     }
45 
46     __gshared {
47         pglGetInteger64i_v glGetInteger64i_v;
48         pglGetBufferParameteri64v glGetBufferParameteri64v;
49         pglFramebufferTexture glFramebufferTexture;
50     }
51 
52     package(bindbc.opengl) @nogc nothrow
53     bool loadGL32(SharedLib lib, GLSupport contextVersion)
54     {
55         import bindbc.opengl.bind.arb : loadARB32;
56 
57         if(contextVersion >= GLSupport.gl32) {
58             lib.bindGLSymbol(cast(void**)&glGetInteger64i_v, "glGetInteger64i_v");
59             lib.bindGLSymbol(cast(void**)&glGetBufferParameteri64v, "glGetBufferParameteri64v");
60             lib.bindGLSymbol(cast(void**)&glFramebufferTexture, "glFramebufferTexture");
61 
62             if(errorCountGL() == 0 && loadARB32(lib, contextVersion)) return true;
63         }
64         return false;
65     }
66 }