blob: 85cbfa2f0288daa29fdfccc3122794c1bb9a3384 [file] [log] [blame]
[email protected]b9363b22010-06-09 22:06:151// Copyright (c) 2010 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef APP_GFX_GL_GL_IMPLEMENTATION_H_
6#define APP_GFX_GL_GL_IMPLEMENTATION_H_
7
[email protected]30aa5c1a2010-07-14 20:47:048#include <string>
9
10#include "base/native_library.h"
11#include "build/build_config.h"
12
[email protected]b9363b22010-06-09 22:06:1513namespace gfx {
14
15// The GL implementation currently in use.
16enum GLImplementation {
17 kGLImplementationNone,
18 kGLImplementationDesktopGL,
19 kGLImplementationOSMesaGL,
20 kGLImplementationEGLGLES2,
21 kGLImplementationMockGL
22};
23
[email protected]30aa5c1a2010-07-14 20:47:0424#if defined(OS_WIN)
25typedef void* (WINAPI *GLGetProcAddressProc)(const char* name);
26#else
27typedef void* (*GLGetProcAddressProc)(const char* name);
28#endif
29
[email protected]b9363b22010-06-09 22:06:1530// Initialize a particular GL implementation.
31bool InitializeGLBindings(GLImplementation implementation);
32
[email protected]30aa5c1a2010-07-14 20:47:0433// Set the current GL implementation.
34void SetGLImplementation(GLImplementation implementation);
35
[email protected]b9363b22010-06-09 22:06:1536// Get the current GL implementation.
37GLImplementation GetGLImplementation();
38
[email protected]30aa5c1a2010-07-14 20:47:0439// Get the GL implementation with a given name.
40GLImplementation GetNamedGLImplementation(const std::wstring& name);
41
42// Initialize the preferred GL binding from the given list. The preferred GL
43// bindings depend on command line switches passed by the user and which GL
44// implementations are available and working on the system
45bool InitializeBestGLBindings(
46 const GLImplementation* allowed_implementations_begin,
47 const GLImplementation* allowed_implementations_end);
48
49// Add a native library to those searched for GL entry points.
50void AddGLNativeLibrary(base::NativeLibrary library);
51
52// Set an additional function that will be called to find GL entry points.
53void SetGLGetProcAddressProc(GLGetProcAddressProc proc);
54
[email protected]b9363b22010-06-09 22:06:1555// Find an entry point in the current GL implementation.
56void* GetGLProcAddress(const char* name);
57
58} // namespace gfx
59
60#endif // APP_GFX_GL_GL_IMPLEMENTATION_H_