mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2603
This commit is contained in:
parent
f1f3e1034d
commit
e5d891334a
30
api/gutil.C
30
api/gutil.C
|
@ -119,6 +119,23 @@ void mode_ortho() {
|
|||
scale_screen(viewport[2],viewport[3]);
|
||||
}
|
||||
|
||||
void mode_ortho_ratio() {
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
gluOrtho2D(0,4,0,3);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
gluLookAt(0.0,0.0,1.0, // eye position
|
||||
0,0,0, // where we're looking
|
||||
0.0, 1.0, 0.); // up is in positive Y direction
|
||||
int viewport[4];
|
||||
get_viewport(viewport);
|
||||
center_screen_ratio(viewport[2],viewport[3]);
|
||||
scale_screen(viewport[2],viewport[3]);
|
||||
}
|
||||
|
||||
void ortho_done() {
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
|
@ -340,6 +357,19 @@ void center_screen(int w,int h)
|
|||
}
|
||||
}
|
||||
|
||||
void center_screen_ratio(int w,int h)
|
||||
{
|
||||
double aspect_ratio = 4.0/3.0;
|
||||
if ((double)h*aspect_ratio > (double)w)
|
||||
{
|
||||
glTranslatef(0.0f*4.0f,(((double)h/2.0f-((double)w/aspect_ratio/2.0f))/(double)h)*3.0f,0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
glTranslatef((((double)w/2.0f-((double)h*aspect_ratio/2.0f))/(double)w)*4.0f,0.0f,0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void drawSphere(GLfloat* pos, GLfloat rad) {
|
||||
GLUquadricObj* x = gluNewQuadric();
|
||||
glPushMatrix();
|
||||
|
|
|
@ -38,6 +38,7 @@ extern void set_viewport_full(int w, int h);
|
|||
extern void set_viewport_fixed(int w, int h);
|
||||
extern void scale_screen(int w,int h);
|
||||
extern void center_screen(int w,int h);
|
||||
extern void center_screen_ratio(int w,int h);
|
||||
|
||||
|
||||
extern void drawSphere(float* pos, float rad);
|
||||
|
@ -83,6 +84,7 @@ extern void draw_text_panel(
|
|||
|
||||
extern void mode_texture();
|
||||
extern void mode_ortho();
|
||||
extern void mode_ortho_ratio();
|
||||
extern void mode_shaded(float*);
|
||||
extern void mode_unshaded();
|
||||
extern void mode_lines();
|
||||
|
|
|
@ -7192,3 +7192,11 @@ Karl 2003-10-28
|
|||
M lib/app_ipc.C
|
||||
M lib/app_ipc.h
|
||||
|
||||
Oliver 29 Oct 2003
|
||||
|
||||
- fixed improperly scaled logos
|
||||
|
||||
api/
|
||||
gutil.C,h
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue