citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

gl_atlas.h (1226B)


      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, Maysum Panju
     17  */
     18 #ifndef DEMO_ATLAS_H
     19 #define DEMO_ATLAS_H
     20 
     21 #include "demo-common.h"
     22 
     23 
     24 namespace citrun {
     25 
     26 class gl_atlas {
     27 	GLuint		 tex_unit;
     28 	GLuint		 tex_name;
     29 	GLuint		 tex_w;
     30 	GLuint		 tex_h;
     31 	GLuint		 item_w;
     32 	GLuint		 item_h_q; /* height quantum */
     33 	GLuint		 cursor_x;
     34 	GLuint		 cursor_y;
     35 
     36 public:
     37 			 gl_atlas(unsigned int, unsigned int, unsigned int, unsigned int);
     38 			~gl_atlas();
     39 
     40 	void		 alloc(glyphy_rgba_t *, unsigned int, unsigned int *, unsigned int *);
     41 	void		 bind_texture();
     42 	void		 set_uniforms();
     43 };
     44 
     45 } // namespace citrun
     46 
     47 #endif /* DEMO_ATLAS_H */