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), 15 fb_config_(NULL) {} 16 virtual ~GLXInterface() {} 17 18 virtual bool Init(); 19 virtual void Cleanup(); 20 virtual XVisualInfo* GetXVisual(); 21 22 virtual void SwapBuffers(); 23 virtual bool SwapInterval(int interval); 24 25 virtual void CheckError(); 26 27 virtual bool MakeCurrent(const GLContext& context); 28 virtual const GLContext CreateContext(); 29 virtual void DeleteContext(const GLContext& context); 30 virtual const GLContext& GetMainContext() { 31 return context_; 32 } 33 34 const GLXFBConfig fb_config() const { 35 return fb_config_; 36 } 37 38 private: 39 GLXContext context_; 40 GLXFBConfig fb_config_; 41 }; 42 43 #endif // BENCH_GL_GLX_STUFF_H_ 44