1*e01b6f76SAndroid Build Coastguard Worker /* 2*e01b6f76SAndroid Build Coastguard Worker * Copyright (C) 2013 The Android Open Source Project 3*e01b6f76SAndroid Build Coastguard Worker * 4*e01b6f76SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*e01b6f76SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*e01b6f76SAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*e01b6f76SAndroid Build Coastguard Worker * 8*e01b6f76SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*e01b6f76SAndroid Build Coastguard Worker * 10*e01b6f76SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*e01b6f76SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*e01b6f76SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*e01b6f76SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*e01b6f76SAndroid Build Coastguard Worker * limitations under the License. 15*e01b6f76SAndroid Build Coastguard Worker */ 16*e01b6f76SAndroid Build Coastguard Worker 17*e01b6f76SAndroid Build Coastguard Worker #ifndef _GL_UTIL_H_ 18*e01b6f76SAndroid Build Coastguard Worker #define _GL_UTIL_H_ 19*e01b6f76SAndroid Build Coastguard Worker 20*e01b6f76SAndroid Build Coastguard Worker /* convenience */ 21*e01b6f76SAndroid Build Coastguard Worker 22*e01b6f76SAndroid Build Coastguard Worker GLuint load_program(const char *vert_src, const char *frag_src); 23*e01b6f76SAndroid Build Coastguard Worker void matrix_init_ortho(GLfloat *m, float w, float h); 24*e01b6f76SAndroid Build Coastguard Worker 25*e01b6f76SAndroid Build Coastguard Worker /* context setup / teardown */ 26*e01b6f76SAndroid Build Coastguard Worker 27*e01b6f76SAndroid Build Coastguard Worker int egl_create(EGLDisplay *_display, EGLSurface *_surface, int *_w, int *_h); 28*e01b6f76SAndroid Build Coastguard Worker void egl_destroy(EGLDisplay display, EGLSurface surface); 29*e01b6f76SAndroid Build Coastguard Worker 30*e01b6f76SAndroid Build Coastguard Worker /* internals needed by util.c */ 31*e01b6f76SAndroid Build Coastguard Worker 32*e01b6f76SAndroid Build Coastguard Worker struct CNativeWindow; 33*e01b6f76SAndroid Build Coastguard Worker struct CNativeWindow *cnw_create(void); 34*e01b6f76SAndroid Build Coastguard Worker void cnw_destroy(struct CNativeWindow *win); 35*e01b6f76SAndroid Build Coastguard Worker void cnw_info(struct CNativeWindow *win, 36*e01b6f76SAndroid Build Coastguard Worker unsigned *w, unsigned *h, unsigned *fmt); 37*e01b6f76SAndroid Build Coastguard Worker 38*e01b6f76SAndroid Build Coastguard Worker #endif 39