19 #ifndef GL_CLAMP_TO_EDGE
20 #define GL_CLAMP_TO_EDGE 0x812F
23 static int sort_surfs_max(
int *,
int *,
int *,
int);
49 sort_surfs_max(surf_list, sortSurfs, sorti, nsurfs);
58 for (i = 0; i < nsurfs; i++) {
84 int sort_surfs_max(
int *surf,
int *id_sort,
int *indices,
int num)
88 float tmp,
max = 0., tmin, tmax, tmid;
90 for (i = 0; i < num; i++) {
99 for (i = 0; i < num; i++) {
102 for (j = 0; j < num; j++) {
103 if (maxvals[j] < tmp) {
109 maxvals[indices[i]] =
max + 1;
110 id_sort[i] = surf[indices[i]];
149 int *site_list, nsites;
158 for (i = 0; i < nsites; i++) {
177 int *vol_list, nvols, i;
186 for (i = 0; i < nvols; i++) {
207 int draw_surf, draw_vect, draw_site, draw_vol;
320 unsigned int texture_id;
332 glGenTextures(1, &texture_id);
333 glBindTexture(GL_TEXTURE_2D, texture_id);
334 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
336 glTexImage2D(GL_TEXTURE_2D, 0, in_format, width, height, 0, format,
337 GL_UNSIGNED_BYTE, image_data);
339 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
340 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
345 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
358 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
360 glMatrixMode(GL_PROJECTION);
362 glOrtho(0, width, 0, height, -1, 1);
366 glTranslatef(0, -height, 0);
368 glMatrixMode(GL_MODELVIEW);
381 glBindTexture(GL_TEXTURE_2D, texture_id);
384 glEnable(GL_TEXTURE_2D);
388 glTexCoord2d(0.0, 1.0);
390 glTexCoord2d(0.0, 0.0);
391 glVertex2d(
x, y + height);
392 glTexCoord2d(1.0, 0.0);
393 glVertex2d(
x + width, y + height);
394 glTexCoord2d(1.0, 1.0);
395 glVertex2d(
x + width, y);
400 glDisable(GL_TEXTURE_2D);
413 glDeleteTextures(1,
t);
422 glGetIntegerv(GL_MAX_TEXTURE_SIZE,
size);
void G_free(void *)
Free allocated memory.
int * GS_get_surf_list(int *)
Get surface list.
int GS_get_zextents(int, float *, float *, float *)
Get z-extent for a single surface.
void GS_set_draw(int)
Sets which buffer to draw to.
void GS_alldraw_wire(void)
Draw all wires.
int * GVL_get_vol_list(int *)
Get list of loaded volume sets.
void GVL_draw_vol(int)
Draw volume set.
void GS_draw_surf(int)
Draw surface.
void GS_setlight_position(int, float, float, float, int)
Set light position.
int GS_draw_cplane_fence(int, int, int)
Draw cplace fence ?
void GV_alldraw_vect(void)
Draw all loaded vector sets.
void GVL_alldraw_wire(void)
Draw all volume sets in wire mode.
int gsd_north_arrow(float *, float, GLuint, unsigned long, unsigned long)
Draw North Arrow takes OpenGL coords and size.
int gsd_scalebar_v2(float *, float, GLuint, unsigned long, unsigned long)
void GS_clear(int)
Clear view.
int * GP_get_site_list(int *)
Get list of point sets.
void GS_done_draw(void)
Draw done, swap buffers.
void GS_draw_fringe(int, unsigned long, float, int *)
Draw fringe around data (surface) at selected corners.
void GP_alldraw_site(void)
Draw all available point sets.
void GP_draw_site(int)
Draw point set.
int Nviz_load_image(GLubyte *image_data, int width, int height, int alpha)
Load image into texture.
void Nviz_get_max_texture(int *size)
Get maximum texture size.
int Nviz_draw_all_vect(void)
Draw all loaded vector sets (lines)
void Nviz_draw_image(int x, int y, int width, int height, int texture_id)
Draw image as texture.
int Nviz_draw_all_surf(nv_data *dc)
Draw all loaded surfaces.
void Nviz_set_2D(int width, int height)
Set ortho view for drawing images.
int Nviz_draw_quick(nv_data *data, int draw_mode)
Draw all surfaces in wireframe (quick mode)
int Nviz_draw_all(nv_data *data)
Draw all map objects (in full resolution) and decorations.
void Nviz_del_texture(int texture_id)
Delete texture.
int Nviz_draw_all_vol(void)
Draw all loaded volume sets.
int Nviz_draw_all_site(void)
Draw all loaded vector point sets.
#define DRAW_QUICK_VOLUME
#define DRAW_QUICK_VPOINTS
#define DRAW_QUICK_SURFACE
#define DRAW_QUICK_VLINES
struct scalebar_data ** scalebar
struct fringe_data ** fringe
struct arrow_data * arrow
light_data light[MAX_LIGHTS]