mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 10:51:35 +00:00
This completely removes the dependency on glad by generating the GL headers from gl.xml directly. This requires adding khrplatform.h so all Khronos dependencies are gathered in third_party/khronos. Also removes a stray CMakeLists.txt that was still hanging out. BUG=dawn:165 Change-Id: Ia64bc51bc8b18c6b48613918e2f309f7405ecb3b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8163 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
//* Copyright 2019 The Dawn Authors
|
|
//*
|
|
//* 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.
|
|
|
|
#include "dawn_native/Error.h"
|
|
#include "dawn_native/opengl/opengl_platform.h"
|
|
|
|
namespace dawn_native { namespace opengl {
|
|
using GetProcAddress = void* (*) (const char*);
|
|
|
|
struct OpenGLFunctionsBase {
|
|
public:
|
|
{% for block in header_blocks %}
|
|
// {{block.description}}
|
|
{% for proc in block.procs %}
|
|
{{proc.PFNGLPROCNAME()}} {{proc.ProcName()}} = nullptr;
|
|
{% endfor %}
|
|
|
|
{% endfor%}
|
|
|
|
protected:
|
|
MaybeError LoadDesktopGLProcs(GetProcAddress getProc, int majorVersion, int minorVersion);
|
|
MaybeError LoadOpenGLESProcs(GetProcAddress getProc, int majorVersion, int minorVersion);
|
|
|
|
private:
|
|
template<typename T>
|
|
MaybeError LoadProc(GetProcAddress getProc, T* memberProc, const char* name);
|
|
};
|
|
|
|
}} // namespace dawn_native::opengl
|