• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2010 The Chromium OS 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 BENCH_GL_GLX_STUFF_H_
6 #define BENCH_GL_GLX_STUFF_H_
7 
8 #include <GL/glx.h>
9 
10 #include "glinterface.h"
11 
12 class GLXInterface : public GLInterface {
13  public:
14   GLXInterface() : context_(NULL), fb_config_(NULL) {}
15   virtual ~GLXInterface() {}
16 
17   virtual bool Init();
18   virtual void Cleanup();
19   virtual XVisualInfo* GetXVisual();
20 
21   virtual void SwapBuffers();
22   virtual bool SwapInterval(int interval);
23 
24   virtual void CheckError();
25 
26   virtual bool MakeCurrent(const GLContext& context);
27   virtual const GLContext CreateContext();
28   virtual void DeleteContext(const GLContext& context);
29   virtual const GLContext& GetMainContext() { return context_; }
30 
31   const GLXFBConfig fb_config() const { return fb_config_; }
32 
33  private:
34   GLXContext context_;
35   GLXFBConfig fb_config_;
36 };
37 
38 #endif  // BENCH_GL_GLX_STUFF_H_
39