glwin.h
来自「有限元学习研究用源代码(老外的),供科研人员参考」· C头文件 代码 · 共 1,032 行 · 第 1/3 页
H
1,032 行
#define GLW_Tab '\t'
/*
{\tt shift\_mask} can have the following values:
*/
#define GLW_SHIFT 8
#define GLW_CONTROL 16
#define GLW_MOD1 32
#define GLW_LOCK 64
/*%-----------------------------------------------------------------*/
/*\func{glwSetMouseDownFunc}
*/
void glwSetMouseDownFunc(
glWindow w,
GLenum (*f)(
glWindow w,
void *user_data,
int pos_x,
int pos_y,
GLenum button_shift_mask
)
);
/*
Set function to be called after pressing a mouse button.
{\tt pos\_x} and {\tt pos\_y} contain the current mouse position.
{\tt button\_shift\_mask} can have the following parameters:
*/
#define GLW_LEFTBUTTON 1
#define GLW_RIGHTBUTTON 2
#define GLW_MIDDLEBUTTON 4
/*%-----------------------------------------------------------------*/
/*\func{glwSetMouseUpFunc}*/
void glwSetMouseUpFunc(
glWindow w,
GLenum (*f)(
glWindow w,
void *user_data,
int pos_x,
int pos_y,
GLenum button_shift_mask
)
);
/*
Set function to be called after releasing a mouse button.
For the meaning of
the parameters, see \xref{glwSetMouseDownFunc}.
%-----------------------------------------------------------------*/
/*\func{glwSetMouseMoveFunc}*/
void glwSetMouseMoveFunc(
glWindow w,
GLenum (*f)(
glWindow w,
void *user_data,
int pos_x,
int pos_y,
GLenum button_shift_mask
)
);
/*
Set function to be called after moving the mouse. For the meaning of
the parameters, see \xref{glwSetMouseDownFunc}
%-----------------------------------------------------------------*/
/*\subsection{Inquiries}*/
/*\func{glwGetWindowSize}*/
void glwGetWindowSize(
glWindow w,
int *width,
int *heigth
);
/*
Get the size of the window {\tt w}
%-----------------------------------------------------------------*/
/*\subsection{Text output}
OpenGL does not support text output by itself. But it is possible
to ''load'' system bitmap fonts or bitmap fonts and to make them
accessible via the display list mechanism. We took here some lines
of code from the OpenGL FAQ to access X11 fonts.
%-----------------------------------------------------------------*/
/*\func{glwLoadFont}
*/
int glwLoadFont(
glWindow w,
int number,
char *fontname
);
/*
Load X-Windows font {\tt fontname} as font no. {\tt number}.
At font number 0, a default font is loaded at startup.
Use the UNIX command {\tt xlsfonts} to see what font names
you can use.
The maximum number of loadable fonts is defined here:
*/
#define GLW_MAX_FONTS 10
/*%-----------------------------------------------------------------*/
/*\func{glwSelectFont}*/
void glwSelectFont(
glWindow w,
int number
);
/*
Select font number {\tt number}.
You must load a font before using it --- see \xref{glwLoadFont}
At startup, font number $0$ is selected.
%-----------------------------------------------------------------*/
/*\func{glwPrint}*/
void glwPrint(
glWindow w,
char *s
);
/*
Print string at actual raster position (see glRasterpos stuff in the
OpenGL documentation).
%-----------------------------------------------------------------*/
/*\func{glwPrintf}*/
void glwPrintf(
glWindow w,
char *format,
...
);
/*
Print formatted string at actual raster position (see glRasterpos stuff in the
OpenGL documentation).
*/
/*
\subsection{
Obsolete functions, maintained for backward compatibility
}
*/
void glwInitPosition(int x,int y,int w, int h );
void glwSetIdleFunc(glWindow,void (*)(glWindow w, void *user_data));
/*
Set draw procedure and application driven mode
*/
void glwSetDisplayFunc(glWindow,void (*)(glWindow w, void *user_data));
/*
Set draw procedure and event driven mode
*/
/*
\subsection{
Things from tk never used and never checked.
}
*/
GLenum glwSetWindowLevel(glWindow ,GLenum);
int glwGetColorMapSize(glWindow w);
void glwGetMouseLoc(glWindow w,int *, int *);
void glwSetOneColor(glWindow w, int, float, float, float);
void glwSetFogRamp(glWindow w,int, int);
void glwSetGreyRamp(glWindow w);
void glwSetRGBMap(glWindow w,int, float *);
void glwSetOverlayMap(glWindow w,int, float *);
/*
Various stuff.
*/
#define GLW_IS_RGB(x) (((x) & GLW_INDEX) == 0)
#define GLW_IS_INDEX(x) (((x) & GLW_INDEX) != 0)
#define GLW_IS_SINGLE(x) (((x) & GLW_DOUBLE) == 0)
#define GLW_IS_DOUBLE(x) (((x) & GLW_DOUBLE) != 0)
#define GLW_IS_DIRECT(x) (((x) & GLW_INDIRECT) == 0)
#define GLW_IS_INDIRECT(x) (((x) & GLW_INDIRECT) != 0)
#define GLW_HAS_ACCUM(x) (((x) & GLW_ACCUM) != 0)
#define GLW_HAS_ALPHA(x) (((x) & GLW_ALPHA) != 0)
#define GLW_HAS_DEPTH(x) (((x) & GLW_DEPTH) != 0)
#define GLW_HAS_OVERLAY(x) (((x) & GLW_OVERLAY) != 0)
#define GLW_HAS_UNDERLAY(x) (((x) & GLW_UNDERLAY) != 0)
#define GLW_HAS_STENCIL(x) (((x) & GLW_STENCIL) != 0)
#define GLW_IS_PIXMAP(x) (((x) & GLW_PIXMAP) != 0)
/*
Color Macros
*/
enum {
GLW_BLACK = 0,
GLW_RED,
GLW_GREEN,
GLW_YELLOW,
GLW_BLUE,
GLW_MAGENTA,
GLW_CYAN,
GLW_WHITE
};
extern float glwRGBMap[8][3];
#define GLW_SETCOLOR(x, y) (GLW_IS_RGB((x)) ? \
glColor3fv(glwRGBMap[(y)]) : glwndexf((y)))
/*
RGB Image Structure
*/
typedef struct _GLW_RGBImageRec {
GLint sizeX, sizeY;
unsigned char *data;
} GLW_RGBImageRec;
#endif
/*
%
% $Log: glwin.h,v $
% Revision 2.23 1998/09/04 15:25:48 fuhrmann
% skip frame option in StartRecording
%
% Revision 2.22 1998/03/11 19:21:05 fuhrmann
% Hey we can create batch videos! (still beta, but...)
%
% Revision 2.21 1998/03/06 16:48:06 fuhrmann
% some doc bugs removed
%
% Revision 2.20 1998/03/06 16:45:32 fuhrmann
% tiff->ppm
% print command
% video recording
%
% Revision 2.19 1998/01/15 13:42:26 fuhrmann
% prevent segmentation fault in key action registry
%
% Revision 2.18 1998/01/14 18:27:35 fuhrmann
% Merge mit Ilja
%
% Revision 2.17 1997/11/27 19:03:10 fuhrmann
% glwRecord stuff, PAL-Format, tex-file for keys
%
% Revision 2.16 1997/11/24 17:51:36 fuhrmann
% revision history out of doc
%
% Revision 2.15 1997/10/27 14:39:45 fuhrmann
% doc stuff
%
% Revision 2.14 1997/10/17 16:55:14 fuhrmann
% glwFlush
%
% Revision 2.13 1997/10/01 15:41:28 fuhrmann
% GLW_MOD1
%
% Revision 2.12 1997/05/20 16:01:00 fuhrmann
% no more rcs style, standalone compilation
%
% Revision 2.11 1997/05/20 11:16:15 fuhrmann
% minor ajustment in doc
%
% Revision 2.10 1997/05/19 18:09:14 fuhrmann
% func,xref
%
% Revision 2.9 1997/05/19 15:46:13 fuhrmann
% no standalone compilation of doc
%
% Revision 2.8 1997/04/02 15:22:36 fuhrmann
% documentation using c2latex
%
% Revision 2.7 1997/02/28 17:40:59 fuhrmann
% glwGrab code
%
% Revision 2.6 1997/02/05 16:58:43 fuhrmann
% removed comment problem on SGI
%
% Revision 2.5 1996/10/09 16:34:11 fuhrmann
% keys next, prev, tab
%
% Revision 2.4 1996/09/23 17:00:01 fuhrmann
% improved documentation
%
% Revision 2.3 1996/09/23 11:57:25 fuhrmann
% documentation using xdoc
%
% Revision 2.2 1996/09/06 18:24:46 fuhrmann
% external for glwRGBMap
%
% Revision 2.1 1996/09/03 09:09:18 fuhrmann
% - fonts & printing characters
% - keep aspect ratio
% - dump pixmap size can default to window size
%
% Revision 2.0 1996/02/15 19:57:10 fuhrmann
% First meta-stable distribution
%
% Revision 1.5 1996/02/09 16:44:44 fuhrmann
% - shift keys now part of button mask
% - more keysyms available
%
% Revision 1.4 1996/02/06 09:59:21 fuhrmann
% - glwDump ( depends on libtiff.a !)
% - glwSetIdleFunc and glwSetDisplayFunc obsolete,
% use glwSetRedrawFunc & glwSetControlMode (better to understand)
% - Header file comments as programmer's doc
%
% Revision 1.3 1995/11/08 12:19:01 fuhrmann
% glwSetTitle introduced
%
% Revision 1.2 1995/10/24 18:34:53 fuhrmann
% Merge mit libtk-1.1 (dmPolicy)
%
% Revision 1.1 1995/10/20 15:42:38 fuhrmann
% Initial revision
% glwin.h: Open GL / MesaGL to X11 interface toolkit,
% derived from tk (see below)
% 1994/15/11 hacked by Juergen Fuhrmann, fuhrmann@wias-berlin.d400.de
% 1995/07/06 fitted to Mesa (minor adjustments
% concerning colormap allocations)
%
% Revision 1.1.2.3 1994/01/21 17:05:31 John_Dennis
% brought file up to SGI 1.0.12 release
% [1994/01/21 14:32:53 John_Dennis]
%
% Revision 1.1.2.2 1993/10/07 20:12:43 John_Dennis
% new files in SGI OpenGL 1.0.11 release
% [1993/10/07 18:48:33 John_Dennis]
%
% $EndLog$
%
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?