Mercurial > hg > Game > Cerium
changeset 929:21be2f7e13ff draft
adjust glOrtho
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 30 Jul 2010 21:14:53 +0900 |
parents | aaf3c4a83fbe |
children | b58861019a28 |
files | Renderer/Engine/viewerGL.cc Renderer/Engine/viewerGL.h |
diffstat | 2 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/viewerGL.cc Fri Jul 30 18:24:08 2010 +0900 +++ b/Renderer/Engine/viewerGL.cc Fri Jul 30 21:14:53 2010 +0900 @@ -125,7 +125,7 @@ glMatrixMode( GL_PROJECTION ); glLoadIdentity( ); - glOrtho( -1000.0, 1000.0, 1000.0, -1000.0, -1000.0, 1000.0 ); + glOrtho( 0.0, width, height, 0.0, OPENGL_PARAM::near, OPENGL_PARAM::far ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity( ); @@ -184,8 +184,11 @@ texture = sg->texture_image; image = SDL_GL_LoadTexture(texture); + glBindTexture(GL_TEXTURE_2D, image); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, image); + glEnable(GL_BLEND); glBegin( GL_TRIANGLES); for (int i = 0; i < sg->size; i += 3) { xyz1[0] = sg->coord_xyz[(i+0)*3]; @@ -255,6 +258,7 @@ obj_draw(xyz3, tex_xy3, normal3); } glEnd( ); + glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); }
--- a/Renderer/Engine/viewerGL.h Fri Jul 30 18:24:08 2010 +0900 +++ b/Renderer/Engine/viewerGL.h Fri Jul 30 21:14:53 2010 +0900 @@ -22,6 +22,11 @@ #include "lindaapi.h" +namespace OPENGL_PARAM { + static const double near = -500.0; + static const double far = 0.0; +} + class cViewerGL : public Viewer { public: cViewerGL(TaskManager *m, int b, int w, int h, int _num);