glstuff

experiments with opengl2/ogles2/sdl
git clone http://frotz.net/git/glstuff.git
Log | Files | Refs

debugtext.h (1164B)


      1 /* Copyright 2013 Brian Swetland <swetland@frotz.net>
      2  *
      3  * Licensed under the Apache License, Version 2.0 (the "License");
      4  * you may not use this file except in compliance with the License.
      5  * You may obtain a copy of the License at
      6  *
      7  *     http://www.apache.org/licenses/LICENSE-2.0
      8  *
      9  * Unless required by applicable law or agreed to in writing, software
     10  * distributed under the License is distributed on an "AS IS" BASIS,
     11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12  * See the License for the specific language governing permissions and
     13  * limitations under the License.
     14  */
     15 
     16 #ifndef _DEBUG_TEXT_H_
     17 #define _DEBUG_TEXT_H_
     18 
     19 #include "program.h"
     20 
     21 struct DebugTextCell;
     22 
     23 class DebugText {
     24 private:
     25 	unsigned char *cbdata;
     26 	unsigned cbw, cbh;
     27 
     28 	void *fontdata;
     29 	unsigned fdw, fdh;
     30 
     31 	Program pgm;
     32 
     33 	struct DebugTextCell *data;
     34 
     35 	GLuint tex0, tex1, vbo;
     36 	GLuint aVertex, aTexCoord;
     37 	GLuint uMVP, uTex0, uTex1;
     38 
     39 	unsigned cx, cy;
     40 	unsigned dirty;
     41 
     42 public:
     43 	int init(unsigned w, unsigned h);
     44 	int render(void);
     45 
     46 	void clear(void);
     47 	void putch(unsigned c);
     48 	void puts(const char *s);
     49 	void printf(const char *fmt, ...);
     50 };
     51 
     52 #endif
     53