/[escript]/trunk/cusplibrary/cusp/opengl/spy/gl_util.h
ViewVC logotype

Contents of /trunk/cusplibrary/cusp/opengl/spy/gl_util.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5148 - (show annotations)
Mon Sep 15 01:25:23 2014 UTC (6 years, 1 month ago) by caltinay
File MIME type: text/plain
File size: 2051 byte(s)
Merging ripley diagonal storage + CUDA support into trunk.
Options file version has been incremented due to new options
'cuda' and 'nvccflags'.

1 /*
2 * Copyright 2008-2013 Steven Dalton
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #pragma once
18
19 namespace cusp
20 {
21 namespace opengl
22 {
23 namespace spy
24 {
25
26 void world_to_screen(float wx, float wy, int *x, int *y);
27 void screen_to_world(int x, int y, double *wx, double *wy);
28 float scale_to_world(float val);
29
30 void world_extents(float &x1, float &y, float &x2, float &y2);
31
32 #ifndef GL_UTIL_GLUT_TEXT_FONT
33 #define GL_UTIL_GLUT_TEXT_FONT GLUT_BITMAP_HELVETICA_18
34 #endif // GL_UTIL_GLUT_TEXT_FONT
35
36 void output_text_string(float x, float y, const char *string, void* font = GL_UTIL_GLUT_TEXT_FONT);
37 void text_extends(int *width, int *height, const char *string, void* font = GL_UTIL_GLUT_TEXT_FONT);
38 void text_extends_world(float *width, float *height, const char *string, void* font = GL_UTIL_GLUT_TEXT_FONT);
39
40 const unsigned int GL_U_TEXT_WORLD_COORDS = 0; // default option
41 const unsigned int GL_U_TEXT_SCREEN_COORDS = 1;
42
43 const unsigned int GL_U_TEXT_LEFT_X = 0; // default option
44 const unsigned int GL_U_TEXT_CENTER_X = 2;
45 const unsigned int GL_U_TEXT_RIGHT_X = 4;
46
47 const unsigned int GL_U_TEXT_BOTTOM_Y = 0;
48 const unsigned int GL_U_TEXT_CENTER_Y = 8;
49 const unsigned int GL_U_TEXT_TOP_Y = 16;
50
51 void draw_text(float x, float y, const char *string,
52 unsigned int flags = 0,
53 void* font = GL_UTIL_GLUT_TEXT_FONT);
54
55 void* get_window_data(int window_id);
56 void set_window_data(int window_id, void* data);
57
58 } // end spy
59 } // end opengl
60 } // end cusp
61
62 #include <cusp/opengl/spy/detail/gl_util.inl>

  ViewVC Help
Powered by ViewVC 1.1.26