dungeon_crawler
diff prototype/src/cmdcon.cc @ 26:21999ef6636b
lalala
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 25 Aug 2012 04:07:51 +0300 |
parents | 527fede30057 |
children | 2fc004802739 |
line diff
1.1 --- a/prototype/src/cmdcon.cc Sat Aug 25 02:16:08 2012 +0300 1.2 +++ b/prototype/src/cmdcon.cc Sat Aug 25 04:07:51 2012 +0300 1.3 @@ -25,6 +25,7 @@ 1.4 return false; 1.5 } 1.6 1.7 + printf("loading font: %s\n", path); 1.8 if(!(font = dtx_open_font(path, 12))) { 1.9 fprintf(stderr, "failed to open font file: %s\n", path); 1.10 return false; 1.11 @@ -71,19 +72,25 @@ 1.12 1.13 void draw_cmdcon() 1.14 { 1.15 + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 1.16 + 1.17 glMatrixMode(GL_PROJECTION); 1.18 glPushMatrix(); 1.19 glLoadIdentity(); 1.20 - glOrtho(0, cfg.width, -cfg.height, 0, -1, 1); 1.21 + //glOrtho(0, cfg.width, cfg.height, 0, -1, 1); 1.22 + glOrtho(-cfg.width / 2.0, cfg.width / 2.0, -cfg.height / 2.0, cfg.height / 2.0, -1, 1); 1.23 glMatrixMode(GL_MODELVIEW); 1.24 glPushMatrix(); 1.25 glLoadIdentity(); 1.26 1.27 + //glTranslatef(100, 100, 0); 1.28 + 1.29 glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT); 1.30 - glEnable(GL_BLEND); 1.31 + glUseProgram(0); 1.32 glDisable(GL_DEPTH_TEST); 1.33 glDisable(GL_LIGHTING); 1.34 - glUseProgram(0); 1.35 + glDisable(GL_CULL_FACE); 1.36 + glEnable(GL_BLEND); 1.37 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 1.38 1.39 glBegin(GL_QUADS); 1.40 @@ -94,8 +101,6 @@ 1.41 glVertex2f(-10, 10); 1.42 glEnd(); 1.43 1.44 - glTranslatef(cfg.width / 2, cfg.height / 2, 0); 1.45 - 1.46 glColor4f(0.2, 0.9, 0.3, 1.0); 1.47 dtx_string(cmdline.c_str()); 1.48 dtx_flush();