MCPcopy Create free account
hub / github.com/Tencent/tgfx / MakeNativeInterface

Method MakeNativeInterface

src/gpu/opengl/GLInterface.cpp:59–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59std::shared_ptr<GLInterface> GLInterface::MakeNativeInterface(const GLProcGetter* getter) {
60 auto getString = reinterpret_cast<GLGetString*>(getter->getProcAddress("glGetString"));
61 if (getString == nullptr) {
62 return nullptr;
63 }
64 auto getIntegerv = reinterpret_cast<GLGetIntegerv*>(getter->getProcAddress("glGetIntegerv"));
65 if (getIntegerv == nullptr) {
66 return nullptr;
67 }
68 auto getShaderPrecisionFormat = reinterpret_cast<GLGetShaderPrecisionFormat*>(
69 getter->getProcAddress("glGetShaderPrecisionFormat"));
70 auto getStringi = reinterpret_cast<GLGetStringi*>(getter->getProcAddress("glGetStringi"));
71 auto getInternalformativ =
72 reinterpret_cast<GLGetInternalformativ*>(getter->getProcAddress("glGetInternalformativ"));
73 GLInfo info(getString, getStringi, getIntegerv, getInternalformativ, getShaderPrecisionFormat);
74 auto functions = std::make_unique<GLFunctions>();
75 functions->activeTexture =
76 reinterpret_cast<GLActiveTexture*>(getter->getProcAddress("glActiveTexture"));
77 functions->attachShader =
78 reinterpret_cast<GLAttachShader*>(getter->getProcAddress("glAttachShader"));
79 functions->bindAttribLocation =
80 reinterpret_cast<GLBindAttribLocation*>(getter->getProcAddress("glBindAttribLocation"));
81 functions->bindBuffer = reinterpret_cast<GLBindBuffer*>(getter->getProcAddress("glBindBuffer"));
82 functions->bindFramebuffer =
83 reinterpret_cast<GLBindFramebuffer*>(getter->getProcAddress("glBindFramebuffer"));
84 functions->bindRenderbuffer =
85 reinterpret_cast<GLBindRenderbuffer*>(getter->getProcAddress("glBindRenderbuffer"));
86 functions->bindTexture =
87 reinterpret_cast<GLBindTexture*>(getter->getProcAddress("glBindTexture"));
88 functions->blendColor = reinterpret_cast<GLBlendColor*>(getter->getProcAddress("glBlendColor"));
89 functions->blendEquation =
90 reinterpret_cast<GLBlendEquation*>(getter->getProcAddress("glBlendEquation"));
91 functions->blendEquationSeparate =
92 reinterpret_cast<GLBlendEquationSeparate*>(getter->getProcAddress("glBlendEquationSeparate"));
93 functions->blendFunc = reinterpret_cast<GLBlendFunc*>(getter->getProcAddress("glBlendFunc"));
94 functions->blendFuncSeparate =
95 reinterpret_cast<GLBlendFuncSeparate*>(getter->getProcAddress("glBlendFuncSeparate"));
96 functions->bufferData = reinterpret_cast<GLBufferData*>(getter->getProcAddress("glBufferData"));
97 functions->bufferSubData =
98 reinterpret_cast<GLBufferSubData*>(getter->getProcAddress("glBufferSubData"));
99 functions->checkFramebufferStatus = reinterpret_cast<GLCheckFramebufferStatus*>(
100 getter->getProcAddress("glCheckFramebufferStatus"));
101 functions->clear = reinterpret_cast<GLClear*>(getter->getProcAddress("glClear"));
102 functions->clearColor = reinterpret_cast<GLClearColor*>(getter->getProcAddress("glClearColor"));
103 functions->clearDepthf =
104 reinterpret_cast<GLClearDepthf*>(getter->getProcAddress("glClearDepthf"));
105 functions->clearStencil =
106 reinterpret_cast<GLClearStencil*>(getter->getProcAddress("glClearStencil"));
107 functions->colorMask = reinterpret_cast<GLColorMask*>(getter->getProcAddress("glColorMask"));
108 functions->compileShader =
109 reinterpret_cast<GLCompileShader*>(getter->getProcAddress("glCompileShader"));
110 functions->compressedTexImage2D =
111 reinterpret_cast<GLCompressedTexImage2D*>(getter->getProcAddress("glCompressedTexImage2D"));
112 functions->compressedTexSubImage2D = reinterpret_cast<GLCompressedTexSubImage2D*>(
113 getter->getProcAddress("glCompressedTexSubImage2D"));
114 functions->copyTexSubImage2D =
115 reinterpret_cast<GLCopyTexSubImage2D*>(getter->getProcAddress("glCopyTexSubImage2D"));
116 functions->createProgram =

Callers

nothing calls this directly

Calls 5

GLAssembleGLInterfaceFunction · 0.85
GLAssembleGLESInterfaceFunction · 0.85
GLAssembleWebGLInterfaceFunction · 0.85
getProcAddressMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected