citrun

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

gl_state.h (1431B)


      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_GLSTATE_H
     19 #define DEMO_GLSTATE_H
     20 
     21 #include "demo-common.h"
     22 #include "gl_atlas.h"		// citrun::gl_atlas
     23 #include "gl_shader.h"
     24 
     25 
     26 namespace citrun {
     27 
     28 class gl_state {
     29 	citrun::gl_shader shader;
     30 	GLuint		 program;
     31 	citrun::gl_atlas atlas;
     32 
     33 	/* Uniforms */
     34 	double		 u_debug;
     35 	double		 u_contrast;
     36 	double		 u_gamma_adjust;
     37 	double		 u_outline;
     38 	double		 u_outline_thickness;
     39 	double		 u_boldness;
     40 public:
     41 			 gl_state();
     42 			~gl_state();
     43 
     44 	void		 setup();
     45 	citrun::gl_atlas &get_atlas();
     46 	void		 scale_gamma_adjust(double);
     47 	void		 scale_contrast(double);
     48 	void		 toggle_debug();
     49 	void		 set_matrix(float[16]);
     50 	void		 toggle_outline();
     51 	void		 scale_outline_thickness(double);
     52 	void		 adjust_boldness(double);
     53 };
     54 
     55 } // namespace citrun
     56 
     57 #endif /* DEMO_GLSTATE_H */