gl_shader.h (1206B)
1 /* 2 * Copyright 2012 Google, Inc. All Rights Reserved. 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 * Google Author(s): Behdad Esfahbod 17 */ 18 #ifndef DEMO_SHADERS_H 19 #define DEMO_SHADERS_H 20 21 #include <vector> 22 23 #include "demo-common.h" 24 #include "gl_font.h" // citrun::glyph_info_t 25 26 27 namespace citrun { 28 29 struct glyph_vertex_t { 30 /* Position */ 31 GLfloat x; 32 GLfloat y; 33 /* Glyph info */ 34 GLfloat g16hi; 35 GLfloat g16lo; 36 }; 37 38 class gl_shader { 39 public: 40 gl_shader(); 41 42 void add_glyph_vertices (const glyphy_point_t &, 43 double, 44 citrun::glyph_info_t *, 45 std::vector<glyph_vertex_t> *, 46 glyphy_extents_t *); 47 GLuint create_program(); 48 }; 49 50 } // namespace citrun 51 52 #endif /* DEMO_SHADERS_H */