1 // 2 // Copyright (c) 2017 The Khronos Group Inc. 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 #ifndef _setup_h 17 #define _setup_h 18 19 #include <stdio.h> 20 #include <stdlib.h> 21 #include <string.h> 22 #include "gl_headers.h" 23 #include <CL/cl.h> 24 25 26 // Note: the idea here is to have every platform define their own setup.cpp file that implements a GLEnvironment 27 // subclass internally, then return it as a definition for GLEnvironment::Create 28 29 class GLEnvironment 30 { 31 public: GLEnvironment()32 GLEnvironment() {} ~GLEnvironment()33 virtual ~GLEnvironment() {} 34 35 virtual int Init( int *argc, char **argv, int use_opengl_32 ) = 0; 36 virtual cl_context CreateCLContext( void ) = 0; 37 virtual int SupportsCLGLInterop( cl_device_type device_type) = 0; 38 39 // cleanup EGL environment properly when the test exit. 40 // This change does not affect any functionality of the test 41 virtual void terminate_egl_display() = 0; 42 43 static GLEnvironment * Instance( void ); 44 }; 45 46 #endif // _setup_h 47