1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Fence.h: Defines the Fence class, which supports the GL_NV_fence extension. 16 17 #ifndef LIBGL_FENCE_H_ 18 #define LIBGL_FENCE_H_ 19 20 #define _GDI32_ 21 #include <windows.h> 22 #include <GL/GL.h> 23 #include <GL/glext.h> 24 25 namespace gl 26 { 27 28 class Fence 29 { 30 public: 31 Fence(); 32 virtual ~Fence(); 33 34 GLboolean isFence(); 35 void setFence(GLenum condition); 36 GLboolean testFence(); 37 void finishFence(); 38 void getFenceiv(GLenum pname, GLint *params); 39 40 private: 41 bool mQuery; 42 GLenum mCondition; 43 GLboolean mStatus; 44 }; 45 46 } 47 48 #endif // LIBGL_FENCE_H_ 49