mirror of https://github.com/BOINC/boinc.git
started moving graphics configurability to S@H
svn path=/trunk/boinc/; revision=2409
This commit is contained in:
parent
219c01e29e
commit
a3a4716946
|
@ -169,8 +169,8 @@ void throttled_app_render(int x, int y, double t) {
|
|||
bool ok_to_render;
|
||||
|
||||
// the following should be passed in via prefs
|
||||
double max_fps = 1;
|
||||
double max_gfx_cpu_frac = 0.2;
|
||||
double max_fps = 1000;
|
||||
double max_gfx_cpu_frac = 1.00;
|
||||
|
||||
ok_to_render = true;
|
||||
now = dtime();
|
||||
|
|
|
@ -47,6 +47,9 @@
|
|||
// There are two buffers, each with a "state" (see below).
|
||||
// In a given state, only one thread can access the data or change the state.
|
||||
//
|
||||
#ifndef GRAPHICS_DATA_H
|
||||
#define GRAPHICS_DATA_H
|
||||
|
||||
#define GB_STATE_IDLE 0
|
||||
#define GB_STATE_GENERATING 1
|
||||
#define GB_STATE_GENERATED 2
|
||||
|
@ -77,3 +80,5 @@ public:
|
|||
GRAPHICS_BUFFER* get_generate_buffer(bool first);
|
||||
void generate_done(GRAPHICS_BUFFER*);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
33
api/gutil.C
33
api/gutil.C
|
@ -22,14 +22,9 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
/* the old way... Use the defines below which should be set in
|
||||
* config.h
|
||||
* #include "gl/gl.h"
|
||||
* #include "gl/glu.h"
|
||||
* #include "gl/glut.h"
|
||||
*/
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GL_H
|
||||
|
@ -59,17 +54,6 @@
|
|||
#include <GLUT/glut.h>
|
||||
#endif
|
||||
|
||||
// the old way
|
||||
// #ifdef __APPLE_CC__
|
||||
// #include <OpenGL/gl.h>
|
||||
// #include <GLUT/glut.h>
|
||||
// #endif
|
||||
// #ifdef unix
|
||||
// #include <GL/gl.h>
|
||||
// #include <GL/glu.h>
|
||||
// #include <GL/glut.h>
|
||||
// #endif
|
||||
|
||||
#include "gutil.h"
|
||||
|
||||
GLfloat mat_diffuse[] = {0.7, 0.5, 1.0, 0.4};
|
||||
|
@ -258,16 +242,6 @@ bool get_matrix_invert(float src[16])
|
|||
src[i*4+3] = dst[i*4+3];
|
||||
}
|
||||
|
||||
/*
|
||||
char buf[512];
|
||||
sprintf(buf,"%f,%f,%f,%f\n%f,%f,%f,%f\n%f,%f,%f,%f\n%f,%f,%f,%f\n",
|
||||
dst[0],dst[1],dst[2],dst[3],
|
||||
dst[4],dst[5],dst[6],dst[7],
|
||||
dst[8],dst[9],dst[10],dst[11],
|
||||
dst[12],dst[13],dst[14],dst[15]);
|
||||
fprintf(stderr, "%s: modelview\n", buf);
|
||||
MessageBox(NULL,buf,"F",0);
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -751,7 +725,6 @@ void draw_texture(float* p, float* size) {
|
|||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
|
||||
//star drawing functions -<oliver wang>-
|
||||
#define PI 3.14159265358979323846264
|
||||
|
||||
|
@ -782,9 +755,7 @@ void build_stars(int size, float speed)
|
|||
|
||||
tmpStar->next = new Star;
|
||||
tmpStar=tmpStar->next;
|
||||
i++;
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
tmpStar->next=NULL;
|
||||
tmpStar=NULL;
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
//
|
||||
|
||||
//using indepenent jpeg group library - jpeglib.lib
|
||||
#ifndef GUTIL_H
|
||||
#define GUTIL_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -152,3 +154,4 @@ extern bool CreateTexturePPM(UINT textureArray[], char* strFileName, int texture
|
|||
extern bool CreateTextureTGA(UINT textureArray[], char* strFileName, int textureID);
|
||||
extern tImageJPG *LoadJPG(const char *filename);
|
||||
extern void print_text(unsigned int base, char *string);
|
||||
#endif
|
|
@ -19,6 +19,8 @@
|
|||
// If reduced in one dimension, draw vertical rectangles.
|
||||
// Otherwise draw quadrilaterals.
|
||||
|
||||
#ifndef REDUCE_H
|
||||
#define REDUCE_H
|
||||
|
||||
#define REDUCE_METHOD_AVG 0 // Take the average of reduced elements
|
||||
#define REDUCE_METHOD_SUM 1 // Take the sum of reduced elements
|
||||
|
@ -82,3 +84,5 @@ public:
|
|||
void draw_labels();
|
||||
void draw_3dlabels();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -206,7 +206,7 @@ static int xml_indent_level=0;
|
|||
|
||||
std::string xml_indent(int i) {
|
||||
if (i) xml_indent_level+=i;
|
||||
xml_indent_level=std::max(xml_indent_level,0);
|
||||
xml_indent_level = (xml_indent_level>0) ? xml_indent_level : 0;
|
||||
return std::string(xml_indent_level,' ');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue