*** empty log message ***

svn path=/trunk/boinc/; revision=2341
This commit is contained in:
Oliver Wang 2003-09-19 22:40:32 +00:00
parent b45639d97b
commit 931bec76fb
3 changed files with 95 additions and 36 deletions

View File

@ -459,9 +459,6 @@ void draw_text_new(
if (q) *q = 0;
glRasterPos3d(pos[0],pos[1],pos[2]);
print_text(listBase, p);
// draw_text_start(pos, char_height, line_width);
/// draw_text_line_aux(p);
// draw_text_end();
pos[1] -= line_spacing;
if (!q) break;
p = q+1;
@ -759,7 +756,7 @@ void draw_texture(float* p, float* size) {
//star drawing functions -<oliver wang>-
#define STARFIELD_SIZE 1000
#define STAR_SPEED 80.0f
#define STAR_SPEED 20.0f
#define PI 3.14159265358979323846264
//pointer to the begining of the list
@ -841,10 +838,15 @@ void update_stars()
continue;
}
// tmpStar->x+=(0)*tmpStar->v*STAR_SPEED;
// tmpStar->y+=(0)*tmpStar->v*STAR_SPEED;
// tmpStar->z+=(1)*tmpStar->v*STAR_SPEED;
tmpStar->x+=(eye[0])*tmpStar->v*STAR_SPEED;
tmpStar->y+=(eye[1])*tmpStar->v*STAR_SPEED;
tmpStar->z+=(eye[2])*tmpStar->v*STAR_SPEED;
//grow objects as the approach you
if(dist>900) glPointSize(1.0f);

View File

@ -278,7 +278,7 @@ void REDUCED_ARRAY::draw_row_rect_x(DrawType type,int row)
glBegin(GL_QUADS);
for (i=0; i<rdimx; i++) {
x0 = draw_pos[0] + (draw_size[0]*i)/rdimx;
x1 = x0 + draw_deltax*.8f;
x1 = x0 + draw_deltax*.95f;
h = (row0[i]-rdata_min)/(rdata_max-rdata_min);
y0 = draw_pos[1];
@ -328,6 +328,7 @@ void REDUCED_ARRAY::draw_row_rect_x(DrawType type,int row)
//draw lines
mode_unshaded();
glLineWidth(.8f);
glBegin(GL_LINES);
@ -394,13 +395,19 @@ void REDUCED_ARRAY::draw_row_rect_x(DrawType type,int row)
glEnd();
break;
case TYPE_SURFACE:
glBegin(GL_QUAD_STRIP);
z0 = draw_pos[2] + (draw_size[2]*row)/rdimy;
z1 = z0+.14f;
row0 = rrow(row);
trow=row-1;
trow=row-1;
if(row!=0) trow0 = rrow(trow);
int i;
//close left hand side
glVertex3f(draw_pos[0],draw_pos[1],z0);
glVertex3f(draw_pos[0],draw_pos[1],draw_pos[2] + (draw_size[2]*trow)/rdimy);
for (i=0; i<rdimx; i++) {
x0 = draw_pos[0] + (draw_size[0]*i)/rdimx;
x1 = x0 + draw_deltax*.8f;
@ -418,7 +425,49 @@ void REDUCED_ARRAY::draw_row_rect_x(DrawType type,int row)
glColor4f(color.r, color.g, color.b, alpha);
glVertex3f(x0+((x1-x0)/2.0f), y1, z0);
}
if(row==0)
{
glVertex3f(x0,y0,z1); //close up back
}
else
{
float h2 = (trow0[i]-rdata_min)/(rdata_max-rdata_min);
float z2 = draw_pos[2] + (draw_size[2]*trow)/rdimy;
float y2 = draw_pos[1] + draw_size[1]*h2;
glVertex3f(x0+((x1-x0)/2.0f), y2, z2);
}
}
//close up right
glVertex3f(draw_pos[0]+draw_size[0],draw_pos[1],z0);
glVertex3f(draw_pos[0]+draw_size[0],draw_pos[1],draw_pos[2] + (draw_size[2]*trow)/rdimy);
glEnd();
glBegin(GL_QUAD_STRIP); //close up front
for (i=0; i<rdimx; i++) {
x0 = draw_pos[0] + (draw_size[0]*i)/rdimx;
x1 = x0 + draw_deltax*.8f;
h = (row0[i]-rdata_min)/(rdata_max-rdata_min);
y0 = draw_pos[1];
y1 = draw_pos[1] + draw_size[1]*h;
double hue = hue0 + (dhue*i)/rdimx;
if (hue > 1) hue -= 1;
double sat = 1.;
double lum = .5 + h/2;
COLOR color;
HLStoRGB(hue, lum, sat, color);
glColor4f(color.r, color.g, color.b, alpha);
glVertex3f(x0+((x1-x0)/2.0f), y1, z0);
float z2 = draw_pos[2] + (draw_size[2]*row+1)/rdimy;
float y2 = draw_pos[1];
if(i==0) glVertex3f(x0,y2,z2);
else if(i==rdimx-1) glVertex3f(x0+((x1-x0)/2.0f),y2,z2);
else glVertex3f(x0+((x1-x0)/2.0f), y2, z2);
}
glEnd();
break;
case TYPE_WAVE:
z0 = draw_pos[2] + (draw_size[2]*row)/rdimy;
@ -426,6 +475,7 @@ void REDUCED_ARRAY::draw_row_rect_x(DrawType type,int row)
row0 = rrow(row);
if(row!=0) trow0 = rrow(trow);
glEnable(GL_LINE_SMOOTH);
glBegin(GL_LINES);
glVertex3f(draw_pos[0],draw_pos[1],z0);
for (i=0; i<rdimx; i++) {
@ -458,13 +508,13 @@ void REDUCED_ARRAY::draw_row_rect_x(DrawType type,int row)
if(row==0)
{
float z2 = draw_pos[2] + (draw_size[2]*row-1)/rdimy;
float z2 = draw_pos[2] - (draw_size[2]*row)/rdimy;
float y2 = draw_pos[1];
glVertex3f(x0+((x1-x0)/2.0f), y1, z0);
glVertex3f(x0+((x1-x0)/2.0f), y2, z2);
}
if(row==rdimy-1)
if(row==rdimy-1) //last row
{
float z2 = draw_pos[2] + (draw_size[2]*row+1)/rdimy;
float y2 = draw_pos[1];
@ -476,6 +526,7 @@ void REDUCED_ARRAY::draw_row_rect_x(DrawType type,int row)
}
glVertex3f(x1,y0,z0);
glEnd();
glDisable(GL_LINE_SMOOTH);
break;
case TYPE_STRIP:
z0 = draw_pos[2] + (draw_size[2]*row)/rdimy;
@ -645,7 +696,8 @@ void REDUCED_ARRAY::draw_axis_labels()
void REDUCED_ARRAY::draw_axes() {
float adj=-.18f;
float adj2=-.18f;
float adj=0.0f;
// box
mode_unshaded();
@ -667,30 +719,30 @@ void REDUCED_ARRAY::draw_axes() {
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+adj);
//top square
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj2);
//connecting lines
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+adj2);
glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj2);
glEnd();
@ -706,13 +758,13 @@ void REDUCED_ARRAY::draw_axes() {
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glEnd();
@ -721,8 +773,8 @@ void REDUCED_ARRAY::draw_axes() {
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj);
glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2);
glEnd();
glDisable(GL_LINE_SMOOTH);
}
@ -806,7 +858,7 @@ void REDUCED_ARRAY::draw_labels()
print_text(listBase, "Frequency(HZ)");
glPopMatrix();
ortho_done();
}

View File

@ -19,6 +19,10 @@
#include "util.h"
#include "win_idle_tracker.h"
//remove if there are windows problems
#define WIN32_LEAN_AND_MEAN // This trims down the windows libraries.
#define WIN32_EXTRA_LEAN // Trims even farther.
static HDC hDC;
static HGLRC hRC;
static HWND hWnd=NULL; // Holds Our Window Handle
@ -43,7 +47,9 @@ DWORD WINAPI win_graphics_event_loop( LPVOID duff );
BOOL reg_win_class();
BOOL unreg_win_class();
bool KillWindow() {
bool KillWindow() {
if(hDC) app_unload_gl();
if (hRC) { // Do We Have A Rendering Context?
if (!wglMakeCurrent(NULL,NULL)) { // Are We Able To Release The DC And RC Contexts?
return false;
@ -65,8 +71,7 @@ bool KillWindow() {
return false;
hWnd=NULL; // Set hWnd To NULL
}
app_unload_gl();
return true;
}